ark-email 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +70 -0
- package/LICENSE +201 -0
- package/README.md +431 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +204 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +204 -0
- package/client.d.ts.map +1 -0
- package/client.js +481 -0
- package/client.js.map +1 -0
- package/client.mjs +477 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/pagination.d.mts +67 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +67 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +105 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +99 -0
- package/core/pagination.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +7 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +7 -0
- package/index.d.ts.map +1 -0
- package/index.js +32 -0
- package/index.js.map +1 -0
- package/index.mjs +8 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +35 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +85 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +79 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +147 -0
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/domains.d.mts +238 -0
- package/resources/domains.d.mts.map +1 -0
- package/resources/domains.d.ts +238 -0
- package/resources/domains.d.ts.map +1 -0
- package/resources/domains.js +82 -0
- package/resources/domains.js.map +1 -0
- package/resources/domains.mjs +78 -0
- package/resources/domains.mjs.map +1 -0
- package/resources/emails.d.mts +602 -0
- package/resources/emails.d.mts.map +1 -0
- package/resources/emails.d.ts +602 -0
- package/resources/emails.d.ts.map +1 -0
- package/resources/emails.js +173 -0
- package/resources/emails.js.map +1 -0
- package/resources/emails.mjs +169 -0
- package/resources/emails.mjs.map +1 -0
- package/resources/index.d.mts +7 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +7 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +17 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +8 -0
- package/resources/index.mjs.map +1 -0
- package/resources/shared.d.mts +7 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +7 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/suppressions.d.mts +181 -0
- package/resources/suppressions.d.mts.map +1 -0
- package/resources/suppressions.d.ts +181 -0
- package/resources/suppressions.d.ts.map +1 -0
- package/resources/suppressions.js +84 -0
- package/resources/suppressions.js.map +1 -0
- package/resources/suppressions.mjs +80 -0
- package/resources/suppressions.mjs.map +1 -0
- package/resources/tracking.d.mts +288 -0
- package/resources/tracking.d.mts.map +1 -0
- package/resources/tracking.d.ts +288 -0
- package/resources/tracking.d.ts.map +1 -0
- package/resources/tracking.js +96 -0
- package/resources/tracking.js.map +1 -0
- package/resources/tracking.mjs +92 -0
- package/resources/tracking.mjs.map +1 -0
- package/resources/webhooks.d.mts +307 -0
- package/resources/webhooks.d.mts.map +1 -0
- package/resources/webhooks.d.ts +307 -0
- package/resources/webhooks.d.ts.map +1 -0
- package/resources/webhooks.js +108 -0
- package/resources/webhooks.js.map +1 -0
- package/resources/webhooks.mjs +104 -0
- package/resources/webhooks.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +898 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +89 -0
- package/src/core/error.ts +130 -0
- package/src/core/pagination.ts +187 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +23 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +126 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/.keep +4 -0
- package/src/pagination.ts +2 -0
- package/src/resource.ts +2 -0
- package/src/resources/domains.ts +320 -0
- package/src/resources/emails.ts +770 -0
- package/src/resources/index.ts +65 -0
- package/src/resources/shared.ts +8 -0
- package/src/resources/suppressions.ts +253 -0
- package/src/resources/tracking.ts +380 -0
- package/src/resources/webhooks.ts +456 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export * from './shared';
|
|
4
|
+
export {
|
|
5
|
+
Domains,
|
|
6
|
+
type DNSRecord,
|
|
7
|
+
type DomainCreateResponse,
|
|
8
|
+
type DomainRetrieveResponse,
|
|
9
|
+
type DomainListResponse,
|
|
10
|
+
type DomainDeleteResponse,
|
|
11
|
+
type DomainVerifyResponse,
|
|
12
|
+
type DomainCreateParams,
|
|
13
|
+
} from './domains';
|
|
14
|
+
export {
|
|
15
|
+
Emails,
|
|
16
|
+
type EmailRetrieveResponse,
|
|
17
|
+
type EmailListResponse,
|
|
18
|
+
type EmailRetrieveDeliveriesResponse,
|
|
19
|
+
type EmailRetryResponse,
|
|
20
|
+
type EmailSendResponse,
|
|
21
|
+
type EmailSendBatchResponse,
|
|
22
|
+
type EmailSendRawResponse,
|
|
23
|
+
type EmailRetrieveParams,
|
|
24
|
+
type EmailListParams,
|
|
25
|
+
type EmailSendParams,
|
|
26
|
+
type EmailSendBatchParams,
|
|
27
|
+
type EmailSendRawParams,
|
|
28
|
+
type EmailListResponsesPageNumberPagination,
|
|
29
|
+
} from './emails';
|
|
30
|
+
export {
|
|
31
|
+
Suppressions,
|
|
32
|
+
type SuppressionCreateResponse,
|
|
33
|
+
type SuppressionRetrieveResponse,
|
|
34
|
+
type SuppressionListResponse,
|
|
35
|
+
type SuppressionDeleteResponse,
|
|
36
|
+
type SuppressionBulkCreateResponse,
|
|
37
|
+
type SuppressionCreateParams,
|
|
38
|
+
type SuppressionListParams,
|
|
39
|
+
type SuppressionBulkCreateParams,
|
|
40
|
+
type SuppressionListResponsesPageNumberPagination,
|
|
41
|
+
} from './suppressions';
|
|
42
|
+
export {
|
|
43
|
+
Tracking,
|
|
44
|
+
type TrackDomain,
|
|
45
|
+
type TrackingCreateResponse,
|
|
46
|
+
type TrackingRetrieveResponse,
|
|
47
|
+
type TrackingUpdateResponse,
|
|
48
|
+
type TrackingListResponse,
|
|
49
|
+
type TrackingDeleteResponse,
|
|
50
|
+
type TrackingVerifyResponse,
|
|
51
|
+
type TrackingCreateParams,
|
|
52
|
+
type TrackingUpdateParams,
|
|
53
|
+
} from './tracking';
|
|
54
|
+
export {
|
|
55
|
+
Webhooks,
|
|
56
|
+
type WebhookCreateResponse,
|
|
57
|
+
type WebhookRetrieveResponse,
|
|
58
|
+
type WebhookUpdateResponse,
|
|
59
|
+
type WebhookListResponse,
|
|
60
|
+
type WebhookDeleteResponse,
|
|
61
|
+
type WebhookTestResponse,
|
|
62
|
+
type WebhookCreateParams,
|
|
63
|
+
type WebhookUpdateParams,
|
|
64
|
+
type WebhookTestParams,
|
|
65
|
+
} from './webhooks';
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as Shared from './shared';
|
|
5
|
+
import { APIPromise } from '../core/api-promise';
|
|
6
|
+
import { PageNumberPagination, type PageNumberPaginationParams, PagePromise } from '../core/pagination';
|
|
7
|
+
import { RequestOptions } from '../internal/request-options';
|
|
8
|
+
import { path } from '../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
export class Suppressions extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Add an email address to the suppression list. The address will not receive any
|
|
13
|
+
* emails until removed.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const suppression = await client.suppressions.create({
|
|
18
|
+
* address: 'user@example.com',
|
|
19
|
+
* reason: 'user requested removal',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
create(body: SuppressionCreateParams, options?: RequestOptions): APIPromise<SuppressionCreateResponse> {
|
|
24
|
+
return this._client.post('/suppressions', { body, ...options });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Check if a specific email address is on the suppression list
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const suppression = await client.suppressions.retrieve(
|
|
33
|
+
* 'dev@stainless.com',
|
|
34
|
+
* );
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
retrieve(email: string, options?: RequestOptions): APIPromise<SuppressionRetrieveResponse> {
|
|
38
|
+
return this._client.get(path`/suppressions/${email}`, options);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Get all email addresses on the suppression list. These addresses will not
|
|
43
|
+
* receive any emails.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* // Automatically fetches more pages as needed.
|
|
48
|
+
* for await (const suppressionListResponse of client.suppressions.list()) {
|
|
49
|
+
* // ...
|
|
50
|
+
* }
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
list(
|
|
54
|
+
query: SuppressionListParams | null | undefined = {},
|
|
55
|
+
options?: RequestOptions,
|
|
56
|
+
): PagePromise<SuppressionListResponsesPageNumberPagination, SuppressionListResponse> {
|
|
57
|
+
return this._client.getAPIList('/suppressions', PageNumberPagination<SuppressionListResponse>, {
|
|
58
|
+
query,
|
|
59
|
+
...options,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Remove an email address from the suppression list. The address will be able to
|
|
65
|
+
* receive emails again.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const suppression = await client.suppressions.delete(
|
|
70
|
+
* 'dev@stainless.com',
|
|
71
|
+
* );
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
delete(email: string, options?: RequestOptions): APIPromise<SuppressionDeleteResponse> {
|
|
75
|
+
return this._client.delete(path`/suppressions/${email}`, options);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Add up to 1000 email addresses to the suppression list at once
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* const response = await client.suppressions.bulkCreate({
|
|
84
|
+
* suppressions: [{ address: 'dev@stainless.com' }],
|
|
85
|
+
* });
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
bulkCreate(
|
|
89
|
+
body: SuppressionBulkCreateParams,
|
|
90
|
+
options?: RequestOptions,
|
|
91
|
+
): APIPromise<SuppressionBulkCreateResponse> {
|
|
92
|
+
return this._client.post('/suppressions/bulk', { body, ...options });
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export type SuppressionListResponsesPageNumberPagination = PageNumberPagination<SuppressionListResponse>;
|
|
97
|
+
|
|
98
|
+
export interface SuppressionCreateResponse {
|
|
99
|
+
data: SuppressionCreateResponse.Data;
|
|
100
|
+
|
|
101
|
+
meta: Shared.APIMeta;
|
|
102
|
+
|
|
103
|
+
success: true;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export namespace SuppressionCreateResponse {
|
|
107
|
+
export interface Data {
|
|
108
|
+
/**
|
|
109
|
+
* Suppression ID
|
|
110
|
+
*/
|
|
111
|
+
id: string;
|
|
112
|
+
|
|
113
|
+
address: string;
|
|
114
|
+
|
|
115
|
+
createdAt: string;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Reason for suppression
|
|
119
|
+
*/
|
|
120
|
+
reason?: string;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface SuppressionRetrieveResponse {
|
|
125
|
+
data: SuppressionRetrieveResponse.Data;
|
|
126
|
+
|
|
127
|
+
meta: Shared.APIMeta;
|
|
128
|
+
|
|
129
|
+
success: true;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export namespace SuppressionRetrieveResponse {
|
|
133
|
+
export interface Data {
|
|
134
|
+
/**
|
|
135
|
+
* The email address that was checked
|
|
136
|
+
*/
|
|
137
|
+
address: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Whether the address is currently suppressed
|
|
141
|
+
*/
|
|
142
|
+
suppressed: boolean;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* When the suppression was created (if suppressed)
|
|
146
|
+
*/
|
|
147
|
+
createdAt?: string | null;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Reason for suppression (if suppressed)
|
|
151
|
+
*/
|
|
152
|
+
reason?: string | null;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export interface SuppressionListResponse {
|
|
157
|
+
/**
|
|
158
|
+
* Suppression ID
|
|
159
|
+
*/
|
|
160
|
+
id: string;
|
|
161
|
+
|
|
162
|
+
address: string;
|
|
163
|
+
|
|
164
|
+
createdAt: string;
|
|
165
|
+
|
|
166
|
+
reason?: string;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export interface SuppressionDeleteResponse {
|
|
170
|
+
data: SuppressionDeleteResponse.Data;
|
|
171
|
+
|
|
172
|
+
meta: Shared.APIMeta;
|
|
173
|
+
|
|
174
|
+
success: true;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export namespace SuppressionDeleteResponse {
|
|
178
|
+
export interface Data {
|
|
179
|
+
message: string;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface SuppressionBulkCreateResponse {
|
|
184
|
+
data: SuppressionBulkCreateResponse.Data;
|
|
185
|
+
|
|
186
|
+
meta: Shared.APIMeta;
|
|
187
|
+
|
|
188
|
+
success: true;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export namespace SuppressionBulkCreateResponse {
|
|
192
|
+
export interface Data {
|
|
193
|
+
/**
|
|
194
|
+
* Newly suppressed addresses
|
|
195
|
+
*/
|
|
196
|
+
added: number;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Invalid addresses skipped
|
|
200
|
+
*/
|
|
201
|
+
failed: number;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Total addresses in request
|
|
205
|
+
*/
|
|
206
|
+
totalRequested: number;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Already suppressed addresses (updated reason)
|
|
210
|
+
*/
|
|
211
|
+
updated: number;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface SuppressionCreateParams {
|
|
216
|
+
/**
|
|
217
|
+
* Email address to suppress
|
|
218
|
+
*/
|
|
219
|
+
address: string;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Reason for suppression
|
|
223
|
+
*/
|
|
224
|
+
reason?: string;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface SuppressionListParams extends PageNumberPaginationParams {}
|
|
228
|
+
|
|
229
|
+
export interface SuppressionBulkCreateParams {
|
|
230
|
+
suppressions: Array<SuppressionBulkCreateParams.Suppression>;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
export namespace SuppressionBulkCreateParams {
|
|
234
|
+
export interface Suppression {
|
|
235
|
+
address: string;
|
|
236
|
+
|
|
237
|
+
reason?: string;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
export declare namespace Suppressions {
|
|
242
|
+
export {
|
|
243
|
+
type SuppressionCreateResponse as SuppressionCreateResponse,
|
|
244
|
+
type SuppressionRetrieveResponse as SuppressionRetrieveResponse,
|
|
245
|
+
type SuppressionListResponse as SuppressionListResponse,
|
|
246
|
+
type SuppressionDeleteResponse as SuppressionDeleteResponse,
|
|
247
|
+
type SuppressionBulkCreateResponse as SuppressionBulkCreateResponse,
|
|
248
|
+
type SuppressionListResponsesPageNumberPagination as SuppressionListResponsesPageNumberPagination,
|
|
249
|
+
type SuppressionCreateParams as SuppressionCreateParams,
|
|
250
|
+
type SuppressionListParams as SuppressionListParams,
|
|
251
|
+
type SuppressionBulkCreateParams as SuppressionBulkCreateParams,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
@@ -0,0 +1,380 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import * as TrackingAPI from './tracking';
|
|
5
|
+
import * as Shared from './shared';
|
|
6
|
+
import { APIPromise } from '../core/api-promise';
|
|
7
|
+
import { RequestOptions } from '../internal/request-options';
|
|
8
|
+
import { path } from '../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
export class Tracking extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Create a new track domain for open/click tracking.
|
|
13
|
+
*
|
|
14
|
+
* After creation, you must configure a CNAME record pointing to the provided DNS
|
|
15
|
+
* value before tracking will work.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const tracking = await client.tracking.create({
|
|
20
|
+
* domainId: '123',
|
|
21
|
+
* name: 'track',
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
create(body: TrackingCreateParams, options?: RequestOptions): APIPromise<TrackingCreateResponse> {
|
|
26
|
+
return this._client.post('/tracking', { body, ...options });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Get details of a specific track domain including DNS configuration
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const tracking = await client.tracking.retrieve(
|
|
35
|
+
* 'trackingId',
|
|
36
|
+
* );
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
retrieve(trackingID: string, options?: RequestOptions): APIPromise<TrackingRetrieveResponse> {
|
|
40
|
+
return this._client.get(path`/tracking/${trackingID}`, options);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Update track domain settings.
|
|
45
|
+
*
|
|
46
|
+
* Use this to:
|
|
47
|
+
*
|
|
48
|
+
* - Enable/disable click tracking
|
|
49
|
+
* - Enable/disable open tracking
|
|
50
|
+
* - Enable/disable SSL
|
|
51
|
+
* - Set excluded click domains
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const tracking = await client.tracking.update('trackingId');
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
update(
|
|
59
|
+
trackingID: string,
|
|
60
|
+
body: TrackingUpdateParams,
|
|
61
|
+
options?: RequestOptions,
|
|
62
|
+
): APIPromise<TrackingUpdateResponse> {
|
|
63
|
+
return this._client.patch(path`/tracking/${trackingID}`, { body, ...options });
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* List all track domains configured for your server. Track domains enable open and
|
|
68
|
+
* click tracking for your emails.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const trackings = await client.tracking.list();
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
list(options?: RequestOptions): APIPromise<TrackingListResponse> {
|
|
76
|
+
return this._client.get('/tracking', options);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Delete a track domain. This will disable tracking for any emails using this
|
|
81
|
+
* domain.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const tracking = await client.tracking.delete('trackingId');
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
delete(trackingID: string, options?: RequestOptions): APIPromise<TrackingDeleteResponse> {
|
|
89
|
+
return this._client.delete(path`/tracking/${trackingID}`, options);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Check DNS configuration for the track domain.
|
|
94
|
+
*
|
|
95
|
+
* The track domain requires a CNAME record to be configured before open and click
|
|
96
|
+
* tracking will work. Use this endpoint to verify the DNS is correctly set up.
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* ```ts
|
|
100
|
+
* const response = await client.tracking.verify('trackingId');
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
verify(trackingID: string, options?: RequestOptions): APIPromise<TrackingVerifyResponse> {
|
|
104
|
+
return this._client.post(path`/tracking/${trackingID}/verify`, options);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export interface TrackDomain {
|
|
109
|
+
/**
|
|
110
|
+
* Track domain ID
|
|
111
|
+
*/
|
|
112
|
+
id: string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* When the track domain was created
|
|
116
|
+
*/
|
|
117
|
+
createdAt: string;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Whether DNS is correctly configured
|
|
121
|
+
*/
|
|
122
|
+
dnsOk: boolean;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* ID of the parent sending domain
|
|
126
|
+
*/
|
|
127
|
+
domainId: string;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Full domain name
|
|
131
|
+
*/
|
|
132
|
+
fullName: string;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Subdomain name
|
|
136
|
+
*/
|
|
137
|
+
name: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Whether SSL is enabled for tracking URLs
|
|
141
|
+
*/
|
|
142
|
+
sslEnabled: boolean;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Whether click tracking is enabled
|
|
146
|
+
*/
|
|
147
|
+
trackClicks: boolean;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Whether open tracking is enabled
|
|
151
|
+
*/
|
|
152
|
+
trackOpens: boolean;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* When DNS was last checked
|
|
156
|
+
*/
|
|
157
|
+
dnsCheckedAt?: string | null;
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* DNS error message if verification failed
|
|
161
|
+
*/
|
|
162
|
+
dnsError?: string | null;
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Required DNS record configuration
|
|
166
|
+
*/
|
|
167
|
+
dnsRecord?: TrackDomain.DNSRecord | null;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Current DNS verification status
|
|
171
|
+
*/
|
|
172
|
+
dnsStatus?: 'ok' | 'missing' | 'invalid' | null;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Domains excluded from click tracking
|
|
176
|
+
*/
|
|
177
|
+
excludedClickDomains?: string | null;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* When the track domain was last updated
|
|
181
|
+
*/
|
|
182
|
+
updatedAt?: string | null;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export namespace TrackDomain {
|
|
186
|
+
/**
|
|
187
|
+
* Required DNS record configuration
|
|
188
|
+
*/
|
|
189
|
+
export interface DNSRecord {
|
|
190
|
+
/**
|
|
191
|
+
* DNS record name
|
|
192
|
+
*/
|
|
193
|
+
name?: string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* DNS record type
|
|
197
|
+
*/
|
|
198
|
+
type?: string;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* DNS record value (target)
|
|
202
|
+
*/
|
|
203
|
+
value?: string;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
export interface TrackingCreateResponse {
|
|
208
|
+
data: TrackDomain;
|
|
209
|
+
|
|
210
|
+
meta: Shared.APIMeta;
|
|
211
|
+
|
|
212
|
+
success: true;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export interface TrackingRetrieveResponse {
|
|
216
|
+
data: TrackDomain;
|
|
217
|
+
|
|
218
|
+
meta: Shared.APIMeta;
|
|
219
|
+
|
|
220
|
+
success: true;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export interface TrackingUpdateResponse {
|
|
224
|
+
data: TrackDomain;
|
|
225
|
+
|
|
226
|
+
meta: Shared.APIMeta;
|
|
227
|
+
|
|
228
|
+
success: true;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface TrackingListResponse {
|
|
232
|
+
data: TrackingListResponse.Data;
|
|
233
|
+
|
|
234
|
+
meta: Shared.APIMeta;
|
|
235
|
+
|
|
236
|
+
success: true;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export namespace TrackingListResponse {
|
|
240
|
+
export interface Data {
|
|
241
|
+
trackDomains: Array<TrackingAPI.TrackDomain>;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
export interface TrackingDeleteResponse {
|
|
246
|
+
data: TrackingDeleteResponse.Data;
|
|
247
|
+
|
|
248
|
+
meta: Shared.APIMeta;
|
|
249
|
+
|
|
250
|
+
success: true;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export namespace TrackingDeleteResponse {
|
|
254
|
+
export interface Data {
|
|
255
|
+
message: string;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
export interface TrackingVerifyResponse {
|
|
260
|
+
data: TrackingVerifyResponse.Data;
|
|
261
|
+
|
|
262
|
+
meta: Shared.APIMeta;
|
|
263
|
+
|
|
264
|
+
success: true;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export namespace TrackingVerifyResponse {
|
|
268
|
+
export interface Data {
|
|
269
|
+
/**
|
|
270
|
+
* Track domain ID
|
|
271
|
+
*/
|
|
272
|
+
id: string;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Whether DNS is correctly configured
|
|
276
|
+
*/
|
|
277
|
+
dnsOk: boolean;
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Current DNS verification status
|
|
281
|
+
*/
|
|
282
|
+
dnsStatus: 'ok' | 'missing' | 'invalid' | null;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* Full domain name
|
|
286
|
+
*/
|
|
287
|
+
fullName: string;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* When DNS was last checked
|
|
291
|
+
*/
|
|
292
|
+
dnsCheckedAt?: string | null;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* DNS error message if verification failed
|
|
296
|
+
*/
|
|
297
|
+
dnsError?: string | null;
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* Required DNS record configuration
|
|
301
|
+
*/
|
|
302
|
+
dnsRecord?: Data.DNSRecord | null;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
export namespace Data {
|
|
306
|
+
/**
|
|
307
|
+
* Required DNS record configuration
|
|
308
|
+
*/
|
|
309
|
+
export interface DNSRecord {
|
|
310
|
+
name?: string;
|
|
311
|
+
|
|
312
|
+
type?: string;
|
|
313
|
+
|
|
314
|
+
value?: string;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export interface TrackingCreateParams {
|
|
320
|
+
/**
|
|
321
|
+
* ID of the sending domain to attach this track domain to
|
|
322
|
+
*/
|
|
323
|
+
domainId: string;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Subdomain name (e.g., 'track' for track.yourdomain.com)
|
|
327
|
+
*/
|
|
328
|
+
name: string;
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Enable SSL for tracking URLs (recommended)
|
|
332
|
+
*/
|
|
333
|
+
sslEnabled?: boolean;
|
|
334
|
+
|
|
335
|
+
/**
|
|
336
|
+
* Enable click tracking
|
|
337
|
+
*/
|
|
338
|
+
trackClicks?: boolean;
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* Enable open tracking (tracking pixel)
|
|
342
|
+
*/
|
|
343
|
+
trackOpens?: boolean;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
export interface TrackingUpdateParams {
|
|
347
|
+
/**
|
|
348
|
+
* Comma-separated list of domains to exclude from click tracking
|
|
349
|
+
*/
|
|
350
|
+
excludedClickDomains?: string;
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Enable or disable SSL for tracking URLs
|
|
354
|
+
*/
|
|
355
|
+
sslEnabled?: boolean;
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Enable or disable click tracking
|
|
359
|
+
*/
|
|
360
|
+
trackClicks?: boolean;
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Enable or disable open tracking
|
|
364
|
+
*/
|
|
365
|
+
trackOpens?: boolean;
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
export declare namespace Tracking {
|
|
369
|
+
export {
|
|
370
|
+
type TrackDomain as TrackDomain,
|
|
371
|
+
type TrackingCreateResponse as TrackingCreateResponse,
|
|
372
|
+
type TrackingRetrieveResponse as TrackingRetrieveResponse,
|
|
373
|
+
type TrackingUpdateResponse as TrackingUpdateResponse,
|
|
374
|
+
type TrackingListResponse as TrackingListResponse,
|
|
375
|
+
type TrackingDeleteResponse as TrackingDeleteResponse,
|
|
376
|
+
type TrackingVerifyResponse as TrackingVerifyResponse,
|
|
377
|
+
type TrackingCreateParams as TrackingCreateParams,
|
|
378
|
+
type TrackingUpdateParams as TrackingUpdateParams,
|
|
379
|
+
};
|
|
380
|
+
}
|