mailinator_client 1.0.5 → 1.0.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.
- checksums.yaml +4 -4
- data/.env.example +12 -0
- data/.gitignore +2 -0
- data/.ruby-version +1 -1
- data/AI_INSTRUCTIONS.md +194 -0
- data/CHANGELOG.md +50 -0
- data/EXAMPLES.md +11 -0
- data/README.md +11 -12
- data/ROADMAP.md +24 -0
- data/docs/domains.md +6 -0
- data/docs/messages.md +21 -2
- data/docs/rules.md +9 -6
- data/docs/stats.md +13 -0
- data/docs/webhooks.md +0 -56
- data/lib/mailinator_client/authenticators.rb +0 -22
- data/lib/mailinator_client/client.rb +4 -24
- data/lib/mailinator_client/domains.rb +3 -23
- data/lib/mailinator_client/error.rb +11 -25
- data/lib/mailinator_client/messages.rb +68 -27
- data/lib/mailinator_client/rules.rb +6 -22
- data/lib/mailinator_client/stats.rb +26 -25
- data/lib/mailinator_client/utils.rb +0 -22
- data/lib/mailinator_client/version.rb +3 -25
- data/lib/mailinator_client/webhooks.rb +17 -148
- data/lib/mailinator_client.rb +0 -22
- data/mailinator_client.gemspec +25 -25
- data/test/authenticators_api_test.rb +28 -0
- data/test/domains_api_test.rb +15 -0
- data/test/messages_api_test.rb +136 -0
- data/test/messages_query_params_test.rb +54 -0
- data/test/rules_api_test.rb +7 -0
- data/test/stats_api_test.rb +19 -0
- data/test/test_helper.rb +31 -1
- data/test/webhooks_api_test.rb +49 -0
- metadata +66 -23
- data/test/mailinator_client_api_test.rb +0 -232
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d662d2fd2a1518a00a7ac85cde34555f177765316ed9b388a7e8f9b0802fed4a
|
|
4
|
+
data.tar.gz: 86a12779d39d7ba6fc7ca06a4db6128a2244e1987d56a5d82424c98f2faac972
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4e14a072c15f1704646c9896f7bb02d1f0ba80be1d808b878b0b2725ab41b3348c4fb570dcb95d1db846dde4b2701d52a2740114a233da7d927f27cf3234e18d
|
|
7
|
+
data.tar.gz: 45bd500f1c146e4f087a5c3008dc08e41fa79d870d67cda8735cb793d81d7901ed4e67fcc63b9e2350559be5545cc280619e8f21bb2f78e227092800a05001de
|
data/.env.example
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
MAILINATOR_TEST_API_TOKEN=
|
|
2
|
+
MAILINATOR_TEST_INBOX=
|
|
3
|
+
MAILINATOR_TEST_PHONE_NUMBER=
|
|
4
|
+
MAILINATOR_TEST_MESSAGE_WITH_ATTACHMENT_ID=
|
|
5
|
+
MAILINATOR_TEST_ATTACHMENT_ID=
|
|
6
|
+
MAILINATOR_TEST_DELETE_DOMAIN=
|
|
7
|
+
MAILINATOR_TEST_WEBHOOKTOKEN_PRIVATEDOMAIN=
|
|
8
|
+
MAILINATOR_TEST_WEBHOOKTOKEN_CUSTOMSERVICE=
|
|
9
|
+
MAILINATOR_TEST_AUTH_SECRET=
|
|
10
|
+
MAILINATOR_TEST_AUTH_ID=
|
|
11
|
+
MAILINATOR_TEST_WEBHOOK_INBOX=
|
|
12
|
+
MAILINATOR_TEST_WEBHOOK_CUSTOMSERVICE=
|
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.7.6
|
|
1
|
+
2.7.6
|
data/AI_INSTRUCTIONS.md
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# AI Instructions
|
|
2
|
+
|
|
3
|
+
This document explains the relationship between this Ruby client and the Mailinator OpenAPI specification.
|
|
4
|
+
|
|
5
|
+
**OpenAPI Specification:** [https://github.com/manybrain/mailinatordocs/blob/main/openapi/mailinator-api.yaml](https://github.com/manybrain/mailinatordocs/blob/main/openapi/mailinator-api.yaml)
|
|
6
|
+
|
|
7
|
+
## Codebase Structure
|
|
8
|
+
|
|
9
|
+
The codebase structure in `lib/mailinator_client/` reflects Mailinator API resource groups.
|
|
10
|
+
|
|
11
|
+
- **Entrypoints:**
|
|
12
|
+
- `lib/mailinator_client.rb` loads all components and provides module-level delegation to a singleton `Client`.
|
|
13
|
+
- `lib/mailinator_client/client.rb` defines the HTTP execution path and shared request behavior.
|
|
14
|
+
- **Resource wrappers:** API resources live in peer files under `lib/mailinator_client/`:
|
|
15
|
+
- `authenticators.rb` for authenticator endpoints.
|
|
16
|
+
- `domains.rb` for domain endpoints.
|
|
17
|
+
- `messages.rb` for inbox/message endpoints.
|
|
18
|
+
- `rules.rb` for rule endpoints.
|
|
19
|
+
- `stats.rb` for team/stat endpoints.
|
|
20
|
+
- `webhooks.rb` for webhook injection endpoints.
|
|
21
|
+
- **Support files:**
|
|
22
|
+
- `utils.rb` normalizes input/query structures.
|
|
23
|
+
- `error.rb` defines `ResponseError`.
|
|
24
|
+
- `version.rb` defines gem version metadata used in user agent headers.
|
|
25
|
+
|
|
26
|
+
## Request Patterns
|
|
27
|
+
|
|
28
|
+
This client uses a **resource wrapper** pattern, not per-operation request classes.
|
|
29
|
+
|
|
30
|
+
- Each resource class exposes Ruby methods (for example, `fetch_inbox`, `get_domains`, `create_rule`) that:
|
|
31
|
+
- accept a params hash,
|
|
32
|
+
- validate required keys with `ArgumentError`,
|
|
33
|
+
- construct `path`, `query`, and optional `body`,
|
|
34
|
+
- call `@client.request(...)`.
|
|
35
|
+
- Method names are snake_case and generally map to one API operation each.
|
|
36
|
+
- Paths are resource-relative and are joined to the client base URL (`https://api.mailinator.com/api/v2`) inside `Client#request`.
|
|
37
|
+
|
|
38
|
+
## Execution
|
|
39
|
+
|
|
40
|
+
Requests are executed through `MailinatorClient::Client#request`, which uses `HTTParty`.
|
|
41
|
+
|
|
42
|
+
```ruby
|
|
43
|
+
client = MailinatorClient::Client.new(auth_token: "api_token")
|
|
44
|
+
response = client.messages.fetch_inbox(domain: "domain.com", inbox: "inbox_name")
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Execution flow:
|
|
48
|
+
- Resource method builds request inputs (`method`, `path`, `query`, `headers`, `body`).
|
|
49
|
+
- `Client#request` appends the path to `https://api.mailinator.com/api/v2`.
|
|
50
|
+
- `HTTParty.send` performs the HTTP call with JSON headers and optional authorization.
|
|
51
|
+
- Non-2xx/3xx responses raise `MailinatorClient::ResponseError`.
|
|
52
|
+
|
|
53
|
+
## Entities
|
|
54
|
+
|
|
55
|
+
This Ruby SDK mostly returns parsed response hashes/arrays directly, rather than strongly typed model classes.
|
|
56
|
+
|
|
57
|
+
- API responses are returned as Ruby data structures from `HTTParty` (`Hash`/`Array`).
|
|
58
|
+
- Error responses are wrapped in `MailinatorClient::ResponseError` with:
|
|
59
|
+
- `code` (HTTP status),
|
|
60
|
+
- `type` (error type from API payload),
|
|
61
|
+
- exception message from the API response.
|
|
62
|
+
- Request inputs are plain Ruby hashes, typically normalized by `Utils.symbolize_hash_keys`.
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Gap Analysis Workflow
|
|
67
|
+
|
|
68
|
+
Use this workflow whenever you want to audit the SDK against the OpenAPI spec, identify missing or extra coverage, and bring the two into alignment.
|
|
69
|
+
|
|
70
|
+
### Step 1 — Fetch the OpenAPI Specification
|
|
71
|
+
|
|
72
|
+
Retrieve the raw YAML from:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
https://raw.githubusercontent.com/manybrain/mailinatordocs/main/openapi/mailinator-api.yaml
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
> The rendered GitHub page is at https://github.com/manybrain/mailinatordocs/blob/main/openapi/mailinator-api.yaml
|
|
79
|
+
> but always read the **raw** URL for machine parsing.
|
|
80
|
+
|
|
81
|
+
Extract every `paths` entry. For each path, record:
|
|
82
|
+
- The HTTP method (`get`, `post`, `put`, `delete`, etc.)
|
|
83
|
+
- The full path string (e.g. `/api/v2/domains/{domain}/inboxes/{inbox}`)
|
|
84
|
+
- The `operationId`
|
|
85
|
+
- The tag (maps to the SDK module directory)
|
|
86
|
+
- All query parameters defined under `parameters`
|
|
87
|
+
|
|
88
|
+
### Step 2 — Catalogue the SDK
|
|
89
|
+
|
|
90
|
+
For each resource file under `lib/mailinator_client/` (`messages.rb`, `domains.rb`, `rules.rb`, etc.):
|
|
91
|
+
1. Enumerate every public method that issues `@client.request(...)`.
|
|
92
|
+
2. Identify the HTTP method (`:get`, `:post`, `:put`, `:delete`).
|
|
93
|
+
3. Extract the `path` template used by that method.
|
|
94
|
+
4. Record query parameters populated in `query_params`.
|
|
95
|
+
5. Note methods already marked deprecated in comments/docs.
|
|
96
|
+
|
|
97
|
+
Also map resource files to OpenAPI tags and check if any tag has no SDK wrapper.
|
|
98
|
+
|
|
99
|
+
### Step 3 — Identify Gaps
|
|
100
|
+
|
|
101
|
+
Produce a gap report with four sections:
|
|
102
|
+
|
|
103
|
+
#### A. In the spec but missing from the SDK
|
|
104
|
+
List every `operationId` that has no corresponding Ruby method. This is what needs to be **added**.
|
|
105
|
+
|
|
106
|
+
#### B. In the SDK but not in the spec
|
|
107
|
+
List every SDK method whose path+method has no matching entry in the spec.
|
|
108
|
+
- If it is already marked deprecated, note that separately.
|
|
109
|
+
- If it is not deprecated but absent from the spec, flag it for clarification (it may be undocumented).
|
|
110
|
+
|
|
111
|
+
#### C. URL path mismatches
|
|
112
|
+
Compare the base path used by each SDK method against the spec.
|
|
113
|
+
- The spec base URL is `https://api.mailinator.com` and all paths start with `/api/v2/`.
|
|
114
|
+
- The SDK **must** use `/api/v2/` not `/v2/`. Flag any method/path using the wrong prefix.
|
|
115
|
+
|
|
116
|
+
#### D. Query parameter gaps
|
|
117
|
+
For each existing SDK method, compare sent query parameters against the spec's declared parameters for that operation. List any missing parameters.
|
|
118
|
+
|
|
119
|
+
### Step 4 — Build a Plan
|
|
120
|
+
|
|
121
|
+
Before making any changes, write out a plan that includes:
|
|
122
|
+
|
|
123
|
+
1. **New methods to add** — one method per missing `operationId`, grouped by resource file.
|
|
124
|
+
2. **URL fixes** — list every file where the prefix needs to change from `/v2/` to `/api/v2/`.
|
|
125
|
+
3. **Query parameter additions** — list every file and which parameters to add.
|
|
126
|
+
4. **Deprecated methods** — decide whether to keep and mark as deprecated or remove. Do not remove without confirmation.
|
|
127
|
+
5. **Response/entity notes** — list response shape expectations or wrappers needed for consistency.
|
|
128
|
+
|
|
129
|
+
Present the plan to the user and wait for approval before proceeding.
|
|
130
|
+
|
|
131
|
+
### Step 5 — Implement
|
|
132
|
+
|
|
133
|
+
Follow the existing patterns in the codebase:
|
|
134
|
+
|
|
135
|
+
#### Adding a new method
|
|
136
|
+
|
|
137
|
+
Use an existing method in the matching resource file as a template.
|
|
138
|
+
|
|
139
|
+
```ruby
|
|
140
|
+
def get_example(params = {})
|
|
141
|
+
params = Utils.symbolize_hash_keys(params)
|
|
142
|
+
query_params = {}
|
|
143
|
+
headers = {}
|
|
144
|
+
body = nil
|
|
145
|
+
|
|
146
|
+
raise ArgumentError.new("domain is required") unless params.has_key?(:domain)
|
|
147
|
+
raise ArgumentError.new("id is required") unless params.has_key?(:id)
|
|
148
|
+
|
|
149
|
+
path = "/domains/#{params[:domain]}/examples/#{params[:id]}"
|
|
150
|
+
|
|
151
|
+
@client.request(
|
|
152
|
+
method: :get,
|
|
153
|
+
path: path,
|
|
154
|
+
query: query_params,
|
|
155
|
+
headers: headers,
|
|
156
|
+
body: body
|
|
157
|
+
)
|
|
158
|
+
end
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Key rules:
|
|
162
|
+
- **Always** use `/api/v2/` as the path prefix — never `/v2/`.
|
|
163
|
+
- Keep methods in the appropriate resource file (`messages.rb`, `rules.rb`, etc.).
|
|
164
|
+
- Validate required params with `ArgumentError`.
|
|
165
|
+
- Use snake_case method names and preserve existing naming conventions in the file.
|
|
166
|
+
|
|
167
|
+
#### Fixing a URL prefix
|
|
168
|
+
|
|
169
|
+
If any hardcoded URL includes `/v2/`, change it to `/api/v2/`. Prefer resource-relative `path` values (`/domains/...`) and let `Client#request` prepend base URL.
|
|
170
|
+
|
|
171
|
+
#### Adding a missing query parameter
|
|
172
|
+
|
|
173
|
+
Add an assignment in the method's query assembly:
|
|
174
|
+
```ruby
|
|
175
|
+
query_params[:my_param] = params[:myParam] if params.has_key?(:myParam)
|
|
176
|
+
```
|
|
177
|
+
Then document the optional parameter in the method comment block.
|
|
178
|
+
|
|
179
|
+
### Step 6 — Verify
|
|
180
|
+
|
|
181
|
+
After implementing:
|
|
182
|
+
1. Run tests: `ruby -I test test/mailinator_client_api_test.rb` (with required env vars).
|
|
183
|
+
2. Run lint/static checks if configured for this repo.
|
|
184
|
+
3. Manually verify at least one changed method generates the exact spec path and sends expected query params.
|
|
185
|
+
|
|
186
|
+
### Notes on SDK Conventions
|
|
187
|
+
|
|
188
|
+
| Convention | Detail |
|
|
189
|
+
|---|---|
|
|
190
|
+
| Version source | `lib/mailinator_client/version.rb` (`MailinatorClient::VERSION`), referenced by gemspec and user-agent string. |
|
|
191
|
+
| Auth header | Set in `Client#request` as `Authorization` when `auth_token` is provided. |
|
|
192
|
+
| No-token requests | Supported by instantiating `Client` without `auth_token` (used by some webhook flows). |
|
|
193
|
+
| Deprecation marker | Use Ruby/YARD style deprecation comments near method definitions and reflect in README/docs. |
|
|
194
|
+
| Entrypoint loading | `lib/mailinator_client.rb` requires resource/support files and delegates module methods to singleton client. |
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project aims to follow [Semantic Versioning](https://semver.org/).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `.env.example` with Mailinator integration test variables.
|
|
13
|
+
- Resource-scoped integration test files:
|
|
14
|
+
- `test/authenticators_api_test.rb`
|
|
15
|
+
- `test/domains_api_test.rb`
|
|
16
|
+
- `test/messages_api_test.rb`
|
|
17
|
+
- `test/rules_api_test.rb`
|
|
18
|
+
- `test/stats_api_test.rb`
|
|
19
|
+
- `test/webhooks_api_test.rb`
|
|
20
|
+
- Focused query-parameter regression tests in `test/messages_query_params_test.rb`.
|
|
21
|
+
|
|
22
|
+
### Deprecated
|
|
23
|
+
|
|
24
|
+
- Marked all Rules endpoints as deprecated:
|
|
25
|
+
- `client.rules.create_rule`
|
|
26
|
+
- `client.rules.enable_rule`
|
|
27
|
+
- `client.rules.disable_rule`
|
|
28
|
+
- `client.rules.get_all_rules`
|
|
29
|
+
- `client.rules.get_rule`
|
|
30
|
+
- `client.rules.delete_rule`
|
|
31
|
+
- Marked Domain mutation endpoints as deprecated:
|
|
32
|
+
- `client.domains.create_domain`
|
|
33
|
+
- `client.domains.delete_domain`
|
|
34
|
+
- Added deprecation markers in code (`lib/mailinator_client/rules.rb`) and deprecation notices in docs (`docs/rules.md`, `README.md`).
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
- Updated dependency constraints:
|
|
39
|
+
- Runtime: `httparty` to `>= 0.21, < 0.22` (Ruby 2.6-compatible)
|
|
40
|
+
- Development: `minitest >= 5.25, < 7.0`, `rake >= 13.0, < 14.0`, `webmock >= 3.26, < 4.0`
|
|
41
|
+
- Updated integration testing structure by splitting the previous monolithic `test/mailinator_client_api_test.rb`.
|
|
42
|
+
- Added `.env` loading support in `test/test_helper.rb`.
|
|
43
|
+
|
|
44
|
+
### Fixed
|
|
45
|
+
|
|
46
|
+
- Added optional `delete` query parameter support to `messages.fetch_inbox_message`.
|
|
47
|
+
- Added inbox-list query parameters to `messages.fetch_sms_message` (`skip`, `limit`, `sort`, `decode_subject`, `cursor`, `full`, `wait`, `delete`).
|
|
48
|
+
- Hardened API error handling for non-JSON/empty error responses:
|
|
49
|
+
- `MailinatorClient::ResponseError` now handles `nil` parsed responses safely.
|
|
50
|
+
- `Client#request` now passes raw response body into `ResponseError`.
|
data/EXAMPLES.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Examples
|
|
2
|
+
|
|
3
|
+
This document will collect practical usage examples for the Mailinator Ruby client.
|
|
4
|
+
|
|
5
|
+
## Planned Sections
|
|
6
|
+
|
|
7
|
+
- Authentication setup
|
|
8
|
+
- Domain and inbox operations
|
|
9
|
+
- Message retrieval and parsing
|
|
10
|
+
- Webhooks and rules
|
|
11
|
+
- Error handling patterns
|
data/README.md
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
# Mailinator Ruby
|
|
1
|
+
# Mailinator Ruby SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The official Mailinator Ruby SDK. This REST API client is implemented as a thin wrapper around the [Mailinator API](https://www.mailinator.com/documentation/docs/api/index.html). The OpenAPI specification is the source of truth.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://badge.fury.io/rb/mailinator_client)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
> [!NOTE]
|
|
8
|
+
> This client works with Ruby 2.1 and higher. It uses [HTTParty](https://github.com/jnunemaker/httparty) under the covers for the actual HTTP communication.
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
## API Reference
|
|
13
|
+
|
|
14
|
+
See [Mailinator's API Reference](https://www.mailinator.com/documentation/docs/api/index.html) for all of the currently available API endpoints.
|
|
10
15
|
|
|
11
16
|
## Installation
|
|
12
17
|
|
|
@@ -56,6 +61,7 @@ Each of the following is a method on the client object, and returns a wrapper fo
|
|
|
56
61
|
|
|
57
62
|
* [rules](docs/rules.md)
|
|
58
63
|
Contains all of the actions that can be performed against the set of [Rules](https://manybrain.github.io/m8rdocs/#rules-api) that the currently authenticated user has access to - such as listing the rules or creating a new rule.
|
|
64
|
+
**Deprecated:** Rules endpoints in this SDK are deprecated.
|
|
59
65
|
|
|
60
66
|
* [messages](docs/messages.md)
|
|
61
67
|
Contains all of the actions that can be performed against the set of [Messages](https://manybrain.github.io/m8rdocs/#message-api) that the currently authenticated user has access to - such as listing the messages or injecting a new message.
|
|
@@ -104,10 +110,3 @@ Most of the tests require env variables with valid values. Visit tests source co
|
|
|
104
110
|
* `MAILINATOR_TEST_AUTH_ID` - authenticator id
|
|
105
111
|
* `MAILINATOR_TEST_WEBHOOK_INBOX` - inbox for webhook
|
|
106
112
|
* `MAILINATOR_TEST_WEBHOOK_CUSTOMSERVICE` - custom service for webhook
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
*****
|
|
110
|
-
|
|
111
|
-
Copyright (c) 2024 Manybrain, Inc
|
|
112
|
-
|
|
113
|
-
<https://www.mailinator.com/>
|
data/ROADMAP.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Roadmap
|
|
2
|
+
|
|
3
|
+
This document tracks planned improvements for the Mailinator Ruby client.
|
|
4
|
+
|
|
5
|
+
## Phase 1
|
|
6
|
+
|
|
7
|
+
- [x] Add structural docs (`ROADMAP.md`, `CHANGELOG.md`, `AI_INSTRUCTIONS.md`, `EXAMPLEs.md`) - completed
|
|
8
|
+
- [x] Update outdated dependencies (`rake` and `webmock` updated; `httparty` pinned to latest Ruby 2.6-compatible range)
|
|
9
|
+
- [x] Update version number - completed (`1.0.7`)
|
|
10
|
+
- [ ] Publish those changes (minor release)
|
|
11
|
+
|
|
12
|
+
## Next
|
|
13
|
+
|
|
14
|
+
- [ ] Mark deprecated endpoints as deprecated in code
|
|
15
|
+
- Rules endpoints marked deprecated in code/docs
|
|
16
|
+
- `client.domains.create_domain` and `client.domains.delete_domain` marked deprecated in code/docs
|
|
17
|
+
- [ ] Fix URL path inconsistencies between SDK and OpenAPI specification
|
|
18
|
+
- [x] Add optional query parameter support:
|
|
19
|
+
- `messages.fetch_inbox_message` now supports optional `delete`
|
|
20
|
+
- `messages.fetch_sms_message` now supports inbox listing query params (`skip`, `limit`, `sort`, `decode_subject`, `cursor`, `full`, `wait`, `delete`)
|
|
21
|
+
- [ ] Implement Streaming Messages endpoint (`/api/v2/domains/private/stream/` and inbox variant) with supported query params (`full`, `limit`, `throttleInterval`, `delete`)
|
|
22
|
+
- [ ] Fix integration test bug: custom-service webhook tests use `@webhookTokenPrivateDomain` instead of `@webhookTokenCustomService`
|
|
23
|
+
- [ ] Decide policy for flaky/500-prone integration flows (`messages.fetch_inbox` with `full`/`wait`, and `webhooks.private_webhook`) and gate or quarantine accordingly
|
|
24
|
+
- [ ] Publish those changes
|
data/docs/domains.md
CHANGED
|
@@ -37,6 +37,9 @@ puts result
|
|
|
37
37
|
|
|
38
38
|
## CreateDomain
|
|
39
39
|
|
|
40
|
+
> [!WARNING]
|
|
41
|
+
> Deprecated in this SDK.
|
|
42
|
+
|
|
40
43
|
This endpoint creates a private domain attached to your account. Note, the domain must be unique to the system and you must have not reached your maximum number of Private Domains.
|
|
41
44
|
|
|
42
45
|
```ruby
|
|
@@ -49,6 +52,9 @@ puts result
|
|
|
49
52
|
|
|
50
53
|
## DeleteDomain
|
|
51
54
|
|
|
55
|
+
> [!WARNING]
|
|
56
|
+
> Deprecated in this SDK.
|
|
57
|
+
|
|
52
58
|
This endpoint deletes a Private Domain
|
|
53
59
|
|
|
54
60
|
```ruby
|
data/docs/messages.md
CHANGED
|
@@ -12,6 +12,7 @@ Details on the various actions that can be performed on the Messages resource, i
|
|
|
12
12
|
* [FetchMessageAttachments](#fetchmessageattachments)
|
|
13
13
|
* [FetchInboxMessageAttachment](#fetchinboxmessageattachment)
|
|
14
14
|
* [FetchMessageAttachment](#fetchmessageattachment)
|
|
15
|
+
* [FetchMessageLinksFull](#fetchmessagelinksfull)
|
|
15
16
|
* [FetchMessageLinks](#fetchmessagelinks)
|
|
16
17
|
* [FetchInboxMessageLinks](#fetchinboxmessagelinks)
|
|
17
18
|
* [DeleteAllDomainMessages](#deletealldomainmessages)
|
|
@@ -38,7 +39,11 @@ result = client.messages.fetch_inbox(
|
|
|
38
39
|
skip: my_skip
|
|
39
40
|
limit: my_limit
|
|
40
41
|
sort: my_sort
|
|
41
|
-
decodeSubject: my_decode_subject
|
|
42
|
+
decodeSubject: my_decode_subject,
|
|
43
|
+
cursor: my_cursor,
|
|
44
|
+
full: my_full,
|
|
45
|
+
delete: my_delete,
|
|
46
|
+
wait: my_wait)
|
|
42
47
|
|
|
43
48
|
puts result
|
|
44
49
|
```
|
|
@@ -67,7 +72,8 @@ Retrieves a specific message by id
|
|
|
67
72
|
```ruby
|
|
68
73
|
result = client.messages.fetch_message(
|
|
69
74
|
domainId: my_domain_id
|
|
70
|
-
messageId: my_message_id
|
|
75
|
+
messageId: my_message_id,
|
|
76
|
+
delete: my_delete)
|
|
71
77
|
|
|
72
78
|
puts result
|
|
73
79
|
```
|
|
@@ -151,6 +157,19 @@ puts result
|
|
|
151
157
|
|
|
152
158
|
<br/>
|
|
153
159
|
|
|
160
|
+
## FetchMessageLinksFull
|
|
161
|
+
|
|
162
|
+
Retrieves all links full found within a given email
|
|
163
|
+
|
|
164
|
+
```ruby
|
|
165
|
+
result = client.messages.fetch_message_links_full(
|
|
166
|
+
domainId: my_domain_id
|
|
167
|
+
messageId: my_message_id)
|
|
168
|
+
|
|
169
|
+
puts result
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
<br/>
|
|
154
173
|
|
|
155
174
|
## FetchMessageLinks
|
|
156
175
|
|
data/docs/rules.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Details on the various actions that can be performed on the Rules resource, including the expected parameters and the potential responses.
|
|
4
4
|
|
|
5
|
+
> [!WARNING]
|
|
6
|
+
> All Rules endpoints in this SDK are deprecated.
|
|
7
|
+
|
|
5
8
|
##### Contents
|
|
6
9
|
|
|
7
10
|
* [CreateRule](#createrule)
|
|
@@ -13,7 +16,7 @@ Details on the various actions that can be performed on the Rules resource, incl
|
|
|
13
16
|
|
|
14
17
|
<br/>
|
|
15
18
|
|
|
16
|
-
## CreateRule
|
|
19
|
+
## CreateRule (Deprecated)
|
|
17
20
|
|
|
18
21
|
Creates a Rule
|
|
19
22
|
|
|
@@ -28,7 +31,7 @@ puts result
|
|
|
28
31
|
|
|
29
32
|
<br/>
|
|
30
33
|
|
|
31
|
-
## EnableRule
|
|
34
|
+
## EnableRule (Deprecated)
|
|
32
35
|
|
|
33
36
|
Enables an existing Rule
|
|
34
37
|
|
|
@@ -42,7 +45,7 @@ puts result
|
|
|
42
45
|
|
|
43
46
|
<br/>
|
|
44
47
|
|
|
45
|
-
## DisableRule
|
|
48
|
+
## DisableRule (Deprecated)
|
|
46
49
|
|
|
47
50
|
Disables an existing Rule
|
|
48
51
|
|
|
@@ -56,7 +59,7 @@ puts result
|
|
|
56
59
|
|
|
57
60
|
<br/>
|
|
58
61
|
|
|
59
|
-
## GetAllRules
|
|
62
|
+
## GetAllRules (Deprecated)
|
|
60
63
|
|
|
61
64
|
Fetches all Rules for a Domain
|
|
62
65
|
|
|
@@ -68,7 +71,7 @@ puts result
|
|
|
68
71
|
|
|
69
72
|
<br/>
|
|
70
73
|
|
|
71
|
-
## GetRule
|
|
74
|
+
## GetRule (Deprecated)
|
|
72
75
|
|
|
73
76
|
Fetches a specific rule for a Domain
|
|
74
77
|
|
|
@@ -82,7 +85,7 @@ puts result
|
|
|
82
85
|
|
|
83
86
|
<br/>
|
|
84
87
|
|
|
85
|
-
## DeleteRule
|
|
88
|
+
## DeleteRule (Deprecated)
|
|
86
89
|
|
|
87
90
|
Deletes a specific rule for a Domain
|
|
88
91
|
|
data/docs/stats.md
CHANGED
|
@@ -4,11 +4,24 @@ Details on the various actions that can be performed on the Stats resource, incl
|
|
|
4
4
|
|
|
5
5
|
##### Contents
|
|
6
6
|
|
|
7
|
+
* [GetTeamInfo](#getteaminfo)
|
|
7
8
|
* [GetTeamStats](#getteamstats)
|
|
8
9
|
* [GetTeam](#getteam)
|
|
9
10
|
|
|
10
11
|
<br/>
|
|
11
12
|
|
|
13
|
+
## GetTeamInfo
|
|
14
|
+
|
|
15
|
+
Retrieves info of team
|
|
16
|
+
|
|
17
|
+
```ruby
|
|
18
|
+
result = client.stats.get_team_info()
|
|
19
|
+
|
|
20
|
+
puts result
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
<br/>
|
|
24
|
+
|
|
12
25
|
## GetTeamStats
|
|
13
26
|
|
|
14
27
|
Retrieves stats of team
|
data/docs/webhooks.md
CHANGED
|
@@ -4,10 +4,6 @@ Details on the various actions that can be performed on the Webhooks resource, i
|
|
|
4
4
|
|
|
5
5
|
##### Contents
|
|
6
6
|
|
|
7
|
-
* [PublicWebhook](#publicwebhook)
|
|
8
|
-
* [PublicInboxWebhook](#publicinboxwebhook)
|
|
9
|
-
* [PublicCustomServiceWebhook](#publiccustomservicewebhook)
|
|
10
|
-
* [PublicCustomServiceInboxWebhook](#publiccustomserviceinboxwebhook)
|
|
11
7
|
* [PrivateWebhook](#privatewebhook)
|
|
12
8
|
* [PrivateInboxWebhook](#privateinboxwebhook)
|
|
13
9
|
* [PrivateCustomServiceWebhook](#privatecustomservicewebhook)
|
|
@@ -15,58 +11,6 @@ Details on the various actions that can be performed on the Webhooks resource, i
|
|
|
15
11
|
|
|
16
12
|
<br/>
|
|
17
13
|
|
|
18
|
-
## PublicWebhook
|
|
19
|
-
|
|
20
|
-
This command will deliver the message to the :to inbox that was set into request object
|
|
21
|
-
|
|
22
|
-
```ruby
|
|
23
|
-
result = client.webhooks.public_webhook()
|
|
24
|
-
|
|
25
|
-
puts result
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
<br/>
|
|
29
|
-
|
|
30
|
-
## PublicInboxWebhook
|
|
31
|
-
|
|
32
|
-
This command will deliver the message to the :inbox inbox
|
|
33
|
-
Note that if the Mailinator system cannot determine the destination inbox via the URL or a "to" field in the payload, the message will be rejected.
|
|
34
|
-
If the message contains a "from" and "subject" field, these will be visible on the inbox page.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
```ruby
|
|
38
|
-
result = client.webhooks.public_inbox_webhook()
|
|
39
|
-
|
|
40
|
-
puts result
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
<br/>
|
|
44
|
-
|
|
45
|
-
## PublicCustomServiceWebhook
|
|
46
|
-
|
|
47
|
-
If you have a Twilio account which receives incoming SMS messages. You may direct those messages through this facility to inject those messages into the Mailinator system.
|
|
48
|
-
|
|
49
|
-
```ruby
|
|
50
|
-
result = client.webhooks.public_custom_service_webhook()
|
|
51
|
-
|
|
52
|
-
puts result
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
<br/>
|
|
56
|
-
|
|
57
|
-
## PublicCustomServiceInboxWebhook
|
|
58
|
-
|
|
59
|
-
The SMS message will arrive in the Public Mailinator inbox corresponding to the Twilio Phone Number. (only the digits, if a plus sign precedes the number it will be removed)
|
|
60
|
-
If you wish the message to arrive in a different inbox, you may append the destination inbox to the URL.
|
|
61
|
-
|
|
62
|
-
```ruby
|
|
63
|
-
result = client.webhooks.public_custom_service_inbox_webhook()
|
|
64
|
-
|
|
65
|
-
puts result
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
<br/>
|
|
69
|
-
|
|
70
14
|
## PrivateWebhook
|
|
71
15
|
|
|
72
16
|
This command will Webhook messages into your Private Domain
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
# The MIT License (MIT)
|
|
2
|
-
#
|
|
3
|
-
# Copyright (c) 2024 Manybrain, Inc.
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
22
|
-
|
|
23
1
|
require "json"
|
|
24
2
|
|
|
25
3
|
module MailinatorClient
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
# The MIT License (MIT)
|
|
2
|
-
#
|
|
3
|
-
# Copyright (c) 2024 Manybrain, Inc.
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
# of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
# in the Software without restriction, including without limitation the rights
|
|
8
|
-
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
# copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
# furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
# copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
# SOFTWARE.
|
|
22
|
-
|
|
23
1
|
require "httparty"
|
|
24
2
|
|
|
25
3
|
module MailinatorClient
|
|
@@ -72,11 +50,13 @@ module MailinatorClient
|
|
|
72
50
|
response = HTTParty.send(method, path,
|
|
73
51
|
query: Utils.fix_query_arrays(options[:query]),
|
|
74
52
|
body: options[:body] && options[:body].to_json(),
|
|
75
|
-
headers: headers
|
|
53
|
+
headers: headers,
|
|
54
|
+
timeout: 125
|
|
55
|
+
)
|
|
76
56
|
|
|
77
57
|
result = response.parsed_response
|
|
78
58
|
if response.code >= 400
|
|
79
|
-
raise ResponseError.new(response.code, result)
|
|
59
|
+
raise ResponseError.new(response.code, result, response.body)
|
|
80
60
|
end
|
|
81
61
|
|
|
82
62
|
result
|