@zyphr-dev/node-sdk 0.1.67 → 0.1.69
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 +232 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +280 -27
- package/dist/index.d.ts +280 -27
- package/dist/index.js +206 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +5 -0
- package/src/src/apis/AuthEmailVerificationApi.ts +4 -4
- package/src/src/apis/AuthMagicLinksApi.ts +12 -12
- package/src/src/apis/AuthPasswordResetApi.ts +12 -12
- package/src/src/apis/AuthUserDirectoryApi.ts +4 -4
- package/src/src/models/ForgotPasswordRequest.ts +11 -0
- package/src/src/models/ForgotPasswordResult.ts +88 -0
- package/src/src/models/ForgotPasswordResultData.ts +100 -0
- package/src/src/models/InviteEndUser200ResponseData.ts +16 -0
- package/src/src/models/InviteEndUserRequest.ts +8 -0
- package/src/src/models/MagicLinkSendRequest.ts +11 -0
- package/src/src/models/MagicLinkSendResult.ts +88 -0
- package/src/src/models/MagicLinkSendResultData.ts +81 -0
- package/src/src/models/ResendEmailVerificationRequest.ts +1 -1
- package/src/src/models/ReturnedAuthLink.ts +87 -0
- package/src/src/models/SendEmailVerificationRequest.ts +1 -1
- package/src/src/models/index.ts +5 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Zyphr API
|
|
5
|
+
* Zyphr is a developer platform for user authentication and transactional messaging. One API covers auth (passkeys, social sign-in, passwordless, MFA, sessions, organizations) plus email, push notifications, SMS, in-app messages, and webhooks. ## 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. > **Test keys are being retired.** `zy_test_*` keys are no longer issued, and existing ones stop working on **21 October 2026**. They never delivered mail — sends were mocked and marked sent without reaching a provider, so they could not verify domain authentication, rendering, or deliverability. To test your integration, use a `zy_live_*` key against a verified domain and send to an address you control. ## 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 { GetDomain200ResponseMeta } from './GetDomain200ResponseMeta';
|
|
17
|
+
import {
|
|
18
|
+
GetDomain200ResponseMetaFromJSON,
|
|
19
|
+
GetDomain200ResponseMetaFromJSONTyped,
|
|
20
|
+
GetDomain200ResponseMetaToJSON,
|
|
21
|
+
GetDomain200ResponseMetaToJSONTyped,
|
|
22
|
+
} from './GetDomain200ResponseMeta';
|
|
23
|
+
import type { MagicLinkSendResultData } from './MagicLinkSendResultData';
|
|
24
|
+
import {
|
|
25
|
+
MagicLinkSendResultDataFromJSON,
|
|
26
|
+
MagicLinkSendResultDataFromJSONTyped,
|
|
27
|
+
MagicLinkSendResultDataToJSON,
|
|
28
|
+
MagicLinkSendResultDataToJSONTyped,
|
|
29
|
+
} from './MagicLinkSendResultData';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @interface MagicLinkSendResult
|
|
35
|
+
*/
|
|
36
|
+
export interface MagicLinkSendResult {
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {MagicLinkSendResultData}
|
|
40
|
+
* @memberof MagicLinkSendResult
|
|
41
|
+
*/
|
|
42
|
+
data?: MagicLinkSendResultData;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @type {GetDomain200ResponseMeta}
|
|
46
|
+
* @memberof MagicLinkSendResult
|
|
47
|
+
*/
|
|
48
|
+
meta?: GetDomain200ResponseMeta;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Check if a given object implements the MagicLinkSendResult interface.
|
|
53
|
+
*/
|
|
54
|
+
export function instanceOfMagicLinkSendResult(value: object): value is MagicLinkSendResult {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function MagicLinkSendResultFromJSON(json: any): MagicLinkSendResult {
|
|
59
|
+
return MagicLinkSendResultFromJSONTyped(json, false);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function MagicLinkSendResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): MagicLinkSendResult {
|
|
63
|
+
if (json == null) {
|
|
64
|
+
return json;
|
|
65
|
+
}
|
|
66
|
+
return {
|
|
67
|
+
|
|
68
|
+
'data': json['data'] == null ? undefined : MagicLinkSendResultDataFromJSON(json['data']),
|
|
69
|
+
'meta': json['meta'] == null ? undefined : GetDomain200ResponseMetaFromJSON(json['meta']),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function MagicLinkSendResultToJSON(json: any): MagicLinkSendResult {
|
|
74
|
+
return MagicLinkSendResultToJSONTyped(json, false);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function MagicLinkSendResultToJSONTyped(value?: MagicLinkSendResult | null, ignoreDiscriminator: boolean = false): any {
|
|
78
|
+
if (value == null) {
|
|
79
|
+
return value;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
|
|
84
|
+
'data': MagicLinkSendResultDataToJSON(value['data']),
|
|
85
|
+
'meta': GetDomain200ResponseMetaToJSON(value['meta']),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Zyphr API
|
|
5
|
+
* Zyphr is a developer platform for user authentication and transactional messaging. One API covers auth (passkeys, social sign-in, passwordless, MFA, sessions, organizations) plus email, push notifications, SMS, in-app messages, and webhooks. ## 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. > **Test keys are being retired.** `zy_test_*` keys are no longer issued, and existing ones stop working on **21 October 2026**. They never delivered mail — sends were mocked and marked sent without reaching a provider, so they could not verify domain authentication, rendering, or deliverability. To test your integration, use a `zy_live_*` key against a verified domain and send to an address you control. ## 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 { ReturnedAuthLink } from './ReturnedAuthLink';
|
|
17
|
+
import {
|
|
18
|
+
ReturnedAuthLinkFromJSON,
|
|
19
|
+
ReturnedAuthLinkFromJSONTyped,
|
|
20
|
+
ReturnedAuthLinkToJSON,
|
|
21
|
+
ReturnedAuthLinkToJSONTyped,
|
|
22
|
+
} from './ReturnedAuthLink';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface MagicLinkSendResultData
|
|
28
|
+
*/
|
|
29
|
+
export interface MagicLinkSendResultData {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {boolean}
|
|
33
|
+
* @memberof MagicLinkSendResultData
|
|
34
|
+
*/
|
|
35
|
+
success?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {ReturnedAuthLink}
|
|
39
|
+
* @memberof MagicLinkSendResultData
|
|
40
|
+
*/
|
|
41
|
+
link?: ReturnedAuthLink;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Check if a given object implements the MagicLinkSendResultData interface.
|
|
46
|
+
*/
|
|
47
|
+
export function instanceOfMagicLinkSendResultData(value: object): value is MagicLinkSendResultData {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function MagicLinkSendResultDataFromJSON(json: any): MagicLinkSendResultData {
|
|
52
|
+
return MagicLinkSendResultDataFromJSONTyped(json, false);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function MagicLinkSendResultDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): MagicLinkSendResultData {
|
|
56
|
+
if (json == null) {
|
|
57
|
+
return json;
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
|
|
61
|
+
'success': json['success'] == null ? undefined : json['success'],
|
|
62
|
+
'link': json['link'] == null ? undefined : ReturnedAuthLinkFromJSON(json['link']),
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export function MagicLinkSendResultDataToJSON(json: any): MagicLinkSendResultData {
|
|
67
|
+
return MagicLinkSendResultDataToJSONTyped(json, false);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function MagicLinkSendResultDataToJSONTyped(value?: MagicLinkSendResultData | null, ignoreDiscriminator: boolean = false): any {
|
|
71
|
+
if (value == null) {
|
|
72
|
+
return value;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return {
|
|
76
|
+
|
|
77
|
+
'success': value['success'],
|
|
78
|
+
'link': ReturnedAuthLinkToJSON(value['link']),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
|
|
@@ -20,7 +20,7 @@ import { mapValues } from '../runtime';
|
|
|
20
20
|
*/
|
|
21
21
|
export interface ResendEmailVerificationRequest {
|
|
22
22
|
/**
|
|
23
|
-
* URL to redirect to after verification
|
|
23
|
+
* URL to redirect to after verification. Same rules as `POST /auth/verify-email/send`.
|
|
24
24
|
* @type {string}
|
|
25
25
|
* @memberof ResendEmailVerificationRequest
|
|
26
26
|
*/
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Zyphr API
|
|
5
|
+
* Zyphr is a developer platform for user authentication and transactional messaging. One API covers auth (passkeys, social sign-in, passwordless, MFA, sessions, organizations) plus email, push notifications, SMS, in-app messages, and webhooks. ## 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. > **Test keys are being retired.** `zy_test_*` keys are no longer issued, and existing ones stop working on **21 October 2026**. They never delivered mail — sends were mocked and marked sent without reaching a provider, so they could not verify domain authentication, rendering, or deliverability. To test your integration, use a `zy_live_*` key against a verified domain and send to an address you control. ## 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
|
+
* A sign-in, reset or invitation link returned instead of emailed
|
|
18
|
+
* (`return_link: true`). The token is a live, single-use credential:
|
|
19
|
+
* never log it or expose it to anyone but the end user.
|
|
20
|
+
*
|
|
21
|
+
* @export
|
|
22
|
+
* @interface ReturnedAuthLink
|
|
23
|
+
*/
|
|
24
|
+
export interface ReturnedAuthLink {
|
|
25
|
+
/**
|
|
26
|
+
* Your `redirect_url` with `?token=` appended — the same URL Zyphr's email would carry.
|
|
27
|
+
* @type {string}
|
|
28
|
+
* @memberof ReturnedAuthLink
|
|
29
|
+
*/
|
|
30
|
+
url: string;
|
|
31
|
+
/**
|
|
32
|
+
* The raw token, redeemed at the matching endpoint (`/auth/magic-link/verify` or `/auth/reset-password`).
|
|
33
|
+
* @type {string}
|
|
34
|
+
* @memberof ReturnedAuthLink
|
|
35
|
+
*/
|
|
36
|
+
token: string;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {Date}
|
|
40
|
+
* @memberof ReturnedAuthLink
|
|
41
|
+
*/
|
|
42
|
+
expiresAt: Date;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Check if a given object implements the ReturnedAuthLink interface.
|
|
47
|
+
*/
|
|
48
|
+
export function instanceOfReturnedAuthLink(value: object): value is ReturnedAuthLink {
|
|
49
|
+
if (!('url' in value) || value['url'] === undefined) return false;
|
|
50
|
+
if (!('token' in value) || value['token'] === undefined) return false;
|
|
51
|
+
if (!('expiresAt' in value) || value['expiresAt'] === undefined) return false;
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function ReturnedAuthLinkFromJSON(json: any): ReturnedAuthLink {
|
|
56
|
+
return ReturnedAuthLinkFromJSONTyped(json, false);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function ReturnedAuthLinkFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReturnedAuthLink {
|
|
60
|
+
if (json == null) {
|
|
61
|
+
return json;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
|
|
65
|
+
'url': json['url'],
|
|
66
|
+
'token': json['token'],
|
|
67
|
+
'expiresAt': (new Date(json['expires_at'])),
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function ReturnedAuthLinkToJSON(json: any): ReturnedAuthLink {
|
|
72
|
+
return ReturnedAuthLinkToJSONTyped(json, false);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function ReturnedAuthLinkToJSONTyped(value?: ReturnedAuthLink | null, ignoreDiscriminator: boolean = false): any {
|
|
76
|
+
if (value == null) {
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
|
|
82
|
+
'url': value['url'],
|
|
83
|
+
'token': value['token'],
|
|
84
|
+
'expires_at': ((value['expiresAt']).toISOString()),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
@@ -20,7 +20,7 @@ import { mapValues } from '../runtime';
|
|
|
20
20
|
*/
|
|
21
21
|
export interface SendEmailVerificationRequest {
|
|
22
22
|
/**
|
|
23
|
-
* URL to redirect to after verification
|
|
23
|
+
* URL to redirect to after verification. Must be snake_case `redirect_url`: a camelCase `redirectUrl` is rejected with 400, since Zyphr hosts no fallback page. Must match one of the application's configured redirect URIs.
|
|
24
24
|
* @type {string}
|
|
25
25
|
* @memberof SendEmailVerificationRequest
|
|
26
26
|
*/
|
package/src/src/models/index.ts
CHANGED
|
@@ -121,6 +121,8 @@ export * from './ExecutionResponse';
|
|
|
121
121
|
export * from './ExecutionRetryResponse';
|
|
122
122
|
export * from './ExecutionRetryResponseData';
|
|
123
123
|
export * from './ForgotPasswordRequest';
|
|
124
|
+
export * from './ForgotPasswordResult';
|
|
125
|
+
export * from './ForgotPasswordResultData';
|
|
124
126
|
export * from './GenerateSubscriberToken200Response';
|
|
125
127
|
export * from './GenerateSubscriberToken200ResponseData';
|
|
126
128
|
export * from './GenerateSubscriberTokenRequest';
|
|
@@ -174,6 +176,8 @@ export * from './ListWorkflows200Response';
|
|
|
174
176
|
export * from './ListWorkflows200ResponseMeta';
|
|
175
177
|
export * from './LoginRequest';
|
|
176
178
|
export * from './MagicLinkSendRequest';
|
|
179
|
+
export * from './MagicLinkSendResult';
|
|
180
|
+
export * from './MagicLinkSendResultData';
|
|
177
181
|
export * from './MagicLinkVerifyRequest';
|
|
178
182
|
export * from './MagicLinkVerifyResponse';
|
|
179
183
|
export * from './MagicLinkVerifyResponseData';
|
|
@@ -282,6 +286,7 @@ export * from './ResetPasswordRequest';
|
|
|
282
286
|
export * from './ResetPasswordResponse';
|
|
283
287
|
export * from './ResubscribeRequest';
|
|
284
288
|
export * from './ResubscribeResponse';
|
|
289
|
+
export * from './ReturnedAuthLink';
|
|
285
290
|
export * from './RevokeAllSessionsResponse';
|
|
286
291
|
export * from './RevokeAllSessionsResponseData';
|
|
287
292
|
export * from './RevokeSessionRequest';
|