@easybits.cloud/mailmask 0.4.5 → 0.4.7
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 +25 -0
- package/dist/index.d.cts +113 -1
- package/dist/index.d.ts +113 -1
- package/dist/index.js +25 -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) {
|
|
@@ -370,6 +376,13 @@ var RegistrationsResource = class {
|
|
|
370
376
|
cancelRenewal(regId) {
|
|
371
377
|
return this.req(`/api/domains/registrations/${regId}/renewal/cancel`, { method: "POST" });
|
|
372
378
|
}
|
|
379
|
+
/**
|
|
380
|
+
* Pone el candado de transferencia. Quitarlo no está en el SDK a propósito: sólo se hace
|
|
381
|
+
* desde el panel, con la sesión del dueño y confirmando por correo.
|
|
382
|
+
*/
|
|
383
|
+
lock(regId) {
|
|
384
|
+
return this.req(`/api/domains/registrations/${regId}/transfer-lock`, { method: "POST", body: JSON.stringify({ locked: true }) });
|
|
385
|
+
}
|
|
373
386
|
};
|
|
374
387
|
var TransfersResource = class {
|
|
375
388
|
constructor(req) {
|
|
@@ -441,6 +454,18 @@ var AccountResource = class {
|
|
|
441
454
|
constructor(req) {
|
|
442
455
|
this.req = req;
|
|
443
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
|
+
}
|
|
444
469
|
getProfile() {
|
|
445
470
|
return this.req("/api/profile");
|
|
446
471
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -463,6 +463,12 @@ interface DomainRegistration {
|
|
|
463
463
|
nextChargeAt: string | null;
|
|
464
464
|
dnsImportStatus: string;
|
|
465
465
|
transferAuthCodeHint: string | null;
|
|
466
|
+
/** Candado de transferencia (`clientTransferProhibited`); null si aún no se ha leído de AWS. */
|
|
467
|
+
transferLock: boolean | null;
|
|
468
|
+
/** Mientras está quitado: cuándo se vuelve a poner solo. */
|
|
469
|
+
transferUnlockedUntil: string | null;
|
|
470
|
+
/** Desde cuándo puede cambiar de registrador (regla de 60 días de ICANN). */
|
|
471
|
+
transferEligibleAt: string;
|
|
466
472
|
lastError: string | null;
|
|
467
473
|
createdAt: string;
|
|
468
474
|
[k: string]: unknown;
|
|
@@ -529,6 +535,93 @@ interface AccountProfile {
|
|
|
529
535
|
/** Ruta relativa al host de MailMask (`/api/avatar/...`), o null sin foto. */
|
|
530
536
|
avatarUrl: string | null;
|
|
531
537
|
}
|
|
538
|
+
/** Derechos y uso de UN dominio, dentro de `AccountMe.porDominio`. */
|
|
539
|
+
interface AccountMeDomainUsage {
|
|
540
|
+
id: string;
|
|
541
|
+
domain: string;
|
|
542
|
+
/** Límites del dominio (sends, aliases, dominios, etc.), por plan y add-ons. */
|
|
543
|
+
derechos: Record<string, unknown>;
|
|
544
|
+
addons: Addon[];
|
|
545
|
+
uso: {
|
|
546
|
+
aliases: {
|
|
547
|
+
current: number;
|
|
548
|
+
limit: number;
|
|
549
|
+
};
|
|
550
|
+
rules: {
|
|
551
|
+
current: number;
|
|
552
|
+
limit: number;
|
|
553
|
+
};
|
|
554
|
+
sends: {
|
|
555
|
+
current: number;
|
|
556
|
+
limit: number;
|
|
557
|
+
};
|
|
558
|
+
forwards: {
|
|
559
|
+
current: number;
|
|
560
|
+
limit: number;
|
|
561
|
+
};
|
|
562
|
+
mailboxBytes: {
|
|
563
|
+
current: number;
|
|
564
|
+
limit: number;
|
|
565
|
+
};
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
/** Respuesta de `account.me()`: identidad de la cuenta y su uso, por dominio y total. */
|
|
569
|
+
interface AccountMe extends AccountProfile {
|
|
570
|
+
isAdmin: boolean;
|
|
571
|
+
assistant: boolean;
|
|
572
|
+
domainsCount: number;
|
|
573
|
+
emailVerified: boolean;
|
|
574
|
+
forwards: {
|
|
575
|
+
current: number;
|
|
576
|
+
limit: number;
|
|
577
|
+
};
|
|
578
|
+
subscription: {
|
|
579
|
+
plan: string;
|
|
580
|
+
status: string;
|
|
581
|
+
currentPeriodEnd: string | null;
|
|
582
|
+
planLabel: string;
|
|
583
|
+
[k: string]: unknown;
|
|
584
|
+
};
|
|
585
|
+
porDominio: AccountMeDomainUsage[];
|
|
586
|
+
addons: Addon[];
|
|
587
|
+
planPriceCents: number | null;
|
|
588
|
+
addonCatalog: Record<string, {
|
|
589
|
+
price: number;
|
|
590
|
+
label: string;
|
|
591
|
+
}>;
|
|
592
|
+
addonsForSale: string[];
|
|
593
|
+
lastOrder: Order | null;
|
|
594
|
+
usage: {
|
|
595
|
+
domains: {
|
|
596
|
+
current: number;
|
|
597
|
+
limit: number | null;
|
|
598
|
+
};
|
|
599
|
+
aliasesPerDomain: unknown[];
|
|
600
|
+
rulesPerDomain: unknown[];
|
|
601
|
+
sendsPerDomain: unknown[];
|
|
602
|
+
};
|
|
603
|
+
referralSlug?: string | null;
|
|
604
|
+
referralStats: ReferralStats;
|
|
605
|
+
}
|
|
606
|
+
/** Respuesta de `account.export()`: todo el dato del usuario, listo para descargar. */
|
|
607
|
+
interface AccountExport {
|
|
608
|
+
email: string;
|
|
609
|
+
exportedAt: string;
|
|
610
|
+
domains: {
|
|
611
|
+
domain: string;
|
|
612
|
+
domainId: string;
|
|
613
|
+
verified: boolean;
|
|
614
|
+
aliases: Alias[];
|
|
615
|
+
rules: Rule[];
|
|
616
|
+
logs: EmailLog[];
|
|
617
|
+
}[];
|
|
618
|
+
}
|
|
619
|
+
/** Respuesta de `domains.uploadImage()`. */
|
|
620
|
+
interface UploadedEmailImage {
|
|
621
|
+
ok: boolean;
|
|
622
|
+
/** Efímera: se borra tras enviarse (o la barre el aseo diario si nunca se usó). */
|
|
623
|
+
url: string;
|
|
624
|
+
}
|
|
532
625
|
type InboxStatus = "open" | "snoozed" | "closed";
|
|
533
626
|
interface InboxConversation {
|
|
534
627
|
id: string;
|
|
@@ -724,6 +817,8 @@ declare class DomainsResource {
|
|
|
724
817
|
removeLogo(id: string): Promise<{
|
|
725
818
|
ok: boolean;
|
|
726
819
|
}>;
|
|
820
|
+
/** 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. */
|
|
821
|
+
uploadImage(id: string, file: Blob, filename?: string): Promise<UploadedEmailImage>;
|
|
727
822
|
}
|
|
728
823
|
declare class DnsResource {
|
|
729
824
|
private req;
|
|
@@ -898,6 +993,15 @@ declare class RegistrationsResource {
|
|
|
898
993
|
ok: boolean;
|
|
899
994
|
aviso: string;
|
|
900
995
|
}>;
|
|
996
|
+
/**
|
|
997
|
+
* Pone el candado de transferencia. Quitarlo no está en el SDK a propósito: sólo se hace
|
|
998
|
+
* desde el panel, con la sesión del dueño y confirmando por correo.
|
|
999
|
+
*/
|
|
1000
|
+
lock(regId: string): Promise<{
|
|
1001
|
+
ok: boolean;
|
|
1002
|
+
transferLock: boolean;
|
|
1003
|
+
transferUnlockedUntil: null;
|
|
1004
|
+
}>;
|
|
901
1005
|
}
|
|
902
1006
|
declare class TransfersResource {
|
|
903
1007
|
private req;
|
|
@@ -970,6 +1074,14 @@ declare class CannedResource {
|
|
|
970
1074
|
declare class AccountResource {
|
|
971
1075
|
private req;
|
|
972
1076
|
constructor(req: Req);
|
|
1077
|
+
/**
|
|
1078
|
+
* Identidad y uso de la cuenta: dominios, derechos por dominio, add-ons y cuotas.
|
|
1079
|
+
* Sustituto de `whoami` mientras no exista un endpoint de identidad más chico — ver
|
|
1080
|
+
* `docs/agents/mailmask-cli.md`.
|
|
1081
|
+
*/
|
|
1082
|
+
me(): Promise<AccountMe>;
|
|
1083
|
+
/** Todo tu dato (alias, reglas y logs de cada dominio) como JSON exportable. */
|
|
1084
|
+
export(): Promise<AccountExport>;
|
|
973
1085
|
getProfile(): Promise<AccountProfile>;
|
|
974
1086
|
/** Nombre visible (máx. 60 caracteres). Cadena vacía lo borra. */
|
|
975
1087
|
updateProfile(input: {
|
|
@@ -1062,4 +1174,4 @@ interface WebhookSignatureHeaders {
|
|
|
1062
1174
|
*/
|
|
1063
1175
|
declare function verifyWebhookSignature(secret: string, headers: WebhookSignatureHeaders, rawBody: string, toleranceMs?: number): Promise<boolean>;
|
|
1064
1176
|
|
|
1065
|
-
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 };
|
|
1177
|
+
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
|
@@ -463,6 +463,12 @@ interface DomainRegistration {
|
|
|
463
463
|
nextChargeAt: string | null;
|
|
464
464
|
dnsImportStatus: string;
|
|
465
465
|
transferAuthCodeHint: string | null;
|
|
466
|
+
/** Candado de transferencia (`clientTransferProhibited`); null si aún no se ha leído de AWS. */
|
|
467
|
+
transferLock: boolean | null;
|
|
468
|
+
/** Mientras está quitado: cuándo se vuelve a poner solo. */
|
|
469
|
+
transferUnlockedUntil: string | null;
|
|
470
|
+
/** Desde cuándo puede cambiar de registrador (regla de 60 días de ICANN). */
|
|
471
|
+
transferEligibleAt: string;
|
|
466
472
|
lastError: string | null;
|
|
467
473
|
createdAt: string;
|
|
468
474
|
[k: string]: unknown;
|
|
@@ -529,6 +535,93 @@ interface AccountProfile {
|
|
|
529
535
|
/** Ruta relativa al host de MailMask (`/api/avatar/...`), o null sin foto. */
|
|
530
536
|
avatarUrl: string | null;
|
|
531
537
|
}
|
|
538
|
+
/** Derechos y uso de UN dominio, dentro de `AccountMe.porDominio`. */
|
|
539
|
+
interface AccountMeDomainUsage {
|
|
540
|
+
id: string;
|
|
541
|
+
domain: string;
|
|
542
|
+
/** Límites del dominio (sends, aliases, dominios, etc.), por plan y add-ons. */
|
|
543
|
+
derechos: Record<string, unknown>;
|
|
544
|
+
addons: Addon[];
|
|
545
|
+
uso: {
|
|
546
|
+
aliases: {
|
|
547
|
+
current: number;
|
|
548
|
+
limit: number;
|
|
549
|
+
};
|
|
550
|
+
rules: {
|
|
551
|
+
current: number;
|
|
552
|
+
limit: number;
|
|
553
|
+
};
|
|
554
|
+
sends: {
|
|
555
|
+
current: number;
|
|
556
|
+
limit: number;
|
|
557
|
+
};
|
|
558
|
+
forwards: {
|
|
559
|
+
current: number;
|
|
560
|
+
limit: number;
|
|
561
|
+
};
|
|
562
|
+
mailboxBytes: {
|
|
563
|
+
current: number;
|
|
564
|
+
limit: number;
|
|
565
|
+
};
|
|
566
|
+
};
|
|
567
|
+
}
|
|
568
|
+
/** Respuesta de `account.me()`: identidad de la cuenta y su uso, por dominio y total. */
|
|
569
|
+
interface AccountMe extends AccountProfile {
|
|
570
|
+
isAdmin: boolean;
|
|
571
|
+
assistant: boolean;
|
|
572
|
+
domainsCount: number;
|
|
573
|
+
emailVerified: boolean;
|
|
574
|
+
forwards: {
|
|
575
|
+
current: number;
|
|
576
|
+
limit: number;
|
|
577
|
+
};
|
|
578
|
+
subscription: {
|
|
579
|
+
plan: string;
|
|
580
|
+
status: string;
|
|
581
|
+
currentPeriodEnd: string | null;
|
|
582
|
+
planLabel: string;
|
|
583
|
+
[k: string]: unknown;
|
|
584
|
+
};
|
|
585
|
+
porDominio: AccountMeDomainUsage[];
|
|
586
|
+
addons: Addon[];
|
|
587
|
+
planPriceCents: number | null;
|
|
588
|
+
addonCatalog: Record<string, {
|
|
589
|
+
price: number;
|
|
590
|
+
label: string;
|
|
591
|
+
}>;
|
|
592
|
+
addonsForSale: string[];
|
|
593
|
+
lastOrder: Order | null;
|
|
594
|
+
usage: {
|
|
595
|
+
domains: {
|
|
596
|
+
current: number;
|
|
597
|
+
limit: number | null;
|
|
598
|
+
};
|
|
599
|
+
aliasesPerDomain: unknown[];
|
|
600
|
+
rulesPerDomain: unknown[];
|
|
601
|
+
sendsPerDomain: unknown[];
|
|
602
|
+
};
|
|
603
|
+
referralSlug?: string | null;
|
|
604
|
+
referralStats: ReferralStats;
|
|
605
|
+
}
|
|
606
|
+
/** Respuesta de `account.export()`: todo el dato del usuario, listo para descargar. */
|
|
607
|
+
interface AccountExport {
|
|
608
|
+
email: string;
|
|
609
|
+
exportedAt: string;
|
|
610
|
+
domains: {
|
|
611
|
+
domain: string;
|
|
612
|
+
domainId: string;
|
|
613
|
+
verified: boolean;
|
|
614
|
+
aliases: Alias[];
|
|
615
|
+
rules: Rule[];
|
|
616
|
+
logs: EmailLog[];
|
|
617
|
+
}[];
|
|
618
|
+
}
|
|
619
|
+
/** Respuesta de `domains.uploadImage()`. */
|
|
620
|
+
interface UploadedEmailImage {
|
|
621
|
+
ok: boolean;
|
|
622
|
+
/** Efímera: se borra tras enviarse (o la barre el aseo diario si nunca se usó). */
|
|
623
|
+
url: string;
|
|
624
|
+
}
|
|
532
625
|
type InboxStatus = "open" | "snoozed" | "closed";
|
|
533
626
|
interface InboxConversation {
|
|
534
627
|
id: string;
|
|
@@ -724,6 +817,8 @@ declare class DomainsResource {
|
|
|
724
817
|
removeLogo(id: string): Promise<{
|
|
725
818
|
ok: boolean;
|
|
726
819
|
}>;
|
|
820
|
+
/** 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. */
|
|
821
|
+
uploadImage(id: string, file: Blob, filename?: string): Promise<UploadedEmailImage>;
|
|
727
822
|
}
|
|
728
823
|
declare class DnsResource {
|
|
729
824
|
private req;
|
|
@@ -898,6 +993,15 @@ declare class RegistrationsResource {
|
|
|
898
993
|
ok: boolean;
|
|
899
994
|
aviso: string;
|
|
900
995
|
}>;
|
|
996
|
+
/**
|
|
997
|
+
* Pone el candado de transferencia. Quitarlo no está en el SDK a propósito: sólo se hace
|
|
998
|
+
* desde el panel, con la sesión del dueño y confirmando por correo.
|
|
999
|
+
*/
|
|
1000
|
+
lock(regId: string): Promise<{
|
|
1001
|
+
ok: boolean;
|
|
1002
|
+
transferLock: boolean;
|
|
1003
|
+
transferUnlockedUntil: null;
|
|
1004
|
+
}>;
|
|
901
1005
|
}
|
|
902
1006
|
declare class TransfersResource {
|
|
903
1007
|
private req;
|
|
@@ -970,6 +1074,14 @@ declare class CannedResource {
|
|
|
970
1074
|
declare class AccountResource {
|
|
971
1075
|
private req;
|
|
972
1076
|
constructor(req: Req);
|
|
1077
|
+
/**
|
|
1078
|
+
* Identidad y uso de la cuenta: dominios, derechos por dominio, add-ons y cuotas.
|
|
1079
|
+
* Sustituto de `whoami` mientras no exista un endpoint de identidad más chico — ver
|
|
1080
|
+
* `docs/agents/mailmask-cli.md`.
|
|
1081
|
+
*/
|
|
1082
|
+
me(): Promise<AccountMe>;
|
|
1083
|
+
/** Todo tu dato (alias, reglas y logs de cada dominio) como JSON exportable. */
|
|
1084
|
+
export(): Promise<AccountExport>;
|
|
973
1085
|
getProfile(): Promise<AccountProfile>;
|
|
974
1086
|
/** Nombre visible (máx. 60 caracteres). Cadena vacía lo borra. */
|
|
975
1087
|
updateProfile(input: {
|
|
@@ -1062,4 +1174,4 @@ interface WebhookSignatureHeaders {
|
|
|
1062
1174
|
*/
|
|
1063
1175
|
declare function verifyWebhookSignature(secret: string, headers: WebhookSignatureHeaders, rawBody: string, toleranceMs?: number): Promise<boolean>;
|
|
1064
1176
|
|
|
1065
|
-
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 };
|
|
1177
|
+
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) {
|
|
@@ -342,6 +348,13 @@ var RegistrationsResource = class {
|
|
|
342
348
|
cancelRenewal(regId) {
|
|
343
349
|
return this.req(`/api/domains/registrations/${regId}/renewal/cancel`, { method: "POST" });
|
|
344
350
|
}
|
|
351
|
+
/**
|
|
352
|
+
* Pone el candado de transferencia. Quitarlo no está en el SDK a propósito: sólo se hace
|
|
353
|
+
* desde el panel, con la sesión del dueño y confirmando por correo.
|
|
354
|
+
*/
|
|
355
|
+
lock(regId) {
|
|
356
|
+
return this.req(`/api/domains/registrations/${regId}/transfer-lock`, { method: "POST", body: JSON.stringify({ locked: true }) });
|
|
357
|
+
}
|
|
345
358
|
};
|
|
346
359
|
var TransfersResource = class {
|
|
347
360
|
constructor(req) {
|
|
@@ -413,6 +426,18 @@ var AccountResource = class {
|
|
|
413
426
|
constructor(req) {
|
|
414
427
|
this.req = req;
|
|
415
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
|
+
}
|
|
416
441
|
getProfile() {
|
|
417
442
|
return this.req("/api/profile");
|
|
418
443
|
}
|