unione 1.2.4 → 1.3.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.
- package/AGENTS.md +11 -11
- package/LICENSE +1 -1
- package/README.md +28 -8
- package/package.json +5 -2
- package/src/api/confirmed-email/ConfirmedEmailApi.d.ts +3 -3
- package/src/api/confirmed-email/models.d.ts +23 -2
- package/src/api/domain/DomainApi.d.ts +6 -6
- package/src/api/domain/models.d.ts +52 -3
- package/src/api/email/EmailApi.d.ts +3 -3
- package/src/api/email/models.d.ts +54 -8
- package/src/api/email-validation/EmailValidationApi.d.ts +2 -2
- package/src/api/email-validation/models.d.ts +6 -0
- package/src/api/event-dump/EventDumpApi.d.ts +4 -4
- package/src/api/event-dump/models.d.ts +51 -4
- package/src/api/obsolete/ObsoleteApi.d.ts +4 -4
- package/src/api/obsolete/models.d.ts +25 -1
- package/src/api/project/ProjectApi.d.ts +5 -5
- package/src/api/project/models.d.ts +42 -3
- package/src/api/suppression/SuppressionApi.d.ts +5 -5
- package/src/api/suppression/models.d.ts +34 -2
- package/src/api/system/models.d.ts +22 -2
- package/src/api/tag/TagApi.d.ts +2 -2
- package/src/api/tag/models.d.ts +13 -1
- package/src/api/template/TemplateApi.d.ts +5 -5
- package/src/api/template/models.d.ts +91 -13
- package/src/api/webhook/WebhookApi.d.ts +5 -5
- package/src/api/webhook/models.d.ts +102 -9
- package/src/client/ApiClient.js +43 -13
- package/src/client/ApiError.d.ts +34 -1
- package/src/client/ApiError.js +42 -3
- package/src/client/Configuration.js +1 -1
- package/src/client/errors.js +195 -0
- package/src/client/index.d.ts +1 -1
- package/src/client/index.js +1 -1
- package/src/common/models.d.ts +15 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
package/AGENTS.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# AGENTS.md
|
|
2
2
|
|
|
3
|
-
UniOne Node.js SDK — client for the UniOne transactional email Web API (Web API 1.
|
|
3
|
+
UniOne Node.js SDK — client for the UniOne transactional email Web API (Web API 1.92). How to integrate UniOne into an application comes first; the last section is about changing this package.
|
|
4
4
|
|
|
5
5
|
## Integrating UniOne
|
|
6
6
|
|
|
7
7
|
### Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install unione
|
|
10
|
+
npm install unione@1
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Requirements: Node.js 14+. The API key goes to `UNIONE_API_KEY`.
|
|
@@ -18,7 +18,7 @@ Requirements: Node.js 14+. The API key goes to `UNIONE_API_KEY`.
|
|
|
18
18
|
import { UniOneClient } from "unione";
|
|
19
19
|
import { MessageObjectRecipientsItem as Recipient } from "unione/api/email";
|
|
20
20
|
|
|
21
|
-
const client = new UniOneClient(process.env.UNIONE_API_KEY);
|
|
21
|
+
const client = new UniOneClient(process.env.UNIONE_API_KEY ?? "");
|
|
22
22
|
|
|
23
23
|
const { jobId } = await client.email.send({
|
|
24
24
|
message: {
|
|
@@ -41,14 +41,14 @@ Personalization, attachments, CC/BCC, scheduling, safe retries, error handling,
|
|
|
41
41
|
- Base URL `https://api.unione.io/en/transactional/api/v1` (an account registered on another host uses that one: `eu1.unione.io`, `us1.unione.io`); every method is POST with a JSON body; auth header `X-API-KEY`. The SDK does all of it.
|
|
42
42
|
- First email without DNS: `domain/get-sandbox-domain` → `confirmed-email/create` (the user clicks the link within 48 hours) → `email/send` from `noreply@<sandbox-domain>` to the confirmed address. Account API key only; up to 10 confirmed addresses, 100 emails a day. The domain is deleted 31 days after it was created: the next `domain/get-sandbox-domain` call creates a new one with another name, so read the name from the response, never hardcode it.
|
|
43
43
|
- Never ship a sandbox domain as the production sender (it is not in `domain/list`); read `from_email` from config. Production needs a verified domain: `domain/get-dns-records` → DNS records (verification TXT as is, DKIM TXT `v=DKIM1; k=rsa; p=<dkim>` on `<selector>._domainkey`, CNAME `_dmarc` → the `dmarc` field; SPF `include:spf.unione.io` is not in the response) → `domain/validate-verification-record`, `domain/validate-dkim` → `domain/list`.
|
|
44
|
-
- Set `message.idempotence_key` on retryable
|
|
44
|
+
- Set `message.idempotence_key` on every send that may be retried. Retry only an error that is retryable (the retryable flag of the SDK error: network, timeout, `429`, `5xx`; never a request you cancelled), with backoff and the same `idempotence_key`, within the one-minute idempotence window; beyond it check your own "sent" record before sending again. Do not retry other errors unchanged. Up to 500 recipients and 10 MB per request with the attachments in base64 (a third larger than the files); always `body.html` or `body.plaintext` (or a `template_id`).
|
|
45
45
|
- Delivery events via webhook (`webhook/set`), not polling. Check the `auth` field of every notification (MD5 of the raw request body with the `auth` value replaced by the API key) and answer 401 to a wrong one. Answer 200 within 3 seconds and process the events from a queue, otherwise the request is repeated every 10 minutes for 24 hours; take at least 5 parallel requests of up to 100 events each; deduplicate.
|
|
46
46
|
- Keep the default unsubscribe and tracking behaviour; changes go through UniOne support.
|
|
47
47
|
- Do not invent methods or fields. Check [docs/](docs/) of this package, the [API reference](https://docs.unione.io/en/web-api-ref) or [llms.txt](https://docs.unione.io/llms.txt).
|
|
48
48
|
|
|
49
49
|
### Errors
|
|
50
50
|
|
|
51
|
-
Every method throws `ApiError` when the request fails
|
|
51
|
+
Every method throws `ApiError` when the request fails. Its message names the method and, for an API error, the [API error code](https://docs.unione.io/en/web-api-ref#api-errors), the HTTP status and how to fix it; its kind tells what failed (api, network, timeout, invalid_response, invalid_request: a missing field found before sending) and retryable whether a repeat may succeed (network, timeout, HTTP 429 and 5xx); the API's own message text is in `apiMessage`.
|
|
52
52
|
|
|
53
53
|
```javascript
|
|
54
54
|
// client created as above
|
|
@@ -58,8 +58,8 @@ try {
|
|
|
58
58
|
await client.system.ping();
|
|
59
59
|
} catch (error) {
|
|
60
60
|
if (!(error instanceof ApiError)) throw error;
|
|
61
|
-
|
|
62
|
-
console.error(error.
|
|
61
|
+
console.error(error.message);
|
|
62
|
+
console.error(error.kind, error.retryable ? "retryable" : "not retryable");
|
|
63
63
|
}
|
|
64
64
|
```
|
|
65
65
|
|
|
@@ -71,7 +71,7 @@ try {
|
|
|
71
71
|
|
|
72
72
|
## Working on this repository
|
|
73
73
|
|
|
74
|
-
- **Generated code.** The whole package is generated by the UniOne team from the UniOne Web API OpenAPI spec (Web API 1.
|
|
74
|
+
- **Generated code.** The whole package is generated by the UniOne team from the UniOne Web API OpenAPI spec (Web API 1.92): sources, docs, README.md and this file. Do not hand-edit it: the next release replaces the content of this repository. Report problems and requests in the issues of this repository (https://github.com/unione-repo/unione-node-sdk).
|
|
75
75
|
- **Build and check:**
|
|
76
76
|
|
|
77
77
|
```bash
|
|
@@ -79,7 +79,7 @@ try {
|
|
|
79
79
|
npm pack --dry-run
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
- **Source label.** Every request carries the query parameter `platform=node-sdk.1.
|
|
83
|
-
- **Tests.** Before a release the generator builds and lints the package and runs every example of docs/ and of this file against a mock of the API
|
|
84
|
-
- **Release.** The version (1.
|
|
82
|
+
- **Source label.** Every request carries the query parameter `platform=node-sdk.1.3.0`, added in one place, the shared request client (`ApiClient`); a package built on this SDK puts its own label in front: `<package>.<version>,node-sdk.1.3.0`.
|
|
83
|
+
- **Tests.** `npm install && npm test` runs the tests of the package (tests/ or test/, not published) offline: the API is faked (a fake transport or a mock server on 127.0.0.1), never the real API, no real key; add a test with every change of the client. Before a release the generator also builds and lints the package and runs every example of docs/ and of this file against a mock of the API. The CI (.github/workflows/test.yml) runs the tests on every push and pull request over the supported runtimes; release.yml publishes a tag only after they pass.
|
|
84
|
+
- **Release.** The version (1.3.0 in package.json) and the tag `v1.3.0` come from the generator; README.md states the Web API version the release was generated from.
|
|
85
85
|
- **Secrets.** Never commit API keys; the examples read `UNIONE_API_KEY` from the environment.
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ Official Node.js library for the [UniOne](https://unione.io) transactional email
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install unione
|
|
14
|
+
npm install unione@1
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Requirements: Node.js 14+. No third-party dependencies.
|
|
@@ -30,7 +30,7 @@ export UNIONE_API_KEY="your-api-key"
|
|
|
30
30
|
import { UniOneClient } from "unione";
|
|
31
31
|
import { MessageObjectRecipientsItem as Recipient } from "unione/api/email";
|
|
32
32
|
|
|
33
|
-
const client = new UniOneClient(process.env.UNIONE_API_KEY);
|
|
33
|
+
const client = new UniOneClient(process.env.UNIONE_API_KEY ?? "");
|
|
34
34
|
|
|
35
35
|
const { jobId } = await client.email.send({
|
|
36
36
|
message: {
|
|
@@ -133,7 +133,7 @@ await client.email.send({
|
|
|
133
133
|
|
|
134
134
|
### Retry safely
|
|
135
135
|
|
|
136
|
-
A repeat with the same `idempotence_key` within a minute is not sent twice: retry network errors, timeouts, 429 and 5xx with it.
|
|
136
|
+
A repeat with the same `idempotence_key` within a minute is not sent twice: retry the retryable errors (network errors, timeouts, 429 and 5xx) with it; after that minute check your own record of the sent email before repeating.
|
|
137
137
|
|
|
138
138
|
```javascript
|
|
139
139
|
await client.email.send({
|
|
@@ -158,8 +158,9 @@ try {
|
|
|
158
158
|
await client.email.send(request);
|
|
159
159
|
} catch (e) {
|
|
160
160
|
if (!(e instanceof ApiError)) throw e;
|
|
161
|
-
// HTTP status
|
|
162
|
-
console.error(e.
|
|
161
|
+
// the message: method, API error code, HTTP status and how to fix it; kind: what failed; retryable: a repeat may succeed
|
|
162
|
+
console.error(e.message);
|
|
163
|
+
console.error(e.kind, e.retryable ? "retryable" : "not retryable");
|
|
163
164
|
}
|
|
164
165
|
```
|
|
165
166
|
|
|
@@ -312,7 +313,7 @@ const other = new UniOneClient("YOUR_API_KEY", Host.US1, { timeout: 10000 });
|
|
|
312
313
|
|
|
313
314
|
### Error handling
|
|
314
315
|
|
|
315
|
-
Every method raises `ApiError
|
|
316
|
+
Every method raises `ApiError`: an error of the API, a network error or a timeout, a broken response, and a mistake found before sending (an empty API key, a missing or empty `message.recipients` or `email` of a recipient: no request is sent). The message names the method and, for an API error, the [API error code](https://docs.unione.io/en/web-api-ref#api-errors), the HTTP status and how to fix it: `email/send: Unknown recipient (API error 204, HTTP 400). Fix: ...`. The error also tells what failed (its kind: api, network, timeout, invalid_response, invalid_request), whether a repeat may succeed (network, timeout, HTTP 429 and 5xx; not a request you cancelled) and keeps the API's own message text, in full and undecorated, in `apiMessage` (empty without an API response).
|
|
316
317
|
|
|
317
318
|
### Custom HTTP client and headers
|
|
318
319
|
|
|
@@ -344,7 +345,7 @@ try {
|
|
|
344
345
|
console.log(await client.confirmedEmail.list());
|
|
345
346
|
} catch (error) {
|
|
346
347
|
if (!(error instanceof ApiError)) throw error;
|
|
347
|
-
console.log(error.
|
|
348
|
+
console.log(error.message, error.kind, error.retryable, error.cause);
|
|
348
349
|
}
|
|
349
350
|
```
|
|
350
351
|
|
|
@@ -378,7 +379,7 @@ console.log(JSON.stringify(request));
|
|
|
378
379
|
|
|
379
380
|
### TypeScript
|
|
380
381
|
|
|
381
|
-
The package has type declarations: the client, the API classes, the models (with their `...JSON` shape in the API format and `...Init` constructor options) and the enums (frozen objects and string literal types).
|
|
382
|
+
The package has type declarations: the client, the API classes, the models (with their `...JSON` shape in the API format, `...Input` - the same as an argument, where a nested model may also be a model, and `...Init` constructor options) and the enums (frozen objects and string literal types).
|
|
382
383
|
|
|
383
384
|
```typescript
|
|
384
385
|
import { UniOneClient, type ConfigurationOptions } from "unione";
|
|
@@ -420,6 +421,25 @@ const response: EmailSendResponse = await client.email.send(new EmailSendRequest
|
|
|
420
421
|
}));
|
|
421
422
|
```
|
|
422
423
|
|
|
424
|
+
### CommonJS
|
|
425
|
+
|
|
426
|
+
The package is an ES module (`import`). In a CommonJS project (`require`) Node.js 20.19+ / 22.12+ loads it with `require()`:
|
|
427
|
+
|
|
428
|
+
```javascript
|
|
429
|
+
const { UniOneClient } = require("unione");
|
|
430
|
+
|
|
431
|
+
const client = new UniOneClient("YOUR_API_KEY");
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
On an older Node.js `require()` of the package fails with `ERR_REQUIRE_ESM`: load it with `import()`, it is asynchronous. In TypeScript this needs `"module": "node16"` or `"nodenext"` in tsconfig.json: with `"commonjs"` the compiler turns `import()` into `require()`.
|
|
435
|
+
|
|
436
|
+
```javascript
|
|
437
|
+
async function createClient() {
|
|
438
|
+
const { UniOneClient } = await import("unione");
|
|
439
|
+
return new UniOneClient("YOUR_API_KEY");
|
|
440
|
+
}
|
|
441
|
+
```
|
|
442
|
+
|
|
423
443
|
## Help
|
|
424
444
|
|
|
425
445
|
- [Integration guides](https://docs.unione.io/en/integrations)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unione",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "UniOne Web API client library for Node.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -88,5 +88,8 @@
|
|
|
88
88
|
"type": "git",
|
|
89
89
|
"url": "git+https://github.com/unione-repo/unione-node-sdk.git"
|
|
90
90
|
},
|
|
91
|
-
"homepage": "https://docs.unione.io/en/web-api-ref"
|
|
91
|
+
"homepage": "https://docs.unione.io/en/web-api-ref",
|
|
92
|
+
"scripts": {
|
|
93
|
+
"test": "node test/run.js"
|
|
94
|
+
}
|
|
92
95
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// ConfirmedEmailApi: API methods of the ConfirmedEmail section.
|
|
2
2
|
import type { ApiClient } from "../../client/ApiClient.js";
|
|
3
|
-
import type { ConfirmedEmailCreateResponse, ConfirmedEmailDeleteResponse, ConfirmedEmailListResponse, ConfirmedEmailRequest,
|
|
3
|
+
import type { ConfirmedEmailCreateResponse, ConfirmedEmailDeleteResponse, ConfirmedEmailListResponse, ConfirmedEmailRequest, ConfirmedEmailRequestInput } from "./models.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Manage email addresses confirmed for sandbox-domain sending. These methods are available only with a
|
|
@@ -16,7 +16,7 @@ export declare class ConfirmedEmailApi {
|
|
|
16
16
|
* Documentation: https://docs.unione.io/en/web-api-ref#confirmed-email-create
|
|
17
17
|
* @throws {ApiError}
|
|
18
18
|
*/
|
|
19
|
-
create(request: ConfirmedEmailRequest |
|
|
19
|
+
create(request: ConfirmedEmailRequest | ConfirmedEmailRequestInput): Promise<ConfirmedEmailCreateResponse>;
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Lists confirmed and unconfirmed email addresses for the account.
|
|
@@ -32,5 +32,5 @@ export declare class ConfirmedEmailApi {
|
|
|
32
32
|
* Documentation: https://docs.unione.io/en/web-api-ref#confirmed-email-delete
|
|
33
33
|
* @throws {ApiError}
|
|
34
34
|
*/
|
|
35
|
-
delete(request: ConfirmedEmailRequest |
|
|
35
|
+
delete(request: ConfirmedEmailRequest | ConfirmedEmailRequestInput): Promise<ConfirmedEmailDeleteResponse>;
|
|
36
36
|
}
|
|
@@ -6,6 +6,9 @@ export interface ConfirmedEmailRequestJSON {
|
|
|
6
6
|
"email": string;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
/** ConfirmedEmailRequest in the API format as an argument: a nested model may also be given as a model. */
|
|
10
|
+
export type ConfirmedEmailRequestInput = ConfirmedEmailRequestJSON;
|
|
11
|
+
|
|
9
12
|
/** Fields of new ConfirmedEmailRequest(): a nested model may be a plain object in the API format. */
|
|
10
13
|
export interface ConfirmedEmailRequestInit {
|
|
11
14
|
/** Email address to add or delete. */
|
|
@@ -29,6 +32,12 @@ export interface ConfirmedEmailCreateResponseJSON {
|
|
|
29
32
|
"confirmed_email"?: ConfirmedEmailJSON;
|
|
30
33
|
}
|
|
31
34
|
|
|
35
|
+
/** ConfirmedEmailCreateResponse in the API format as an argument: a nested model may also be given as a model. */
|
|
36
|
+
export interface ConfirmedEmailCreateResponseInput {
|
|
37
|
+
"status"?: string;
|
|
38
|
+
"confirmed_email"?: ConfirmedEmail | ConfirmedEmailInput;
|
|
39
|
+
}
|
|
40
|
+
|
|
32
41
|
/** Fields of new ConfirmedEmailCreateResponse(): a nested model may be a plain object in the API format. */
|
|
33
42
|
export interface ConfirmedEmailCreateResponseInit {
|
|
34
43
|
/**
|
|
@@ -36,7 +45,7 @@ export interface ConfirmedEmailCreateResponseInit {
|
|
|
36
45
|
* Allowed values: `success`.
|
|
37
46
|
*/
|
|
38
47
|
status?: string;
|
|
39
|
-
confirmedEmail?: ConfirmedEmail |
|
|
48
|
+
confirmedEmail?: ConfirmedEmail | ConfirmedEmailInput;
|
|
40
49
|
}
|
|
41
50
|
|
|
42
51
|
/** ConfirmedEmailCreateResponse */
|
|
@@ -60,6 +69,9 @@ export interface ConfirmedEmailJSON {
|
|
|
60
69
|
"status"?: VerificationRecordStatus;
|
|
61
70
|
}
|
|
62
71
|
|
|
72
|
+
/** ConfirmedEmail in the API format as an argument: a nested model may also be given as a model. */
|
|
73
|
+
export type ConfirmedEmailInput = ConfirmedEmailJSON;
|
|
74
|
+
|
|
63
75
|
/** Fields of new ConfirmedEmail(): a nested model may be a plain object in the API format. */
|
|
64
76
|
export interface ConfirmedEmailInit {
|
|
65
77
|
email?: string;
|
|
@@ -85,6 +97,12 @@ export interface ConfirmedEmailListResponseJSON {
|
|
|
85
97
|
"confirmed_emails"?: Array<ConfirmedEmailJSON>;
|
|
86
98
|
}
|
|
87
99
|
|
|
100
|
+
/** ConfirmedEmailListResponse in the API format as an argument: a nested model may also be given as a model. */
|
|
101
|
+
export interface ConfirmedEmailListResponseInput {
|
|
102
|
+
"status"?: string;
|
|
103
|
+
"confirmed_emails"?: Array<ConfirmedEmail | ConfirmedEmailInput>;
|
|
104
|
+
}
|
|
105
|
+
|
|
88
106
|
/** Fields of new ConfirmedEmailListResponse(): a nested model may be a plain object in the API format. */
|
|
89
107
|
export interface ConfirmedEmailListResponseInit {
|
|
90
108
|
/**
|
|
@@ -92,7 +110,7 @@ export interface ConfirmedEmailListResponseInit {
|
|
|
92
110
|
* Allowed values: `success`.
|
|
93
111
|
*/
|
|
94
112
|
status?: string;
|
|
95
|
-
confirmedEmails?: Array<ConfirmedEmail |
|
|
113
|
+
confirmedEmails?: Array<ConfirmedEmail | ConfirmedEmailInput>;
|
|
96
114
|
}
|
|
97
115
|
|
|
98
116
|
/** ConfirmedEmailListResponse */
|
|
@@ -116,6 +134,9 @@ export interface ConfirmedEmailDeleteResponseJSON {
|
|
|
116
134
|
"message"?: string;
|
|
117
135
|
}
|
|
118
136
|
|
|
137
|
+
/** ConfirmedEmailDeleteResponse in the API format as an argument: a nested model may also be given as a model. */
|
|
138
|
+
export type ConfirmedEmailDeleteResponseInput = ConfirmedEmailDeleteResponseJSON;
|
|
139
|
+
|
|
119
140
|
/** Fields of new ConfirmedEmailDeleteResponse(): a nested model may be a plain object in the API format. */
|
|
120
141
|
export interface ConfirmedEmailDeleteResponseInit {
|
|
121
142
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// DomainApi: API methods of the Domain section.
|
|
2
2
|
import type { ApiClient } from "../../client/ApiClient.js";
|
|
3
|
-
import type { DomainDeleteRequest,
|
|
3
|
+
import type { DomainDeleteRequest, DomainDeleteRequestInput, DomainDeleteResponse, DomainGetDnsRecordsRequest, DomainGetDnsRecordsRequestInput, DomainGetDnsRecordsResponse, DomainGetSandboxDomainResponse, DomainListRequest, DomainListRequestInput, DomainListResponse, DomainValidateDkimRequest, DomainValidateDkimRequestInput, DomainValidateDkimResponse, DomainValidateVerificationRecordRequest, DomainValidateVerificationRecordRequestInput, DomainValidateVerificationRecordResponse } from "./models.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* You can use these methods to setup sender domains and check their statuses. They might be useful in
|
|
@@ -48,7 +48,7 @@ export declare class DomainApi {
|
|
|
48
48
|
* Documentation: https://docs.unione.io/en/web-api-ref#domain-get-dns-records
|
|
49
49
|
* @throws {ApiError}
|
|
50
50
|
*/
|
|
51
|
-
getDnsRecords(request: DomainGetDnsRecordsRequest |
|
|
51
|
+
getDnsRecords(request: DomainGetDnsRecordsRequest | DomainGetDnsRecordsRequestInput): Promise<DomainGetDnsRecordsResponse>;
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
54
|
* Triggers verification record validation for domain.
|
|
@@ -61,7 +61,7 @@ export declare class DomainApi {
|
|
|
61
61
|
* Documentation: https://docs.unione.io/en/web-api-ref#domain-validate-verification-record
|
|
62
62
|
* @throws {ApiError}
|
|
63
63
|
*/
|
|
64
|
-
validateVerificationRecord(request: DomainValidateVerificationRecordRequest |
|
|
64
|
+
validateVerificationRecord(request: DomainValidateVerificationRecordRequest | DomainValidateVerificationRecordRequestInput): Promise<DomainValidateVerificationRecordResponse>;
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* Validates DKIM record for domain.
|
|
@@ -74,7 +74,7 @@ export declare class DomainApi {
|
|
|
74
74
|
* Documentation: https://docs.unione.io/en/web-api-ref#domain-validate-dkim
|
|
75
75
|
* @throws {ApiError}
|
|
76
76
|
*/
|
|
77
|
-
validateDkim(request: DomainValidateDkimRequest |
|
|
77
|
+
validateDkim(request: DomainValidateDkimRequest | DomainValidateDkimRequestInput): Promise<DomainValidateDkimResponse>;
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* Returns a list of all registered domains for user or project, together with statuses of last
|
|
@@ -86,7 +86,7 @@ export declare class DomainApi {
|
|
|
86
86
|
* Documentation: https://docs.unione.io/en/web-api-ref#domain-list
|
|
87
87
|
* @throws {ApiError}
|
|
88
88
|
*/
|
|
89
|
-
list(request?: DomainListRequest |
|
|
89
|
+
list(request?: DomainListRequest | DomainListRequestInput): Promise<DomainListResponse>;
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* Creates a sandbox domain for the account or returns the existing one.
|
|
@@ -114,5 +114,5 @@ export declare class DomainApi {
|
|
|
114
114
|
* Documentation: https://docs.unione.io/en/web-api-ref#domain-delete
|
|
115
115
|
* @throws {ApiError}
|
|
116
116
|
*/
|
|
117
|
-
delete(request: DomainDeleteRequest |
|
|
117
|
+
delete(request: DomainDeleteRequest | DomainDeleteRequestInput): Promise<DomainDeleteResponse>;
|
|
118
118
|
}
|
|
@@ -14,6 +14,9 @@ export interface DomainGetDnsRecordsRequestJSON {
|
|
|
14
14
|
"domain": string;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/** DomainGetDnsRecordsRequest in the API format as an argument: a nested model may also be given as a model. */
|
|
18
|
+
export type DomainGetDnsRecordsRequestInput = DomainGetDnsRecordsRequestJSON;
|
|
19
|
+
|
|
17
20
|
/** Fields of new DomainGetDnsRecordsRequest(): a nested model may be a plain object in the API format. */
|
|
18
21
|
export interface DomainGetDnsRecordsRequestInit {
|
|
19
22
|
/** Domain to get DNS records for. */
|
|
@@ -40,6 +43,9 @@ export interface DomainGetDnsRecordsResponseJSON {
|
|
|
40
43
|
"dmarc"?: string;
|
|
41
44
|
}
|
|
42
45
|
|
|
46
|
+
/** DomainGetDnsRecordsResponse in the API format as an argument: a nested model may also be given as a model. */
|
|
47
|
+
export type DomainGetDnsRecordsResponseInput = DomainGetDnsRecordsResponseJSON;
|
|
48
|
+
|
|
43
49
|
/** Fields of new DomainGetDnsRecordsResponse(): a nested model may be a plain object in the API format. */
|
|
44
50
|
export interface DomainGetDnsRecordsResponseInit {
|
|
45
51
|
/**
|
|
@@ -90,6 +96,9 @@ export interface DomainValidateVerificationRecordRequestJSON {
|
|
|
90
96
|
"domain": string;
|
|
91
97
|
}
|
|
92
98
|
|
|
99
|
+
/** DomainValidateVerificationRecordRequest in the API format as an argument: a nested model may also be given as a model. */
|
|
100
|
+
export type DomainValidateVerificationRecordRequestInput = DomainValidateVerificationRecordRequestJSON;
|
|
101
|
+
|
|
93
102
|
/** Fields of new DomainValidateVerificationRecordRequest(): a nested model may be a plain object in the API format. */
|
|
94
103
|
export interface DomainValidateVerificationRecordRequestInit {
|
|
95
104
|
/** Domain to validate verification record for. */
|
|
@@ -113,6 +122,9 @@ export interface DomainValidateVerificationRecordResponseJSON {
|
|
|
113
122
|
"message"?: string;
|
|
114
123
|
}
|
|
115
124
|
|
|
125
|
+
/** DomainValidateVerificationRecordResponse in the API format as an argument: a nested model may also be given as a model. */
|
|
126
|
+
export type DomainValidateVerificationRecordResponseInput = DomainValidateVerificationRecordResponseJSON;
|
|
127
|
+
|
|
116
128
|
/** Fields of new DomainValidateVerificationRecordResponse(): a nested model may be a plain object in the API format. */
|
|
117
129
|
export interface DomainValidateVerificationRecordResponseInit {
|
|
118
130
|
/**
|
|
@@ -145,6 +157,9 @@ export interface DomainValidateDkimRequestJSON {
|
|
|
145
157
|
"domain": string;
|
|
146
158
|
}
|
|
147
159
|
|
|
160
|
+
/** DomainValidateDkimRequest in the API format as an argument: a nested model may also be given as a model. */
|
|
161
|
+
export type DomainValidateDkimRequestInput = DomainValidateDkimRequestJSON;
|
|
162
|
+
|
|
148
163
|
/** Fields of new DomainValidateDkimRequest(): a nested model may be a plain object in the API format. */
|
|
149
164
|
export interface DomainValidateDkimRequestInit {
|
|
150
165
|
/** Domain to validate DKIM record for. */
|
|
@@ -168,6 +183,9 @@ export interface DomainValidateDkimResponseJSON {
|
|
|
168
183
|
"message"?: string;
|
|
169
184
|
}
|
|
170
185
|
|
|
186
|
+
/** DomainValidateDkimResponse in the API format as an argument: a nested model may also be given as a model. */
|
|
187
|
+
export type DomainValidateDkimResponseInput = DomainValidateDkimResponseJSON;
|
|
188
|
+
|
|
171
189
|
/** Fields of new DomainValidateDkimResponse(): a nested model may be a plain object in the API format. */
|
|
172
190
|
export interface DomainValidateDkimResponseInit {
|
|
173
191
|
/**
|
|
@@ -202,6 +220,9 @@ export interface DomainListRequestJSON {
|
|
|
202
220
|
"offset"?: number;
|
|
203
221
|
}
|
|
204
222
|
|
|
223
|
+
/** DomainListRequest in the API format as an argument: a nested model may also be given as a model. */
|
|
224
|
+
export type DomainListRequestInput = DomainListRequestJSON;
|
|
225
|
+
|
|
205
226
|
/** Fields of new DomainListRequest(): a nested model may be a plain object in the API format. */
|
|
206
227
|
export interface DomainListRequestInit {
|
|
207
228
|
/** Optional domain name if you want to get the status of single domain only. */
|
|
@@ -245,6 +266,12 @@ export interface DomainListResponseJSON {
|
|
|
245
266
|
"domains"?: Array<DomainListResponseDomainsItemJSON>;
|
|
246
267
|
}
|
|
247
268
|
|
|
269
|
+
/** DomainListResponse in the API format as an argument: a nested model may also be given as a model. */
|
|
270
|
+
export interface DomainListResponseInput {
|
|
271
|
+
"status"?: string;
|
|
272
|
+
"domains"?: Array<DomainListResponseDomainsItem | DomainListResponseDomainsItemInput>;
|
|
273
|
+
}
|
|
274
|
+
|
|
248
275
|
/** Fields of new DomainListResponse(): a nested model may be a plain object in the API format. */
|
|
249
276
|
export interface DomainListResponseInit {
|
|
250
277
|
/**
|
|
@@ -253,7 +280,7 @@ export interface DomainListResponseInit {
|
|
|
253
280
|
*/
|
|
254
281
|
status?: string;
|
|
255
282
|
/** Array of objects describing domains. */
|
|
256
|
-
domains?: Array<DomainListResponseDomainsItem |
|
|
283
|
+
domains?: Array<DomainListResponseDomainsItem | DomainListResponseDomainsItemInput>;
|
|
257
284
|
}
|
|
258
285
|
|
|
259
286
|
/** DomainListResponse */
|
|
@@ -279,14 +306,21 @@ export interface DomainListResponseDomainsItemJSON {
|
|
|
279
306
|
"dkim"?: DomainListResponseDomainsItemDkimJSON;
|
|
280
307
|
}
|
|
281
308
|
|
|
309
|
+
/** DomainListResponseDomainsItem in the API format as an argument: a nested model may also be given as a model. */
|
|
310
|
+
export interface DomainListResponseDomainsItemInput {
|
|
311
|
+
"domain"?: string;
|
|
312
|
+
"verification-record"?: DomainListResponseDomainsItemVerificationRecord | DomainListResponseDomainsItemVerificationRecordInput;
|
|
313
|
+
"dkim"?: DomainListResponseDomainsItemDkim | DomainListResponseDomainsItemDkimInput;
|
|
314
|
+
}
|
|
315
|
+
|
|
282
316
|
/** Fields of new DomainListResponseDomainsItem(): a nested model may be a plain object in the API format. */
|
|
283
317
|
export interface DomainListResponseDomainsItemInit {
|
|
284
318
|
/** Domain name. */
|
|
285
319
|
domain?: string;
|
|
286
320
|
/** Object describing verification record value and status. */
|
|
287
|
-
verificationRecord?: DomainListResponseDomainsItemVerificationRecord |
|
|
321
|
+
verificationRecord?: DomainListResponseDomainsItemVerificationRecord | DomainListResponseDomainsItemVerificationRecordInput;
|
|
288
322
|
/** Object describing DKIM record value and status. */
|
|
289
|
-
dkim?: DomainListResponseDomainsItemDkim |
|
|
323
|
+
dkim?: DomainListResponseDomainsItemDkim | DomainListResponseDomainsItemDkimInput;
|
|
290
324
|
}
|
|
291
325
|
|
|
292
326
|
/** DomainListResponseDomainsItem */
|
|
@@ -310,6 +344,9 @@ export interface DomainListResponseDomainsItemVerificationRecordJSON {
|
|
|
310
344
|
"status"?: VerificationRecordStatus;
|
|
311
345
|
}
|
|
312
346
|
|
|
347
|
+
/** DomainListResponseDomainsItemVerificationRecord in the API format as an argument: a nested model may also be given as a model. */
|
|
348
|
+
export type DomainListResponseDomainsItemVerificationRecordInput = DomainListResponseDomainsItemVerificationRecordJSON;
|
|
349
|
+
|
|
313
350
|
/** Fields of new DomainListResponseDomainsItemVerificationRecord(): a nested model may be a plain object in the API format. */
|
|
314
351
|
export interface DomainListResponseDomainsItemVerificationRecordInit {
|
|
315
352
|
/** Record to be added "as is" to verify ownership of this domain. */
|
|
@@ -337,6 +374,9 @@ export interface DomainListResponseDomainsItemDkimJSON {
|
|
|
337
374
|
"status"?: DkimStatus;
|
|
338
375
|
}
|
|
339
376
|
|
|
377
|
+
/** DomainListResponseDomainsItemDkim in the API format as an argument: a nested model may also be given as a model. */
|
|
378
|
+
export type DomainListResponseDomainsItemDkimInput = DomainListResponseDomainsItemDkimJSON;
|
|
379
|
+
|
|
340
380
|
/** Fields of new DomainListResponseDomainsItemDkim(): a nested model may be a plain object in the API format. */
|
|
341
381
|
export interface DomainListResponseDomainsItemDkimInit {
|
|
342
382
|
/**
|
|
@@ -372,6 +412,9 @@ export interface DomainGetSandboxDomainResponseJSON {
|
|
|
372
412
|
"domain"?: string;
|
|
373
413
|
}
|
|
374
414
|
|
|
415
|
+
/** DomainGetSandboxDomainResponse in the API format as an argument: a nested model may also be given as a model. */
|
|
416
|
+
export type DomainGetSandboxDomainResponseInput = DomainGetSandboxDomainResponseJSON;
|
|
417
|
+
|
|
375
418
|
/** Fields of new DomainGetSandboxDomainResponse(): a nested model may be a plain object in the API format. */
|
|
376
419
|
export interface DomainGetSandboxDomainResponseInit {
|
|
377
420
|
/**
|
|
@@ -404,6 +447,9 @@ export interface DomainDeleteRequestJSON {
|
|
|
404
447
|
"domain": string;
|
|
405
448
|
}
|
|
406
449
|
|
|
450
|
+
/** DomainDeleteRequest in the API format as an argument: a nested model may also be given as a model. */
|
|
451
|
+
export type DomainDeleteRequestInput = DomainDeleteRequestJSON;
|
|
452
|
+
|
|
407
453
|
/** Fields of new DomainDeleteRequest(): a nested model may be a plain object in the API format. */
|
|
408
454
|
export interface DomainDeleteRequestInit {
|
|
409
455
|
/** Domain name to delete. */
|
|
@@ -427,6 +473,9 @@ export interface DomainDeleteResponseJSON {
|
|
|
427
473
|
"message"?: string;
|
|
428
474
|
}
|
|
429
475
|
|
|
476
|
+
/** DomainDeleteResponse in the API format as an argument: a nested model may also be given as a model. */
|
|
477
|
+
export type DomainDeleteResponseInput = DomainDeleteResponseJSON;
|
|
478
|
+
|
|
430
479
|
/** Fields of new DomainDeleteResponse(): a nested model may be a plain object in the API format. */
|
|
431
480
|
export interface DomainDeleteResponseInit {
|
|
432
481
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// EmailApi: API methods of the Email section.
|
|
2
2
|
import type { ApiClient } from "../../client/ApiClient.js";
|
|
3
3
|
import type { SuccessResponse } from "../../common/models.js";
|
|
4
|
-
import type { EmailSendRequest,
|
|
4
|
+
import type { EmailSendRequest, EmailSendRequestInput, EmailSendResponse, EmailSubscribeRequest, EmailSubscribeRequestInput } from "./models.js";
|
|
5
5
|
|
|
6
6
|
/** This group of methods is related with email sending. */
|
|
7
7
|
export declare class EmailApi {
|
|
@@ -27,7 +27,7 @@ export declare class EmailApi {
|
|
|
27
27
|
* Documentation: https://docs.unione.io/en/web-api-ref#email-send
|
|
28
28
|
* @throws {ApiError}
|
|
29
29
|
*/
|
|
30
|
-
send(request: EmailSendRequest |
|
|
30
|
+
send(request: EmailSendRequest | EmailSendRequestInput): Promise<EmailSendResponse>;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Sends an email with (re)subscribe link.
|
|
@@ -41,5 +41,5 @@ export declare class EmailApi {
|
|
|
41
41
|
* Documentation: https://docs.unione.io/en/web-api-ref#email-subscribe
|
|
42
42
|
* @throws {ApiError}
|
|
43
43
|
*/
|
|
44
|
-
subscribe(request: EmailSubscribeRequest |
|
|
44
|
+
subscribe(request: EmailSubscribeRequest | EmailSubscribeRequestInput): Promise<SuccessResponse>;
|
|
45
45
|
}
|