unione 2.2.3 → 2.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.
Files changed (37) hide show
  1. package/AGENTS.md +53 -64
  2. package/LICENSE +1 -1
  3. package/README.md +27 -7
  4. package/package.json +5 -2
  5. package/src/api/confirmed-email/ConfirmedEmailApi.d.ts +3 -3
  6. package/src/api/confirmed-email/models.d.ts +23 -2
  7. package/src/api/domain/DomainApi.d.ts +6 -6
  8. package/src/api/domain/models.d.ts +52 -3
  9. package/src/api/email/EmailApi.d.ts +3 -3
  10. package/src/api/email/models.d.ts +54 -8
  11. package/src/api/email-validation/EmailValidationApi.d.ts +2 -2
  12. package/src/api/email-validation/models.d.ts +6 -0
  13. package/src/api/event-dump/EventDumpApi.d.ts +4 -4
  14. package/src/api/event-dump/models.d.ts +51 -4
  15. package/src/api/obsolete/ObsoleteApi.d.ts +4 -4
  16. package/src/api/obsolete/models.d.ts +25 -1
  17. package/src/api/project/ProjectApi.d.ts +5 -5
  18. package/src/api/project/models.d.ts +42 -3
  19. package/src/api/suppression/SuppressionApi.d.ts +5 -5
  20. package/src/api/suppression/models.d.ts +34 -2
  21. package/src/api/system/models.d.ts +22 -2
  22. package/src/api/tag/TagApi.d.ts +2 -2
  23. package/src/api/tag/models.d.ts +13 -1
  24. package/src/api/template/TemplateApi.d.ts +5 -5
  25. package/src/api/template/models.d.ts +91 -13
  26. package/src/api/webhook/WebhookApi.d.ts +5 -5
  27. package/src/api/webhook/models.d.ts +102 -9
  28. package/src/client/ApiClient.js +47 -16
  29. package/src/client/ApiError.d.ts +34 -1
  30. package/src/client/ApiError.js +42 -3
  31. package/src/client/Configuration.js +1 -1
  32. package/src/client/errors.js +195 -0
  33. package/src/client/index.d.ts +1 -1
  34. package/src/client/index.js +1 -1
  35. package/src/common/models.d.ts +15 -0
  36. package/src/index.d.ts +1 -1
  37. package/src/index.js +1 -1
package/AGENTS.md CHANGED
@@ -1,87 +1,61 @@
1
1
  # AGENTS.md
2
2
 
3
- UniOne Node.js SDK — client for the UniOne transactional email Web API (Web API 1.90).
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
- ## Working on this repository
6
-
7
- - **Generated code.** The whole package is generated by the UniOne team from the UniOne Web API OpenAPI spec (Web API 1.90): 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).
8
- - **Build and check:**
9
-
10
- ```bash
11
- npm install
12
- npm pack --dry-run
13
- ```
5
+ ## Integrating UniOne
14
6
 
15
- - **Source label.** Every request carries the query parameter `platform=node-sdk.2.2.3`, 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.2.2.3`.
16
- - **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: no real API key, no real sends.
17
- - **Release.** The version (2.2.3 in package.json) and the tag `v2.2.3` come from the generator; README.md states the Web API version the release was generated from.
18
- - **Secrets.** Never commit API keys; the examples read `UNIONE_API_KEY` from the environment.
7
+ **On one of these frameworks, install its package instead of this SDK:** it brings the SDK and plugs it into the framework (configuration, client in the container, mailer, webhooks).
19
8
 
20
- ## Integrating UniOne with this SDK
9
+ | Framework | Package | Guide |
10
+ |---|---|---|
11
+ | Express | `unione-express` | [AGENTS.md](https://github.com/unione-repo/unione-express/blob/HEAD/AGENTS.md) |
12
+ | NestJS | `unione-nestjs` | [AGENTS.md](https://github.com/unione-repo/unione-nestjs/blob/HEAD/AGENTS.md) |
21
13
 
22
- Full quickstart: [README.md](README.md). Install:
14
+ ### Install
23
15
 
24
16
  ```bash
25
17
  npm install unione
26
18
  ```
27
19
 
28
- Requirements: Node.js 18+.
20
+ Requirements: Node.js 18+. The API key goes to `UNIONE_API_KEY`.
29
21
 
30
- If the project is built on one of these frameworks, install its package instead: it brings this SDK and plugs it into the framework (configuration, client in the container, mailer, webhooks).
22
+ ### Send an email
31
23
 
32
- | Framework | Package | Guide |
33
- |---|---|---|
34
- | Express | `unione-express` | [AGENTS.md](https://github.com/unione-repo/unione-express/blob/HEAD/AGENTS.md) |
35
- | NestJS | `unione-nestjs` | [AGENTS.md](https://github.com/unione-repo/unione-nestjs/blob/HEAD/AGENTS.md) |
24
+ ```javascript
25
+ import { UniOneClient } from "unione";
26
+ import { MessageObjectRecipientsItem as Recipient } from "unione/api/email";
27
+
28
+ const client = new UniOneClient(process.env.UNIONE_API_KEY ?? "");
29
+
30
+ const { jobId } = await client.email.send({
31
+ message: {
32
+ recipients: [Recipient.fromAddress("Alex <alex@example.com>")],
33
+ from_email: "shop@example.com",
34
+ from_name: "Shop",
35
+ subject: "Your order",
36
+ body: { html: "<p>Hello, {{to_name}}! Your order has shipped.</p>" },
37
+ },
38
+ });
39
+ console.log(jobId);
40
+ ```
41
+
42
+ Personalization, attachments, CC/BCC, scheduling, safe retries, error handling, the webhook handler and the sandbox flow: the recipes of [README.md](README.md#recipes).
36
43
 
37
- Rules that generated code must follow:
44
+ ### Rules for generated code
38
45
 
39
46
  - Server-side only. Read the API key from `UNIONE_API_KEY`; never put it in browser or mobile code, never commit it.
47
+ - Build the recipients and the body with the short forms of the SDK (the recipient from `"Name <email>"`, the name goes to `to_name`; per-recipient metadata; the HTML / text body), as in "Send an email" and the README recipes, not with hand-built nested objects.
40
48
  - 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.
41
- - 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 expires after 31 days.
42
- - 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 → `domain/validate-verification-record`, `domain/validate-dkim` → `domain/list`.
43
- - Set `message.idempotence_key` on retryable sends; retry network errors, `429` and `5xx` with backoff, not 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`.
44
- - Delivery events via webhook (`webhook/set`) with a fast, idempotent HTTPS handler, not polling; check the `auth` field of every notification: the MD5 of the request body with the `auth` value replaced by the API key.
49
+ - 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.
50
+ - 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`.
51
+ - 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`).
52
+ - 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.
45
53
  - Keep the default unsubscribe and tracking behaviour; changes go through UniOne support.
46
54
  - 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).
47
55
 
48
- ### Send an email
49
-
50
- The client reads the API key from `UNIONE_API_KEY`:
51
-
52
- ```javascript
53
- import { UniOneClient } from "unione";
54
- import { EmailSendRequest, MessageObject, MessageObjectRecipientsItem } from "unione/api/email";
55
- import { BodyObject } from "unione/common";
56
-
57
- const client = new UniOneClient(process.env.UNIONE_API_KEY);
58
-
59
- const response = await client.email.send(new EmailSendRequest({
60
- message: new MessageObject({
61
- recipients: [
62
- new MessageObjectRecipientsItem({
63
- email: "user@example.com",
64
- substitutions: {
65
- "CustomerId": "12452",
66
- "to_name": "John Smith",
67
- },
68
- }),
69
- ],
70
- body: new BodyObject({
71
- html: "<b>Hello, {{to_name}}</b>",
72
- plaintext: "Hello, {{to_name}}",
73
- }),
74
- subject: "UniOne test email ",
75
- fromEmail: "email@example.com",
76
- fromName: "John Smith",
77
- }),
78
- }));
79
- console.log(response.jobId);
80
- ```
81
-
82
56
  ### Errors
83
57
 
84
- Every method throws `ApiError` when the request fails: the HTTP status (0 for a network error or a timeout), the [API error code](https://docs.unione.io/en/web-api-ref#api-errors) and the message.
58
+ 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`.
85
59
 
86
60
  ```javascript
87
61
  // client created as above
@@ -91,8 +65,8 @@ try {
91
65
  await client.system.ping();
92
66
  } catch (error) {
93
67
  if (!(error instanceof ApiError)) throw error;
94
- // httpStatus is 0 for a network error or a timeout
95
- console.error(error.httpStatus, error.errorCode, error.message);
68
+ console.error(error.message);
69
+ console.error(error.kind, error.retryable ? "retryable" : "not retryable");
96
70
  }
97
71
  ```
98
72
 
@@ -101,3 +75,18 @@ try {
101
75
  - Methods and models of every section: [Email](docs/Email.md), [EmailValidation](docs/EmailValidation.md), [ConfirmedEmail](docs/ConfirmedEmail.md), [Template](docs/Template.md), [Webhook](docs/Webhook.md), [Suppression](docs/Suppression.md), [Domain](docs/Domain.md), [EventDump](docs/EventDump.md), [Tag](docs/Tag.md), [Project](docs/Project.md), [System](docs/System.md), [Obsolete](docs/Obsolete.md)
102
76
  - [API reference](https://docs.unione.io/en/web-api-ref)
103
77
  - [Full API reference for LLMs](https://docs.unione.io/llms-full.txt)
78
+
79
+ ## Working on this repository
80
+
81
+ - **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).
82
+ - **Build and check:**
83
+
84
+ ```bash
85
+ npm install
86
+ npm pack --dry-run
87
+ ```
88
+
89
+ - **Source label.** Every request carries the query parameter `platform=node-sdk.2.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.2.3.0`.
90
+ - **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.
91
+ - **Release.** The version (2.3.0 in package.json) and the tag `v2.3.0` come from the generator; README.md states the Web API version the release was generated from.
92
+ - **Secrets.** Never commit API keys; the examples read `UNIONE_API_KEY` from the environment.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 UniOne
3
+ Copyright (c) 2026 UniOne
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -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 (0: network error or timeout), API error code, message
162
- console.error(e.httpStatus, e.errorCode, e.message);
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` when the API returns an error; it carries the [API error code](https://docs.unione.io/en/web-api-ref#api-errors) and the HTTP status.
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.httpStatus, error.errorCode, error.message, error.cause);
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": "2.2.3",
3
+ "version": "2.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 test/*.test.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, ConfirmedEmailRequestJSON } from "./models.js";
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 | ConfirmedEmailRequestJSON): Promise<ConfirmedEmailCreateResponse>;
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 | ConfirmedEmailRequestJSON): Promise<ConfirmedEmailDeleteResponse>;
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 | ConfirmedEmailJSON;
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 | ConfirmedEmailJSON>;
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, DomainDeleteRequestJSON, DomainDeleteResponse, DomainGetDnsRecordsRequest, DomainGetDnsRecordsRequestJSON, DomainGetDnsRecordsResponse, DomainGetSandboxDomainResponse, DomainListRequest, DomainListRequestJSON, DomainListResponse, DomainValidateDkimRequest, DomainValidateDkimRequestJSON, DomainValidateDkimResponse, DomainValidateVerificationRecordRequest, DomainValidateVerificationRecordRequestJSON, DomainValidateVerificationRecordResponse } from "./models.js";
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 | DomainGetDnsRecordsRequestJSON): Promise<DomainGetDnsRecordsResponse>;
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 | DomainValidateVerificationRecordRequestJSON): Promise<DomainValidateVerificationRecordResponse>;
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 | DomainValidateDkimRequestJSON): Promise<DomainValidateDkimResponse>;
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 | DomainListRequestJSON): Promise<DomainListResponse>;
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 | DomainDeleteRequestJSON): Promise<DomainDeleteResponse>;
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 | DomainListResponseDomainsItemJSON>;
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 | DomainListResponseDomainsItemVerificationRecordJSON;
321
+ verificationRecord?: DomainListResponseDomainsItemVerificationRecord | DomainListResponseDomainsItemVerificationRecordInput;
288
322
  /** Object describing DKIM record value and status. */
289
- dkim?: DomainListResponseDomainsItemDkim | DomainListResponseDomainsItemDkimJSON;
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, EmailSendRequestJSON, EmailSendResponse, EmailSubscribeRequest, EmailSubscribeRequestJSON } from "./models.js";
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 | EmailSendRequestJSON): Promise<EmailSendResponse>;
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 | EmailSubscribeRequestJSON): Promise<SuccessResponse>;
44
+ subscribe(request: EmailSubscribeRequest | EmailSubscribeRequestInput): Promise<SuccessResponse>;
45
45
  }