@easybits.cloud/mailmask 0.4.6 → 0.4.8
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 +7 -0
- package/dist/index.cjs +18 -0
- package/dist/index.d.cts +110 -1
- package/dist/index.d.ts +110 -1
- package/dist/index.js +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -62,6 +62,13 @@ await mm.send.send(domainId, {
|
|
|
62
62
|
inReplyTo: "<abc@mail.example.com>", references: "<abc@mail.example.com>",
|
|
63
63
|
}, { idempotencyKey: `invoice-42` });
|
|
64
64
|
|
|
65
|
+
// Account: identity + usage, and a full JSON export
|
|
66
|
+
const me = await mm.account.me();
|
|
67
|
+
const backup = await mm.account.export();
|
|
68
|
+
|
|
69
|
+
// Upload an image to embed in an outgoing email (returns a public url)
|
|
70
|
+
const { url } = await mm.domains.uploadImage(domainId, imageBlob);
|
|
71
|
+
|
|
65
72
|
// Suppression list (hard bounces / complaints)
|
|
66
73
|
await mm.suppressions.list(domainId);
|
|
67
74
|
await mm.suppressions.remove(domainId, "fixed@example.com");
|
package/dist/index.cjs
CHANGED
|
@@ -120,6 +120,12 @@ var DomainsResource = class {
|
|
|
120
120
|
removeLogo(id) {
|
|
121
121
|
return this.req(`/api/domains/${id}/logo`, { method: "DELETE" });
|
|
122
122
|
}
|
|
123
|
+
/** 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
|
+
uploadImage(id, file, filename = "imagen") {
|
|
125
|
+
const form = new FormData();
|
|
126
|
+
form.append("file", file, filename);
|
|
127
|
+
return this.req(`/api/domains/${id}/images`, { method: "POST", body: form });
|
|
128
|
+
}
|
|
123
129
|
};
|
|
124
130
|
var DnsResource = class {
|
|
125
131
|
constructor(req) {
|
|
@@ -448,6 +454,18 @@ var AccountResource = class {
|
|
|
448
454
|
constructor(req) {
|
|
449
455
|
this.req = req;
|
|
450
456
|
}
|
|
457
|
+
/**
|
|
458
|
+
* Identidad y uso de la cuenta: dominios, derechos por dominio, add-ons y cuotas.
|
|
459
|
+
* Sustituto de `whoami` mientras no exista un endpoint de identidad más chico — ver
|
|
460
|
+
* `docs/agents/mailmask-cli.md`.
|
|
461
|
+
*/
|
|
462
|
+
me() {
|
|
463
|
+
return this.req("/api/auth/me");
|
|
464
|
+
}
|
|
465
|
+
/** Todo tu dato (alias, reglas y logs de cada dominio) como JSON exportable. */
|
|
466
|
+
export() {
|
|
467
|
+
return this.req("/api/export");
|
|
468
|
+
}
|
|
451
469
|
getProfile() {
|
|
452
470
|
return this.req("/api/profile");
|
|
453
471
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -11,10 +11,20 @@ interface MailMaskConfig {
|
|
|
11
11
|
interface Domain {
|
|
12
12
|
id: string;
|
|
13
13
|
domain: string;
|
|
14
|
+
/** Último valor medido. Si `verifiedStatus` es "unknown", no lo afirmes: confírmalo con `domains.health`. */
|
|
14
15
|
verified: boolean;
|
|
16
|
+
/** Último valor medido. Si `mxStatus` es "unknown", no lo afirmes: confírmalo con `domains.health`. */
|
|
15
17
|
mxConfigured: boolean;
|
|
16
18
|
registeredViaMailmask: boolean;
|
|
17
19
|
createdAt: string;
|
|
20
|
+
/** Cuándo se midieron `verified` y `mxConfigured` en vivo (health, verify o el servidor). null = nunca. */
|
|
21
|
+
checkedAt?: string | null;
|
|
22
|
+
/** "unknown" si la revisión tiene más de 24 h o nunca se hizo. */
|
|
23
|
+
mxStatus?: "ok" | "missing" | "unknown";
|
|
24
|
+
/** "unknown" si la revisión tiene más de 24 h o nunca se hizo. */
|
|
25
|
+
verifiedStatus?: "ok" | "missing" | "unknown";
|
|
26
|
+
/** Presente cuando algún estado es "unknown": qué hacer para confirmarlo. */
|
|
27
|
+
statusNote?: string;
|
|
18
28
|
/** Sólo en `domains.list`: reenvíos del mes en curso. */
|
|
19
29
|
monthlyForwards?: number;
|
|
20
30
|
/** Sólo en `domains.list`: tope de reenvíos por hora del plan. */
|
|
@@ -43,6 +53,8 @@ interface DomainVerification {
|
|
|
43
53
|
domain: string;
|
|
44
54
|
verified: boolean;
|
|
45
55
|
dkimVerified: boolean;
|
|
56
|
+
/** Si el MX apunta al inbound de SES, medido en la misma llamada; null si el DNS no respondió. */
|
|
57
|
+
mxConfigured?: boolean | null;
|
|
46
58
|
/** true cuando no se pudo consultar a SES: los campos son el último estado conocido. */
|
|
47
59
|
stale?: boolean;
|
|
48
60
|
error?: string;
|
|
@@ -535,6 +547,93 @@ interface AccountProfile {
|
|
|
535
547
|
/** Ruta relativa al host de MailMask (`/api/avatar/...`), o null sin foto. */
|
|
536
548
|
avatarUrl: string | null;
|
|
537
549
|
}
|
|
550
|
+
/** Derechos y uso de UN dominio, dentro de `AccountMe.porDominio`. */
|
|
551
|
+
interface AccountMeDomainUsage {
|
|
552
|
+
id: string;
|
|
553
|
+
domain: string;
|
|
554
|
+
/** Límites del dominio (sends, aliases, dominios, etc.), por plan y add-ons. */
|
|
555
|
+
derechos: Record<string, unknown>;
|
|
556
|
+
addons: Addon[];
|
|
557
|
+
uso: {
|
|
558
|
+
aliases: {
|
|
559
|
+
current: number;
|
|
560
|
+
limit: number;
|
|
561
|
+
};
|
|
562
|
+
rules: {
|
|
563
|
+
current: number;
|
|
564
|
+
limit: number;
|
|
565
|
+
};
|
|
566
|
+
sends: {
|
|
567
|
+
current: number;
|
|
568
|
+
limit: number;
|
|
569
|
+
};
|
|
570
|
+
forwards: {
|
|
571
|
+
current: number;
|
|
572
|
+
limit: number;
|
|
573
|
+
};
|
|
574
|
+
mailboxBytes: {
|
|
575
|
+
current: number;
|
|
576
|
+
limit: number;
|
|
577
|
+
};
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
/** Respuesta de `account.me()`: identidad de la cuenta y su uso, por dominio y total. */
|
|
581
|
+
interface AccountMe extends AccountProfile {
|
|
582
|
+
isAdmin: boolean;
|
|
583
|
+
assistant: boolean;
|
|
584
|
+
domainsCount: number;
|
|
585
|
+
emailVerified: boolean;
|
|
586
|
+
forwards: {
|
|
587
|
+
current: number;
|
|
588
|
+
limit: number;
|
|
589
|
+
};
|
|
590
|
+
subscription: {
|
|
591
|
+
plan: string;
|
|
592
|
+
status: string;
|
|
593
|
+
currentPeriodEnd: string | null;
|
|
594
|
+
planLabel: string;
|
|
595
|
+
[k: string]: unknown;
|
|
596
|
+
};
|
|
597
|
+
porDominio: AccountMeDomainUsage[];
|
|
598
|
+
addons: Addon[];
|
|
599
|
+
planPriceCents: number | null;
|
|
600
|
+
addonCatalog: Record<string, {
|
|
601
|
+
price: number;
|
|
602
|
+
label: string;
|
|
603
|
+
}>;
|
|
604
|
+
addonsForSale: string[];
|
|
605
|
+
lastOrder: Order | null;
|
|
606
|
+
usage: {
|
|
607
|
+
domains: {
|
|
608
|
+
current: number;
|
|
609
|
+
limit: number | null;
|
|
610
|
+
};
|
|
611
|
+
aliasesPerDomain: unknown[];
|
|
612
|
+
rulesPerDomain: unknown[];
|
|
613
|
+
sendsPerDomain: unknown[];
|
|
614
|
+
};
|
|
615
|
+
referralSlug?: string | null;
|
|
616
|
+
referralStats: ReferralStats;
|
|
617
|
+
}
|
|
618
|
+
/** Respuesta de `account.export()`: todo el dato del usuario, listo para descargar. */
|
|
619
|
+
interface AccountExport {
|
|
620
|
+
email: string;
|
|
621
|
+
exportedAt: string;
|
|
622
|
+
domains: {
|
|
623
|
+
domain: string;
|
|
624
|
+
domainId: string;
|
|
625
|
+
verified: boolean;
|
|
626
|
+
aliases: Alias[];
|
|
627
|
+
rules: Rule[];
|
|
628
|
+
logs: EmailLog[];
|
|
629
|
+
}[];
|
|
630
|
+
}
|
|
631
|
+
/** Respuesta de `domains.uploadImage()`. */
|
|
632
|
+
interface UploadedEmailImage {
|
|
633
|
+
ok: boolean;
|
|
634
|
+
/** Efímera: se borra tras enviarse (o la barre el aseo diario si nunca se usó). */
|
|
635
|
+
url: string;
|
|
636
|
+
}
|
|
538
637
|
type InboxStatus = "open" | "snoozed" | "closed";
|
|
539
638
|
interface InboxConversation {
|
|
540
639
|
id: string;
|
|
@@ -730,6 +829,8 @@ declare class DomainsResource {
|
|
|
730
829
|
removeLogo(id: string): Promise<{
|
|
731
830
|
ok: boolean;
|
|
732
831
|
}>;
|
|
832
|
+
/** 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. */
|
|
833
|
+
uploadImage(id: string, file: Blob, filename?: string): Promise<UploadedEmailImage>;
|
|
733
834
|
}
|
|
734
835
|
declare class DnsResource {
|
|
735
836
|
private req;
|
|
@@ -985,6 +1086,14 @@ declare class CannedResource {
|
|
|
985
1086
|
declare class AccountResource {
|
|
986
1087
|
private req;
|
|
987
1088
|
constructor(req: Req);
|
|
1089
|
+
/**
|
|
1090
|
+
* Identidad y uso de la cuenta: dominios, derechos por dominio, add-ons y cuotas.
|
|
1091
|
+
* Sustituto de `whoami` mientras no exista un endpoint de identidad más chico — ver
|
|
1092
|
+
* `docs/agents/mailmask-cli.md`.
|
|
1093
|
+
*/
|
|
1094
|
+
me(): Promise<AccountMe>;
|
|
1095
|
+
/** Todo tu dato (alias, reglas y logs de cada dominio) como JSON exportable. */
|
|
1096
|
+
export(): Promise<AccountExport>;
|
|
988
1097
|
getProfile(): Promise<AccountProfile>;
|
|
989
1098
|
/** Nombre visible (máx. 60 caracteres). Cadena vacía lo borra. */
|
|
990
1099
|
updateProfile(input: {
|
|
@@ -1077,4 +1186,4 @@ interface WebhookSignatureHeaders {
|
|
|
1077
1186
|
*/
|
|
1078
1187
|
declare function verifyWebhookSignature(secret: string, headers: WebhookSignatureHeaders, rawBody: string, toleranceMs?: number): Promise<boolean>;
|
|
1079
1188
|
|
|
1080
|
-
export { type AccountProfile, type Addon, type AddonsResponse, type Address, type AddressCreated, type Alias, type AliasCreated, type ApiKey, type AttachmentRef, type BillingStatus, type BulkJob, type BulkJobCreated, type BulkSendInput, type CannedReply, type CheckoutLink, type CreateAddressInput, type CreateAliasInput, type CreateRuleInput, type CreateWebhookInput, type DnsChangeResult, type DnsDelegation, type DnsImportResult, type DnsListResponse, type DnsPreset, type DnsRRSet, type DnsRRSetAnotado, type DnsRecord, type DnsRecordType, type DnsSetup, type DnsSetupRecord, type DnsZoneCreated, type DnsZoneState, type Domain, type DomainCreated, type DomainInvite, type DomainMember, type DomainRegistration, type DomainRegistrationCreated, type DomainSearchResult, type DomainVerification, type EmailLog, type InboxAttachment, type InboxComposeInput, type InboxConversation, type InboxConversationDetail, type InboxListOptions, type InboxMessage, type InboxNote, type InboxPage, type InboxReplyInput, type InboxStatus, type InboxUpdateInput, MailMask, type MailMaskConfig, MailMaskError, type MailboxCreated, type Order, type OrdersPage, type ReferralStats, type RenewalLink, type Rule, type RuleAction, type RuleField, type RuleMatch, type SendEmailInput, type SendOptions, type SmtpCredential, type SmtpCredentialCreated, type Suppression, type TldPrice, type TransferCheck, type TransferDnsInventory, type TransferRequirement, type UpdateAddressInput, type UpdateAliasInput, type UpdateRuleInput, type UpdateWebhookInput, type UploadAttachmentInput, type UploadedAttachment, type Webhook, type WebhookCreated, type WebhookDelivery, type WebhookEvent, type WebhookPayload, type WebhookSignatureHeaders, verifyWebhookSignature };
|
|
1189
|
+
export { type AccountExport, type AccountMe, type AccountMeDomainUsage, type AccountProfile, type Addon, type AddonsResponse, type Address, type AddressCreated, type Alias, type AliasCreated, type ApiKey, type AttachmentRef, type BillingStatus, type BulkJob, type BulkJobCreated, type BulkSendInput, type CannedReply, type CheckoutLink, type CreateAddressInput, type CreateAliasInput, type CreateRuleInput, type CreateWebhookInput, type DnsChangeResult, type DnsDelegation, type DnsImportResult, type DnsListResponse, type DnsPreset, type DnsRRSet, type DnsRRSetAnotado, type DnsRecord, type DnsRecordType, type DnsSetup, type DnsSetupRecord, type DnsZoneCreated, type DnsZoneState, type Domain, type DomainCreated, type DomainInvite, type DomainMember, type DomainRegistration, type DomainRegistrationCreated, type DomainSearchResult, type DomainVerification, type EmailLog, type InboxAttachment, type InboxComposeInput, type InboxConversation, type InboxConversationDetail, type InboxListOptions, type InboxMessage, type InboxNote, type InboxPage, type InboxReplyInput, type InboxStatus, type InboxUpdateInput, MailMask, type MailMaskConfig, MailMaskError, type MailboxCreated, type Order, type OrdersPage, type ReferralStats, type RenewalLink, type Rule, type RuleAction, type RuleField, type RuleMatch, type SendEmailInput, type SendOptions, type SmtpCredential, type SmtpCredentialCreated, type Suppression, type TldPrice, type TransferCheck, type TransferDnsInventory, type TransferRequirement, type UpdateAddressInput, type UpdateAliasInput, type UpdateRuleInput, type UpdateWebhookInput, type UploadAttachmentInput, type UploadedAttachment, type UploadedEmailImage, type Webhook, type WebhookCreated, type WebhookDelivery, type WebhookEvent, type WebhookPayload, type WebhookSignatureHeaders, verifyWebhookSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -11,10 +11,20 @@ interface MailMaskConfig {
|
|
|
11
11
|
interface Domain {
|
|
12
12
|
id: string;
|
|
13
13
|
domain: string;
|
|
14
|
+
/** Último valor medido. Si `verifiedStatus` es "unknown", no lo afirmes: confírmalo con `domains.health`. */
|
|
14
15
|
verified: boolean;
|
|
16
|
+
/** Último valor medido. Si `mxStatus` es "unknown", no lo afirmes: confírmalo con `domains.health`. */
|
|
15
17
|
mxConfigured: boolean;
|
|
16
18
|
registeredViaMailmask: boolean;
|
|
17
19
|
createdAt: string;
|
|
20
|
+
/** Cuándo se midieron `verified` y `mxConfigured` en vivo (health, verify o el servidor). null = nunca. */
|
|
21
|
+
checkedAt?: string | null;
|
|
22
|
+
/** "unknown" si la revisión tiene más de 24 h o nunca se hizo. */
|
|
23
|
+
mxStatus?: "ok" | "missing" | "unknown";
|
|
24
|
+
/** "unknown" si la revisión tiene más de 24 h o nunca se hizo. */
|
|
25
|
+
verifiedStatus?: "ok" | "missing" | "unknown";
|
|
26
|
+
/** Presente cuando algún estado es "unknown": qué hacer para confirmarlo. */
|
|
27
|
+
statusNote?: string;
|
|
18
28
|
/** Sólo en `domains.list`: reenvíos del mes en curso. */
|
|
19
29
|
monthlyForwards?: number;
|
|
20
30
|
/** Sólo en `domains.list`: tope de reenvíos por hora del plan. */
|
|
@@ -43,6 +53,8 @@ interface DomainVerification {
|
|
|
43
53
|
domain: string;
|
|
44
54
|
verified: boolean;
|
|
45
55
|
dkimVerified: boolean;
|
|
56
|
+
/** Si el MX apunta al inbound de SES, medido en la misma llamada; null si el DNS no respondió. */
|
|
57
|
+
mxConfigured?: boolean | null;
|
|
46
58
|
/** true cuando no se pudo consultar a SES: los campos son el último estado conocido. */
|
|
47
59
|
stale?: boolean;
|
|
48
60
|
error?: string;
|
|
@@ -535,6 +547,93 @@ interface AccountProfile {
|
|
|
535
547
|
/** Ruta relativa al host de MailMask (`/api/avatar/...`), o null sin foto. */
|
|
536
548
|
avatarUrl: string | null;
|
|
537
549
|
}
|
|
550
|
+
/** Derechos y uso de UN dominio, dentro de `AccountMe.porDominio`. */
|
|
551
|
+
interface AccountMeDomainUsage {
|
|
552
|
+
id: string;
|
|
553
|
+
domain: string;
|
|
554
|
+
/** Límites del dominio (sends, aliases, dominios, etc.), por plan y add-ons. */
|
|
555
|
+
derechos: Record<string, unknown>;
|
|
556
|
+
addons: Addon[];
|
|
557
|
+
uso: {
|
|
558
|
+
aliases: {
|
|
559
|
+
current: number;
|
|
560
|
+
limit: number;
|
|
561
|
+
};
|
|
562
|
+
rules: {
|
|
563
|
+
current: number;
|
|
564
|
+
limit: number;
|
|
565
|
+
};
|
|
566
|
+
sends: {
|
|
567
|
+
current: number;
|
|
568
|
+
limit: number;
|
|
569
|
+
};
|
|
570
|
+
forwards: {
|
|
571
|
+
current: number;
|
|
572
|
+
limit: number;
|
|
573
|
+
};
|
|
574
|
+
mailboxBytes: {
|
|
575
|
+
current: number;
|
|
576
|
+
limit: number;
|
|
577
|
+
};
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
/** Respuesta de `account.me()`: identidad de la cuenta y su uso, por dominio y total. */
|
|
581
|
+
interface AccountMe extends AccountProfile {
|
|
582
|
+
isAdmin: boolean;
|
|
583
|
+
assistant: boolean;
|
|
584
|
+
domainsCount: number;
|
|
585
|
+
emailVerified: boolean;
|
|
586
|
+
forwards: {
|
|
587
|
+
current: number;
|
|
588
|
+
limit: number;
|
|
589
|
+
};
|
|
590
|
+
subscription: {
|
|
591
|
+
plan: string;
|
|
592
|
+
status: string;
|
|
593
|
+
currentPeriodEnd: string | null;
|
|
594
|
+
planLabel: string;
|
|
595
|
+
[k: string]: unknown;
|
|
596
|
+
};
|
|
597
|
+
porDominio: AccountMeDomainUsage[];
|
|
598
|
+
addons: Addon[];
|
|
599
|
+
planPriceCents: number | null;
|
|
600
|
+
addonCatalog: Record<string, {
|
|
601
|
+
price: number;
|
|
602
|
+
label: string;
|
|
603
|
+
}>;
|
|
604
|
+
addonsForSale: string[];
|
|
605
|
+
lastOrder: Order | null;
|
|
606
|
+
usage: {
|
|
607
|
+
domains: {
|
|
608
|
+
current: number;
|
|
609
|
+
limit: number | null;
|
|
610
|
+
};
|
|
611
|
+
aliasesPerDomain: unknown[];
|
|
612
|
+
rulesPerDomain: unknown[];
|
|
613
|
+
sendsPerDomain: unknown[];
|
|
614
|
+
};
|
|
615
|
+
referralSlug?: string | null;
|
|
616
|
+
referralStats: ReferralStats;
|
|
617
|
+
}
|
|
618
|
+
/** Respuesta de `account.export()`: todo el dato del usuario, listo para descargar. */
|
|
619
|
+
interface AccountExport {
|
|
620
|
+
email: string;
|
|
621
|
+
exportedAt: string;
|
|
622
|
+
domains: {
|
|
623
|
+
domain: string;
|
|
624
|
+
domainId: string;
|
|
625
|
+
verified: boolean;
|
|
626
|
+
aliases: Alias[];
|
|
627
|
+
rules: Rule[];
|
|
628
|
+
logs: EmailLog[];
|
|
629
|
+
}[];
|
|
630
|
+
}
|
|
631
|
+
/** Respuesta de `domains.uploadImage()`. */
|
|
632
|
+
interface UploadedEmailImage {
|
|
633
|
+
ok: boolean;
|
|
634
|
+
/** Efímera: se borra tras enviarse (o la barre el aseo diario si nunca se usó). */
|
|
635
|
+
url: string;
|
|
636
|
+
}
|
|
538
637
|
type InboxStatus = "open" | "snoozed" | "closed";
|
|
539
638
|
interface InboxConversation {
|
|
540
639
|
id: string;
|
|
@@ -730,6 +829,8 @@ declare class DomainsResource {
|
|
|
730
829
|
removeLogo(id: string): Promise<{
|
|
731
830
|
ok: boolean;
|
|
732
831
|
}>;
|
|
832
|
+
/** 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. */
|
|
833
|
+
uploadImage(id: string, file: Blob, filename?: string): Promise<UploadedEmailImage>;
|
|
733
834
|
}
|
|
734
835
|
declare class DnsResource {
|
|
735
836
|
private req;
|
|
@@ -985,6 +1086,14 @@ declare class CannedResource {
|
|
|
985
1086
|
declare class AccountResource {
|
|
986
1087
|
private req;
|
|
987
1088
|
constructor(req: Req);
|
|
1089
|
+
/**
|
|
1090
|
+
* Identidad y uso de la cuenta: dominios, derechos por dominio, add-ons y cuotas.
|
|
1091
|
+
* Sustituto de `whoami` mientras no exista un endpoint de identidad más chico — ver
|
|
1092
|
+
* `docs/agents/mailmask-cli.md`.
|
|
1093
|
+
*/
|
|
1094
|
+
me(): Promise<AccountMe>;
|
|
1095
|
+
/** Todo tu dato (alias, reglas y logs de cada dominio) como JSON exportable. */
|
|
1096
|
+
export(): Promise<AccountExport>;
|
|
988
1097
|
getProfile(): Promise<AccountProfile>;
|
|
989
1098
|
/** Nombre visible (máx. 60 caracteres). Cadena vacía lo borra. */
|
|
990
1099
|
updateProfile(input: {
|
|
@@ -1077,4 +1186,4 @@ interface WebhookSignatureHeaders {
|
|
|
1077
1186
|
*/
|
|
1078
1187
|
declare function verifyWebhookSignature(secret: string, headers: WebhookSignatureHeaders, rawBody: string, toleranceMs?: number): Promise<boolean>;
|
|
1079
1188
|
|
|
1080
|
-
export { type AccountProfile, type Addon, type AddonsResponse, type Address, type AddressCreated, type Alias, type AliasCreated, type ApiKey, type AttachmentRef, type BillingStatus, type BulkJob, type BulkJobCreated, type BulkSendInput, type CannedReply, type CheckoutLink, type CreateAddressInput, type CreateAliasInput, type CreateRuleInput, type CreateWebhookInput, type DnsChangeResult, type DnsDelegation, type DnsImportResult, type DnsListResponse, type DnsPreset, type DnsRRSet, type DnsRRSetAnotado, type DnsRecord, type DnsRecordType, type DnsSetup, type DnsSetupRecord, type DnsZoneCreated, type DnsZoneState, type Domain, type DomainCreated, type DomainInvite, type DomainMember, type DomainRegistration, type DomainRegistrationCreated, type DomainSearchResult, type DomainVerification, type EmailLog, type InboxAttachment, type InboxComposeInput, type InboxConversation, type InboxConversationDetail, type InboxListOptions, type InboxMessage, type InboxNote, type InboxPage, type InboxReplyInput, type InboxStatus, type InboxUpdateInput, MailMask, type MailMaskConfig, MailMaskError, type MailboxCreated, type Order, type OrdersPage, type ReferralStats, type RenewalLink, type Rule, type RuleAction, type RuleField, type RuleMatch, type SendEmailInput, type SendOptions, type SmtpCredential, type SmtpCredentialCreated, type Suppression, type TldPrice, type TransferCheck, type TransferDnsInventory, type TransferRequirement, type UpdateAddressInput, type UpdateAliasInput, type UpdateRuleInput, type UpdateWebhookInput, type UploadAttachmentInput, type UploadedAttachment, type Webhook, type WebhookCreated, type WebhookDelivery, type WebhookEvent, type WebhookPayload, type WebhookSignatureHeaders, verifyWebhookSignature };
|
|
1189
|
+
export { type AccountExport, type AccountMe, type AccountMeDomainUsage, type AccountProfile, type Addon, type AddonsResponse, type Address, type AddressCreated, type Alias, type AliasCreated, type ApiKey, type AttachmentRef, type BillingStatus, type BulkJob, type BulkJobCreated, type BulkSendInput, type CannedReply, type CheckoutLink, type CreateAddressInput, type CreateAliasInput, type CreateRuleInput, type CreateWebhookInput, type DnsChangeResult, type DnsDelegation, type DnsImportResult, type DnsListResponse, type DnsPreset, type DnsRRSet, type DnsRRSetAnotado, type DnsRecord, type DnsRecordType, type DnsSetup, type DnsSetupRecord, type DnsZoneCreated, type DnsZoneState, type Domain, type DomainCreated, type DomainInvite, type DomainMember, type DomainRegistration, type DomainRegistrationCreated, type DomainSearchResult, type DomainVerification, type EmailLog, type InboxAttachment, type InboxComposeInput, type InboxConversation, type InboxConversationDetail, type InboxListOptions, type InboxMessage, type InboxNote, type InboxPage, type InboxReplyInput, type InboxStatus, type InboxUpdateInput, MailMask, type MailMaskConfig, MailMaskError, type MailboxCreated, type Order, type OrdersPage, type ReferralStats, type RenewalLink, type Rule, type RuleAction, type RuleField, type RuleMatch, type SendEmailInput, type SendOptions, type SmtpCredential, type SmtpCredentialCreated, type Suppression, type TldPrice, type TransferCheck, type TransferDnsInventory, type TransferRequirement, type UpdateAddressInput, type UpdateAliasInput, type UpdateRuleInput, type UpdateWebhookInput, type UploadAttachmentInput, type UploadedAttachment, type UploadedEmailImage, type Webhook, type WebhookCreated, type WebhookDelivery, type WebhookEvent, type WebhookPayload, type WebhookSignatureHeaders, verifyWebhookSignature };
|
package/dist/index.js
CHANGED
|
@@ -92,6 +92,12 @@ var DomainsResource = class {
|
|
|
92
92
|
removeLogo(id) {
|
|
93
93
|
return this.req(`/api/domains/${id}/logo`, { method: "DELETE" });
|
|
94
94
|
}
|
|
95
|
+
/** 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
|
+
uploadImage(id, file, filename = "imagen") {
|
|
97
|
+
const form = new FormData();
|
|
98
|
+
form.append("file", file, filename);
|
|
99
|
+
return this.req(`/api/domains/${id}/images`, { method: "POST", body: form });
|
|
100
|
+
}
|
|
95
101
|
};
|
|
96
102
|
var DnsResource = class {
|
|
97
103
|
constructor(req) {
|
|
@@ -420,6 +426,18 @@ var AccountResource = class {
|
|
|
420
426
|
constructor(req) {
|
|
421
427
|
this.req = req;
|
|
422
428
|
}
|
|
429
|
+
/**
|
|
430
|
+
* Identidad y uso de la cuenta: dominios, derechos por dominio, add-ons y cuotas.
|
|
431
|
+
* Sustituto de `whoami` mientras no exista un endpoint de identidad más chico — ver
|
|
432
|
+
* `docs/agents/mailmask-cli.md`.
|
|
433
|
+
*/
|
|
434
|
+
me() {
|
|
435
|
+
return this.req("/api/auth/me");
|
|
436
|
+
}
|
|
437
|
+
/** Todo tu dato (alias, reglas y logs de cada dominio) como JSON exportable. */
|
|
438
|
+
export() {
|
|
439
|
+
return this.req("/api/export");
|
|
440
|
+
}
|
|
423
441
|
getProfile() {
|
|
424
442
|
return this.req("/api/profile");
|
|
425
443
|
}
|