@zyphr-dev/node-sdk 0.1.43 → 0.1.45
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/README.md +6 -4
- package/dist/index.cjs +511 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +522 -21
- package/dist/index.d.ts +522 -21
- package/dist/index.js +472 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +8 -0
- package/src/client.ts +18 -3
- package/src/clientAuth.ts +45 -12
- package/src/src/apis/AuthApplicationApi.ts +162 -0
- package/src/src/apis/AuthEmailTemplatesApi.ts +4 -4
- package/src/src/apis/AuthUserDirectoryApi.ts +66 -0
- package/src/src/apis/AuthUserProfileApi.ts +76 -0
- package/src/src/apis/index.ts +1 -0
- package/src/src/models/ApplicationSelf.ts +127 -0
- package/src/src/models/ApplicationSelfResponse.ts +88 -0
- package/src/src/models/AuthEmailTemplateTestRequest.ts +1 -1
- package/src/src/models/AuthMethods.ts +111 -0
- package/src/src/models/ChangePasswordRequest.ts +75 -0
- package/src/src/models/GetEndUserAuthMethods200Response.ts +88 -0
- package/src/src/models/SetSelfApplicationTestRecipientsRequest.ts +66 -0
- package/src/src/models/WebhookDelivery.ts +12 -4
- package/src/src/models/WebhookDeliveryDetail.ts +12 -4
- package/src/src/models/WebhookEventType.ts +79 -0
- package/src/src/models/WebhookEventTypesResponseData.ts +12 -4
- package/src/src/models/WebhookTestEventResponseData.ts +14 -4
- package/src/src/models/index.ts +7 -0
|
@@ -0,0 +1,127 @@
|
|
|
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
|
+
* Non-sensitive metadata about the authenticating application. Returned by
|
|
18
|
+
* GET /auth/application so an integrator can read their own application_id
|
|
19
|
+
* (the sole tenant discriminator embedded in end-user tokens) directly from
|
|
20
|
+
* the API. Never includes secrets, signing keys, or account-internal fields.
|
|
21
|
+
*
|
|
22
|
+
* @export
|
|
23
|
+
* @interface ApplicationSelf
|
|
24
|
+
*/
|
|
25
|
+
export interface ApplicationSelf {
|
|
26
|
+
/**
|
|
27
|
+
* The application's unique id (application_id).
|
|
28
|
+
* @type {string}
|
|
29
|
+
* @memberof ApplicationSelf
|
|
30
|
+
*/
|
|
31
|
+
id: string;
|
|
32
|
+
/**
|
|
33
|
+
* Human-readable application name.
|
|
34
|
+
* @type {string}
|
|
35
|
+
* @memberof ApplicationSelf
|
|
36
|
+
*/
|
|
37
|
+
name: string;
|
|
38
|
+
/**
|
|
39
|
+
* The environment mode of the credentials used to authenticate this request. `null` when the environment cannot be determined (e.g. a legacy application-level key that predates environment-scoped keys) — not defaulted to a guessed value.
|
|
40
|
+
* @type {string}
|
|
41
|
+
* @memberof ApplicationSelf
|
|
42
|
+
*/
|
|
43
|
+
environment: ApplicationSelfEnvironmentEnum | null;
|
|
44
|
+
/**
|
|
45
|
+
* JWT signing algorithm for this application's end-user tokens.
|
|
46
|
+
* @type {string}
|
|
47
|
+
* @memberof ApplicationSelf
|
|
48
|
+
*/
|
|
49
|
+
signingAlgorithm: ApplicationSelfSigningAlgorithmEnum;
|
|
50
|
+
/**
|
|
51
|
+
* The auth-email test allowlist. When non-empty, only these addresses receive auth emails (the gate from sc-7443); an empty array disables the gate. Settable via PATCH /auth/application (sc-7600).
|
|
52
|
+
* @type {Array<string>}
|
|
53
|
+
* @memberof ApplicationSelf
|
|
54
|
+
*/
|
|
55
|
+
testRecipients: Array<string>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @export
|
|
61
|
+
*/
|
|
62
|
+
export const ApplicationSelfEnvironmentEnum = {
|
|
63
|
+
TEST: 'test',
|
|
64
|
+
LIVE: 'live'
|
|
65
|
+
} as const;
|
|
66
|
+
export type ApplicationSelfEnvironmentEnum = typeof ApplicationSelfEnvironmentEnum[keyof typeof ApplicationSelfEnvironmentEnum];
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* @export
|
|
70
|
+
*/
|
|
71
|
+
export const ApplicationSelfSigningAlgorithmEnum = {
|
|
72
|
+
HS256: 'HS256',
|
|
73
|
+
RS256: 'RS256',
|
|
74
|
+
ES256: 'ES256'
|
|
75
|
+
} as const;
|
|
76
|
+
export type ApplicationSelfSigningAlgorithmEnum = typeof ApplicationSelfSigningAlgorithmEnum[keyof typeof ApplicationSelfSigningAlgorithmEnum];
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Check if a given object implements the ApplicationSelf interface.
|
|
81
|
+
*/
|
|
82
|
+
export function instanceOfApplicationSelf(value: object): value is ApplicationSelf {
|
|
83
|
+
if (!('id' in value) || value['id'] === undefined) return false;
|
|
84
|
+
if (!('name' in value) || value['name'] === undefined) return false;
|
|
85
|
+
if (!('environment' in value) || value['environment'] === undefined) return false;
|
|
86
|
+
if (!('signingAlgorithm' in value) || value['signingAlgorithm'] === undefined) return false;
|
|
87
|
+
if (!('testRecipients' in value) || value['testRecipients'] === undefined) return false;
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function ApplicationSelfFromJSON(json: any): ApplicationSelf {
|
|
92
|
+
return ApplicationSelfFromJSONTyped(json, false);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function ApplicationSelfFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApplicationSelf {
|
|
96
|
+
if (json == null) {
|
|
97
|
+
return json;
|
|
98
|
+
}
|
|
99
|
+
return {
|
|
100
|
+
|
|
101
|
+
'id': json['id'],
|
|
102
|
+
'name': json['name'],
|
|
103
|
+
'environment': json['environment'],
|
|
104
|
+
'signingAlgorithm': json['signing_algorithm'],
|
|
105
|
+
'testRecipients': json['test_recipients'],
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function ApplicationSelfToJSON(json: any): ApplicationSelf {
|
|
110
|
+
return ApplicationSelfToJSONTyped(json, false);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function ApplicationSelfToJSONTyped(value?: ApplicationSelf | null, ignoreDiscriminator: boolean = false): any {
|
|
114
|
+
if (value == null) {
|
|
115
|
+
return value;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
|
|
120
|
+
'id': value['id'],
|
|
121
|
+
'name': value['name'],
|
|
122
|
+
'environment': value['environment'],
|
|
123
|
+
'signing_algorithm': value['signingAlgorithm'],
|
|
124
|
+
'test_recipients': value['testRecipients'],
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
@@ -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 { ApplicationSelf } from './ApplicationSelf';
|
|
17
|
+
import {
|
|
18
|
+
ApplicationSelfFromJSON,
|
|
19
|
+
ApplicationSelfFromJSONTyped,
|
|
20
|
+
ApplicationSelfToJSON,
|
|
21
|
+
ApplicationSelfToJSONTyped,
|
|
22
|
+
} from './ApplicationSelf';
|
|
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 ApplicationSelfResponse
|
|
35
|
+
*/
|
|
36
|
+
export interface ApplicationSelfResponse {
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {ApplicationSelf}
|
|
40
|
+
* @memberof ApplicationSelfResponse
|
|
41
|
+
*/
|
|
42
|
+
data?: ApplicationSelf;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @type {RequestMeta}
|
|
46
|
+
* @memberof ApplicationSelfResponse
|
|
47
|
+
*/
|
|
48
|
+
meta?: RequestMeta;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Check if a given object implements the ApplicationSelfResponse interface.
|
|
53
|
+
*/
|
|
54
|
+
export function instanceOfApplicationSelfResponse(value: object): value is ApplicationSelfResponse {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function ApplicationSelfResponseFromJSON(json: any): ApplicationSelfResponse {
|
|
59
|
+
return ApplicationSelfResponseFromJSONTyped(json, false);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function ApplicationSelfResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApplicationSelfResponse {
|
|
63
|
+
if (json == null) {
|
|
64
|
+
return json;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
|
|
68
|
+
'data': json['data'] == null ? undefined : ApplicationSelfFromJSON(json['data']),
|
|
69
|
+
'meta': json['meta'] == null ? undefined : RequestMetaFromJSON(json['meta']),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function ApplicationSelfResponseToJSON(json: any): ApplicationSelfResponse {
|
|
74
|
+
return ApplicationSelfResponseToJSONTyped(json, false);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function ApplicationSelfResponseToJSONTyped(value?: ApplicationSelfResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
78
|
+
if (value == null) {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
|
|
84
|
+
'data': ApplicationSelfToJSON(value['data']),
|
|
85
|
+
'meta': RequestMetaToJSON(value['meta']),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
@@ -20,7 +20,7 @@ import { mapValues } from '../runtime';
|
|
|
20
20
|
*/
|
|
21
21
|
export interface AuthEmailTemplateTestRequest {
|
|
22
22
|
/**
|
|
23
|
-
* Recipient email. Must be in the application's `test_recipients` allowlist.
|
|
23
|
+
* Recipient email. Must be in the application's `test_recipients` allowlist. When non-empty, `test_recipients` gates ALL auth emails the application sends (magic link, password reset, verification, OTP) — only listed recipients receive auth email — which keeps non-production applications safe from mass sends. An empty allowlist imposes no restriction.
|
|
24
24
|
* @type {string}
|
|
25
25
|
* @memberof AuthEmailTemplateTestRequest
|
|
26
26
|
*/
|
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
* Aggregate view of the sign-in methods configured for a single end user, for building a customer "sign-in methods" screen.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface AuthMethods
|
|
20
|
+
*/
|
|
21
|
+
export interface AuthMethods {
|
|
22
|
+
/**
|
|
23
|
+
* True if the user has a password credential (false for OAuth-only / passwordless users).
|
|
24
|
+
* @type {boolean}
|
|
25
|
+
* @memberof AuthMethods
|
|
26
|
+
*/
|
|
27
|
+
hasPassword: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Distinct OAuth providers linked to the user (e.g. google, apple).
|
|
30
|
+
* @type {Array<string>}
|
|
31
|
+
* @memberof AuthMethods
|
|
32
|
+
*/
|
|
33
|
+
oauthProviders: Array<string>;
|
|
34
|
+
/**
|
|
35
|
+
* True if the user has multi-factor authentication enabled.
|
|
36
|
+
* @type {boolean}
|
|
37
|
+
* @memberof AuthMethods
|
|
38
|
+
*/
|
|
39
|
+
mfaEnabled: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* True if the user's email address has been verified.
|
|
42
|
+
* @type {boolean}
|
|
43
|
+
* @memberof AuthMethods
|
|
44
|
+
*/
|
|
45
|
+
emailVerified: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* True if the user's phone number has been verified.
|
|
48
|
+
* @type {boolean}
|
|
49
|
+
* @memberof AuthMethods
|
|
50
|
+
*/
|
|
51
|
+
phoneVerified: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Number of WebAuthn passkeys registered for the user.
|
|
54
|
+
* @type {number}
|
|
55
|
+
* @memberof AuthMethods
|
|
56
|
+
*/
|
|
57
|
+
passkeys: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Check if a given object implements the AuthMethods interface.
|
|
62
|
+
*/
|
|
63
|
+
export function instanceOfAuthMethods(value: object): value is AuthMethods {
|
|
64
|
+
if (!('hasPassword' in value) || value['hasPassword'] === undefined) return false;
|
|
65
|
+
if (!('oauthProviders' in value) || value['oauthProviders'] === undefined) return false;
|
|
66
|
+
if (!('mfaEnabled' in value) || value['mfaEnabled'] === undefined) return false;
|
|
67
|
+
if (!('emailVerified' in value) || value['emailVerified'] === undefined) return false;
|
|
68
|
+
if (!('phoneVerified' in value) || value['phoneVerified'] === undefined) return false;
|
|
69
|
+
if (!('passkeys' in value) || value['passkeys'] === undefined) return false;
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function AuthMethodsFromJSON(json: any): AuthMethods {
|
|
74
|
+
return AuthMethodsFromJSONTyped(json, false);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function AuthMethodsFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthMethods {
|
|
78
|
+
if (json == null) {
|
|
79
|
+
return json;
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
|
|
83
|
+
'hasPassword': json['has_password'],
|
|
84
|
+
'oauthProviders': json['oauth_providers'],
|
|
85
|
+
'mfaEnabled': json['mfa_enabled'],
|
|
86
|
+
'emailVerified': json['email_verified'],
|
|
87
|
+
'phoneVerified': json['phone_verified'],
|
|
88
|
+
'passkeys': json['passkeys'],
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function AuthMethodsToJSON(json: any): AuthMethods {
|
|
93
|
+
return AuthMethodsToJSONTyped(json, false);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export function AuthMethodsToJSONTyped(value?: AuthMethods | null, ignoreDiscriminator: boolean = false): any {
|
|
97
|
+
if (value == null) {
|
|
98
|
+
return value;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
|
|
103
|
+
'has_password': value['hasPassword'],
|
|
104
|
+
'oauth_providers': value['oauthProviders'],
|
|
105
|
+
'mfa_enabled': value['mfaEnabled'],
|
|
106
|
+
'email_verified': value['emailVerified'],
|
|
107
|
+
'phone_verified': value['phoneVerified'],
|
|
108
|
+
'passkeys': value['passkeys'],
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
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 ChangePasswordRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface ChangePasswordRequest {
|
|
22
|
+
/**
|
|
23
|
+
* The user's current password, for verification.
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof ChangePasswordRequest
|
|
26
|
+
*/
|
|
27
|
+
currentPassword: string;
|
|
28
|
+
/**
|
|
29
|
+
* The new password. Must satisfy the application's password policy.
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof ChangePasswordRequest
|
|
32
|
+
*/
|
|
33
|
+
newPassword: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Check if a given object implements the ChangePasswordRequest interface.
|
|
38
|
+
*/
|
|
39
|
+
export function instanceOfChangePasswordRequest(value: object): value is ChangePasswordRequest {
|
|
40
|
+
if (!('currentPassword' in value) || value['currentPassword'] === undefined) return false;
|
|
41
|
+
if (!('newPassword' in value) || value['newPassword'] === undefined) return false;
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function ChangePasswordRequestFromJSON(json: any): ChangePasswordRequest {
|
|
46
|
+
return ChangePasswordRequestFromJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function ChangePasswordRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ChangePasswordRequest {
|
|
50
|
+
if (json == null) {
|
|
51
|
+
return json;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
|
|
55
|
+
'currentPassword': json['current_password'],
|
|
56
|
+
'newPassword': json['new_password'],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function ChangePasswordRequestToJSON(json: any): ChangePasswordRequest {
|
|
61
|
+
return ChangePasswordRequestToJSONTyped(json, false);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function ChangePasswordRequestToJSONTyped(value?: ChangePasswordRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
65
|
+
if (value == null) {
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
|
|
71
|
+
'current_password': value['currentPassword'],
|
|
72
|
+
'new_password': value['newPassword'],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
@@ -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 { AuthMethods } from './AuthMethods';
|
|
17
|
+
import {
|
|
18
|
+
AuthMethodsFromJSON,
|
|
19
|
+
AuthMethodsFromJSONTyped,
|
|
20
|
+
AuthMethodsToJSON,
|
|
21
|
+
AuthMethodsToJSONTyped,
|
|
22
|
+
} from './AuthMethods';
|
|
23
|
+
import type { GetDomain200ResponseMeta } from './GetDomain200ResponseMeta';
|
|
24
|
+
import {
|
|
25
|
+
GetDomain200ResponseMetaFromJSON,
|
|
26
|
+
GetDomain200ResponseMetaFromJSONTyped,
|
|
27
|
+
GetDomain200ResponseMetaToJSON,
|
|
28
|
+
GetDomain200ResponseMetaToJSONTyped,
|
|
29
|
+
} from './GetDomain200ResponseMeta';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @interface GetEndUserAuthMethods200Response
|
|
35
|
+
*/
|
|
36
|
+
export interface GetEndUserAuthMethods200Response {
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {AuthMethods}
|
|
40
|
+
* @memberof GetEndUserAuthMethods200Response
|
|
41
|
+
*/
|
|
42
|
+
data?: AuthMethods;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @type {GetDomain200ResponseMeta}
|
|
46
|
+
* @memberof GetEndUserAuthMethods200Response
|
|
47
|
+
*/
|
|
48
|
+
meta?: GetDomain200ResponseMeta;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Check if a given object implements the GetEndUserAuthMethods200Response interface.
|
|
53
|
+
*/
|
|
54
|
+
export function instanceOfGetEndUserAuthMethods200Response(value: object): value is GetEndUserAuthMethods200Response {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function GetEndUserAuthMethods200ResponseFromJSON(json: any): GetEndUserAuthMethods200Response {
|
|
59
|
+
return GetEndUserAuthMethods200ResponseFromJSONTyped(json, false);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function GetEndUserAuthMethods200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GetEndUserAuthMethods200Response {
|
|
63
|
+
if (json == null) {
|
|
64
|
+
return json;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
|
|
68
|
+
'data': json['data'] == null ? undefined : AuthMethodsFromJSON(json['data']),
|
|
69
|
+
'meta': json['meta'] == null ? undefined : GetDomain200ResponseMetaFromJSON(json['meta']),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function GetEndUserAuthMethods200ResponseToJSON(json: any): GetEndUserAuthMethods200Response {
|
|
74
|
+
return GetEndUserAuthMethods200ResponseToJSONTyped(json, false);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function GetEndUserAuthMethods200ResponseToJSONTyped(value?: GetEndUserAuthMethods200Response | null, ignoreDiscriminator: boolean = false): any {
|
|
78
|
+
if (value == null) {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
|
|
84
|
+
'data': AuthMethodsToJSON(value['data']),
|
|
85
|
+
'meta': GetDomain200ResponseMetaToJSON(value['meta']),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
@@ -0,0 +1,66 @@
|
|
|
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 SetSelfApplicationTestRecipientsRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface SetSelfApplicationTestRecipientsRequest {
|
|
22
|
+
/**
|
|
23
|
+
* Email addresses allowed to receive auth emails. An empty array clears the allowlist (disables the gate).
|
|
24
|
+
* @type {Array<string>}
|
|
25
|
+
* @memberof SetSelfApplicationTestRecipientsRequest
|
|
26
|
+
*/
|
|
27
|
+
testRecipients: Array<string>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the SetSelfApplicationTestRecipientsRequest interface.
|
|
32
|
+
*/
|
|
33
|
+
export function instanceOfSetSelfApplicationTestRecipientsRequest(value: object): value is SetSelfApplicationTestRecipientsRequest {
|
|
34
|
+
if (!('testRecipients' in value) || value['testRecipients'] === undefined) return false;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function SetSelfApplicationTestRecipientsRequestFromJSON(json: any): SetSelfApplicationTestRecipientsRequest {
|
|
39
|
+
return SetSelfApplicationTestRecipientsRequestFromJSONTyped(json, false);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function SetSelfApplicationTestRecipientsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SetSelfApplicationTestRecipientsRequest {
|
|
43
|
+
if (json == null) {
|
|
44
|
+
return json;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
|
|
48
|
+
'testRecipients': json['test_recipients'],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function SetSelfApplicationTestRecipientsRequestToJSON(json: any): SetSelfApplicationTestRecipientsRequest {
|
|
53
|
+
return SetSelfApplicationTestRecipientsRequestToJSONTyped(json, false);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function SetSelfApplicationTestRecipientsRequestToJSONTyped(value?: SetSelfApplicationTestRecipientsRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
57
|
+
if (value == null) {
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
|
|
63
|
+
'test_recipients': value['testRecipients'],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
@@ -13,6 +13,14 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
|
+
import type { WebhookEventType } from './WebhookEventType';
|
|
17
|
+
import {
|
|
18
|
+
WebhookEventTypeFromJSON,
|
|
19
|
+
WebhookEventTypeFromJSONTyped,
|
|
20
|
+
WebhookEventTypeToJSON,
|
|
21
|
+
WebhookEventTypeToJSONTyped,
|
|
22
|
+
} from './WebhookEventType';
|
|
23
|
+
|
|
16
24
|
/**
|
|
17
25
|
*
|
|
18
26
|
* @export
|
|
@@ -39,10 +47,10 @@ export interface WebhookDelivery {
|
|
|
39
47
|
eventId?: string;
|
|
40
48
|
/**
|
|
41
49
|
*
|
|
42
|
-
* @type {
|
|
50
|
+
* @type {WebhookEventType}
|
|
43
51
|
* @memberof WebhookDelivery
|
|
44
52
|
*/
|
|
45
|
-
eventType?:
|
|
53
|
+
eventType?: WebhookEventType;
|
|
46
54
|
/**
|
|
47
55
|
*
|
|
48
56
|
* @type {string}
|
|
@@ -151,7 +159,7 @@ export function WebhookDeliveryFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
151
159
|
'id': json['id'] == null ? undefined : json['id'],
|
|
152
160
|
'msgId': json['msg_id'] == null ? undefined : json['msg_id'],
|
|
153
161
|
'eventId': json['event_id'] == null ? undefined : json['event_id'],
|
|
154
|
-
'eventType': json['event_type'] == null ? undefined : json['event_type'],
|
|
162
|
+
'eventType': json['event_type'] == null ? undefined : WebhookEventTypeFromJSON(json['event_type']),
|
|
155
163
|
'status': json['status'] == null ? undefined : json['status'],
|
|
156
164
|
'attempts': json['attempts'] == null ? undefined : json['attempts'],
|
|
157
165
|
'maxAttempts': json['max_attempts'] == null ? undefined : json['max_attempts'],
|
|
@@ -181,7 +189,7 @@ export function WebhookDeliveryToJSONTyped(value?: WebhookDelivery | null, ignor
|
|
|
181
189
|
'id': value['id'],
|
|
182
190
|
'msg_id': value['msgId'],
|
|
183
191
|
'event_id': value['eventId'],
|
|
184
|
-
'event_type': value['eventType'],
|
|
192
|
+
'event_type': WebhookEventTypeToJSON(value['eventType']),
|
|
185
193
|
'status': value['status'],
|
|
186
194
|
'attempts': value['attempts'],
|
|
187
195
|
'max_attempts': value['maxAttempts'],
|
|
@@ -13,6 +13,14 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
|
+
import type { WebhookEventType } from './WebhookEventType';
|
|
17
|
+
import {
|
|
18
|
+
WebhookEventTypeFromJSON,
|
|
19
|
+
WebhookEventTypeFromJSONTyped,
|
|
20
|
+
WebhookEventTypeToJSON,
|
|
21
|
+
WebhookEventTypeToJSONTyped,
|
|
22
|
+
} from './WebhookEventType';
|
|
23
|
+
|
|
16
24
|
/**
|
|
17
25
|
* Full delivery object with payload, headers, and response details
|
|
18
26
|
* @export
|
|
@@ -39,10 +47,10 @@ export interface WebhookDeliveryDetail {
|
|
|
39
47
|
eventId?: string;
|
|
40
48
|
/**
|
|
41
49
|
*
|
|
42
|
-
* @type {
|
|
50
|
+
* @type {WebhookEventType}
|
|
43
51
|
* @memberof WebhookDeliveryDetail
|
|
44
52
|
*/
|
|
45
|
-
eventType?:
|
|
53
|
+
eventType?: WebhookEventType;
|
|
46
54
|
/**
|
|
47
55
|
*
|
|
48
56
|
* @type {string}
|
|
@@ -175,7 +183,7 @@ export function WebhookDeliveryDetailFromJSONTyped(json: any, ignoreDiscriminato
|
|
|
175
183
|
'id': json['id'] == null ? undefined : json['id'],
|
|
176
184
|
'msgId': json['msg_id'] == null ? undefined : json['msg_id'],
|
|
177
185
|
'eventId': json['event_id'] == null ? undefined : json['event_id'],
|
|
178
|
-
'eventType': json['event_type'] == null ? undefined : json['event_type'],
|
|
186
|
+
'eventType': json['event_type'] == null ? undefined : WebhookEventTypeFromJSON(json['event_type']),
|
|
179
187
|
'status': json['status'] == null ? undefined : json['status'],
|
|
180
188
|
'attempts': json['attempts'] == null ? undefined : json['attempts'],
|
|
181
189
|
'maxAttempts': json['max_attempts'] == null ? undefined : json['max_attempts'],
|
|
@@ -209,7 +217,7 @@ export function WebhookDeliveryDetailToJSONTyped(value?: WebhookDeliveryDetail |
|
|
|
209
217
|
'id': value['id'],
|
|
210
218
|
'msg_id': value['msgId'],
|
|
211
219
|
'event_id': value['eventId'],
|
|
212
|
-
'event_type': value['eventType'],
|
|
220
|
+
'event_type': WebhookEventTypeToJSON(value['eventType']),
|
|
213
221
|
'status': value['status'],
|
|
214
222
|
'attempts': value['attempts'],
|
|
215
223
|
'max_attempts': value['maxAttempts'],
|