@easybits.cloud/mailmask 0.4.4 → 0.4.6
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 +10 -9
- package/dist/index.cjs +9 -1
- package/dist/index.d.cts +27 -1
- package/dist/index.d.ts +27 -1
- package/dist/index.js +9 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @easybits.cloud/mailmask
|
|
2
2
|
|
|
3
|
-
Official TypeScript/JavaScript SDK for the [MailMask](https://mailmask.studio) email
|
|
3
|
+
Official TypeScript/JavaScript SDK for the [MailMask](https://mailmask.studio) email address, mailbox and forwarding API.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -19,29 +19,30 @@ const mm = new MailMask({ apiKey: "mk_..." });
|
|
|
19
19
|
const domains = await mm.domains.list();
|
|
20
20
|
const domainId = domains[0].id;
|
|
21
21
|
|
|
22
|
-
// Create an
|
|
23
|
-
const
|
|
22
|
+
// Create an address — emails to hello@yourdomain.com forward to your inbox
|
|
23
|
+
const address = await mm.addresses.create(domainId, {
|
|
24
24
|
alias: "hello",
|
|
25
25
|
destinations: ["you@example.com"],
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
// Send an email (routed through MailMask for high deliverability)
|
|
29
29
|
await mm.send.send(domainId, {
|
|
30
|
-
from: "hello", // must be an active
|
|
30
|
+
from: "hello", // must be an active address; defaults to `noreply`
|
|
31
31
|
fromName: "Acme", // optional display name: Acme <hello@yourdomain.com>
|
|
32
32
|
to: "client@example.com",
|
|
33
33
|
subject: "Welcome!",
|
|
34
34
|
html: "<p>Thanks for signing up.</p>", // or `body` (plain text) / `markdown`
|
|
35
35
|
});
|
|
36
36
|
|
|
37
|
-
// List
|
|
38
|
-
const
|
|
37
|
+
// List addresses for a domain
|
|
38
|
+
const addresses = await mm.addresses.list(domainId);
|
|
39
39
|
|
|
40
40
|
// Add a domain — returns the DNS records to configure (MX, TXT, DKIM, SPF)
|
|
41
41
|
const { domain, dnsRecords } = await mm.domains.create("yourdomain.com");
|
|
42
42
|
|
|
43
|
-
// An
|
|
44
|
-
const inbox = await mm.
|
|
43
|
+
// An address with an IMAP mailbox (activated domain): password is returned once
|
|
44
|
+
const inbox = await mm.addresses.create(domainId, { alias: "sales", mailbox: true });
|
|
45
|
+
// `mm.aliases` still works: it is the same resource under its old name.
|
|
45
46
|
console.log(inbox.buzon?.password, inbox.buzon?.imap);
|
|
46
47
|
```
|
|
47
48
|
|
|
@@ -79,7 +80,7 @@ Full API reference and examples: https://mailmask.studio/docs
|
|
|
79
80
|
|
|
80
81
|
## Links
|
|
81
82
|
|
|
82
|
-
- [MailMask](https://mailmask.studio) — Email
|
|
83
|
+
- [MailMask](https://mailmask.studio) — Email addresses, mailboxes & forwarding on your domain
|
|
83
84
|
- [EasyBits](https://easybits.cloud) — Cloud platform
|
|
84
85
|
- [Fixter](https://fixter.org) — Development team
|
|
85
86
|
|
package/dist/index.cjs
CHANGED
|
@@ -59,7 +59,8 @@ var MailMask = class {
|
|
|
59
59
|
const doFetch = config.fetch ? config.fetch : fetch;
|
|
60
60
|
const req = (path, opts) => request(this.baseUrl, this.apiKey, path, opts, doFetch);
|
|
61
61
|
this.domains = new DomainsResource(req);
|
|
62
|
-
this.
|
|
62
|
+
this.addresses = new AliasesResource(req, (path) => requestRaw(this.baseUrl, this.apiKey, path, doFetch));
|
|
63
|
+
this.aliases = this.addresses;
|
|
63
64
|
this.rules = new RulesResource(req);
|
|
64
65
|
this.logs = new LogsResource(req);
|
|
65
66
|
this.send = new SendResource(req);
|
|
@@ -369,6 +370,13 @@ var RegistrationsResource = class {
|
|
|
369
370
|
cancelRenewal(regId) {
|
|
370
371
|
return this.req(`/api/domains/registrations/${regId}/renewal/cancel`, { method: "POST" });
|
|
371
372
|
}
|
|
373
|
+
/**
|
|
374
|
+
* Pone el candado de transferencia. Quitarlo no está en el SDK a propósito: sólo se hace
|
|
375
|
+
* desde el panel, con la sesión del dueño y confirmando por correo.
|
|
376
|
+
*/
|
|
377
|
+
lock(regId) {
|
|
378
|
+
return this.req(`/api/domains/registrations/${regId}/transfer-lock`, { method: "POST", body: JSON.stringify({ locked: true }) });
|
|
379
|
+
}
|
|
372
380
|
};
|
|
373
381
|
var TransfersResource = class {
|
|
374
382
|
constructor(req) {
|
package/dist/index.d.cts
CHANGED
|
@@ -47,6 +47,14 @@ interface DomainVerification {
|
|
|
47
47
|
stale?: boolean;
|
|
48
48
|
error?: string;
|
|
49
49
|
}
|
|
50
|
+
/** Nombre público de `Alias` desde la 0.4.5. */
|
|
51
|
+
type Address = Alias;
|
|
52
|
+
/** Nombre público de `AliasCreated` desde la 0.4.5. */
|
|
53
|
+
type AddressCreated = AliasCreated;
|
|
54
|
+
/** Nombre público de `CreateAliasInput` desde la 0.4.5. */
|
|
55
|
+
type CreateAddressInput = CreateAliasInput;
|
|
56
|
+
/** Nombre público de `UpdateAliasInput` desde la 0.4.5. */
|
|
57
|
+
type UpdateAddressInput = UpdateAliasInput;
|
|
50
58
|
interface Alias {
|
|
51
59
|
alias: string;
|
|
52
60
|
domainId: string;
|
|
@@ -455,6 +463,12 @@ interface DomainRegistration {
|
|
|
455
463
|
nextChargeAt: string | null;
|
|
456
464
|
dnsImportStatus: string;
|
|
457
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;
|
|
458
472
|
lastError: string | null;
|
|
459
473
|
createdAt: string;
|
|
460
474
|
[k: string]: unknown;
|
|
@@ -663,6 +677,9 @@ declare class MailMask {
|
|
|
663
677
|
private baseUrl;
|
|
664
678
|
private apiKey;
|
|
665
679
|
domains: DomainsResource;
|
|
680
|
+
/** Las direcciones del dominio (máscaras), con reenvío, buzón o ambos. */
|
|
681
|
+
addresses: AliasesResource;
|
|
682
|
+
/** @deprecated Usa `addresses`; es el mismo recurso y no se va a retirar. */
|
|
666
683
|
aliases: AliasesResource;
|
|
667
684
|
rules: RulesResource;
|
|
668
685
|
logs: LogsResource;
|
|
@@ -887,6 +904,15 @@ declare class RegistrationsResource {
|
|
|
887
904
|
ok: boolean;
|
|
888
905
|
aviso: string;
|
|
889
906
|
}>;
|
|
907
|
+
/**
|
|
908
|
+
* Pone el candado de transferencia. Quitarlo no está en el SDK a propósito: sólo se hace
|
|
909
|
+
* desde el panel, con la sesión del dueño y confirmando por correo.
|
|
910
|
+
*/
|
|
911
|
+
lock(regId: string): Promise<{
|
|
912
|
+
ok: boolean;
|
|
913
|
+
transferLock: boolean;
|
|
914
|
+
transferUnlockedUntil: null;
|
|
915
|
+
}>;
|
|
890
916
|
}
|
|
891
917
|
declare class TransfersResource {
|
|
892
918
|
private req;
|
|
@@ -1051,4 +1077,4 @@ interface WebhookSignatureHeaders {
|
|
|
1051
1077
|
*/
|
|
1052
1078
|
declare function verifyWebhookSignature(secret: string, headers: WebhookSignatureHeaders, rawBody: string, toleranceMs?: number): Promise<boolean>;
|
|
1053
1079
|
|
|
1054
|
-
export { type AccountProfile, type Addon, type AddonsResponse, type Alias, type AliasCreated, type ApiKey, type AttachmentRef, type BillingStatus, type BulkJob, type BulkJobCreated, type BulkSendInput, type CannedReply, type CheckoutLink, 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 UpdateAliasInput, type UpdateRuleInput, type UpdateWebhookInput, type UploadAttachmentInput, type UploadedAttachment, type Webhook, type WebhookCreated, type WebhookDelivery, type WebhookEvent, type WebhookPayload, type WebhookSignatureHeaders, verifyWebhookSignature };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -47,6 +47,14 @@ interface DomainVerification {
|
|
|
47
47
|
stale?: boolean;
|
|
48
48
|
error?: string;
|
|
49
49
|
}
|
|
50
|
+
/** Nombre público de `Alias` desde la 0.4.5. */
|
|
51
|
+
type Address = Alias;
|
|
52
|
+
/** Nombre público de `AliasCreated` desde la 0.4.5. */
|
|
53
|
+
type AddressCreated = AliasCreated;
|
|
54
|
+
/** Nombre público de `CreateAliasInput` desde la 0.4.5. */
|
|
55
|
+
type CreateAddressInput = CreateAliasInput;
|
|
56
|
+
/** Nombre público de `UpdateAliasInput` desde la 0.4.5. */
|
|
57
|
+
type UpdateAddressInput = UpdateAliasInput;
|
|
50
58
|
interface Alias {
|
|
51
59
|
alias: string;
|
|
52
60
|
domainId: string;
|
|
@@ -455,6 +463,12 @@ interface DomainRegistration {
|
|
|
455
463
|
nextChargeAt: string | null;
|
|
456
464
|
dnsImportStatus: string;
|
|
457
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;
|
|
458
472
|
lastError: string | null;
|
|
459
473
|
createdAt: string;
|
|
460
474
|
[k: string]: unknown;
|
|
@@ -663,6 +677,9 @@ declare class MailMask {
|
|
|
663
677
|
private baseUrl;
|
|
664
678
|
private apiKey;
|
|
665
679
|
domains: DomainsResource;
|
|
680
|
+
/** Las direcciones del dominio (máscaras), con reenvío, buzón o ambos. */
|
|
681
|
+
addresses: AliasesResource;
|
|
682
|
+
/** @deprecated Usa `addresses`; es el mismo recurso y no se va a retirar. */
|
|
666
683
|
aliases: AliasesResource;
|
|
667
684
|
rules: RulesResource;
|
|
668
685
|
logs: LogsResource;
|
|
@@ -887,6 +904,15 @@ declare class RegistrationsResource {
|
|
|
887
904
|
ok: boolean;
|
|
888
905
|
aviso: string;
|
|
889
906
|
}>;
|
|
907
|
+
/**
|
|
908
|
+
* Pone el candado de transferencia. Quitarlo no está en el SDK a propósito: sólo se hace
|
|
909
|
+
* desde el panel, con la sesión del dueño y confirmando por correo.
|
|
910
|
+
*/
|
|
911
|
+
lock(regId: string): Promise<{
|
|
912
|
+
ok: boolean;
|
|
913
|
+
transferLock: boolean;
|
|
914
|
+
transferUnlockedUntil: null;
|
|
915
|
+
}>;
|
|
890
916
|
}
|
|
891
917
|
declare class TransfersResource {
|
|
892
918
|
private req;
|
|
@@ -1051,4 +1077,4 @@ interface WebhookSignatureHeaders {
|
|
|
1051
1077
|
*/
|
|
1052
1078
|
declare function verifyWebhookSignature(secret: string, headers: WebhookSignatureHeaders, rawBody: string, toleranceMs?: number): Promise<boolean>;
|
|
1053
1079
|
|
|
1054
|
-
export { type AccountProfile, type Addon, type AddonsResponse, type Alias, type AliasCreated, type ApiKey, type AttachmentRef, type BillingStatus, type BulkJob, type BulkJobCreated, type BulkSendInput, type CannedReply, type CheckoutLink, 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 UpdateAliasInput, type UpdateRuleInput, type UpdateWebhookInput, type UploadAttachmentInput, type UploadedAttachment, type Webhook, type WebhookCreated, type WebhookDelivery, type WebhookEvent, type WebhookPayload, type WebhookSignatureHeaders, verifyWebhookSignature };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -31,7 +31,8 @@ var MailMask = class {
|
|
|
31
31
|
const doFetch = config.fetch ? config.fetch : fetch;
|
|
32
32
|
const req = (path, opts) => request(this.baseUrl, this.apiKey, path, opts, doFetch);
|
|
33
33
|
this.domains = new DomainsResource(req);
|
|
34
|
-
this.
|
|
34
|
+
this.addresses = new AliasesResource(req, (path) => requestRaw(this.baseUrl, this.apiKey, path, doFetch));
|
|
35
|
+
this.aliases = this.addresses;
|
|
35
36
|
this.rules = new RulesResource(req);
|
|
36
37
|
this.logs = new LogsResource(req);
|
|
37
38
|
this.send = new SendResource(req);
|
|
@@ -341,6 +342,13 @@ var RegistrationsResource = class {
|
|
|
341
342
|
cancelRenewal(regId) {
|
|
342
343
|
return this.req(`/api/domains/registrations/${regId}/renewal/cancel`, { method: "POST" });
|
|
343
344
|
}
|
|
345
|
+
/**
|
|
346
|
+
* Pone el candado de transferencia. Quitarlo no está en el SDK a propósito: sólo se hace
|
|
347
|
+
* desde el panel, con la sesión del dueño y confirmando por correo.
|
|
348
|
+
*/
|
|
349
|
+
lock(regId) {
|
|
350
|
+
return this.req(`/api/domains/registrations/${regId}/transfer-lock`, { method: "POST", body: JSON.stringify({ locked: true }) });
|
|
351
|
+
}
|
|
344
352
|
};
|
|
345
353
|
var TransfersResource = class {
|
|
346
354
|
constructor(req) {
|