@zyphr-dev/node-sdk 0.1.33 → 0.1.35
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 +975 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1025 -42
- package/dist/index.d.ts +1025 -42
- package/dist/index.js +898 -39
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +16 -1
- package/src/client.ts +4 -0
- package/src/src/apis/AuthEmailOTPApi.ts +371 -0
- package/src/src/apis/DomainsApi.ts +73 -0
- package/src/src/apis/InboundEmailApi.ts +264 -0
- package/src/src/apis/index.ts +2 -0
- package/src/src/models/CheckEmailOtpAvailability200Response.ts +73 -0
- package/src/src/models/{PhoneAuthAvailabilityResponseData.ts → CheckEmailOtpAvailability200ResponseData.ts} +12 -12
- package/src/src/models/InboundAttachmentUrlResponse.ts +88 -0
- package/src/src/models/InboundAttachmentUrlResponseData.ts +81 -0
- package/src/src/models/InboundEmail.ts +247 -0
- package/src/src/models/InboundEmailAttachment.ts +89 -0
- package/src/src/models/InboundEmailFrom.ts +73 -0
- package/src/src/models/InboundEmailListResponse.ts +88 -0
- package/src/src/models/InboundEmailListResponseMeta.ts +89 -0
- package/src/src/models/InboundEmailResponse.ts +88 -0
- package/src/src/models/PhoneAuthAvailabilityResponse.ts +10 -10
- package/src/src/models/SendEmailOtpRegistrationRequest.ts +66 -0
- package/src/src/models/SetDomainInboundRequest.ts +65 -0
- package/src/src/models/VerifyEmailOtpLoginRequest.ts +83 -0
- package/src/src/models/VerifyEmailOtpRegistrationRequest.ts +91 -0
- package/src/src/models/index.ts +14 -1
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
.npmignore
|
|
3
3
|
README.md
|
|
4
4
|
package.json
|
|
5
|
+
src/apis/AuthEmailOTPApi.ts
|
|
5
6
|
src/apis/AuthEmailTemplatesApi.ts
|
|
6
7
|
src/apis/AuthEmailVerificationApi.ts
|
|
7
8
|
src/apis/AuthLoginApi.ts
|
|
@@ -19,6 +20,7 @@ src/apis/DevicesApi.ts
|
|
|
19
20
|
src/apis/DomainsApi.ts
|
|
20
21
|
src/apis/EmailsApi.ts
|
|
21
22
|
src/apis/ExecutionsApi.ts
|
|
23
|
+
src/apis/InboundEmailApi.ts
|
|
22
24
|
src/apis/InboxApi.ts
|
|
23
25
|
src/apis/MuseApi.ts
|
|
24
26
|
src/apis/PushApi.ts
|
|
@@ -80,6 +82,8 @@ src/models/BulkUpsertAuthEmailTemplatesResponse.ts
|
|
|
80
82
|
src/models/Category.ts
|
|
81
83
|
src/models/CategoryListResponse.ts
|
|
82
84
|
src/models/CategoryResponse.ts
|
|
85
|
+
src/models/CheckEmailOtpAvailability200Response.ts
|
|
86
|
+
src/models/CheckEmailOtpAvailability200ResponseData.ts
|
|
83
87
|
src/models/ConfirmEmailVerificationRequest.ts
|
|
84
88
|
src/models/ConfirmEmailVerificationResponse.ts
|
|
85
89
|
src/models/ConfirmEmailVerificationResponseData.ts
|
|
@@ -153,6 +157,14 @@ src/models/GetDomain200ResponseMeta.ts
|
|
|
153
157
|
src/models/GetWaaSEndpoint200Response.ts
|
|
154
158
|
src/models/GetWaaSUsage200Response.ts
|
|
155
159
|
src/models/InAppNotification.ts
|
|
160
|
+
src/models/InboundAttachmentUrlResponse.ts
|
|
161
|
+
src/models/InboundAttachmentUrlResponseData.ts
|
|
162
|
+
src/models/InboundEmail.ts
|
|
163
|
+
src/models/InboundEmailAttachment.ts
|
|
164
|
+
src/models/InboundEmailFrom.ts
|
|
165
|
+
src/models/InboundEmailListResponse.ts
|
|
166
|
+
src/models/InboundEmailListResponseMeta.ts
|
|
167
|
+
src/models/InboundEmailResponse.ts
|
|
156
168
|
src/models/InboxListMeta.ts
|
|
157
169
|
src/models/InboxListResponse.ts
|
|
158
170
|
src/models/InboxNotificationResponse.ts
|
|
@@ -222,7 +234,6 @@ src/models/PayloadTooLargeError.ts
|
|
|
222
234
|
src/models/PayloadTooLargeErrorError.ts
|
|
223
235
|
src/models/PayloadTooLargeErrorErrorDetails.ts
|
|
224
236
|
src/models/PhoneAuthAvailabilityResponse.ts
|
|
225
|
-
src/models/PhoneAuthAvailabilityResponseData.ts
|
|
226
237
|
src/models/PhoneLoginVerifyRequest.ts
|
|
227
238
|
src/models/PhoneOtpSendRequest.ts
|
|
228
239
|
src/models/PhoneOtpSentResponse.ts
|
|
@@ -272,6 +283,7 @@ src/models/SendBatchInAppResponse.ts
|
|
|
272
283
|
src/models/SendBatchSmsData.ts
|
|
273
284
|
src/models/SendBatchSmsRequest.ts
|
|
274
285
|
src/models/SendBatchSmsResponse.ts
|
|
286
|
+
src/models/SendEmailOtpRegistrationRequest.ts
|
|
275
287
|
src/models/SendEmailRequest.ts
|
|
276
288
|
src/models/SendEmailResponse.ts
|
|
277
289
|
src/models/SendEmailResponseData.ts
|
|
@@ -300,6 +312,7 @@ src/models/SendWebhookTestEventRequest.ts
|
|
|
300
312
|
src/models/SessionListResponse.ts
|
|
301
313
|
src/models/SessionListResponseData.ts
|
|
302
314
|
src/models/SessionListResponseDataSessionInfo.ts
|
|
315
|
+
src/models/SetDomainInboundRequest.ts
|
|
303
316
|
src/models/SetPreferencesRequest.ts
|
|
304
317
|
src/models/SetPreferencesRequestPreferencesInner.ts
|
|
305
318
|
src/models/SignInAnonymouslyRequest.ts
|
|
@@ -382,6 +395,8 @@ src/models/VerificationStatusResponse.ts
|
|
|
382
395
|
src/models/VerificationStatusResponseData.ts
|
|
383
396
|
src/models/VerifyDomainResponse.ts
|
|
384
397
|
src/models/VerifyDomainResponseData.ts
|
|
398
|
+
src/models/VerifyEmailOtpLoginRequest.ts
|
|
399
|
+
src/models/VerifyEmailOtpRegistrationRequest.ts
|
|
385
400
|
src/models/VerifySmsConfigData.ts
|
|
386
401
|
src/models/VerifySmsConfigResponse.ts
|
|
387
402
|
src/models/WaaSApplication.ts
|
package/src/client.ts
CHANGED
|
@@ -31,6 +31,7 @@ import {
|
|
|
31
31
|
DevicesApi,
|
|
32
32
|
DomainsApi,
|
|
33
33
|
EmailsApi,
|
|
34
|
+
InboundEmailApi,
|
|
34
35
|
InboxApi,
|
|
35
36
|
PushApi,
|
|
36
37
|
SlackApi,
|
|
@@ -84,6 +85,8 @@ export class Zyphr {
|
|
|
84
85
|
readonly topics: TopicsApi;
|
|
85
86
|
readonly devices: DevicesApi;
|
|
86
87
|
readonly domains: DomainsApi;
|
|
88
|
+
/** Inbound (received) email — read access. Requires the `email:read` scope. */
|
|
89
|
+
readonly inbound: InboundEmailApi;
|
|
87
90
|
|
|
88
91
|
readonly waas: {
|
|
89
92
|
readonly applications: WaaSApplicationsApi;
|
|
@@ -135,6 +138,7 @@ export class Zyphr {
|
|
|
135
138
|
this.topics = new TopicsApi(config);
|
|
136
139
|
this.devices = new DevicesApi(config);
|
|
137
140
|
this.domains = new DomainsApi(config);
|
|
141
|
+
this.inbound = new InboundEmailApi(config);
|
|
138
142
|
|
|
139
143
|
this.waas = {
|
|
140
144
|
applications: new WaaSApplicationsApi(config),
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Zyphr API
|
|
5
|
+
* Zyphr is a multi-channel notification platform that enables developers to send emails, push notifications, SMS, and in-app messages through a unified API. ## Authentication All API requests require authentication using an API key. Include your API key in the `X-API-Key` header: ``` X-API-Key: zy_live_xxxxxxxxxxxx ``` API keys can be created in the Zyphr Dashboard. Use `zy_test_*` keys for testing and `zy_live_*` keys for production. ## Rate Limiting The API implements rate limiting to ensure fair usage. Rate limit information is included in response headers: - `X-RateLimit-Limit`: Maximum requests per window - `X-RateLimit-Remaining`: Remaining requests in current window - `X-RateLimit-Reset`: Unix timestamp when the window resets ## Errors All errors follow a consistent format: ```json { \"error\": { \"code\": \"error_code\", \"message\": \"Human readable message\", \"details\": {} }, \"meta\": { \"request_id\": \"req_xxxx\" } } ```
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.0.0
|
|
8
|
+
* Contact: support@zyphr.dev
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
ApiError,
|
|
19
|
+
AuthLoginResponse,
|
|
20
|
+
AuthResultResponse,
|
|
21
|
+
CheckEmailOtpAvailability200Response,
|
|
22
|
+
PhoneOtpSentResponse,
|
|
23
|
+
SendEmailOtpRegistrationRequest,
|
|
24
|
+
VerifyEmailOtpLoginRequest,
|
|
25
|
+
VerifyEmailOtpRegistrationRequest,
|
|
26
|
+
} from '../models/index';
|
|
27
|
+
import {
|
|
28
|
+
ApiErrorFromJSON,
|
|
29
|
+
ApiErrorToJSON,
|
|
30
|
+
AuthLoginResponseFromJSON,
|
|
31
|
+
AuthLoginResponseToJSON,
|
|
32
|
+
AuthResultResponseFromJSON,
|
|
33
|
+
AuthResultResponseToJSON,
|
|
34
|
+
CheckEmailOtpAvailability200ResponseFromJSON,
|
|
35
|
+
CheckEmailOtpAvailability200ResponseToJSON,
|
|
36
|
+
PhoneOtpSentResponseFromJSON,
|
|
37
|
+
PhoneOtpSentResponseToJSON,
|
|
38
|
+
SendEmailOtpRegistrationRequestFromJSON,
|
|
39
|
+
SendEmailOtpRegistrationRequestToJSON,
|
|
40
|
+
VerifyEmailOtpLoginRequestFromJSON,
|
|
41
|
+
VerifyEmailOtpLoginRequestToJSON,
|
|
42
|
+
VerifyEmailOtpRegistrationRequestFromJSON,
|
|
43
|
+
VerifyEmailOtpRegistrationRequestToJSON,
|
|
44
|
+
} from '../models/index';
|
|
45
|
+
|
|
46
|
+
export interface AuthEmailOTPApiSendEmailOtpLoginRequest {
|
|
47
|
+
sendEmailOtpRegistrationRequest: SendEmailOtpRegistrationRequest;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface AuthEmailOTPApiSendEmailOtpRegistrationOperationRequest {
|
|
51
|
+
sendEmailOtpRegistrationRequest: SendEmailOtpRegistrationRequest;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface AuthEmailOTPApiVerifyEmailOtpLoginOperationRequest {
|
|
55
|
+
verifyEmailOtpLoginRequest: VerifyEmailOtpLoginRequest;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface AuthEmailOTPApiVerifyEmailOtpRegistrationOperationRequest {
|
|
59
|
+
verifyEmailOtpRegistrationRequest: VerifyEmailOtpRegistrationRequest;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* AuthEmailOTPApi - interface
|
|
64
|
+
*
|
|
65
|
+
* @export
|
|
66
|
+
* @interface AuthEmailOTPApiInterface
|
|
67
|
+
*/
|
|
68
|
+
export interface AuthEmailOTPApiInterface {
|
|
69
|
+
/**
|
|
70
|
+
* Check if numeric email OTP authentication is available for this application. Requires a verified sending domain on the project.
|
|
71
|
+
* @summary Check email OTP availability
|
|
72
|
+
* @param {*} [options] Override http request option.
|
|
73
|
+
* @throws {RequiredError}
|
|
74
|
+
* @memberof AuthEmailOTPApiInterface
|
|
75
|
+
*/
|
|
76
|
+
checkEmailOtpAvailabilityRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CheckEmailOtpAvailability200Response>>;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Check if numeric email OTP authentication is available for this application. Requires a verified sending domain on the project.
|
|
80
|
+
* Check email OTP availability
|
|
81
|
+
*/
|
|
82
|
+
checkEmailOtpAvailability(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CheckEmailOtpAvailability200Response>;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Send a numeric verification code to an existing user\'s email address for login.
|
|
86
|
+
* @summary Send email OTP for login
|
|
87
|
+
* @param {SendEmailOtpRegistrationRequest} sendEmailOtpRegistrationRequest
|
|
88
|
+
* @param {*} [options] Override http request option.
|
|
89
|
+
* @throws {RequiredError}
|
|
90
|
+
* @memberof AuthEmailOTPApiInterface
|
|
91
|
+
*/
|
|
92
|
+
sendEmailOtpLoginRaw(requestParameters: AuthEmailOTPApiSendEmailOtpLoginRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhoneOtpSentResponse>>;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Send a numeric verification code to an existing user\'s email address for login.
|
|
96
|
+
* Send email OTP for login
|
|
97
|
+
*/
|
|
98
|
+
sendEmailOtpLogin(sendEmailOtpRegistrationRequest: SendEmailOtpRegistrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhoneOtpSentResponse>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Send a numeric verification code to an email address for new user registration.
|
|
102
|
+
* @summary Send email OTP for registration
|
|
103
|
+
* @param {SendEmailOtpRegistrationRequest} sendEmailOtpRegistrationRequest
|
|
104
|
+
* @param {*} [options] Override http request option.
|
|
105
|
+
* @throws {RequiredError}
|
|
106
|
+
* @memberof AuthEmailOTPApiInterface
|
|
107
|
+
*/
|
|
108
|
+
sendEmailOtpRegistrationRaw(requestParameters: AuthEmailOTPApiSendEmailOtpRegistrationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhoneOtpSentResponse>>;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Send a numeric verification code to an email address for new user registration.
|
|
112
|
+
* Send email OTP for registration
|
|
113
|
+
*/
|
|
114
|
+
sendEmailOtpRegistration(sendEmailOtpRegistrationRequest: SendEmailOtpRegistrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhoneOtpSentResponse>;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Verify the numeric code and login an existing user. If MFA is enabled, returns mfa_required with a challenge token.
|
|
118
|
+
* @summary Verify email OTP login
|
|
119
|
+
* @param {VerifyEmailOtpLoginRequest} verifyEmailOtpLoginRequest
|
|
120
|
+
* @param {*} [options] Override http request option.
|
|
121
|
+
* @throws {RequiredError}
|
|
122
|
+
* @memberof AuthEmailOTPApiInterface
|
|
123
|
+
*/
|
|
124
|
+
verifyEmailOtpLoginRaw(requestParameters: AuthEmailOTPApiVerifyEmailOtpLoginOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthLoginResponse>>;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Verify the numeric code and login an existing user. If MFA is enabled, returns mfa_required with a challenge token.
|
|
128
|
+
* Verify email OTP login
|
|
129
|
+
*/
|
|
130
|
+
verifyEmailOtpLogin(verifyEmailOtpLoginRequest: VerifyEmailOtpLoginRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthLoginResponse>;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Verify the numeric code and create a new user account with the email address.
|
|
134
|
+
* @summary Verify email OTP registration
|
|
135
|
+
* @param {VerifyEmailOtpRegistrationRequest} verifyEmailOtpRegistrationRequest
|
|
136
|
+
* @param {*} [options] Override http request option.
|
|
137
|
+
* @throws {RequiredError}
|
|
138
|
+
* @memberof AuthEmailOTPApiInterface
|
|
139
|
+
*/
|
|
140
|
+
verifyEmailOtpRegistrationRaw(requestParameters: AuthEmailOTPApiVerifyEmailOtpRegistrationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthResultResponse>>;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Verify the numeric code and create a new user account with the email address.
|
|
144
|
+
* Verify email OTP registration
|
|
145
|
+
*/
|
|
146
|
+
verifyEmailOtpRegistration(verifyEmailOtpRegistrationRequest: VerifyEmailOtpRegistrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthResultResponse>;
|
|
147
|
+
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
*
|
|
152
|
+
*/
|
|
153
|
+
export class AuthEmailOTPApi extends runtime.BaseAPI implements AuthEmailOTPApiInterface {
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Check if numeric email OTP authentication is available for this application. Requires a verified sending domain on the project.
|
|
157
|
+
* Check email OTP availability
|
|
158
|
+
*/
|
|
159
|
+
async checkEmailOtpAvailabilityRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CheckEmailOtpAvailability200Response>> {
|
|
160
|
+
const queryParameters: any = {};
|
|
161
|
+
|
|
162
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
163
|
+
|
|
164
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
165
|
+
headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key"); // ApplicationPublicKey authentication
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const response = await this.request({
|
|
169
|
+
path: `/auth/email-otp/available`,
|
|
170
|
+
method: 'GET',
|
|
171
|
+
headers: headerParameters,
|
|
172
|
+
query: queryParameters,
|
|
173
|
+
}, initOverrides);
|
|
174
|
+
|
|
175
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CheckEmailOtpAvailability200ResponseFromJSON(jsonValue));
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Check if numeric email OTP authentication is available for this application. Requires a verified sending domain on the project.
|
|
180
|
+
* Check email OTP availability
|
|
181
|
+
*/
|
|
182
|
+
async checkEmailOtpAvailability(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CheckEmailOtpAvailability200Response> {
|
|
183
|
+
const response = await this.checkEmailOtpAvailabilityRaw(initOverrides);
|
|
184
|
+
return await response.value();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Send a numeric verification code to an existing user\'s email address for login.
|
|
189
|
+
* Send email OTP for login
|
|
190
|
+
*/
|
|
191
|
+
async sendEmailOtpLoginRaw(requestParameters: AuthEmailOTPApiSendEmailOtpLoginRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhoneOtpSentResponse>> {
|
|
192
|
+
if (requestParameters['sendEmailOtpRegistrationRequest'] == null) {
|
|
193
|
+
throw new runtime.RequiredError(
|
|
194
|
+
'sendEmailOtpRegistrationRequest',
|
|
195
|
+
'Required parameter "sendEmailOtpRegistrationRequest" was null or undefined when calling sendEmailOtpLogin().'
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const queryParameters: any = {};
|
|
200
|
+
|
|
201
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
202
|
+
|
|
203
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
204
|
+
|
|
205
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
206
|
+
headerParameters["X-Application-Secret"] = await this.configuration.apiKey("X-Application-Secret"); // ApplicationSecret authentication
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
210
|
+
headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key"); // ApplicationPublicKey authentication
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const response = await this.request({
|
|
214
|
+
path: `/auth/email-otp/login/send`,
|
|
215
|
+
method: 'POST',
|
|
216
|
+
headers: headerParameters,
|
|
217
|
+
query: queryParameters,
|
|
218
|
+
body: SendEmailOtpRegistrationRequestToJSON(requestParameters['sendEmailOtpRegistrationRequest']),
|
|
219
|
+
}, initOverrides);
|
|
220
|
+
|
|
221
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PhoneOtpSentResponseFromJSON(jsonValue));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Send a numeric verification code to an existing user\'s email address for login.
|
|
226
|
+
* Send email OTP for login
|
|
227
|
+
*/
|
|
228
|
+
async sendEmailOtpLogin(sendEmailOtpRegistrationRequest: SendEmailOtpRegistrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhoneOtpSentResponse> {
|
|
229
|
+
const response = await this.sendEmailOtpLoginRaw({ sendEmailOtpRegistrationRequest: sendEmailOtpRegistrationRequest }, initOverrides);
|
|
230
|
+
return await response.value();
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Send a numeric verification code to an email address for new user registration.
|
|
235
|
+
* Send email OTP for registration
|
|
236
|
+
*/
|
|
237
|
+
async sendEmailOtpRegistrationRaw(requestParameters: AuthEmailOTPApiSendEmailOtpRegistrationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhoneOtpSentResponse>> {
|
|
238
|
+
if (requestParameters['sendEmailOtpRegistrationRequest'] == null) {
|
|
239
|
+
throw new runtime.RequiredError(
|
|
240
|
+
'sendEmailOtpRegistrationRequest',
|
|
241
|
+
'Required parameter "sendEmailOtpRegistrationRequest" was null or undefined when calling sendEmailOtpRegistration().'
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const queryParameters: any = {};
|
|
246
|
+
|
|
247
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
248
|
+
|
|
249
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
250
|
+
|
|
251
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
252
|
+
headerParameters["X-Application-Secret"] = await this.configuration.apiKey("X-Application-Secret"); // ApplicationSecret authentication
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
256
|
+
headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key"); // ApplicationPublicKey authentication
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const response = await this.request({
|
|
260
|
+
path: `/auth/email-otp/register/send`,
|
|
261
|
+
method: 'POST',
|
|
262
|
+
headers: headerParameters,
|
|
263
|
+
query: queryParameters,
|
|
264
|
+
body: SendEmailOtpRegistrationRequestToJSON(requestParameters['sendEmailOtpRegistrationRequest']),
|
|
265
|
+
}, initOverrides);
|
|
266
|
+
|
|
267
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PhoneOtpSentResponseFromJSON(jsonValue));
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Send a numeric verification code to an email address for new user registration.
|
|
272
|
+
* Send email OTP for registration
|
|
273
|
+
*/
|
|
274
|
+
async sendEmailOtpRegistration(sendEmailOtpRegistrationRequest: SendEmailOtpRegistrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhoneOtpSentResponse> {
|
|
275
|
+
const response = await this.sendEmailOtpRegistrationRaw({ sendEmailOtpRegistrationRequest: sendEmailOtpRegistrationRequest }, initOverrides);
|
|
276
|
+
return await response.value();
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Verify the numeric code and login an existing user. If MFA is enabled, returns mfa_required with a challenge token.
|
|
281
|
+
* Verify email OTP login
|
|
282
|
+
*/
|
|
283
|
+
async verifyEmailOtpLoginRaw(requestParameters: AuthEmailOTPApiVerifyEmailOtpLoginOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthLoginResponse>> {
|
|
284
|
+
if (requestParameters['verifyEmailOtpLoginRequest'] == null) {
|
|
285
|
+
throw new runtime.RequiredError(
|
|
286
|
+
'verifyEmailOtpLoginRequest',
|
|
287
|
+
'Required parameter "verifyEmailOtpLoginRequest" was null or undefined when calling verifyEmailOtpLogin().'
|
|
288
|
+
);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const queryParameters: any = {};
|
|
292
|
+
|
|
293
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
294
|
+
|
|
295
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
296
|
+
|
|
297
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
298
|
+
headerParameters["X-Application-Secret"] = await this.configuration.apiKey("X-Application-Secret"); // ApplicationSecret authentication
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
302
|
+
headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key"); // ApplicationPublicKey authentication
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
const response = await this.request({
|
|
306
|
+
path: `/auth/email-otp/login/verify`,
|
|
307
|
+
method: 'POST',
|
|
308
|
+
headers: headerParameters,
|
|
309
|
+
query: queryParameters,
|
|
310
|
+
body: VerifyEmailOtpLoginRequestToJSON(requestParameters['verifyEmailOtpLoginRequest']),
|
|
311
|
+
}, initOverrides);
|
|
312
|
+
|
|
313
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AuthLoginResponseFromJSON(jsonValue));
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Verify the numeric code and login an existing user. If MFA is enabled, returns mfa_required with a challenge token.
|
|
318
|
+
* Verify email OTP login
|
|
319
|
+
*/
|
|
320
|
+
async verifyEmailOtpLogin(verifyEmailOtpLoginRequest: VerifyEmailOtpLoginRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthLoginResponse> {
|
|
321
|
+
const response = await this.verifyEmailOtpLoginRaw({ verifyEmailOtpLoginRequest: verifyEmailOtpLoginRequest }, initOverrides);
|
|
322
|
+
return await response.value();
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Verify the numeric code and create a new user account with the email address.
|
|
327
|
+
* Verify email OTP registration
|
|
328
|
+
*/
|
|
329
|
+
async verifyEmailOtpRegistrationRaw(requestParameters: AuthEmailOTPApiVerifyEmailOtpRegistrationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthResultResponse>> {
|
|
330
|
+
if (requestParameters['verifyEmailOtpRegistrationRequest'] == null) {
|
|
331
|
+
throw new runtime.RequiredError(
|
|
332
|
+
'verifyEmailOtpRegistrationRequest',
|
|
333
|
+
'Required parameter "verifyEmailOtpRegistrationRequest" was null or undefined when calling verifyEmailOtpRegistration().'
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const queryParameters: any = {};
|
|
338
|
+
|
|
339
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
340
|
+
|
|
341
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
342
|
+
|
|
343
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
344
|
+
headerParameters["X-Application-Secret"] = await this.configuration.apiKey("X-Application-Secret"); // ApplicationSecret authentication
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
348
|
+
headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key"); // ApplicationPublicKey authentication
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
const response = await this.request({
|
|
352
|
+
path: `/auth/email-otp/register/verify`,
|
|
353
|
+
method: 'POST',
|
|
354
|
+
headers: headerParameters,
|
|
355
|
+
query: queryParameters,
|
|
356
|
+
body: VerifyEmailOtpRegistrationRequestToJSON(requestParameters['verifyEmailOtpRegistrationRequest']),
|
|
357
|
+
}, initOverrides);
|
|
358
|
+
|
|
359
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => AuthResultResponseFromJSON(jsonValue));
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* Verify the numeric code and create a new user account with the email address.
|
|
364
|
+
* Verify email OTP registration
|
|
365
|
+
*/
|
|
366
|
+
async verifyEmailOtpRegistration(verifyEmailOtpRegistrationRequest: VerifyEmailOtpRegistrationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthResultResponse> {
|
|
367
|
+
const response = await this.verifyEmailOtpRegistrationRaw({ verifyEmailOtpRegistrationRequest: verifyEmailOtpRegistrationRequest }, initOverrides);
|
|
368
|
+
return await response.value();
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
}
|
|
@@ -21,6 +21,7 @@ import type {
|
|
|
21
21
|
DeleteDomainResponse,
|
|
22
22
|
DomainListResponse,
|
|
23
23
|
GetDomain200Response,
|
|
24
|
+
SetDomainInboundRequest,
|
|
24
25
|
VerificationStatusResponse,
|
|
25
26
|
VerifyDomainResponse,
|
|
26
27
|
} from '../models/index';
|
|
@@ -37,6 +38,8 @@ import {
|
|
|
37
38
|
DomainListResponseToJSON,
|
|
38
39
|
GetDomain200ResponseFromJSON,
|
|
39
40
|
GetDomain200ResponseToJSON,
|
|
41
|
+
SetDomainInboundRequestFromJSON,
|
|
42
|
+
SetDomainInboundRequestToJSON,
|
|
40
43
|
VerificationStatusResponseFromJSON,
|
|
41
44
|
VerificationStatusResponseToJSON,
|
|
42
45
|
VerifyDomainResponseFromJSON,
|
|
@@ -59,6 +62,11 @@ export interface DomainsApiGetDomainVerificationStatusRequest {
|
|
|
59
62
|
id: string;
|
|
60
63
|
}
|
|
61
64
|
|
|
65
|
+
export interface DomainsApiSetDomainInboundOperationRequest {
|
|
66
|
+
id: string;
|
|
67
|
+
setDomainInboundRequest: SetDomainInboundRequest;
|
|
68
|
+
}
|
|
69
|
+
|
|
62
70
|
export interface DomainsApiVerifyDomainRequest {
|
|
63
71
|
id: string;
|
|
64
72
|
}
|
|
@@ -149,6 +157,23 @@ export interface DomainsApiInterface {
|
|
|
149
157
|
*/
|
|
150
158
|
listDomains(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DomainListResponse>;
|
|
151
159
|
|
|
160
|
+
/**
|
|
161
|
+
* Toggle email receiving for a domain. When enabled, the domain\'s DNS records gain an MX record on the `inbound.` subdomain that the tenant must publish. Requires a plan with inbound email (Starter+).
|
|
162
|
+
* @summary Enable or disable inbound email for a domain
|
|
163
|
+
* @param {string} id
|
|
164
|
+
* @param {SetDomainInboundRequest} setDomainInboundRequest
|
|
165
|
+
* @param {*} [options] Override http request option.
|
|
166
|
+
* @throws {RequiredError}
|
|
167
|
+
* @memberof DomainsApiInterface
|
|
168
|
+
*/
|
|
169
|
+
setDomainInboundRaw(requestParameters: DomainsApiSetDomainInboundOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Toggle email receiving for a domain. When enabled, the domain\'s DNS records gain an MX record on the `inbound.` subdomain that the tenant must publish. Requires a plan with inbound email (Starter+).
|
|
173
|
+
* Enable or disable inbound email for a domain
|
|
174
|
+
*/
|
|
175
|
+
setDomainInbound(id: string, setDomainInboundRequest: SetDomainInboundRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
176
|
+
|
|
152
177
|
/**
|
|
153
178
|
* 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
179
|
* @summary Trigger domain verification
|
|
@@ -363,6 +388,54 @@ export class DomainsApi extends runtime.BaseAPI implements DomainsApiInterface {
|
|
|
363
388
|
return await response.value();
|
|
364
389
|
}
|
|
365
390
|
|
|
391
|
+
/**
|
|
392
|
+
* Toggle email receiving for a domain. When enabled, the domain\'s DNS records gain an MX record on the `inbound.` subdomain that the tenant must publish. Requires a plan with inbound email (Starter+).
|
|
393
|
+
* Enable or disable inbound email for a domain
|
|
394
|
+
*/
|
|
395
|
+
async setDomainInboundRaw(requestParameters: DomainsApiSetDomainInboundOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
396
|
+
if (requestParameters['id'] == null) {
|
|
397
|
+
throw new runtime.RequiredError(
|
|
398
|
+
'id',
|
|
399
|
+
'Required parameter "id" was null or undefined when calling setDomainInbound().'
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
if (requestParameters['setDomainInboundRequest'] == null) {
|
|
404
|
+
throw new runtime.RequiredError(
|
|
405
|
+
'setDomainInboundRequest',
|
|
406
|
+
'Required parameter "setDomainInboundRequest" was null or undefined when calling setDomainInbound().'
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
const queryParameters: any = {};
|
|
411
|
+
|
|
412
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
413
|
+
|
|
414
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
415
|
+
|
|
416
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
417
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
const response = await this.request({
|
|
421
|
+
path: `/domains/{id}/inbound`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id']))),
|
|
422
|
+
method: 'PUT',
|
|
423
|
+
headers: headerParameters,
|
|
424
|
+
query: queryParameters,
|
|
425
|
+
body: SetDomainInboundRequestToJSON(requestParameters['setDomainInboundRequest']),
|
|
426
|
+
}, initOverrides);
|
|
427
|
+
|
|
428
|
+
return new runtime.VoidApiResponse(response);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Toggle email receiving for a domain. When enabled, the domain\'s DNS records gain an MX record on the `inbound.` subdomain that the tenant must publish. Requires a plan with inbound email (Starter+).
|
|
433
|
+
* Enable or disable inbound email for a domain
|
|
434
|
+
*/
|
|
435
|
+
async setDomainInbound(id: string, setDomainInboundRequest: SetDomainInboundRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
436
|
+
await this.setDomainInboundRaw({ id: id, setDomainInboundRequest: setDomainInboundRequest }, initOverrides);
|
|
437
|
+
}
|
|
438
|
+
|
|
366
439
|
/**
|
|
367
440
|
* 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
441
|
* Trigger domain verification
|