@zyphr-dev/node-sdk 0.1.50 → 0.1.52
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 +262 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +238 -3
- package/dist/index.d.ts +238 -3
- package/dist/index.js +242 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +4 -0
- package/src/src/apis/AuthOAuthApi.ts +165 -0
- package/src/src/models/OAuthAuthorizeResponse.ts +88 -0
- package/src/src/models/OAuthAuthorizeResponseData.ts +73 -0
- package/src/src/models/OAuthLinkResponse.ts +88 -0
- package/src/src/models/OAuthLinkResponseData.ts +81 -0
- package/src/src/models/PasswordPolicy.ts +9 -0
- package/src/src/models/PasswordStrength.ts +20 -2
- package/src/src/models/index.ts +4 -0
package/package.json
CHANGED
|
@@ -244,6 +244,8 @@ src/models/MfaVerifyEnrollmentResponseData.ts
|
|
|
244
244
|
src/models/MfaVerifyRequest.ts
|
|
245
245
|
src/models/OAuthAuthorizationUrlResponse.ts
|
|
246
246
|
src/models/OAuthAuthorizationUrlResponseData.ts
|
|
247
|
+
src/models/OAuthAuthorizeResponse.ts
|
|
248
|
+
src/models/OAuthAuthorizeResponseData.ts
|
|
247
249
|
src/models/OAuthCallbackRequest.ts
|
|
248
250
|
src/models/OAuthCallbackResponse.ts
|
|
249
251
|
src/models/OAuthCallbackResponseData.ts
|
|
@@ -252,6 +254,8 @@ src/models/OAuthConnectionInfoResponse.ts
|
|
|
252
254
|
src/models/OAuthConnectionInfoResponseData.ts
|
|
253
255
|
src/models/OAuthConnectionsResponse.ts
|
|
254
256
|
src/models/OAuthConnectionsResponseData.ts
|
|
257
|
+
src/models/OAuthLinkResponse.ts
|
|
258
|
+
src/models/OAuthLinkResponseData.ts
|
|
255
259
|
src/models/OAuthProvider.ts
|
|
256
260
|
src/models/OAuthProviderInfo.ts
|
|
257
261
|
src/models/OAuthProviderName.ts
|
|
@@ -17,10 +17,12 @@ import * as runtime from '../runtime';
|
|
|
17
17
|
import type {
|
|
18
18
|
ApiError,
|
|
19
19
|
OAuthAuthorizationUrlResponse,
|
|
20
|
+
OAuthAuthorizeResponse,
|
|
20
21
|
OAuthCallbackRequest,
|
|
21
22
|
OAuthCallbackResponse,
|
|
22
23
|
OAuthConnectionInfoResponse,
|
|
23
24
|
OAuthConnectionsResponse,
|
|
25
|
+
OAuthLinkResponse,
|
|
24
26
|
OAuthProviderName,
|
|
25
27
|
OAuthProvidersResponse,
|
|
26
28
|
OAuthTokensRefreshResponse,
|
|
@@ -33,6 +35,8 @@ import {
|
|
|
33
35
|
ApiErrorToJSON,
|
|
34
36
|
OAuthAuthorizationUrlResponseFromJSON,
|
|
35
37
|
OAuthAuthorizationUrlResponseToJSON,
|
|
38
|
+
OAuthAuthorizeResponseFromJSON,
|
|
39
|
+
OAuthAuthorizeResponseToJSON,
|
|
36
40
|
OAuthCallbackRequestFromJSON,
|
|
37
41
|
OAuthCallbackRequestToJSON,
|
|
38
42
|
OAuthCallbackResponseFromJSON,
|
|
@@ -41,6 +45,8 @@ import {
|
|
|
41
45
|
OAuthConnectionInfoResponseToJSON,
|
|
42
46
|
OAuthConnectionsResponseFromJSON,
|
|
43
47
|
OAuthConnectionsResponseToJSON,
|
|
48
|
+
OAuthLinkResponseFromJSON,
|
|
49
|
+
OAuthLinkResponseToJSON,
|
|
44
50
|
OAuthProviderNameFromJSON,
|
|
45
51
|
OAuthProviderNameToJSON,
|
|
46
52
|
OAuthProvidersResponseFromJSON,
|
|
@@ -55,6 +61,11 @@ import {
|
|
|
55
61
|
SuccessResultToJSON,
|
|
56
62
|
} from '../models/index';
|
|
57
63
|
|
|
64
|
+
export interface AuthOAuthApiCompleteOAuthLinkRequest {
|
|
65
|
+
provider: OAuthProviderName;
|
|
66
|
+
oAuthCallbackRequest: OAuthCallbackRequest;
|
|
67
|
+
}
|
|
68
|
+
|
|
58
69
|
export interface AuthOAuthApiDisconnectOAuthProviderRequest {
|
|
59
70
|
provider: OAuthProviderName;
|
|
60
71
|
}
|
|
@@ -83,6 +94,11 @@ export interface AuthOAuthApiRefreshOAuthTokensOperationRequest {
|
|
|
83
94
|
refreshOAuthTokensRequest: RefreshOAuthTokensRequest;
|
|
84
95
|
}
|
|
85
96
|
|
|
97
|
+
export interface AuthOAuthApiStartOAuthLinkRequest {
|
|
98
|
+
provider: OAuthProviderName;
|
|
99
|
+
redirectUri: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
86
102
|
/**
|
|
87
103
|
* AuthOAuthApi - interface
|
|
88
104
|
*
|
|
@@ -90,6 +106,23 @@ export interface AuthOAuthApiRefreshOAuthTokensOperationRequest {
|
|
|
90
106
|
* @interface AuthOAuthApiInterface
|
|
91
107
|
*/
|
|
92
108
|
export interface AuthOAuthApiInterface {
|
|
109
|
+
/**
|
|
110
|
+
* Complete an authenticated account-linking flow started via the link authorize endpoint. Attaches the resolved provider identity to the current end user. Rejects if the provider identity is already linked to a different account, if the provider did not verify the email, or if the linking session does not belong to the authenticated user.
|
|
111
|
+
* @summary Complete linking an OAuth provider to the current account
|
|
112
|
+
* @param {OAuthProviderName} provider OAuth provider name
|
|
113
|
+
* @param {OAuthCallbackRequest} oAuthCallbackRequest
|
|
114
|
+
* @param {*} [options] Override http request option.
|
|
115
|
+
* @throws {RequiredError}
|
|
116
|
+
* @memberof AuthOAuthApiInterface
|
|
117
|
+
*/
|
|
118
|
+
completeOAuthLinkRaw(requestParameters: AuthOAuthApiCompleteOAuthLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OAuthLinkResponse>>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Complete an authenticated account-linking flow started via the link authorize endpoint. Attaches the resolved provider identity to the current end user. Rejects if the provider identity is already linked to a different account, if the provider did not verify the email, or if the linking session does not belong to the authenticated user.
|
|
122
|
+
* Complete linking an OAuth provider to the current account
|
|
123
|
+
*/
|
|
124
|
+
completeOAuthLink(provider: OAuthProviderName, oAuthCallbackRequest: OAuthCallbackRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OAuthLinkResponse>;
|
|
125
|
+
|
|
93
126
|
/**
|
|
94
127
|
* Disconnect an OAuth provider from the current user.
|
|
95
128
|
* @summary Disconnect OAuth provider
|
|
@@ -220,6 +253,23 @@ export interface AuthOAuthApiInterface {
|
|
|
220
253
|
*/
|
|
221
254
|
refreshOAuthTokens(provider: OAuthProviderName, refreshOAuthTokensRequest: RefreshOAuthTokensRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OAuthTokensRefreshResponse>;
|
|
222
255
|
|
|
256
|
+
/**
|
|
257
|
+
* Begin an authenticated account-linking flow. Unlike the sign-in authorize endpoint, this binds the current end user into the OAuth state so the matching link callback attaches the returned provider identity to THIS account instead of finding-or-creating a user. Requires an end-user token.
|
|
258
|
+
* @summary Start linking an OAuth provider to the current account
|
|
259
|
+
* @param {OAuthProviderName} provider OAuth provider name
|
|
260
|
+
* @param {string} redirectUri Redirect URI registered for the application
|
|
261
|
+
* @param {*} [options] Override http request option.
|
|
262
|
+
* @throws {RequiredError}
|
|
263
|
+
* @memberof AuthOAuthApiInterface
|
|
264
|
+
*/
|
|
265
|
+
startOAuthLinkRaw(requestParameters: AuthOAuthApiStartOAuthLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OAuthAuthorizeResponse>>;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Begin an authenticated account-linking flow. Unlike the sign-in authorize endpoint, this binds the current end user into the OAuth state so the matching link callback attaches the returned provider identity to THIS account instead of finding-or-creating a user. Requires an end-user token.
|
|
269
|
+
* Start linking an OAuth provider to the current account
|
|
270
|
+
*/
|
|
271
|
+
startOAuthLink(provider: OAuthProviderName, redirectUri: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OAuthAuthorizeResponse>;
|
|
272
|
+
|
|
223
273
|
}
|
|
224
274
|
|
|
225
275
|
/**
|
|
@@ -227,6 +277,63 @@ export interface AuthOAuthApiInterface {
|
|
|
227
277
|
*/
|
|
228
278
|
export class AuthOAuthApi extends runtime.BaseAPI implements AuthOAuthApiInterface {
|
|
229
279
|
|
|
280
|
+
/**
|
|
281
|
+
* Complete an authenticated account-linking flow started via the link authorize endpoint. Attaches the resolved provider identity to the current end user. Rejects if the provider identity is already linked to a different account, if the provider did not verify the email, or if the linking session does not belong to the authenticated user.
|
|
282
|
+
* Complete linking an OAuth provider to the current account
|
|
283
|
+
*/
|
|
284
|
+
async completeOAuthLinkRaw(requestParameters: AuthOAuthApiCompleteOAuthLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OAuthLinkResponse>> {
|
|
285
|
+
if (requestParameters['provider'] == null) {
|
|
286
|
+
throw new runtime.RequiredError(
|
|
287
|
+
'provider',
|
|
288
|
+
'Required parameter "provider" was null or undefined when calling completeOAuthLink().'
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (requestParameters['oAuthCallbackRequest'] == null) {
|
|
293
|
+
throw new runtime.RequiredError(
|
|
294
|
+
'oAuthCallbackRequest',
|
|
295
|
+
'Required parameter "oAuthCallbackRequest" was null or undefined when calling completeOAuthLink().'
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const queryParameters: any = {};
|
|
300
|
+
|
|
301
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
302
|
+
|
|
303
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
304
|
+
|
|
305
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
306
|
+
const token = this.configuration.accessToken;
|
|
307
|
+
const tokenString = await token("EndUserToken", []);
|
|
308
|
+
|
|
309
|
+
if (tokenString) {
|
|
310
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
314
|
+
headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key"); // ApplicationPublicKey authentication
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const response = await this.request({
|
|
318
|
+
path: `/auth/oauth/{provider}/link/callback`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))),
|
|
319
|
+
method: 'POST',
|
|
320
|
+
headers: headerParameters,
|
|
321
|
+
query: queryParameters,
|
|
322
|
+
body: OAuthCallbackRequestToJSON(requestParameters['oAuthCallbackRequest']),
|
|
323
|
+
}, initOverrides);
|
|
324
|
+
|
|
325
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => OAuthLinkResponseFromJSON(jsonValue));
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Complete an authenticated account-linking flow started via the link authorize endpoint. Attaches the resolved provider identity to the current end user. Rejects if the provider identity is already linked to a different account, if the provider did not verify the email, or if the linking session does not belong to the authenticated user.
|
|
330
|
+
* Complete linking an OAuth provider to the current account
|
|
331
|
+
*/
|
|
332
|
+
async completeOAuthLink(provider: OAuthProviderName, oAuthCallbackRequest: OAuthCallbackRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OAuthLinkResponse> {
|
|
333
|
+
const response = await this.completeOAuthLinkRaw({ provider: provider, oAuthCallbackRequest: oAuthCallbackRequest }, initOverrides);
|
|
334
|
+
return await response.value();
|
|
335
|
+
}
|
|
336
|
+
|
|
230
337
|
/**
|
|
231
338
|
* Disconnect an OAuth provider from the current user.
|
|
232
339
|
* Disconnect OAuth provider
|
|
@@ -595,4 +702,62 @@ export class AuthOAuthApi extends runtime.BaseAPI implements AuthOAuthApiInterfa
|
|
|
595
702
|
return await response.value();
|
|
596
703
|
}
|
|
597
704
|
|
|
705
|
+
/**
|
|
706
|
+
* Begin an authenticated account-linking flow. Unlike the sign-in authorize endpoint, this binds the current end user into the OAuth state so the matching link callback attaches the returned provider identity to THIS account instead of finding-or-creating a user. Requires an end-user token.
|
|
707
|
+
* Start linking an OAuth provider to the current account
|
|
708
|
+
*/
|
|
709
|
+
async startOAuthLinkRaw(requestParameters: AuthOAuthApiStartOAuthLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OAuthAuthorizeResponse>> {
|
|
710
|
+
if (requestParameters['provider'] == null) {
|
|
711
|
+
throw new runtime.RequiredError(
|
|
712
|
+
'provider',
|
|
713
|
+
'Required parameter "provider" was null or undefined when calling startOAuthLink().'
|
|
714
|
+
);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
if (requestParameters['redirectUri'] == null) {
|
|
718
|
+
throw new runtime.RequiredError(
|
|
719
|
+
'redirectUri',
|
|
720
|
+
'Required parameter "redirectUri" was null or undefined when calling startOAuthLink().'
|
|
721
|
+
);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
const queryParameters: any = {};
|
|
725
|
+
|
|
726
|
+
if (requestParameters['redirectUri'] != null) {
|
|
727
|
+
queryParameters['redirect_uri'] = requestParameters['redirectUri'];
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
731
|
+
|
|
732
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
733
|
+
const token = this.configuration.accessToken;
|
|
734
|
+
const tokenString = await token("EndUserToken", []);
|
|
735
|
+
|
|
736
|
+
if (tokenString) {
|
|
737
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
741
|
+
headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key"); // ApplicationPublicKey authentication
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
const response = await this.request({
|
|
745
|
+
path: `/auth/oauth/{provider}/link`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters['provider']))),
|
|
746
|
+
method: 'GET',
|
|
747
|
+
headers: headerParameters,
|
|
748
|
+
query: queryParameters,
|
|
749
|
+
}, initOverrides);
|
|
750
|
+
|
|
751
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => OAuthAuthorizeResponseFromJSON(jsonValue));
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* Begin an authenticated account-linking flow. Unlike the sign-in authorize endpoint, this binds the current end user into the OAuth state so the matching link callback attaches the returned provider identity to THIS account instead of finding-or-creating a user. Requires an end-user token.
|
|
756
|
+
* Start linking an OAuth provider to the current account
|
|
757
|
+
*/
|
|
758
|
+
async startOAuthLink(provider: OAuthProviderName, redirectUri: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OAuthAuthorizeResponse> {
|
|
759
|
+
const response = await this.startOAuthLinkRaw({ provider: provider, redirectUri: redirectUri }, initOverrides);
|
|
760
|
+
return await response.value();
|
|
761
|
+
}
|
|
762
|
+
|
|
598
763
|
}
|
|
@@ -0,0 +1,88 @@
|
|
|
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 ## Account Sending Status Every authenticated response carries the account\'s current sending state so you can surface it in your own tooling without a separate call: - `X-Account-Sending-Status`: `active`, `throttled`, or `frozen` - `X-Account-Sending-Status-Reason`: human-readable reason (present only when the status is `throttled` or `frozen`) This header is informational and non-blocking on non-send endpoints (reads, billing, and deliverability stay available). Send-capable endpoints additionally enforce the state: a frozen account receives `403 account_frozen` and a throttled account receives `429 account_throttled`, both with the reason in the error message. ## 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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { OAuthAuthorizeResponseData } from './OAuthAuthorizeResponseData';
|
|
17
|
+
import {
|
|
18
|
+
OAuthAuthorizeResponseDataFromJSON,
|
|
19
|
+
OAuthAuthorizeResponseDataFromJSONTyped,
|
|
20
|
+
OAuthAuthorizeResponseDataToJSON,
|
|
21
|
+
OAuthAuthorizeResponseDataToJSONTyped,
|
|
22
|
+
} from './OAuthAuthorizeResponseData';
|
|
23
|
+
import type { RequestMeta } from './RequestMeta';
|
|
24
|
+
import {
|
|
25
|
+
RequestMetaFromJSON,
|
|
26
|
+
RequestMetaFromJSONTyped,
|
|
27
|
+
RequestMetaToJSON,
|
|
28
|
+
RequestMetaToJSONTyped,
|
|
29
|
+
} from './RequestMeta';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @interface OAuthAuthorizeResponse
|
|
35
|
+
*/
|
|
36
|
+
export interface OAuthAuthorizeResponse {
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {OAuthAuthorizeResponseData}
|
|
40
|
+
* @memberof OAuthAuthorizeResponse
|
|
41
|
+
*/
|
|
42
|
+
data?: OAuthAuthorizeResponseData;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @type {RequestMeta}
|
|
46
|
+
* @memberof OAuthAuthorizeResponse
|
|
47
|
+
*/
|
|
48
|
+
meta?: RequestMeta;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Check if a given object implements the OAuthAuthorizeResponse interface.
|
|
53
|
+
*/
|
|
54
|
+
export function instanceOfOAuthAuthorizeResponse(value: object): value is OAuthAuthorizeResponse {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function OAuthAuthorizeResponseFromJSON(json: any): OAuthAuthorizeResponse {
|
|
59
|
+
return OAuthAuthorizeResponseFromJSONTyped(json, false);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function OAuthAuthorizeResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): OAuthAuthorizeResponse {
|
|
63
|
+
if (json == null) {
|
|
64
|
+
return json;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
|
|
68
|
+
'data': json['data'] == null ? undefined : OAuthAuthorizeResponseDataFromJSON(json['data']),
|
|
69
|
+
'meta': json['meta'] == null ? undefined : RequestMetaFromJSON(json['meta']),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function OAuthAuthorizeResponseToJSON(json: any): OAuthAuthorizeResponse {
|
|
74
|
+
return OAuthAuthorizeResponseToJSONTyped(json, false);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function OAuthAuthorizeResponseToJSONTyped(value?: OAuthAuthorizeResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
78
|
+
if (value == null) {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
|
|
84
|
+
'data': OAuthAuthorizeResponseDataToJSON(value['data']),
|
|
85
|
+
'meta': RequestMetaToJSON(value['meta']),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
@@ -0,0 +1,73 @@
|
|
|
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 ## Account Sending Status Every authenticated response carries the account\'s current sending state so you can surface it in your own tooling without a separate call: - `X-Account-Sending-Status`: `active`, `throttled`, or `frozen` - `X-Account-Sending-Status-Reason`: human-readable reason (present only when the status is `throttled` or `frozen`) This header is informational and non-blocking on non-send endpoints (reads, billing, and deliverability stay available). Send-capable endpoints additionally enforce the state: a frozen account receives `403 account_frozen` and a throttled account receives `429 account_throttled`, both with the reason in the error message. ## 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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface OAuthAuthorizeResponseData
|
|
20
|
+
*/
|
|
21
|
+
export interface OAuthAuthorizeResponseData {
|
|
22
|
+
/**
|
|
23
|
+
* Provider authorization URL to redirect the user to
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof OAuthAuthorizeResponseData
|
|
26
|
+
*/
|
|
27
|
+
authorizationUrl?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Opaque one-time state token for the callback
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof OAuthAuthorizeResponseData
|
|
32
|
+
*/
|
|
33
|
+
state?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Check if a given object implements the OAuthAuthorizeResponseData interface.
|
|
38
|
+
*/
|
|
39
|
+
export function instanceOfOAuthAuthorizeResponseData(value: object): value is OAuthAuthorizeResponseData {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function OAuthAuthorizeResponseDataFromJSON(json: any): OAuthAuthorizeResponseData {
|
|
44
|
+
return OAuthAuthorizeResponseDataFromJSONTyped(json, false);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function OAuthAuthorizeResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): OAuthAuthorizeResponseData {
|
|
48
|
+
if (json == null) {
|
|
49
|
+
return json;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
|
|
53
|
+
'authorizationUrl': json['authorization_url'] == null ? undefined : json['authorization_url'],
|
|
54
|
+
'state': json['state'] == null ? undefined : json['state'],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function OAuthAuthorizeResponseDataToJSON(json: any): OAuthAuthorizeResponseData {
|
|
59
|
+
return OAuthAuthorizeResponseDataToJSONTyped(json, false);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function OAuthAuthorizeResponseDataToJSONTyped(value?: OAuthAuthorizeResponseData | null, ignoreDiscriminator: boolean = false): any {
|
|
63
|
+
if (value == null) {
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
|
|
69
|
+
'authorization_url': value['authorizationUrl'],
|
|
70
|
+
'state': value['state'],
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
@@ -0,0 +1,88 @@
|
|
|
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 ## Account Sending Status Every authenticated response carries the account\'s current sending state so you can surface it in your own tooling without a separate call: - `X-Account-Sending-Status`: `active`, `throttled`, or `frozen` - `X-Account-Sending-Status-Reason`: human-readable reason (present only when the status is `throttled` or `frozen`) This header is informational and non-blocking on non-send endpoints (reads, billing, and deliverability stay available). Send-capable endpoints additionally enforce the state: a frozen account receives `403 account_frozen` and a throttled account receives `429 account_throttled`, both with the reason in the error message. ## 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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { RequestMeta } from './RequestMeta';
|
|
17
|
+
import {
|
|
18
|
+
RequestMetaFromJSON,
|
|
19
|
+
RequestMetaFromJSONTyped,
|
|
20
|
+
RequestMetaToJSON,
|
|
21
|
+
RequestMetaToJSONTyped,
|
|
22
|
+
} from './RequestMeta';
|
|
23
|
+
import type { OAuthLinkResponseData } from './OAuthLinkResponseData';
|
|
24
|
+
import {
|
|
25
|
+
OAuthLinkResponseDataFromJSON,
|
|
26
|
+
OAuthLinkResponseDataFromJSONTyped,
|
|
27
|
+
OAuthLinkResponseDataToJSON,
|
|
28
|
+
OAuthLinkResponseDataToJSONTyped,
|
|
29
|
+
} from './OAuthLinkResponseData';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @interface OAuthLinkResponse
|
|
35
|
+
*/
|
|
36
|
+
export interface OAuthLinkResponse {
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {OAuthLinkResponseData}
|
|
40
|
+
* @memberof OAuthLinkResponse
|
|
41
|
+
*/
|
|
42
|
+
data?: OAuthLinkResponseData;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @type {RequestMeta}
|
|
46
|
+
* @memberof OAuthLinkResponse
|
|
47
|
+
*/
|
|
48
|
+
meta?: RequestMeta;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Check if a given object implements the OAuthLinkResponse interface.
|
|
53
|
+
*/
|
|
54
|
+
export function instanceOfOAuthLinkResponse(value: object): value is OAuthLinkResponse {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function OAuthLinkResponseFromJSON(json: any): OAuthLinkResponse {
|
|
59
|
+
return OAuthLinkResponseFromJSONTyped(json, false);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function OAuthLinkResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): OAuthLinkResponse {
|
|
63
|
+
if (json == null) {
|
|
64
|
+
return json;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
|
|
68
|
+
'data': json['data'] == null ? undefined : OAuthLinkResponseDataFromJSON(json['data']),
|
|
69
|
+
'meta': json['meta'] == null ? undefined : RequestMetaFromJSON(json['meta']),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function OAuthLinkResponseToJSON(json: any): OAuthLinkResponse {
|
|
74
|
+
return OAuthLinkResponseToJSONTyped(json, false);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function OAuthLinkResponseToJSONTyped(value?: OAuthLinkResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
78
|
+
if (value == null) {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
|
|
84
|
+
'data': OAuthLinkResponseDataToJSON(value['data']),
|
|
85
|
+
'meta': RequestMetaToJSON(value['meta']),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
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 ## Account Sending Status Every authenticated response carries the account\'s current sending state so you can surface it in your own tooling without a separate call: - `X-Account-Sending-Status`: `active`, `throttled`, or `frozen` - `X-Account-Sending-Status-Reason`: human-readable reason (present only when the status is `throttled` or `frozen`) This header is informational and non-blocking on non-send endpoints (reads, billing, and deliverability stay available). Send-capable endpoints additionally enforce the state: a frozen account receives `403 account_frozen` and a throttled account receives `429 account_throttled`, both with the reason in the error message. ## 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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { OAuthProviderInfo } from './OAuthProviderInfo';
|
|
17
|
+
import {
|
|
18
|
+
OAuthProviderInfoFromJSON,
|
|
19
|
+
OAuthProviderInfoFromJSONTyped,
|
|
20
|
+
OAuthProviderInfoToJSON,
|
|
21
|
+
OAuthProviderInfoToJSONTyped,
|
|
22
|
+
} from './OAuthProviderInfo';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface OAuthLinkResponseData
|
|
28
|
+
*/
|
|
29
|
+
export interface OAuthLinkResponseData {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {boolean}
|
|
33
|
+
* @memberof OAuthLinkResponseData
|
|
34
|
+
*/
|
|
35
|
+
success?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {OAuthProviderInfo}
|
|
39
|
+
* @memberof OAuthLinkResponseData
|
|
40
|
+
*/
|
|
41
|
+
providerInfo?: OAuthProviderInfo;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Check if a given object implements the OAuthLinkResponseData interface.
|
|
46
|
+
*/
|
|
47
|
+
export function instanceOfOAuthLinkResponseData(value: object): value is OAuthLinkResponseData {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function OAuthLinkResponseDataFromJSON(json: any): OAuthLinkResponseData {
|
|
52
|
+
return OAuthLinkResponseDataFromJSONTyped(json, false);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function OAuthLinkResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): OAuthLinkResponseData {
|
|
56
|
+
if (json == null) {
|
|
57
|
+
return json;
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
|
|
61
|
+
'success': json['success'] == null ? undefined : json['success'],
|
|
62
|
+
'providerInfo': json['provider_info'] == null ? undefined : OAuthProviderInfoFromJSON(json['provider_info']),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function OAuthLinkResponseDataToJSON(json: any): OAuthLinkResponseData {
|
|
67
|
+
return OAuthLinkResponseDataToJSONTyped(json, false);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function OAuthLinkResponseDataToJSONTyped(value?: OAuthLinkResponseData | null, ignoreDiscriminator: boolean = false): any {
|
|
71
|
+
if (value == null) {
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
|
|
77
|
+
'success': value['success'],
|
|
78
|
+
'provider_info': OAuthProviderInfoToJSON(value['providerInfo']),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
@@ -61,6 +61,12 @@ export interface PasswordPolicy {
|
|
|
61
61
|
* @memberof PasswordPolicy
|
|
62
62
|
*/
|
|
63
63
|
disallowCommon: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Whether passwords found in the HaveIBeenPwned breach corpus are rejected at registration/reset. Checked via k-anonymity (only a 5-char SHA-1 prefix leaves our infrastructure) and fail-open: if the breach source is unavailable the password is allowed. Default false (advisory only — the breach signal is returned but does not gate acceptance unless enabled).
|
|
66
|
+
* @type {boolean}
|
|
67
|
+
* @memberof PasswordPolicy
|
|
68
|
+
*/
|
|
69
|
+
disallowBreached: boolean;
|
|
64
70
|
}
|
|
65
71
|
|
|
66
72
|
/**
|
|
@@ -74,6 +80,7 @@ export function instanceOfPasswordPolicy(value: object): value is PasswordPolicy
|
|
|
74
80
|
if (!('requireNumbers' in value) || value['requireNumbers'] === undefined) return false;
|
|
75
81
|
if (!('requireSpecial' in value) || value['requireSpecial'] === undefined) return false;
|
|
76
82
|
if (!('disallowCommon' in value) || value['disallowCommon'] === undefined) return false;
|
|
83
|
+
if (!('disallowBreached' in value) || value['disallowBreached'] === undefined) return false;
|
|
77
84
|
return true;
|
|
78
85
|
}
|
|
79
86
|
|
|
@@ -94,6 +101,7 @@ export function PasswordPolicyFromJSONTyped(json: any, ignoreDiscriminator: bool
|
|
|
94
101
|
'requireNumbers': json['require_numbers'],
|
|
95
102
|
'requireSpecial': json['require_special'],
|
|
96
103
|
'disallowCommon': json['disallow_common'],
|
|
104
|
+
'disallowBreached': json['disallow_breached'],
|
|
97
105
|
};
|
|
98
106
|
}
|
|
99
107
|
|
|
@@ -115,6 +123,7 @@ export function PasswordPolicyToJSONTyped(value?: PasswordPolicy | null, ignoreD
|
|
|
115
123
|
'require_numbers': value['requireNumbers'],
|
|
116
124
|
'require_special': value['requireSpecial'],
|
|
117
125
|
'disallow_common': value['disallowCommon'],
|
|
126
|
+
'disallow_breached': value['disallowBreached'],
|
|
118
127
|
};
|
|
119
128
|
}
|
|
120
129
|
|