@stackshift-cloud/sdk 0.1.0 → 0.1.2

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.
@@ -0,0 +1,55 @@
1
+ export type MailReputationStatus = 'healthy' | 'watch' | 'throttled' | 'disabled';
2
+ export type MailReputationTier = 'sandbox' | 'starter' | 'verified' | 'trusted' | 'custom';
3
+ export type MailManualReviewStatus = 'not_required' | 'pending' | 'approved' | 'rejected';
4
+ export type MailReputationEventSeverity = 'info' | 'warning' | 'critical';
5
+ export interface MailLimits {
6
+ tier: MailReputationTier;
7
+ status: MailReputationStatus;
8
+ dailyLimit: number;
9
+ dailyUsed: number;
10
+ hourlyLimit: number;
11
+ hourlyUsed: number;
12
+ perMinuteLimit: number;
13
+ currentWarmupStage: number;
14
+ manualReviewStatus: MailManualReviewStatus;
15
+ }
16
+ export interface MailReputationWorkspace {
17
+ status: MailReputationStatus;
18
+ score: number;
19
+ tier: MailReputationTier;
20
+ bounceRate: number;
21
+ deferralRate: number;
22
+ suppressionRate: number;
23
+ complaintRate: number | null;
24
+ }
25
+ export interface MailDomainReputation {
26
+ domain: string;
27
+ status: MailReputationStatus;
28
+ score: number;
29
+ bounceRate: number;
30
+ deferralRate: number;
31
+ complaintRate: number | null;
32
+ currentWarmupStage: number;
33
+ }
34
+ export interface MailReputation {
35
+ workspace: MailReputationWorkspace;
36
+ domains: MailDomainReputation[];
37
+ }
38
+ export interface MailReputationEvent {
39
+ id: string;
40
+ type: string;
41
+ severity: MailReputationEventSeverity;
42
+ message: string;
43
+ metadata?: Record<string, unknown>;
44
+ createdAt: string;
45
+ }
46
+ export interface MailReputationEventListOptions {
47
+ severity?: MailReputationEventSeverity;
48
+ type?: string;
49
+ limit?: number;
50
+ cursor?: string;
51
+ }
52
+ export interface MailReputationEventListResult {
53
+ data: MailReputationEvent[];
54
+ nextCursor?: string | null;
55
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,96 @@
1
+ import type { JsonValue, MailAddressInput, MailIdempotencyStatus, MailStatus } from './types.js';
2
+ export type MailTemplateStatus = 'active' | 'archived' | 'deleted';
3
+ export interface MailTemplateCreateInput {
4
+ name: string;
5
+ slug: string;
6
+ description?: string;
7
+ subject: string;
8
+ html?: string;
9
+ text?: string;
10
+ }
11
+ export interface MailTemplateUpdateInput {
12
+ name?: string;
13
+ description?: string;
14
+ subject?: string;
15
+ html?: string;
16
+ text?: string;
17
+ }
18
+ export interface MailTemplateListOptions {
19
+ status?: MailTemplateStatus;
20
+ limit?: number;
21
+ cursor?: string;
22
+ search?: string;
23
+ }
24
+ export interface MailTemplate {
25
+ id: string;
26
+ name: string;
27
+ slug: string;
28
+ description?: string | null;
29
+ status: MailTemplateStatus;
30
+ activeVersionId?: string | null;
31
+ variables: string[];
32
+ createdAt: string;
33
+ updatedAt: string;
34
+ }
35
+ export interface MailTemplateVersion {
36
+ id: string;
37
+ templateId: string;
38
+ versionNumber: number;
39
+ subject: string;
40
+ html?: string | null;
41
+ text?: string | null;
42
+ variables: string[];
43
+ createdAt: string;
44
+ }
45
+ export interface MailTemplateDetail extends MailTemplate {
46
+ activeVersion?: MailTemplateVersion | null;
47
+ versions?: MailTemplateVersion[];
48
+ }
49
+ export interface MailTemplateListResult {
50
+ data: MailTemplate[];
51
+ nextCursor?: string | null;
52
+ }
53
+ export interface MailTemplatePreview {
54
+ subject: string;
55
+ html?: string | null;
56
+ text?: string | null;
57
+ missingVariables: string[];
58
+ }
59
+ export interface MailTemplatePreviewInput {
60
+ data: Record<string, JsonValue>;
61
+ versionId?: string;
62
+ }
63
+ export interface MailTemplateTestSendInput {
64
+ to: MailAddressInput;
65
+ from?: MailAddressInput;
66
+ data: Record<string, JsonValue>;
67
+ versionId?: string;
68
+ }
69
+ export interface MailTemplateTestSendResponse {
70
+ messageId: string;
71
+ status: MailStatus;
72
+ }
73
+ export interface MailSendTemplateInput {
74
+ template: string;
75
+ versionId?: string;
76
+ to: MailAddressInput;
77
+ from?: MailAddressInput;
78
+ cc?: MailAddressInput;
79
+ bcc?: MailAddressInput;
80
+ replyTo?: MailAddressInput;
81
+ data: Record<string, JsonValue>;
82
+ idempotencyKey?: string;
83
+ attachments?: Array<{
84
+ assetId?: string;
85
+ uploadId?: string;
86
+ filename: string;
87
+ contentType?: string;
88
+ }>;
89
+ }
90
+ export interface MailSendTemplateResponse {
91
+ id: string;
92
+ status: MailStatus;
93
+ templateId: string;
94
+ templateVersionId: string;
95
+ idempotencyStatus: MailIdempotencyStatus;
96
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,96 @@
1
+ import type { JsonValue } from './types.js';
2
+ export type MailEventType = 'mail.message.queued' | 'mail.message.sending' | 'mail.message.sent' | 'mail.message.deferred' | 'mail.message.failed' | 'mail.message.bounced' | 'mail.message.suppressed' | 'mail.suppression.created' | 'mail.suppression.deleted' | 'mail.otp.created' | 'mail.otp.sent' | 'mail.otp.verified' | 'mail.otp.failed_attempt' | 'mail.otp.failed' | 'mail.otp.expired' | 'mail.otp.canceled' | 'mail.template.created' | 'mail.template.updated' | 'mail.template.deleted' | 'mail.template.version.created' | 'mail.template.test_sent' | 'mail.domain.created' | 'mail.domain.verified' | 'mail.domain.failed' | 'mail.domain.deleted' | 'mail.webhook.created' | 'mail.webhook.updated' | 'mail.webhook.disabled' | 'mail.webhook.delivery.succeeded' | 'mail.webhook.delivery.failed';
3
+ export interface MailEvent {
4
+ id: string;
5
+ type: MailEventType | string;
6
+ resourceType?: string | null;
7
+ resourceId?: string | null;
8
+ messageId?: string | null;
9
+ payload: JsonValue;
10
+ occurredAt: string;
11
+ createdAt: string;
12
+ }
13
+ export interface MailEventListOptions {
14
+ type?: MailEventType | string;
15
+ resourceType?: string;
16
+ resourceId?: string;
17
+ messageId?: string;
18
+ limit?: number;
19
+ cursor?: string;
20
+ from?: string;
21
+ to?: string;
22
+ }
23
+ export interface MailEventListResult {
24
+ data: MailEvent[];
25
+ nextCursor?: string | null;
26
+ }
27
+ export interface MailTimelineItem {
28
+ type: string;
29
+ label: string;
30
+ createdAt: string;
31
+ metadata?: Record<string, JsonValue>;
32
+ }
33
+ export interface MailWebhook {
34
+ id: string;
35
+ url: string;
36
+ description?: string | null;
37
+ status: 'active' | 'disabled' | 'deleted' | string;
38
+ eventTypes: Array<MailEventType | string>;
39
+ failureCount?: number;
40
+ lastSuccessAt?: string | null;
41
+ lastFailureAt?: string | null;
42
+ createdAt: string;
43
+ }
44
+ export interface MailWebhookCreateInput {
45
+ url: string;
46
+ description?: string;
47
+ eventTypes: Array<MailEventType | string>;
48
+ }
49
+ export interface MailWebhookCreateResponse extends MailWebhook {
50
+ secret: string;
51
+ }
52
+ export interface MailWebhookUpdateInput {
53
+ url?: string;
54
+ description?: string;
55
+ eventTypes?: Array<MailEventType | string>;
56
+ status?: 'active' | 'disabled';
57
+ }
58
+ export interface MailWebhookListOptions {
59
+ limit?: number;
60
+ cursor?: string;
61
+ }
62
+ export interface MailWebhookListResult {
63
+ data: MailWebhook[];
64
+ nextCursor?: string | null;
65
+ }
66
+ export interface MailWebhookDelivery {
67
+ id: string;
68
+ endpointId: string;
69
+ eventId: string;
70
+ status: 'pending' | 'delivering' | 'succeeded' | 'failed' | 'abandoned' | string;
71
+ attemptCount: number;
72
+ nextAttemptAt?: string | null;
73
+ lastAttemptAt?: string | null;
74
+ responseStatus?: number | null;
75
+ responseBodySnippet?: string | null;
76
+ errorMessage?: string | null;
77
+ createdAt: string;
78
+ completedAt?: string | null;
79
+ }
80
+ export interface MailWebhookDeliveryAttempt {
81
+ id: string;
82
+ attemptNumber: number;
83
+ responseStatus?: number | null;
84
+ responseBodySnippet?: string | null;
85
+ errorMessage?: string | null;
86
+ durationMs?: number | null;
87
+ createdAt: string;
88
+ }
89
+ export interface MailWebhookDeliveryDetail extends MailWebhookDelivery {
90
+ attempts: MailWebhookDeliveryAttempt[];
91
+ }
92
+ export interface MailWebhookDeliveryListOptions {
93
+ status?: string;
94
+ limit?: number;
95
+ cursor?: string;
96
+ }
@@ -0,0 +1 @@
1
+ export {};
package/dist/mail.d.ts ADDED
@@ -0,0 +1,115 @@
1
+ import type { StackShift } from './client.js';
2
+ import type { MailLog, MailDomain, MailDomainListResult, MailMessage, MailMessageListOptions, MailMessageListResult, MailSendAttempt, MailSendInput, MailSendResponse } from './types.js';
3
+ import type { MailBounce, MailBounceListOptions, MailBounceListResult, MailSuppression, MailSuppressionCreateInput, MailSuppressionListOptions, MailSuppressionListResult } from './mail-phase4-types.js';
4
+ import type { MailOtpChallenge, MailOtpChallengeListOptions, MailOtpChallengeListResult, MailOtpSendInput, MailOtpSendResponse, MailOtpVerifyInput, MailOtpVerifyResponse } from './mail-otp-types.js';
5
+ import type { MailSendTemplateInput, MailSendTemplateResponse, MailTemplate, MailTemplateCreateInput, MailTemplateDetail, MailTemplateListOptions, MailTemplateListResult, MailTemplatePreview, MailTemplatePreviewInput, MailTemplateTestSendInput, MailTemplateTestSendResponse, MailTemplateUpdateInput, MailTemplateVersion } from './mail-template-types.js';
6
+ import { MailAnalyticsClient, MailBatchClient, MailInboundClient, MailScheduledClient } from './mail-advanced.js';
7
+ export { MailAnalyticsClient, MailBatchClient, MailInboundClient, MailScheduledClient } from './mail-advanced.js';
8
+ import type { MailLimits, MailReputation, MailReputationEventListOptions, MailReputationEventListResult } from './mail-reputation-types.js';
9
+ export { MailEventsClient, MailWebhooksClient, verifyWebhookSignature } from './mail-events-webhooks.js';
10
+ import { MailEventsClient, MailWebhooksClient } from './mail-events-webhooks.js';
11
+ export declare class MailClient {
12
+ private readonly client;
13
+ readonly domains: MailDomainsClient;
14
+ readonly messages: MailMessagesClient;
15
+ readonly suppressions: MailSuppressionsClient;
16
+ readonly bounces: MailBouncesClient;
17
+ readonly otp: MailOtpClient;
18
+ readonly templates: MailTemplatesClient;
19
+ readonly events: MailEventsClient;
20
+ readonly webhooks: MailWebhooksClient;
21
+ readonly limits: MailLimitsClient;
22
+ readonly reputation: MailReputationClient;
23
+ readonly scheduled: MailScheduledClient;
24
+ readonly batch: MailBatchClient;
25
+ readonly inbound: MailInboundClient;
26
+ readonly analytics: MailAnalyticsClient;
27
+ constructor(client: StackShift);
28
+ send(input: MailSendInput): Promise<MailSendResponse>;
29
+ sendTemplate(input: MailSendTemplateInput): Promise<MailSendTemplateResponse>;
30
+ }
31
+ export declare class MailLimitsClient {
32
+ private readonly client;
33
+ constructor(client: StackShift);
34
+ get(): Promise<MailLimits>;
35
+ }
36
+ export declare class MailReputationClient {
37
+ private readonly client;
38
+ readonly events: MailReputationEventsClient;
39
+ constructor(client: StackShift);
40
+ get(): Promise<MailReputation>;
41
+ }
42
+ export declare class MailReputationEventsClient {
43
+ private readonly client;
44
+ constructor(client: StackShift);
45
+ list(options?: MailReputationEventListOptions): Promise<MailReputationEventListResult>;
46
+ }
47
+ export declare class MailTemplatesClient {
48
+ private readonly client;
49
+ constructor(client: StackShift);
50
+ create(input: MailTemplateCreateInput): Promise<MailTemplate>;
51
+ list(options?: MailTemplateListOptions): Promise<MailTemplateListResult>;
52
+ get(templateIdOrSlug: string): Promise<MailTemplateDetail>;
53
+ update(templateId: string, input: MailTemplateUpdateInput): Promise<MailTemplate>;
54
+ delete(templateId: string): Promise<void>;
55
+ versions(templateId: string): Promise<{
56
+ data: MailTemplateVersion[];
57
+ }>;
58
+ getVersion(templateId: string, versionId: string): Promise<MailTemplateVersion>;
59
+ activateVersion(templateId: string, versionId: string): Promise<MailTemplate>;
60
+ preview(templateId: string, input: MailTemplatePreviewInput): Promise<MailTemplatePreview>;
61
+ testSend(templateId: string, input: MailTemplateTestSendInput): Promise<MailTemplateTestSendResponse>;
62
+ }
63
+ export declare class MailDomainsClient {
64
+ private readonly client;
65
+ constructor(client: StackShift);
66
+ create(domain: string): Promise<MailDomain>;
67
+ list(): Promise<MailDomainListResult>;
68
+ get(domainId: string): Promise<MailDomain>;
69
+ verify(domainId: string): Promise<MailDomain>;
70
+ delete(domainId: string): Promise<void>;
71
+ }
72
+ export declare class MailMessagesClient {
73
+ private readonly client;
74
+ constructor(client: StackShift);
75
+ list(options?: MailMessageListOptions): Promise<MailMessageListResult>;
76
+ get(messageId: string): Promise<MailMessage>;
77
+ attempts(messageId: string): Promise<{
78
+ data: MailSendAttempt[];
79
+ }>;
80
+ logs(messageId: string): Promise<{
81
+ data: MailLog[];
82
+ }>;
83
+ bounces(messageId: string): Promise<{
84
+ data: MailBounce[];
85
+ }>;
86
+ timeline(messageId: string): Promise<{
87
+ data: import("./mail-webhook-types.js").MailTimelineItem[];
88
+ }>;
89
+ }
90
+ export declare class MailSuppressionsClient {
91
+ private readonly client;
92
+ constructor(client: StackShift);
93
+ list(options?: MailSuppressionListOptions): Promise<MailSuppressionListResult>;
94
+ create(input: MailSuppressionCreateInput): Promise<MailSuppression>;
95
+ delete(suppressionId: string): Promise<void>;
96
+ }
97
+ export declare class MailBouncesClient {
98
+ private readonly client;
99
+ constructor(client: StackShift);
100
+ list(options?: MailBounceListOptions): Promise<MailBounceListResult>;
101
+ }
102
+ export declare class MailOtpClient {
103
+ private readonly client;
104
+ readonly challenges: MailOtpChallengesClient;
105
+ constructor(client: StackShift);
106
+ send(input: MailOtpSendInput): Promise<MailOtpSendResponse>;
107
+ verify(input: MailOtpVerifyInput): Promise<MailOtpVerifyResponse>;
108
+ }
109
+ export declare class MailOtpChallengesClient {
110
+ private readonly client;
111
+ constructor(client: StackShift);
112
+ list(options?: MailOtpChallengeListOptions): Promise<MailOtpChallengeListResult>;
113
+ get(challengeId: string): Promise<MailOtpChallenge>;
114
+ cancel(challengeId: string): Promise<MailOtpChallenge>;
115
+ }
package/dist/mail.js ADDED
@@ -0,0 +1,293 @@
1
+ import { MailAnalyticsClient, MailBatchClient, MailInboundClient, MailScheduledClient } from './mail-advanced.js';
2
+ export { MailAnalyticsClient, MailBatchClient, MailInboundClient, MailScheduledClient } from './mail-advanced.js';
3
+ export { MailEventsClient, MailWebhooksClient, verifyWebhookSignature } from './mail-events-webhooks.js';
4
+ import { MailEventsClient, MailWebhooksClient, timeline } from './mail-events-webhooks.js';
5
+ export class MailClient {
6
+ client;
7
+ domains;
8
+ messages;
9
+ suppressions;
10
+ bounces;
11
+ otp;
12
+ templates;
13
+ events;
14
+ webhooks;
15
+ limits;
16
+ reputation;
17
+ scheduled;
18
+ batch;
19
+ inbound;
20
+ analytics;
21
+ constructor(client) {
22
+ this.client = client;
23
+ this.domains = new MailDomainsClient(client);
24
+ this.messages = new MailMessagesClient(client);
25
+ this.suppressions = new MailSuppressionsClient(client);
26
+ this.bounces = new MailBouncesClient(client);
27
+ this.otp = new MailOtpClient(client);
28
+ this.templates = new MailTemplatesClient(client);
29
+ this.events = new MailEventsClient(client);
30
+ this.webhooks = new MailWebhooksClient(client);
31
+ this.limits = new MailLimitsClient(client);
32
+ this.reputation = new MailReputationClient(client);
33
+ this.scheduled = new MailScheduledClient(client);
34
+ this.batch = new MailBatchClient(client);
35
+ this.inbound = new MailInboundClient(client);
36
+ this.analytics = new MailAnalyticsClient(client);
37
+ }
38
+ send(input) {
39
+ return this.client.mailRequest('/mail/send', {
40
+ method: 'POST',
41
+ body: input,
42
+ });
43
+ }
44
+ sendTemplate(input) {
45
+ return this.client.mailRequest('/mail/send-template', {
46
+ method: 'POST',
47
+ body: input,
48
+ });
49
+ }
50
+ }
51
+ export class MailLimitsClient {
52
+ client;
53
+ constructor(client) {
54
+ this.client = client;
55
+ }
56
+ get() {
57
+ return this.client.mailRequest('/mail/limits');
58
+ }
59
+ }
60
+ export class MailReputationClient {
61
+ client;
62
+ events;
63
+ constructor(client) {
64
+ this.client = client;
65
+ this.events = new MailReputationEventsClient(client);
66
+ }
67
+ get() {
68
+ return this.client.mailRequest('/mail/reputation');
69
+ }
70
+ }
71
+ export class MailReputationEventsClient {
72
+ client;
73
+ constructor(client) {
74
+ this.client = client;
75
+ }
76
+ list(options = {}) {
77
+ const query = new URLSearchParams();
78
+ append(query, 'severity', options.severity);
79
+ append(query, 'type', options.type);
80
+ append(query, 'limit', options.limit);
81
+ append(query, 'cursor', options.cursor);
82
+ const suffix = query.toString();
83
+ return this.client.mailRequest(`/mail/reputation/events${suffix ? `?${suffix}` : ''}`);
84
+ }
85
+ }
86
+ export class MailTemplatesClient {
87
+ client;
88
+ constructor(client) {
89
+ this.client = client;
90
+ }
91
+ create(input) {
92
+ return this.client.mailRequest('/mail/templates', {
93
+ method: 'POST',
94
+ body: input,
95
+ });
96
+ }
97
+ list(options = {}) {
98
+ const query = new URLSearchParams();
99
+ append(query, 'status', options.status);
100
+ append(query, 'limit', options.limit);
101
+ append(query, 'cursor', options.cursor);
102
+ append(query, 'search', options.search);
103
+ const suffix = query.toString();
104
+ return this.client.mailRequest(`/mail/templates${suffix ? `?${suffix}` : ''}`);
105
+ }
106
+ get(templateIdOrSlug) {
107
+ return this.client.mailRequest(`/mail/templates/${encodeURIComponent(templateIdOrSlug)}`);
108
+ }
109
+ update(templateId, input) {
110
+ return this.client.mailRequest(`/mail/templates/${encodeURIComponent(templateId)}`, {
111
+ method: 'PATCH',
112
+ body: input,
113
+ });
114
+ }
115
+ delete(templateId) {
116
+ return this.client.mailRequest(`/mail/templates/${encodeURIComponent(templateId)}`, {
117
+ method: 'DELETE',
118
+ });
119
+ }
120
+ versions(templateId) {
121
+ return this.client.mailRequest(`/mail/templates/${encodeURIComponent(templateId)}/versions`);
122
+ }
123
+ getVersion(templateId, versionId) {
124
+ return this.client.mailRequest(`/mail/templates/${encodeURIComponent(templateId)}/versions/${encodeURIComponent(versionId)}`);
125
+ }
126
+ activateVersion(templateId, versionId) {
127
+ return this.client.mailRequest(`/mail/templates/${encodeURIComponent(templateId)}/versions/${encodeURIComponent(versionId)}/activate`, {
128
+ method: 'POST',
129
+ });
130
+ }
131
+ preview(templateId, input) {
132
+ return this.client.mailRequest(`/mail/templates/${encodeURIComponent(templateId)}/preview`, {
133
+ method: 'POST',
134
+ body: input,
135
+ });
136
+ }
137
+ testSend(templateId, input) {
138
+ return this.client.mailRequest(`/mail/templates/${encodeURIComponent(templateId)}/test-send`, {
139
+ method: 'POST',
140
+ body: input,
141
+ });
142
+ }
143
+ }
144
+ export class MailDomainsClient {
145
+ client;
146
+ constructor(client) {
147
+ this.client = client;
148
+ }
149
+ create(domain) {
150
+ return this.client.mailRequest('/mail/domains', {
151
+ method: 'POST',
152
+ body: { domain },
153
+ });
154
+ }
155
+ list() {
156
+ return this.client.mailRequest('/mail/domains');
157
+ }
158
+ get(domainId) {
159
+ return this.client.mailRequest(`/mail/domains/${encodeURIComponent(domainId)}`);
160
+ }
161
+ verify(domainId) {
162
+ return this.client.mailRequest(`/mail/domains/${encodeURIComponent(domainId)}/verify`, {
163
+ method: 'POST',
164
+ });
165
+ }
166
+ delete(domainId) {
167
+ return this.client.mailRequest(`/mail/domains/${encodeURIComponent(domainId)}`, {
168
+ method: 'DELETE',
169
+ });
170
+ }
171
+ }
172
+ export class MailMessagesClient {
173
+ client;
174
+ constructor(client) {
175
+ this.client = client;
176
+ }
177
+ list(options = {}) {
178
+ const query = new URLSearchParams();
179
+ append(query, 'status', options.status);
180
+ append(query, 'limit', options.limit);
181
+ append(query, 'cursor', options.cursor);
182
+ append(query, 'to', options.to);
183
+ append(query, 'from', options.from);
184
+ const suffix = query.toString();
185
+ return this.client.mailRequest(`/mail/messages${suffix ? `?${suffix}` : ''}`);
186
+ }
187
+ get(messageId) {
188
+ return this.client.mailRequest(`/mail/messages/${encodeURIComponent(messageId)}`);
189
+ }
190
+ attempts(messageId) {
191
+ return this.client.mailRequest(`/mail/messages/${encodeURIComponent(messageId)}/attempts`);
192
+ }
193
+ logs(messageId) {
194
+ return this.client.mailRequest(`/mail/messages/${encodeURIComponent(messageId)}/logs`);
195
+ }
196
+ bounces(messageId) {
197
+ return this.client.mailRequest(`/mail/messages/${encodeURIComponent(messageId)}/bounces`);
198
+ }
199
+ timeline(messageId) {
200
+ return timeline(this.client, messageId);
201
+ }
202
+ }
203
+ export class MailSuppressionsClient {
204
+ client;
205
+ constructor(client) {
206
+ this.client = client;
207
+ }
208
+ list(options = {}) {
209
+ const query = new URLSearchParams();
210
+ append(query, 'email', options.email);
211
+ append(query, 'reason', options.reason);
212
+ append(query, 'limit', options.limit);
213
+ append(query, 'cursor', options.cursor);
214
+ const suffix = query.toString();
215
+ return this.client.mailRequest(`/mail/suppressions${suffix ? `?${suffix}` : ''}`);
216
+ }
217
+ create(input) {
218
+ return this.client.mailRequest('/mail/suppressions', {
219
+ method: 'POST',
220
+ body: input,
221
+ });
222
+ }
223
+ delete(suppressionId) {
224
+ return this.client.mailRequest(`/mail/suppressions/${encodeURIComponent(suppressionId)}`, {
225
+ method: 'DELETE',
226
+ });
227
+ }
228
+ }
229
+ export class MailBouncesClient {
230
+ client;
231
+ constructor(client) {
232
+ this.client = client;
233
+ }
234
+ list(options = {}) {
235
+ const query = new URLSearchParams();
236
+ append(query, 'email', options.email);
237
+ append(query, 'type', options.type);
238
+ append(query, 'messageId', options.messageId);
239
+ append(query, 'limit', options.limit);
240
+ append(query, 'cursor', options.cursor);
241
+ const suffix = query.toString();
242
+ return this.client.mailRequest(`/mail/bounces${suffix ? `?${suffix}` : ''}`);
243
+ }
244
+ }
245
+ export class MailOtpClient {
246
+ client;
247
+ challenges;
248
+ constructor(client) {
249
+ this.client = client;
250
+ this.challenges = new MailOtpChallengesClient(client);
251
+ }
252
+ send(input) {
253
+ return this.client.mailRequest('/mail/otp/send', {
254
+ method: 'POST',
255
+ body: input,
256
+ });
257
+ }
258
+ verify(input) {
259
+ return this.client.mailRequest('/mail/otp/verify', {
260
+ method: 'POST',
261
+ body: input,
262
+ });
263
+ }
264
+ }
265
+ export class MailOtpChallengesClient {
266
+ client;
267
+ constructor(client) {
268
+ this.client = client;
269
+ }
270
+ list(options = {}) {
271
+ const query = new URLSearchParams();
272
+ append(query, 'to', options.to);
273
+ append(query, 'purpose', options.purpose);
274
+ append(query, 'status', options.status);
275
+ append(query, 'limit', options.limit);
276
+ append(query, 'cursor', options.cursor);
277
+ const suffix = query.toString();
278
+ return this.client.mailRequest(`/mail/otp/challenges${suffix ? `?${suffix}` : ''}`);
279
+ }
280
+ get(challengeId) {
281
+ return this.client.mailRequest(`/mail/otp/challenges/${encodeURIComponent(challengeId)}`);
282
+ }
283
+ cancel(challengeId) {
284
+ return this.client.mailRequest(`/mail/otp/challenges/${encodeURIComponent(challengeId)}/cancel`, {
285
+ method: 'POST',
286
+ });
287
+ }
288
+ }
289
+ function append(target, key, value) {
290
+ if (value !== undefined && value !== null && value !== '') {
291
+ target.append(key, String(value));
292
+ }
293
+ }
@@ -1,5 +1,5 @@
1
- import type { StackShift } from './client';
2
- import type { Project, ProjectListOptions } from './types';
1
+ import type { StackShift } from './client.js';
2
+ import type { Project, ProjectListOptions } from './types.js';
3
3
  export declare class ProjectsClient {
4
4
  private readonly client;
5
5
  constructor(client: StackShift);