nextmail 0.1.0 → 0.1.1
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.
- checksums.yaml +4 -4
- data/README.md +14 -0
- data/lib/nextmail/api_paths.rb +10 -0
- data/lib/nextmail/client.rb +2 -0
- data/lib/nextmail/constants.rb +156 -2
- data/lib/nextmail/protocol.rb +3 -1
- data/lib/nextmail/resources/notifications.rb +37 -0
- data/lib/nextmail/resources/signups.rb +15 -0
- data/lib/nextmail/resources/templates.rb +4 -4
- data/lib/nextmail/resources/tools.rb +12 -0
- data/lib/nextmail/results.rb +6 -0
- data/lib/nextmail/version.rb +1 -1
- data/lib/nextmail.rb +8 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bb3b572836d9f9d4e43b372c25a2706cd49825313601f132ef6eb0ca414e13c5
|
|
4
|
+
data.tar.gz: 3323950f7ed612e31f13f36802c7309228c22d79b82e3abc69dab78b68e29fd0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 244a38f542a4e20e7192638d3d7cddad830617c7b31267c7019a35558a103e09d6f063bd69d091ff8a685c7d949cef01a81576d931cc4ed38e8c6f7ce91787ad
|
|
7
|
+
data.tar.gz: 860beb519e29aeee5accafd683d20887284a24ba7dee7e093efde0d3d413badee501d2cd35837eaa33a196fc05f231377fbfdb86209ef99ad1fab49eb57d0020
|
data/README.md
CHANGED
|
@@ -138,6 +138,20 @@ page = temp_mail.list_messages(inbox[:id], inbox_token: inbox[:token])
|
|
|
138
138
|
|
|
139
139
|
`create` needs no credential and is the only call that returns the inbox token, so keep it.
|
|
140
140
|
|
|
141
|
+
### Signing a person up
|
|
142
|
+
```ruby
|
|
143
|
+
signups = Nextmail.create_signups
|
|
144
|
+
|
|
145
|
+
sign_up = signups.create(email: "ada@example.com", agent: "Claude Code")
|
|
146
|
+
|
|
147
|
+
print "The code sent to #{sign_up[:sentTo]}: "
|
|
148
|
+
account = signups.verify(sign_up[:id], $stdin.gets.strip)
|
|
149
|
+
|
|
150
|
+
client = Nextmail::Client.new(api_key: account[:apiKey][:token])
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
An agent with no key starts a sign-up for a person's address, asks them for the six-digit code emailed to them, and gets back an API key for the new account. `account[:apiKey][:token]` is shown only in that answer, so store it.
|
|
154
|
+
|
|
141
155
|
### OAuth access tokens
|
|
142
156
|
An app a person connected to Nextmail with OAuth, such as a command line tool or an agent, holds an access token rather than an API key. Pass it as `access_token:`, either the token itself or anything that responds to `call` and returns it:
|
|
143
157
|
|
data/lib/nextmail/api_paths.rb
CHANGED
|
@@ -308,6 +308,11 @@ module Nextmail
|
|
|
308
308
|
MEMBER_INVITATION = "/members/invitations/:invitationId"
|
|
309
309
|
MEMBER_INVITATIONS = "/members/invitations"
|
|
310
310
|
MEMBER_INVITATION_RESEND = "/members/invitations/:invitationId/resend"
|
|
311
|
+
NOTIFICATIONS = "/notifications"
|
|
312
|
+
NOTIFICATIONS_CLEAR = "/notifications/clear"
|
|
313
|
+
NOTIFICATIONS_READ = "/notifications/read"
|
|
314
|
+
NOTIFICATIONS_READ_ALL = "/notifications/read-all"
|
|
315
|
+
NOTIFICATIONS_UNREAD_COUNT = "/notifications/unread-count"
|
|
311
316
|
OUT_OF_OFFICE = "/out-of-office"
|
|
312
317
|
PING = "/ping"
|
|
313
318
|
PROVIDER_IMPORT = "/provider-imports/:id"
|
|
@@ -347,6 +352,8 @@ module Nextmail
|
|
|
347
352
|
SIGNATURE = "/signatures/:id"
|
|
348
353
|
SIGNATURES = "/signatures"
|
|
349
354
|
SIGNATURE_COPY = "/signatures/:id/copy"
|
|
355
|
+
SIGNUPS = "/signups"
|
|
356
|
+
SIGNUP_VERIFY = "/signups/:id/verify"
|
|
350
357
|
SUBSCRIBE_FORM = "/subscribe/:formId"
|
|
351
358
|
SUBSCRIPTIONS = "/subscriptions"
|
|
352
359
|
SUBSCRIPTIONS_BATCH_KEEP = "/subscriptions/batch-keep"
|
|
@@ -435,7 +442,10 @@ module Nextmail
|
|
|
435
442
|
TOOLS_BIMI = "/tools/bimi"
|
|
436
443
|
TOOLS_COST = "/tools/cost"
|
|
437
444
|
TOOLS_DELIVERABILITY = "/tools/deliverability"
|
|
445
|
+
TOOLS_DKIM = "/tools/dkim"
|
|
438
446
|
TOOLS_DMARC = "/tools/dmarc"
|
|
447
|
+
TOOLS_MX = "/tools/mx"
|
|
448
|
+
TOOLS_SPF = "/tools/spf"
|
|
439
449
|
TOOLS_VERIFICATION_CODE = "/tools/verification-code"
|
|
440
450
|
TRACKED = "/tracking/:id"
|
|
441
451
|
TRACKED_CLICKS = "/tracking/:id/clicks"
|
data/lib/nextmail/client.rb
CHANGED
|
@@ -43,6 +43,7 @@ module Nextmail
|
|
|
43
43
|
files: Resources::Files,
|
|
44
44
|
knowledge: Resources::Knowledge,
|
|
45
45
|
temp_mail: Resources::TempMail,
|
|
46
|
+
signups: Resources::Signups,
|
|
46
47
|
exports: Resources::Exports,
|
|
47
48
|
chats: Resources::Chats,
|
|
48
49
|
encryption: Resources::Encryption,
|
|
@@ -54,6 +55,7 @@ module Nextmail
|
|
|
54
55
|
dns_connections: Resources::DnsConnections,
|
|
55
56
|
workspaces: Resources::Workspaces,
|
|
56
57
|
account: Resources::Account,
|
|
58
|
+
notifications: Resources::Notifications,
|
|
57
59
|
signatures: Resources::Signatures,
|
|
58
60
|
tasks: Resources::Tasks,
|
|
59
61
|
bookings: Resources::Bookings,
|
data/lib/nextmail/constants.rb
CHANGED
|
@@ -532,6 +532,36 @@ module Nextmail
|
|
|
532
532
|
|
|
533
533
|
DIRECTORY_PERSON_STATES = {MEMBER: "member", INVITED: "invited", WAITING: "waiting", INACTIVE: "inactive"}.freeze
|
|
534
534
|
|
|
535
|
+
DKIM_FINDING_CODES = {
|
|
536
|
+
LOOKUP_FAILED: "lookup-failed",
|
|
537
|
+
NOT_FOUND: "not-found",
|
|
538
|
+
NONE_FOUND: "none-found",
|
|
539
|
+
NOT_DKIM: "not-dkim",
|
|
540
|
+
ALIASED: "aliased",
|
|
541
|
+
MULTIPLE_RECORDS: "multiple-records",
|
|
542
|
+
VERSION_INVALID: "version-invalid",
|
|
543
|
+
VERSION_NOT_FIRST: "version-not-first",
|
|
544
|
+
DUPLICATE_TAG: "duplicate-tag",
|
|
545
|
+
MALFORMED_TAG: "malformed-tag",
|
|
546
|
+
MISSING_KEY: "missing-key",
|
|
547
|
+
INVALID_KEY: "invalid-key",
|
|
548
|
+
REVOKED: "revoked",
|
|
549
|
+
WEAK_KEY: "weak-key",
|
|
550
|
+
SHORT_KEY: "short-key",
|
|
551
|
+
STRONG_KEY: "strong-key",
|
|
552
|
+
LONG_KEY: "long-key",
|
|
553
|
+
ED25519_KEY: "ed25519-key",
|
|
554
|
+
UNKNOWN_KEY_TYPE: "unknown-key-type",
|
|
555
|
+
SHA1_ONLY: "sha1-only",
|
|
556
|
+
SHA1_ALLOWED: "sha1-allowed",
|
|
557
|
+
UNKNOWN_HASH: "unknown-hash",
|
|
558
|
+
TESTING_MODE: "testing-mode",
|
|
559
|
+
STRICT_MODE: "strict-mode",
|
|
560
|
+
SERVICE_MISMATCH: "service-mismatch",
|
|
561
|
+
OBSOLETE_GRANULARITY: "obsolete-granularity",
|
|
562
|
+
UNKNOWN_TAG: "unknown-tag"
|
|
563
|
+
}.freeze
|
|
564
|
+
|
|
535
565
|
DNS_CONNECTION_STATUSES = {ACTIVE: "active", NEEDS_REAUTH: "needs-reauth", REVOKED: "revoked", ERROR: "error"}.freeze
|
|
536
566
|
|
|
537
567
|
DNS_PROVISION_STATES = {
|
|
@@ -1225,6 +1255,40 @@ module Nextmail
|
|
|
1225
1255
|
SMIME_SIGNED: "smime-signed"
|
|
1226
1256
|
}.freeze
|
|
1227
1257
|
|
|
1258
|
+
MX_ADDRESS_FAMILIES = {IPV4: "ipv4", IPV6: "ipv6"}.freeze
|
|
1259
|
+
|
|
1260
|
+
MX_FINDING_CODES = {
|
|
1261
|
+
LOOKUP_FAILED: "lookup-failed",
|
|
1262
|
+
DOMAIN_MISSING: "domain-missing",
|
|
1263
|
+
NO_MAIL: "no-mail",
|
|
1264
|
+
IMPLICIT_MX: "implicit-mx",
|
|
1265
|
+
NULL_MX: "null-mx",
|
|
1266
|
+
NULL_MX_MIXED: "null-mx-mixed",
|
|
1267
|
+
ADDRESS_TARGET: "address-target",
|
|
1268
|
+
ALIAS_TARGET: "alias-target",
|
|
1269
|
+
HOST_UNRESOLVED: "host-unresolved",
|
|
1270
|
+
RESERVED_ADDRESS: "reserved-address",
|
|
1271
|
+
NO_REVERSE_DNS: "no-reverse-dns",
|
|
1272
|
+
DUPLICATE_HOST: "duplicate-host",
|
|
1273
|
+
SINGLE_HOST: "single-host",
|
|
1274
|
+
BACKUP_HOSTS: "backup-hosts",
|
|
1275
|
+
LOAD_BALANCED: "load-balanced",
|
|
1276
|
+
ALL_RESOLVE: "all-resolve",
|
|
1277
|
+
IPV6_READY: "ipv6-ready",
|
|
1278
|
+
NO_IPV6: "no-ipv6",
|
|
1279
|
+
PROVIDER: "provider"
|
|
1280
|
+
}.freeze
|
|
1281
|
+
|
|
1282
|
+
NOTIFICATION_INVITATION_STATUSES = {
|
|
1283
|
+
OPEN: "open",
|
|
1284
|
+
ACCEPTED: "accepted",
|
|
1285
|
+
DECLINED: "declined",
|
|
1286
|
+
WITHDRAWN: "withdrawn",
|
|
1287
|
+
EXPIRED: "expired"
|
|
1288
|
+
}.freeze
|
|
1289
|
+
|
|
1290
|
+
NOTIFICATION_KINDS = {WORKSPACE_INVITATION: "workspace-invitation"}.freeze
|
|
1291
|
+
|
|
1228
1292
|
PAGE_LIMITS = {MAX_LIMIT: 100, DEFAULT_LIMIT: 25}.freeze
|
|
1229
1293
|
|
|
1230
1294
|
PAID_PLAN_IDS = {STARTER: "starter", BUSINESS: "business", ENTERPRISE: "enterprise"}.freeze
|
|
@@ -1279,6 +1343,10 @@ module Nextmail
|
|
|
1279
1343
|
|
|
1280
1344
|
RAW_MESSAGE_SOURCES = {ORIGINAL: "original", REBUILT: "rebuilt"}.freeze
|
|
1281
1345
|
|
|
1346
|
+
RECORD_CHECK_SEVERITIES = {ERROR: "error", WARNING: "warning", NOTICE: "notice", PASS: "pass"}.freeze
|
|
1347
|
+
|
|
1348
|
+
RECORD_CHECK_STATUSES = {PASS: "pass", WARN: "warn", FAIL: "fail", MISSING: "missing"}.freeze
|
|
1349
|
+
|
|
1282
1350
|
REPLY_SUGGESTION_STATES = {READY: "ready", PENDING: "pending", NONE: "none"}.freeze
|
|
1283
1351
|
|
|
1284
1352
|
REWRITE_ACTIONS = {
|
|
@@ -1374,7 +1442,11 @@ module Nextmail
|
|
|
1374
1442
|
CONNECTOR_DISCONNECTED: "connector-disconnected",
|
|
1375
1443
|
CONNECTOR_CHANGED: "connector-changed",
|
|
1376
1444
|
OWNERSHIP_OFFERED: "ownership-offered",
|
|
1377
|
-
OWNERSHIP_TRANSFERRED: "ownership-transferred"
|
|
1445
|
+
OWNERSHIP_TRANSFERRED: "ownership-transferred",
|
|
1446
|
+
ADDRESS_ACCESS_GRANTED: "address-access-granted",
|
|
1447
|
+
ADDRESS_ACCESS_REVOKED: "address-access-revoked",
|
|
1448
|
+
DOMAIN_ACCESS_GRANTED: "domain-access-granted",
|
|
1449
|
+
DOMAIN_ACCESS_REVOKED: "domain-access-revoked"
|
|
1378
1450
|
}.freeze
|
|
1379
1451
|
|
|
1380
1452
|
SECURITY_EVENT_SCOPES = {ACCOUNT: "account", WORKSPACE: "workspace"}.freeze
|
|
@@ -1448,6 +1520,59 @@ module Nextmail
|
|
|
1448
1520
|
|
|
1449
1521
|
SHARE_KINDS = {TEMPLATE: "template", FORM: "form", AUTOMATION: "automation"}.freeze
|
|
1450
1522
|
|
|
1523
|
+
SPF_FINDING_CODES = {
|
|
1524
|
+
LOOKUP_FAILED: "lookup-failed",
|
|
1525
|
+
DOMAIN_MISSING: "domain-missing",
|
|
1526
|
+
NO_RECORD: "no-record",
|
|
1527
|
+
NEAR_MISS: "near-miss",
|
|
1528
|
+
ONE_RECORD: "one-record",
|
|
1529
|
+
MULTIPLE_RECORDS: "multiple-records",
|
|
1530
|
+
VALID_SYNTAX: "valid-syntax",
|
|
1531
|
+
INVALID_TERM: "invalid-term",
|
|
1532
|
+
UNKNOWN_MECHANISM: "unknown-mechanism",
|
|
1533
|
+
INVALID_ADDRESS: "invalid-address",
|
|
1534
|
+
INVALID_DOMAIN: "invalid-domain",
|
|
1535
|
+
LOOKUPS_WITHIN_LIMIT: "lookups-within-limit",
|
|
1536
|
+
NEAR_LOOKUP_LIMIT: "near-lookup-limit",
|
|
1537
|
+
TOO_MANY_LOOKUPS: "too-many-lookups",
|
|
1538
|
+
TOO_MANY_VOID_LOOKUPS: "too-many-void-lookups",
|
|
1539
|
+
VOID_LOOKUP: "void-lookup",
|
|
1540
|
+
INCLUDE_MISSING: "include-missing",
|
|
1541
|
+
INCLUDE_MULTIPLE: "include-multiple",
|
|
1542
|
+
INCLUDE_LOOP: "include-loop",
|
|
1543
|
+
INCLUDE_LOOKUP_FAILED: "include-lookup-failed",
|
|
1544
|
+
TOO_MANY_MX_HOSTS: "too-many-mx-hosts",
|
|
1545
|
+
PASS_ALL: "pass-all",
|
|
1546
|
+
NEUTRAL_ALL: "neutral-all",
|
|
1547
|
+
SOFTFAIL_ALL: "softfail-all",
|
|
1548
|
+
FAIL_ALL: "fail-all",
|
|
1549
|
+
NO_ALL: "no-all",
|
|
1550
|
+
TERMS_AFTER_ALL: "terms-after-all",
|
|
1551
|
+
REDIRECT_IGNORED: "redirect-ignored",
|
|
1552
|
+
DUPLICATE_MODIFIER: "duplicate-modifier",
|
|
1553
|
+
PTR_USED: "ptr-used",
|
|
1554
|
+
MACROS_USED: "macros-used",
|
|
1555
|
+
UNKNOWN_MODIFIER: "unknown-modifier",
|
|
1556
|
+
BROAD_RANGE: "broad-range",
|
|
1557
|
+
LONG_RECORD: "long-record",
|
|
1558
|
+
LONG_STRING: "long-string",
|
|
1559
|
+
ANALYSIS_TRUNCATED: "analysis-truncated"
|
|
1560
|
+
}.freeze
|
|
1561
|
+
|
|
1562
|
+
SPF_NODE_ERRORS = {
|
|
1563
|
+
MISSING: "missing",
|
|
1564
|
+
MULTIPLE: "multiple",
|
|
1565
|
+
LOOP: "loop",
|
|
1566
|
+
LOOKUP_FAILED: "lookup-failed",
|
|
1567
|
+
SKIPPED: "skipped"
|
|
1568
|
+
}.freeze
|
|
1569
|
+
|
|
1570
|
+
SPF_QUALIFIERS = {PASS: "+", FAIL: "-", SOFT_FAIL: "~", NEUTRAL: "?"}.freeze
|
|
1571
|
+
|
|
1572
|
+
SPF_REFERENCE_KINDS = {INCLUDE: "include", REDIRECT: "redirect"}.freeze
|
|
1573
|
+
|
|
1574
|
+
SPF_TERM_KINDS = {MECHANISM: "mechanism", MODIFIER: "modifier", UNKNOWN: "unknown"}.freeze
|
|
1575
|
+
|
|
1451
1576
|
STEP_UP_ERROR_CODES = {
|
|
1452
1577
|
STEP_UP_REQUIRED: "step_up_required",
|
|
1453
1578
|
STEP_UP_NOT_APPLICABLE: "step_up_not_applicable",
|
|
@@ -1535,6 +1660,22 @@ module Nextmail
|
|
|
1535
1660
|
|
|
1536
1661
|
TASK_TRIGGER_KINDS = {SCHEDULE: "schedule", MAIL: "mail", MANUAL: "manual"}.freeze
|
|
1537
1662
|
|
|
1663
|
+
TEMPLATE_CATEGORIES = {
|
|
1664
|
+
ACCOUNT: "account",
|
|
1665
|
+
COMMERCE: "commerce",
|
|
1666
|
+
NOTIFY: "notify",
|
|
1667
|
+
MARKETING: "marketing",
|
|
1668
|
+
EVENTS: "events",
|
|
1669
|
+
HOSPITALITY: "hospitality",
|
|
1670
|
+
HEALTH: "health",
|
|
1671
|
+
EDUCATION: "education",
|
|
1672
|
+
REAL_ESTATE: "real-estate",
|
|
1673
|
+
NONPROFIT: "nonprofit",
|
|
1674
|
+
TRAVEL: "travel",
|
|
1675
|
+
RECRUITING: "recruiting",
|
|
1676
|
+
COMMUNITY: "community"
|
|
1677
|
+
}.freeze
|
|
1678
|
+
|
|
1538
1679
|
TEMPLATE_IMAGE_TYPES = {
|
|
1539
1680
|
PNG: "image/png",
|
|
1540
1681
|
JPEG: "image/jpeg",
|
|
@@ -1543,6 +1684,15 @@ module Nextmail
|
|
|
1543
1684
|
SVG: "image/svg+xml"
|
|
1544
1685
|
}.freeze
|
|
1545
1686
|
|
|
1687
|
+
TEMPLATE_STYLES = {
|
|
1688
|
+
MINIMAL: "minimal",
|
|
1689
|
+
MODERN: "modern",
|
|
1690
|
+
BOLD: "bold",
|
|
1691
|
+
CLASSIC: "classic",
|
|
1692
|
+
DARK: "dark",
|
|
1693
|
+
SOFT: "soft"
|
|
1694
|
+
}.freeze
|
|
1695
|
+
|
|
1546
1696
|
THREAD_NOTE_COLORS = {
|
|
1547
1697
|
DEFAULT: "default",
|
|
1548
1698
|
RED: "red",
|
|
@@ -1643,6 +1793,8 @@ module Nextmail
|
|
|
1643
1793
|
DOMAIN_VERIFIED: "domain.verified",
|
|
1644
1794
|
DOMAIN_SENDING_CHANGED: "domain.sending_changed",
|
|
1645
1795
|
DOMAIN_DELETED: "domain.deleted",
|
|
1796
|
+
DOMAIN_ACCESS_GRANTED: "domain.access_granted",
|
|
1797
|
+
DOMAIN_ACCESS_REVOKED: "domain.access_revoked",
|
|
1646
1798
|
SUPPRESSION_ADDED: "suppression.added",
|
|
1647
1799
|
SUPPRESSION_REMOVED: "suppression.removed",
|
|
1648
1800
|
FILE_UPLOADED: "file.uploaded",
|
|
@@ -1676,7 +1828,9 @@ module Nextmail
|
|
|
1676
1828
|
BROADCAST_SENT: "broadcast.sent",
|
|
1677
1829
|
BROADCAST_FAILED: "broadcast.failed",
|
|
1678
1830
|
BROADCAST_CANCELLED: "broadcast.cancelled",
|
|
1679
|
-
ADDRESS_EXPIRED: "address.expired"
|
|
1831
|
+
ADDRESS_EXPIRED: "address.expired",
|
|
1832
|
+
ADDRESS_ACCESS_GRANTED: "address.access_granted",
|
|
1833
|
+
ADDRESS_ACCESS_REVOKED: "address.access_revoked"
|
|
1680
1834
|
}.freeze
|
|
1681
1835
|
|
|
1682
1836
|
WEBHOOK_REPLAY_ERROR_CODES = {
|
data/lib/nextmail/protocol.rb
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nextmail
|
|
4
|
+
module Resources
|
|
5
|
+
class Notifications < Resource
|
|
6
|
+
def list(limit: nil, cursor: nil, api_key: nil)
|
|
7
|
+
envelope = request(ApiPaths::NOTIFICATIONS, query: query_params(limit:, cursor:), api_key:)
|
|
8
|
+
envelope = {} unless envelope.is_a?(Hash)
|
|
9
|
+
next_cursor = Pagination.cursor_of(envelope[:nextCursor])
|
|
10
|
+
|
|
11
|
+
NotificationPage.new(
|
|
12
|
+
items: Pagination.items_of(envelope),
|
|
13
|
+
unread_count: envelope[:unreadCount] || 0,
|
|
14
|
+
has_more: Pagination.more?(envelope, next_cursor),
|
|
15
|
+
next_cursor:
|
|
16
|
+
)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def unread_count(api_key: nil)
|
|
20
|
+
request(ApiPaths::NOTIFICATIONS_UNREAD_COUNT, api_key:)
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def mark_read(ids, api_key: nil)
|
|
24
|
+
request(ApiPaths::NOTIFICATIONS_READ, method: :post, body: {"ids" => ids}, repeatable: true, api_key:)
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def mark_all_read(api_key: nil)
|
|
28
|
+
request(ApiPaths::NOTIFICATIONS_READ_ALL, method: :post, repeatable: true, api_key:)
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def clear(decline_invitations: nil, api_key: nil)
|
|
32
|
+
request(ApiPaths::NOTIFICATIONS_CLEAR, method: :post,
|
|
33
|
+
body: decline_invitations.nil? ? {} : {"declineInvitations" => decline_invitations}, repeatable: true, api_key:)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Nextmail
|
|
4
|
+
module Resources
|
|
5
|
+
class Signups < Resource
|
|
6
|
+
def create(body = nil, api_key: nil, **fields)
|
|
7
|
+
request(ApiPaths::SIGNUPS, method: :post, body: payload(body, fields), anonymous: true)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def verify(sign_up_id, code, api_key: nil)
|
|
11
|
+
request(fill(ApiPaths::SIGNUP_VERIFY, id: sign_up_id), method: :post, body: {code:}, anonymous: true)
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -15,16 +15,16 @@ module Nextmail
|
|
|
15
15
|
iterate_pages(ApiPaths::TEMPLATES, query_params(status:, search:, sort:), limit:, cursor:, api_key:, &)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
def list_starters(api_key: nil)
|
|
19
|
-
fetch_list(ApiPaths::TEMPLATE_STARTERS, api_key:)
|
|
18
|
+
def list_starters(category: nil, api_key: nil)
|
|
19
|
+
fetch_list(ApiPaths::TEMPLATE_STARTERS, query_params(category:), api_key:)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def list_fonts(api_key: nil)
|
|
23
23
|
fetch_list(ApiPaths::TEMPLATE_FONTS, api_key:)
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
def get_starter(slug, api_key: nil)
|
|
27
|
-
request(fill(ApiPaths::TEMPLATE_STARTER, slug:), api_key:)
|
|
26
|
+
def get_starter(slug, style: nil, api_key: nil)
|
|
27
|
+
request(fill(ApiPaths::TEMPLATE_STARTER, slug:), query: query_params(style:), api_key:)
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
def render(body = nil, api_key: nil, **fields)
|
|
@@ -15,6 +15,18 @@ module Nextmail
|
|
|
15
15
|
request(ApiPaths::TOOLS_DELIVERABILITY, query: query_params(domain:), api_key:)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
+
def check_spf(domain, api_key: nil)
|
|
19
|
+
request(ApiPaths::TOOLS_SPF, query: query_params(domain:), api_key:)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def check_dkim(domain, selector: nil, api_key: nil)
|
|
23
|
+
request(ApiPaths::TOOLS_DKIM, query: query_params(domain:, selector:), api_key:)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def check_mx(domain, api_key: nil)
|
|
27
|
+
request(ApiPaths::TOOLS_MX, query: query_params(domain:), api_key:)
|
|
28
|
+
end
|
|
29
|
+
|
|
18
30
|
def read_verification_code(body = nil, api_key: nil, **fields)
|
|
19
31
|
request(ApiPaths::TOOLS_VERIFICATION_CODE, method: :post, body: payload(body, fields), api_key:)
|
|
20
32
|
end
|
data/lib/nextmail/results.rb
CHANGED
|
@@ -19,6 +19,12 @@ module Nextmail
|
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
NotificationPage = Data.define(:items, :unread_count, :has_more, :next_cursor) do
|
|
23
|
+
def has_more?
|
|
24
|
+
has_more
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
22
28
|
AddressBookPage = Data.define(:unrestricted, :addresses, :domains, :has_more, :next_cursor) do
|
|
23
29
|
def has_more?
|
|
24
30
|
has_more
|
data/lib/nextmail/version.rb
CHANGED
data/lib/nextmail.rb
CHANGED
|
@@ -79,6 +79,14 @@ module Nextmail
|
|
|
79
79
|
Resources::TempMail.new(transport)
|
|
80
80
|
end
|
|
81
81
|
|
|
82
|
+
def create_signups(base_url: nil, adapter: nil, max_retries: nil, timeout: nil, user_agent: nil, headers: nil,
|
|
83
|
+
disable_update_notice: false)
|
|
84
|
+
base_url = Endpoint.normalise(base_url || from_environment(Protocol::ENV_VARS[:BASE_URL]))
|
|
85
|
+
transport = Transport.new(base_url:, adapter:, max_retries:, timeout:, user_agent:, headers:,
|
|
86
|
+
disable_update_notice:)
|
|
87
|
+
Resources::Signups.new(transport)
|
|
88
|
+
end
|
|
89
|
+
|
|
82
90
|
def verify_webhook_signature(payload:, headers:, secret:, tolerance_seconds: nil)
|
|
83
91
|
Webhook.verify(payload:, headers:, secret:, tolerance_seconds:)
|
|
84
92
|
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: nextmail
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Nextmail
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-11-01 00:00:00.000000000 Z
|
|
11
11
|
dependencies: []
|
|
12
12
|
description: Send email and broadcasts, work with threads, drafts, labels, templates,
|
|
13
13
|
rules, webhooks, tracking, contacts, audiences, sign-up forms, domains, suppressions,
|
|
@@ -69,6 +69,7 @@ files:
|
|
|
69
69
|
- lib/nextmail/resources/live_events.rb
|
|
70
70
|
- lib/nextmail/resources/me.rb
|
|
71
71
|
- lib/nextmail/resources/members.rb
|
|
72
|
+
- lib/nextmail/resources/notifications.rb
|
|
72
73
|
- lib/nextmail/resources/out_of_office.rb
|
|
73
74
|
- lib/nextmail/resources/provider_imports.rb
|
|
74
75
|
- lib/nextmail/resources/roles.rb
|
|
@@ -81,6 +82,7 @@ files:
|
|
|
81
82
|
- lib/nextmail/resources/share_links.rb
|
|
82
83
|
- lib/nextmail/resources/shared.rb
|
|
83
84
|
- lib/nextmail/resources/signatures.rb
|
|
85
|
+
- lib/nextmail/resources/signups.rb
|
|
84
86
|
- lib/nextmail/resources/subscriptions.rb
|
|
85
87
|
- lib/nextmail/resources/support.rb
|
|
86
88
|
- lib/nextmail/resources/suppressions.rb
|