mailkite 0.17.0 → 0.18.0

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mailkite.rb +77 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b15ee263fe07ec0ace5a924dfbf72ea4af0315ec1d3e680c6de957fbabc9f802
4
- data.tar.gz: 736c9345872755f6d696347f39131e103f4a1bb0a6620fa0ef0066061090751d
3
+ metadata.gz: a4b8b0706aa98435dc195e58ee8c548e762e5fff84819432b96741de752ef32a
4
+ data.tar.gz: b5ab6561c1750cd702b7f4e545001bd25d8a0c75996a930eae70b691e2500bc4
5
5
  SHA512:
6
- metadata.gz: 7f6115ce30631c431bb1f4f7eb009f21418930108ad237c318cc33ff753edb0751a1fdb8ff424f8d4f06d2340a7657e5bc3570295d71cca9907e62ed578964c8
7
- data.tar.gz: 9bc55eac84d0f2f62ebc8630e14bba0a9a095ec083c1010ee8c111fcc842d3b6d1620f6bdeb6aaaec385c63a3b8c354ddae15ded8581ab71af6eb8cb0078b1e7
6
+ metadata.gz: 6c599c0cc4f9efc6c94e5701d7adca5b508bf6fb94a7cc6c2747ad5c23649c362014664acaa402de2086af7507e757c686959681fdc3ce147f136cdfe515af34
7
+ data.tar.gz: 79b945cbac587203ea1c2a9613a9eb76ef98bfc357572ed2767c861c880ffbb341753f58aab10abda130aa65923928d403cbc62a7840c5a8c1ea115b1c7e0360
data/lib/mailkite.rb CHANGED
@@ -15,7 +15,7 @@ require "base64"
15
15
  require "cgi"
16
16
 
17
17
  module Mailkite
18
- VERSION = "0.17.0"
18
+ VERSION = "0.18.0"
19
19
  DEFAULT_BASE_URL = "https://api.mailkite.dev"
20
20
  # Reject webhook events older than this (ms) to block replays. Pass 0 to disable.
21
21
  DEFAULT_TOLERANCE_MS = 5 * 60 * 1000
@@ -491,6 +491,82 @@ module Mailkite
491
491
  request("POST", "/api/broadcasts/#{id}/send", body)
492
492
  end
493
493
 
494
+ # --- Account ----------------------------------------------------------
495
+ # Create a MailKite account from just an email — no password. +body+ is a
496
+ # hash with "email" (required) and optional "channel", "ref" and
497
+ # "referrer". Returns the new account's API key immediately; a
498
+ # verification link is emailed, and SENDING stays blocked until the
499
+ # address is verified (poll me()). An existing email returns 409
500
+ # account_exists with no credentials. PUBLIC — no API key required.
501
+ def register(body)
502
+ request("POST", "/api/v1/provision", body)
503
+ end
504
+
505
+ # The account behind this credential: email, whether it is verified
506
+ # (sending is blocked until it is), and plan. Use to poll verification
507
+ # state after register().
508
+ def me
509
+ request("GET", "/v1/me")
510
+ end
511
+
512
+ # Get the account's unrestricted API key (mk_live_…). Read-or-create: the
513
+ # first call mints it.
514
+ def getApiKey
515
+ request("GET", "/api/keys")
516
+ end
517
+
518
+ # Rotate the account API key: the old key stops working immediately and a
519
+ # fresh one is returned. The plaintext is only shown here.
520
+ def rotateApiKey
521
+ request("POST", "/api/keys/rotate")
522
+ end
523
+
524
+ # List the account's domain-scoped API keys. A scoped key can send and
525
+ # manage only its one domain — hand one to each site or CI job so a leak
526
+ # burns only that surface.
527
+ def listScopedKeys
528
+ request("GET", "/api/keys/scoped")
529
+ end
530
+
531
+ # Create a key scoped to one domain. +body+ is a hash with "domainId"
532
+ # (required) and optional "name". Ideal for per-site installs (e.g. a
533
+ # WordPress plugin) — the site never holds the account master key.
534
+ def createScopedKey(body)
535
+ request("POST", "/api/keys/scoped", body)
536
+ end
537
+
538
+ # Revoke a domain-scoped key. Takes effect immediately.
539
+ def deleteScopedKey(id)
540
+ request("DELETE", "/api/keys/scoped/#{id}")
541
+ end
542
+
543
+ # Current billing-period usage: emails used vs the plan's included bucket
544
+ # (null = unlimited), AI actions, and the overage state that gates
545
+ # sending. Powers quota meters in dashboards and integrations.
546
+ def getUsage
547
+ request("GET", "/api/billing/usage")
548
+ end
549
+
550
+ # --- Suppressions -----------------------------------------------------
551
+ # List suppressed addresses (unsubscribes, hard bounces, spam complaints,
552
+ # manual). Sends to a suppressed address are dropped before delivery.
553
+ def listSuppressions
554
+ request("GET", "/api/contacts/suppressions")
555
+ end
556
+
557
+ # Suppress an address so this account never sends to it again. +body+ is
558
+ # a hash with "email" (required) and optional "reason" (defaults to
559
+ # manual) and "note".
560
+ def addSuppression(body)
561
+ request("POST", "/api/contacts/suppressions", body)
562
+ end
563
+
564
+ # Remove an address from the suppression list. Removing an unsuppressed
565
+ # address is a no-op success.
566
+ def removeSuppression(email)
567
+ request("DELETE", "/api/contacts/suppressions/#{CGI.escape(email)}")
568
+ end
569
+
494
570
  # --- Docs -----------------------------------------------------------
495
571
  # Semantic search over the MailKite docs. PUBLIC — no auth required.
496
572
  # Returns { "query" => ..., "matches" => [...] }.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mailkite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - MailKite
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-01 00:00:00.000000000 Z
11
+ date: 2026-08-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mail