@zyphr-dev/node-sdk 0.1.31 → 0.1.33
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/dist/index.cjs +2204 -157
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2214 -145
- package/dist/index.d.ts +2214 -145
- package/dist/index.js +2066 -157
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +28 -0
- package/src/client.ts +5 -0
- package/src/src/apis/AuthOrganizationsApi.ts +823 -0
- package/src/src/apis/AuthUserProfileApi.ts +62 -0
- package/src/src/apis/DomainsApi.ts +248 -0
- package/src/src/apis/MuseApi.ts +531 -0
- package/src/src/apis/index.ts +2 -0
- package/src/src/models/AddOrganizationMemberRequest.ts +74 -0
- package/src/src/models/CreateOrganizationRequest.ts +82 -0
- package/src/src/models/DeleteDomainResponse.ts +90 -0
- package/src/src/models/DeleteDomainResponseData.ts +75 -0
- package/src/src/models/DomainResponse.ts +47 -1
- package/src/src/models/GetDomain200Response.ts +88 -0
- package/src/src/models/GetDomain200ResponseMeta.ts +65 -0
- package/src/src/models/LoginRequest.ts +12 -0
- package/src/src/models/Organization.ts +137 -0
- package/src/src/models/OrganizationListResponse.ts +90 -0
- package/src/src/models/OrganizationListResponseMeta.ts +73 -0
- package/src/src/models/OrganizationMembersListResponse.ts +90 -0
- package/src/src/models/OrganizationMembership.ts +119 -0
- package/src/src/models/OrganizationMembershipResponse.ts +90 -0
- package/src/src/models/OrganizationMembershipWithUser.ts +135 -0
- package/src/src/models/OrganizationResponse.ts +90 -0
- package/src/src/models/RegisterRequest.ts +23 -0
- package/src/src/models/SwitchOrganizationRequest.ts +75 -0
- package/src/src/models/SwitchOrganizationResponse.ts +90 -0
- package/src/src/models/SwitchOrganizationResponseData.ts +99 -0
- package/src/src/models/SwitchOrganizationResponseDataTokens.ts +103 -0
- package/src/src/models/SwitchOrganizationResponseDataUser.ts +73 -0
- package/src/src/models/UpdateOrganizationMemberRoleRequest.ts +66 -0
- package/src/src/models/UpdateOrganizationRequest.ts +81 -0
- package/src/src/models/V1MuseSubjectsSuggestPostRequest.ts +105 -0
- package/src/src/models/VerificationStatusResponse.ts +90 -0
- package/src/src/models/VerificationStatusResponseData.ts +148 -0
- package/src/src/models/VerifyDomainResponse.ts +90 -0
- package/src/src/models/VerifyDomainResponseData.ts +103 -0
- package/src/src/models/index.ts +26 -0
|
@@ -31,6 +31,10 @@ import {
|
|
|
31
31
|
UpdateEndUserRequestToJSON,
|
|
32
32
|
} from '../models/index';
|
|
33
33
|
|
|
34
|
+
export interface AuthUserProfileApiDeleteEndUserByApplicationRequest {
|
|
35
|
+
userId: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
export interface AuthUserProfileApiUpdateEndUserOperationRequest {
|
|
35
39
|
updateEndUserRequest: UpdateEndUserRequest;
|
|
36
40
|
}
|
|
@@ -57,6 +61,22 @@ export interface AuthUserProfileApiInterface {
|
|
|
57
61
|
*/
|
|
58
62
|
deleteEndUser(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EndUserDeleteResponse>;
|
|
59
63
|
|
|
64
|
+
/**
|
|
65
|
+
* App-credentialed soft-delete for an end user, scoped to the test environment only. Live-mode credentials receive 403 — this is the intentional safety guard against a misconfigured CI runner nuking production users. Mirrors the self-service `DELETE /auth/users/me` flow: revokes all sessions, soft-deletes the row (status=\'deleted\'), and emits a `user.deleted` webhook with `method=\'application_admin\'`. The audit log row survives (no FK to end_users), so org-history queries still resolve. Intended for smoke / test-fixture cleanup. Production deletes should continue to use `DELETE /auth/users/me` from the end-user\'s own session or the dashboard.
|
|
66
|
+
* @summary Delete an end user (test environment only)
|
|
67
|
+
* @param {string} userId
|
|
68
|
+
* @param {*} [options] Override http request option.
|
|
69
|
+
* @throws {RequiredError}
|
|
70
|
+
* @memberof AuthUserProfileApiInterface
|
|
71
|
+
*/
|
|
72
|
+
deleteEndUserByApplicationRaw(requestParameters: AuthUserProfileApiDeleteEndUserByApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* App-credentialed soft-delete for an end user, scoped to the test environment only. Live-mode credentials receive 403 — this is the intentional safety guard against a misconfigured CI runner nuking production users. Mirrors the self-service `DELETE /auth/users/me` flow: revokes all sessions, soft-deletes the row (status=\'deleted\'), and emits a `user.deleted` webhook with `method=\'application_admin\'`. The audit log row survives (no FK to end_users), so org-history queries still resolve. Intended for smoke / test-fixture cleanup. Production deletes should continue to use `DELETE /auth/users/me` from the end-user\'s own session or the dashboard.
|
|
76
|
+
* Delete an end user (test environment only)
|
|
77
|
+
*/
|
|
78
|
+
deleteEndUserByApplication(userId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
79
|
+
|
|
60
80
|
/**
|
|
61
81
|
* Retrieve the profile of the currently authenticated end user.
|
|
62
82
|
* @summary Get current end user profile
|
|
@@ -135,6 +155,48 @@ export class AuthUserProfileApi extends runtime.BaseAPI implements AuthUserProfi
|
|
|
135
155
|
return await response.value();
|
|
136
156
|
}
|
|
137
157
|
|
|
158
|
+
/**
|
|
159
|
+
* App-credentialed soft-delete for an end user, scoped to the test environment only. Live-mode credentials receive 403 — this is the intentional safety guard against a misconfigured CI runner nuking production users. Mirrors the self-service `DELETE /auth/users/me` flow: revokes all sessions, soft-deletes the row (status=\'deleted\'), and emits a `user.deleted` webhook with `method=\'application_admin\'`. The audit log row survives (no FK to end_users), so org-history queries still resolve. Intended for smoke / test-fixture cleanup. Production deletes should continue to use `DELETE /auth/users/me` from the end-user\'s own session or the dashboard.
|
|
160
|
+
* Delete an end user (test environment only)
|
|
161
|
+
*/
|
|
162
|
+
async deleteEndUserByApplicationRaw(requestParameters: AuthUserProfileApiDeleteEndUserByApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
163
|
+
if (requestParameters['userId'] == null) {
|
|
164
|
+
throw new runtime.RequiredError(
|
|
165
|
+
'userId',
|
|
166
|
+
'Required parameter "userId" was null or undefined when calling deleteEndUserByApplication().'
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const queryParameters: any = {};
|
|
171
|
+
|
|
172
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
173
|
+
|
|
174
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
175
|
+
headerParameters["X-Application-Secret"] = await this.configuration.apiKey("X-Application-Secret"); // ApplicationSecret authentication
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
179
|
+
headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key"); // ApplicationPublicKey authentication
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
const response = await this.request({
|
|
183
|
+
path: `/auth/users/{user_id}`.replace(`{${"user_id"}}`, encodeURIComponent(String(requestParameters['userId']))),
|
|
184
|
+
method: 'DELETE',
|
|
185
|
+
headers: headerParameters,
|
|
186
|
+
query: queryParameters,
|
|
187
|
+
}, initOverrides);
|
|
188
|
+
|
|
189
|
+
return new runtime.VoidApiResponse(response);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* App-credentialed soft-delete for an end user, scoped to the test environment only. Live-mode credentials receive 403 — this is the intentional safety guard against a misconfigured CI runner nuking production users. Mirrors the self-service `DELETE /auth/users/me` flow: revokes all sessions, soft-deletes the row (status=\'deleted\'), and emits a `user.deleted` webhook with `method=\'application_admin\'`. The audit log row survives (no FK to end_users), so org-history queries still resolve. Intended for smoke / test-fixture cleanup. Production deletes should continue to use `DELETE /auth/users/me` from the end-user\'s own session or the dashboard.
|
|
194
|
+
* Delete an end user (test environment only)
|
|
195
|
+
*/
|
|
196
|
+
async deleteEndUserByApplication(userId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
197
|
+
await this.deleteEndUserByApplicationRaw({ userId: userId }, initOverrides);
|
|
198
|
+
}
|
|
199
|
+
|
|
138
200
|
/**
|
|
139
201
|
* Retrieve the profile of the currently authenticated end user.
|
|
140
202
|
* Get current end user profile
|
|
@@ -18,7 +18,11 @@ import type {
|
|
|
18
18
|
AddDomain200Response,
|
|
19
19
|
AddDomainRequest,
|
|
20
20
|
ApiError,
|
|
21
|
+
DeleteDomainResponse,
|
|
21
22
|
DomainListResponse,
|
|
23
|
+
GetDomain200Response,
|
|
24
|
+
VerificationStatusResponse,
|
|
25
|
+
VerifyDomainResponse,
|
|
22
26
|
} from '../models/index';
|
|
23
27
|
import {
|
|
24
28
|
AddDomain200ResponseFromJSON,
|
|
@@ -27,14 +31,38 @@ import {
|
|
|
27
31
|
AddDomainRequestToJSON,
|
|
28
32
|
ApiErrorFromJSON,
|
|
29
33
|
ApiErrorToJSON,
|
|
34
|
+
DeleteDomainResponseFromJSON,
|
|
35
|
+
DeleteDomainResponseToJSON,
|
|
30
36
|
DomainListResponseFromJSON,
|
|
31
37
|
DomainListResponseToJSON,
|
|
38
|
+
GetDomain200ResponseFromJSON,
|
|
39
|
+
GetDomain200ResponseToJSON,
|
|
40
|
+
VerificationStatusResponseFromJSON,
|
|
41
|
+
VerificationStatusResponseToJSON,
|
|
42
|
+
VerifyDomainResponseFromJSON,
|
|
43
|
+
VerifyDomainResponseToJSON,
|
|
32
44
|
} from '../models/index';
|
|
33
45
|
|
|
34
46
|
export interface DomainsApiAddDomainOperationRequest {
|
|
35
47
|
addDomainRequest: AddDomainRequest;
|
|
36
48
|
}
|
|
37
49
|
|
|
50
|
+
export interface DomainsApiDeleteDomainRequest {
|
|
51
|
+
id: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface DomainsApiGetDomainRequest {
|
|
55
|
+
id: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface DomainsApiGetDomainVerificationStatusRequest {
|
|
59
|
+
id: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface DomainsApiVerifyDomainRequest {
|
|
63
|
+
id: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
38
66
|
/**
|
|
39
67
|
* DomainsApi - interface
|
|
40
68
|
*
|
|
@@ -58,6 +86,54 @@ export interface DomainsApiInterface {
|
|
|
58
86
|
*/
|
|
59
87
|
addDomain(addDomainRequest: AddDomainRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AddDomain200Response>;
|
|
60
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Remove a sending domain from the project. The domain is also detached from any SES identity that was provisioned for it. Returns 409 if the domain is still referenced by other resources (templates, scheduled sends, etc.) — those must be removed first.
|
|
91
|
+
* @summary Remove a sending domain
|
|
92
|
+
* @param {string} id
|
|
93
|
+
* @param {*} [options] Override http request option.
|
|
94
|
+
* @throws {RequiredError}
|
|
95
|
+
* @memberof DomainsApiInterface
|
|
96
|
+
*/
|
|
97
|
+
deleteDomainRaw(requestParameters: DomainsApiDeleteDomainRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DeleteDomainResponse>>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Remove a sending domain from the project. The domain is also detached from any SES identity that was provisioned for it. Returns 409 if the domain is still referenced by other resources (templates, scheduled sends, etc.) — those must be removed first.
|
|
101
|
+
* Remove a sending domain
|
|
102
|
+
*/
|
|
103
|
+
deleteDomain(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DeleteDomainResponse>;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Retrieve a single sending domain by ID, including DNS records and verification counters.
|
|
107
|
+
* @summary Get a sending domain
|
|
108
|
+
* @param {string} id
|
|
109
|
+
* @param {*} [options] Override http request option.
|
|
110
|
+
* @throws {RequiredError}
|
|
111
|
+
* @memberof DomainsApiInterface
|
|
112
|
+
*/
|
|
113
|
+
getDomainRaw(requestParameters: DomainsApiGetDomainRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetDomain200Response>>;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Retrieve a single sending domain by ID, including DNS records and verification counters.
|
|
117
|
+
* Get a sending domain
|
|
118
|
+
*/
|
|
119
|
+
getDomain(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetDomain200Response>;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Returns the current verification status with per-record `verified` flags and aggregate counters. Useful when polling for terminal status from an AI agent (the recommended pattern is to subscribe to the `domain.verified` webhook event instead — see sc-5444).
|
|
123
|
+
* @summary Get domain verification status
|
|
124
|
+
* @param {string} id Domain ID
|
|
125
|
+
* @param {*} [options] Override http request option.
|
|
126
|
+
* @throws {RequiredError}
|
|
127
|
+
* @memberof DomainsApiInterface
|
|
128
|
+
*/
|
|
129
|
+
getDomainVerificationStatusRaw(requestParameters: DomainsApiGetDomainVerificationStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VerificationStatusResponse>>;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Returns the current verification status with per-record `verified` flags and aggregate counters. Useful when polling for terminal status from an AI agent (the recommended pattern is to subscribe to the `domain.verified` webhook event instead — see sc-5444).
|
|
133
|
+
* Get domain verification status
|
|
134
|
+
*/
|
|
135
|
+
getDomainVerificationStatus(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VerificationStatusResponse>;
|
|
136
|
+
|
|
61
137
|
/**
|
|
62
138
|
* List sending domains on the current project, with verification status and DNS records.
|
|
63
139
|
* @summary List sending domains
|
|
@@ -73,6 +149,22 @@ export interface DomainsApiInterface {
|
|
|
73
149
|
*/
|
|
74
150
|
listDomains(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DomainListResponse>;
|
|
75
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Queue an asynchronous DNS verification check. Returns immediately with a `job_id`. Poll `GET /v1/domains/{id}/verification-status` (or the higher-level `GET /v1/domains/{id}`) for the result, or subscribe to the `domain.verified` webhook event when sc-5444 ships. Returns 409 if a verification is already in progress for this domain (within the last 2 minutes).
|
|
154
|
+
* @summary Trigger domain verification
|
|
155
|
+
* @param {string} id
|
|
156
|
+
* @param {*} [options] Override http request option.
|
|
157
|
+
* @throws {RequiredError}
|
|
158
|
+
* @memberof DomainsApiInterface
|
|
159
|
+
*/
|
|
160
|
+
verifyDomainRaw(requestParameters: DomainsApiVerifyDomainRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VerifyDomainResponse>>;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Queue an asynchronous DNS verification check. Returns immediately with a `job_id`. Poll `GET /v1/domains/{id}/verification-status` (or the higher-level `GET /v1/domains/{id}`) for the result, or subscribe to the `domain.verified` webhook event when sc-5444 ships. Returns 409 if a verification is already in progress for this domain (within the last 2 minutes).
|
|
164
|
+
* Trigger domain verification
|
|
165
|
+
*/
|
|
166
|
+
verifyDomain(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VerifyDomainResponse>;
|
|
167
|
+
|
|
76
168
|
}
|
|
77
169
|
|
|
78
170
|
/**
|
|
@@ -122,6 +214,123 @@ export class DomainsApi extends runtime.BaseAPI implements DomainsApiInterface {
|
|
|
122
214
|
return await response.value();
|
|
123
215
|
}
|
|
124
216
|
|
|
217
|
+
/**
|
|
218
|
+
* Remove a sending domain from the project. The domain is also detached from any SES identity that was provisioned for it. Returns 409 if the domain is still referenced by other resources (templates, scheduled sends, etc.) — those must be removed first.
|
|
219
|
+
* Remove a sending domain
|
|
220
|
+
*/
|
|
221
|
+
async deleteDomainRaw(requestParameters: DomainsApiDeleteDomainRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DeleteDomainResponse>> {
|
|
222
|
+
if (requestParameters['id'] == null) {
|
|
223
|
+
throw new runtime.RequiredError(
|
|
224
|
+
'id',
|
|
225
|
+
'Required parameter "id" was null or undefined when calling deleteDomain().'
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const queryParameters: any = {};
|
|
230
|
+
|
|
231
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
232
|
+
|
|
233
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
234
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
const response = await this.request({
|
|
238
|
+
path: `/domains/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
239
|
+
method: 'DELETE',
|
|
240
|
+
headers: headerParameters,
|
|
241
|
+
query: queryParameters,
|
|
242
|
+
}, initOverrides);
|
|
243
|
+
|
|
244
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => DeleteDomainResponseFromJSON(jsonValue));
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Remove a sending domain from the project. The domain is also detached from any SES identity that was provisioned for it. Returns 409 if the domain is still referenced by other resources (templates, scheduled sends, etc.) — those must be removed first.
|
|
249
|
+
* Remove a sending domain
|
|
250
|
+
*/
|
|
251
|
+
async deleteDomain(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DeleteDomainResponse> {
|
|
252
|
+
const response = await this.deleteDomainRaw({ id: id }, initOverrides);
|
|
253
|
+
return await response.value();
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Retrieve a single sending domain by ID, including DNS records and verification counters.
|
|
258
|
+
* Get a sending domain
|
|
259
|
+
*/
|
|
260
|
+
async getDomainRaw(requestParameters: DomainsApiGetDomainRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetDomain200Response>> {
|
|
261
|
+
if (requestParameters['id'] == null) {
|
|
262
|
+
throw new runtime.RequiredError(
|
|
263
|
+
'id',
|
|
264
|
+
'Required parameter "id" was null or undefined when calling getDomain().'
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
const queryParameters: any = {};
|
|
269
|
+
|
|
270
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
271
|
+
|
|
272
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
273
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const response = await this.request({
|
|
277
|
+
path: `/domains/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
278
|
+
method: 'GET',
|
|
279
|
+
headers: headerParameters,
|
|
280
|
+
query: queryParameters,
|
|
281
|
+
}, initOverrides);
|
|
282
|
+
|
|
283
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GetDomain200ResponseFromJSON(jsonValue));
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Retrieve a single sending domain by ID, including DNS records and verification counters.
|
|
288
|
+
* Get a sending domain
|
|
289
|
+
*/
|
|
290
|
+
async getDomain(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetDomain200Response> {
|
|
291
|
+
const response = await this.getDomainRaw({ id: id }, initOverrides);
|
|
292
|
+
return await response.value();
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Returns the current verification status with per-record `verified` flags and aggregate counters. Useful when polling for terminal status from an AI agent (the recommended pattern is to subscribe to the `domain.verified` webhook event instead — see sc-5444).
|
|
297
|
+
* Get domain verification status
|
|
298
|
+
*/
|
|
299
|
+
async getDomainVerificationStatusRaw(requestParameters: DomainsApiGetDomainVerificationStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VerificationStatusResponse>> {
|
|
300
|
+
if (requestParameters['id'] == null) {
|
|
301
|
+
throw new runtime.RequiredError(
|
|
302
|
+
'id',
|
|
303
|
+
'Required parameter "id" was null or undefined when calling getDomainVerificationStatus().'
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
const queryParameters: any = {};
|
|
308
|
+
|
|
309
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
310
|
+
|
|
311
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
312
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const response = await this.request({
|
|
316
|
+
path: `/domains/{id}/verification-status`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
317
|
+
method: 'GET',
|
|
318
|
+
headers: headerParameters,
|
|
319
|
+
query: queryParameters,
|
|
320
|
+
}, initOverrides);
|
|
321
|
+
|
|
322
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => VerificationStatusResponseFromJSON(jsonValue));
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Returns the current verification status with per-record `verified` flags and aggregate counters. Useful when polling for terminal status from an AI agent (the recommended pattern is to subscribe to the `domain.verified` webhook event instead — see sc-5444).
|
|
327
|
+
* Get domain verification status
|
|
328
|
+
*/
|
|
329
|
+
async getDomainVerificationStatus(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VerificationStatusResponse> {
|
|
330
|
+
const response = await this.getDomainVerificationStatusRaw({ id: id }, initOverrides);
|
|
331
|
+
return await response.value();
|
|
332
|
+
}
|
|
333
|
+
|
|
125
334
|
/**
|
|
126
335
|
* List sending domains on the current project, with verification status and DNS records.
|
|
127
336
|
* List sending domains
|
|
@@ -154,4 +363,43 @@ export class DomainsApi extends runtime.BaseAPI implements DomainsApiInterface {
|
|
|
154
363
|
return await response.value();
|
|
155
364
|
}
|
|
156
365
|
|
|
366
|
+
/**
|
|
367
|
+
* Queue an asynchronous DNS verification check. Returns immediately with a `job_id`. Poll `GET /v1/domains/{id}/verification-status` (or the higher-level `GET /v1/domains/{id}`) for the result, or subscribe to the `domain.verified` webhook event when sc-5444 ships. Returns 409 if a verification is already in progress for this domain (within the last 2 minutes).
|
|
368
|
+
* Trigger domain verification
|
|
369
|
+
*/
|
|
370
|
+
async verifyDomainRaw(requestParameters: DomainsApiVerifyDomainRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VerifyDomainResponse>> {
|
|
371
|
+
if (requestParameters['id'] == null) {
|
|
372
|
+
throw new runtime.RequiredError(
|
|
373
|
+
'id',
|
|
374
|
+
'Required parameter "id" was null or undefined when calling verifyDomain().'
|
|
375
|
+
);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
const queryParameters: any = {};
|
|
379
|
+
|
|
380
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
381
|
+
|
|
382
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
383
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
const response = await this.request({
|
|
387
|
+
path: `/domains/{id}/verify`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
388
|
+
method: 'POST',
|
|
389
|
+
headers: headerParameters,
|
|
390
|
+
query: queryParameters,
|
|
391
|
+
}, initOverrides);
|
|
392
|
+
|
|
393
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => VerifyDomainResponseFromJSON(jsonValue));
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Queue an asynchronous DNS verification check. Returns immediately with a `job_id`. Poll `GET /v1/domains/{id}/verification-status` (or the higher-level `GET /v1/domains/{id}`) for the result, or subscribe to the `domain.verified` webhook event when sc-5444 ships. Returns 409 if a verification is already in progress for this domain (within the last 2 minutes).
|
|
398
|
+
* Trigger domain verification
|
|
399
|
+
*/
|
|
400
|
+
async verifyDomain(id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VerifyDomainResponse> {
|
|
401
|
+
const response = await this.verifyDomainRaw({ id: id }, initOverrides);
|
|
402
|
+
return await response.value();
|
|
403
|
+
}
|
|
404
|
+
|
|
157
405
|
}
|