@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zyphr-dev/node-sdk",
3
- "version": "0.1.67",
3
+ "version": "0.1.69",
4
4
  "description": "Official Zyphr SDK for Node.js, React, and React Native",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -162,6 +162,8 @@ src/models/ExecutionResponse.ts
162
162
  src/models/ExecutionRetryResponse.ts
163
163
  src/models/ExecutionRetryResponseData.ts
164
164
  src/models/ForgotPasswordRequest.ts
165
+ src/models/ForgotPasswordResult.ts
166
+ src/models/ForgotPasswordResultData.ts
165
167
  src/models/GenerateSubscriberToken200Response.ts
166
168
  src/models/GenerateSubscriberToken200ResponseData.ts
167
169
  src/models/GenerateSubscriberTokenRequest.ts
@@ -215,6 +217,8 @@ src/models/ListWorkflows200Response.ts
215
217
  src/models/ListWorkflows200ResponseMeta.ts
216
218
  src/models/LoginRequest.ts
217
219
  src/models/MagicLinkSendRequest.ts
220
+ src/models/MagicLinkSendResult.ts
221
+ src/models/MagicLinkSendResultData.ts
218
222
  src/models/MagicLinkVerifyRequest.ts
219
223
  src/models/MagicLinkVerifyResponse.ts
220
224
  src/models/MagicLinkVerifyResponseData.ts
@@ -323,6 +327,7 @@ src/models/ResetPasswordRequest.ts
323
327
  src/models/ResetPasswordResponse.ts
324
328
  src/models/ResubscribeRequest.ts
325
329
  src/models/ResubscribeResponse.ts
330
+ src/models/ReturnedAuthLink.ts
326
331
  src/models/RevokeAllSessionsResponse.ts
327
332
  src/models/RevokeAllSessionsResponseData.ts
328
333
  src/models/RevokeSessionRequest.ts
@@ -73,7 +73,7 @@ export interface AuthEmailVerificationApiInterface {
73
73
  confirmEmailVerification(confirmEmailVerificationRequest: ConfirmEmailVerificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ConfirmEmailVerificationResponse>;
74
74
 
75
75
  /**
76
- * Resend the verification email to the authenticated user. Rate limited to once per 60 seconds.
76
+ * Resend the verification email to the authenticated user. Rate limited to once per 60 seconds. Requires all three credentials simultaneously: the application key (`X-Application-Key`), the application secret (`X-Application-Secret`), and the end user\'s `Authorization: Bearer` token. Failures behave as on `POST /auth/verify-email/send`, including the 200 accepted-and-suppressed response for a recipient outside the application allowlist.
77
77
  * @summary Resend email verification
78
78
  * @param {ResendEmailVerificationRequest} [resendEmailVerificationRequest]
79
79
  * @param {*} [options] Override http request option.
@@ -83,7 +83,7 @@ export interface AuthEmailVerificationApiInterface {
83
83
  resendEmailVerificationRaw(requestParameters: AuthEmailVerificationApiResendEmailVerificationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResult>>;
84
84
 
85
85
  /**
86
- * Resend the verification email to the authenticated user. Rate limited to once per 60 seconds.
86
+ * Resend the verification email to the authenticated user. Rate limited to once per 60 seconds. Requires all three credentials simultaneously: the application key (`X-Application-Key`), the application secret (`X-Application-Secret`), and the end user\'s `Authorization: Bearer` token. Failures behave as on `POST /auth/verify-email/send`, including the 200 accepted-and-suppressed response for a recipient outside the application allowlist.
87
87
  * Resend email verification
88
88
  */
89
89
  resendEmailVerification(resendEmailVerificationRequest?: ResendEmailVerificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResult>;
@@ -172,7 +172,7 @@ export class AuthEmailVerificationApi extends runtime.BaseAPI implements AuthEma
172
172
  }
173
173
 
174
174
  /**
175
- * Resend the verification email to the authenticated user. Rate limited to once per 60 seconds.
175
+ * Resend the verification email to the authenticated user. Rate limited to once per 60 seconds. Requires all three credentials simultaneously: the application key (`X-Application-Key`), the application secret (`X-Application-Secret`), and the end user\'s `Authorization: Bearer` token. Failures behave as on `POST /auth/verify-email/send`, including the 200 accepted-and-suppressed response for a recipient outside the application allowlist.
176
176
  * Resend email verification
177
177
  */
178
178
  async resendEmailVerificationRaw(requestParameters: AuthEmailVerificationApiResendEmailVerificationOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResult>> {
@@ -224,7 +224,7 @@ export class AuthEmailVerificationApi extends runtime.BaseAPI implements AuthEma
224
224
  }
225
225
 
226
226
  /**
227
- * Resend the verification email to the authenticated user. Rate limited to once per 60 seconds.
227
+ * Resend the verification email to the authenticated user. Rate limited to once per 60 seconds. Requires all three credentials simultaneously: the application key (`X-Application-Key`), the application secret (`X-Application-Secret`), and the end user\'s `Authorization: Bearer` token. Failures behave as on `POST /auth/verify-email/send`, including the 200 accepted-and-suppressed response for a recipient outside the application allowlist.
228
228
  * Resend email verification
229
229
  */
230
230
  async resendEmailVerification(resendEmailVerificationRequest?: ResendEmailVerificationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResult> {
@@ -17,21 +17,21 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  ApiError,
19
19
  MagicLinkSendRequest,
20
+ MagicLinkSendResult,
20
21
  MagicLinkVerifyRequest,
21
22
  MagicLinkVerifyResponse,
22
- SuccessResult,
23
23
  } from '../models/index';
24
24
  import {
25
25
  ApiErrorFromJSON,
26
26
  ApiErrorToJSON,
27
27
  MagicLinkSendRequestFromJSON,
28
28
  MagicLinkSendRequestToJSON,
29
+ MagicLinkSendResultFromJSON,
30
+ MagicLinkSendResultToJSON,
29
31
  MagicLinkVerifyRequestFromJSON,
30
32
  MagicLinkVerifyRequestToJSON,
31
33
  MagicLinkVerifyResponseFromJSON,
32
34
  MagicLinkVerifyResponseToJSON,
33
- SuccessResultFromJSON,
34
- SuccessResultToJSON,
35
35
  } from '../models/index';
36
36
 
37
37
  export interface AuthMagicLinksApiSendMagicLinkRequest {
@@ -50,20 +50,20 @@ export interface AuthMagicLinksApiVerifyMagicLinkRequest {
50
50
  */
51
51
  export interface AuthMagicLinksApiInterface {
52
52
  /**
53
- * Send a magic link email for passwordless authentication.
53
+ * Send a magic link email for passwordless authentication. **Sending the email yourself:** pass `return_link: true` (with `redirect_url`) and Zyphr mints the link but sends nothing, returning it in `data.link`. Requires your application secret, so call it server-side only.
54
54
  * @summary Send a magic link
55
55
  * @param {MagicLinkSendRequest} magicLinkSendRequest
56
56
  * @param {*} [options] Override http request option.
57
57
  * @throws {RequiredError}
58
58
  * @memberof AuthMagicLinksApiInterface
59
59
  */
60
- sendMagicLinkRaw(requestParameters: AuthMagicLinksApiSendMagicLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResult>>;
60
+ sendMagicLinkRaw(requestParameters: AuthMagicLinksApiSendMagicLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MagicLinkSendResult>>;
61
61
 
62
62
  /**
63
- * Send a magic link email for passwordless authentication.
63
+ * Send a magic link email for passwordless authentication. **Sending the email yourself:** pass `return_link: true` (with `redirect_url`) and Zyphr mints the link but sends nothing, returning it in `data.link`. Requires your application secret, so call it server-side only.
64
64
  * Send a magic link
65
65
  */
66
- sendMagicLink(magicLinkSendRequest: MagicLinkSendRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResult>;
66
+ sendMagicLink(magicLinkSendRequest: MagicLinkSendRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MagicLinkSendResult>;
67
67
 
68
68
  /**
69
69
  * Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag. A magic link is a single factor, so a user who has enrolled MFA gets `mfa_required: true` and an `mfa_challenge` instead of tokens; complete the login with the challenge token at `POST /auth/mfa/verify`, exactly as after password login.
@@ -89,10 +89,10 @@ export interface AuthMagicLinksApiInterface {
89
89
  export class AuthMagicLinksApi extends runtime.BaseAPI implements AuthMagicLinksApiInterface {
90
90
 
91
91
  /**
92
- * Send a magic link email for passwordless authentication.
92
+ * Send a magic link email for passwordless authentication. **Sending the email yourself:** pass `return_link: true` (with `redirect_url`) and Zyphr mints the link but sends nothing, returning it in `data.link`. Requires your application secret, so call it server-side only.
93
93
  * Send a magic link
94
94
  */
95
- async sendMagicLinkRaw(requestParameters: AuthMagicLinksApiSendMagicLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResult>> {
95
+ async sendMagicLinkRaw(requestParameters: AuthMagicLinksApiSendMagicLinkRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MagicLinkSendResult>> {
96
96
  if (requestParameters['magicLinkSendRequest'] == null) {
97
97
  throw new runtime.RequiredError(
98
98
  'magicLinkSendRequest',
@@ -136,14 +136,14 @@ export class AuthMagicLinksApi extends runtime.BaseAPI implements AuthMagicLinks
136
136
  body: MagicLinkSendRequestToJSON(requestParameters['magicLinkSendRequest']),
137
137
  }, initOverrides);
138
138
 
139
- return new runtime.JSONApiResponse(response, (jsonValue) => SuccessResultFromJSON(jsonValue));
139
+ return new runtime.JSONApiResponse(response, (jsonValue) => MagicLinkSendResultFromJSON(jsonValue));
140
140
  }
141
141
 
142
142
  /**
143
- * Send a magic link email for passwordless authentication.
143
+ * Send a magic link email for passwordless authentication. **Sending the email yourself:** pass `return_link: true` (with `redirect_url`) and Zyphr mints the link but sends nothing, returning it in `data.link`. Requires your application secret, so call it server-side only.
144
144
  * Send a magic link
145
145
  */
146
- async sendMagicLink(magicLinkSendRequest: MagicLinkSendRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResult> {
146
+ async sendMagicLink(magicLinkSendRequest: MagicLinkSendRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MagicLinkSendResult> {
147
147
  const response = await this.sendMagicLinkRaw({ magicLinkSendRequest: magicLinkSendRequest }, initOverrides);
148
148
  return await response.value();
149
149
  }
@@ -17,9 +17,9 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  ApiError,
19
19
  ForgotPasswordRequest,
20
+ ForgotPasswordResult,
20
21
  ResetPasswordRequest,
21
22
  ResetPasswordResponse,
22
- SuccessResult,
23
23
  ValidateResetTokenRequest,
24
24
  ValidateResetTokenResponse,
25
25
  } from '../models/index';
@@ -28,12 +28,12 @@ import {
28
28
  ApiErrorToJSON,
29
29
  ForgotPasswordRequestFromJSON,
30
30
  ForgotPasswordRequestToJSON,
31
+ ForgotPasswordResultFromJSON,
32
+ ForgotPasswordResultToJSON,
31
33
  ResetPasswordRequestFromJSON,
32
34
  ResetPasswordRequestToJSON,
33
35
  ResetPasswordResponseFromJSON,
34
36
  ResetPasswordResponseToJSON,
35
- SuccessResultFromJSON,
36
- SuccessResultToJSON,
37
37
  ValidateResetTokenRequestFromJSON,
38
38
  ValidateResetTokenRequestToJSON,
39
39
  ValidateResetTokenResponseFromJSON,
@@ -60,20 +60,20 @@ export interface AuthPasswordResetApiValidateResetTokenOperationRequest {
60
60
  */
61
61
  export interface AuthPasswordResetApiInterface {
62
62
  /**
63
- * Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`.
63
+ * Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`. **Sending the email yourself:** pass `return_link: true` (with `redirect_url`) and Zyphr mints the token but sends nothing, returning the link in `data.link`. When no link is minted, `data.link` is null and `data.link_suppressed_reason` says why. Unlike the default response, this reveals whether the address is registered — acceptable only because the endpoint requires your application secret, so it must only be called server-side.
64
64
  * @summary Request a password reset
65
65
  * @param {ForgotPasswordRequest} forgotPasswordRequest
66
66
  * @param {*} [options] Override http request option.
67
67
  * @throws {RequiredError}
68
68
  * @memberof AuthPasswordResetApiInterface
69
69
  */
70
- forgotPasswordRaw(requestParameters: AuthPasswordResetApiForgotPasswordOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResult>>;
70
+ forgotPasswordRaw(requestParameters: AuthPasswordResetApiForgotPasswordOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ForgotPasswordResult>>;
71
71
 
72
72
  /**
73
- * Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`.
73
+ * Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`. **Sending the email yourself:** pass `return_link: true` (with `redirect_url`) and Zyphr mints the token but sends nothing, returning the link in `data.link`. When no link is minted, `data.link` is null and `data.link_suppressed_reason` says why. Unlike the default response, this reveals whether the address is registered — acceptable only because the endpoint requires your application secret, so it must only be called server-side.
74
74
  * Request a password reset
75
75
  */
76
- forgotPassword(forgotPasswordRequest: ForgotPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResult>;
76
+ forgotPassword(forgotPasswordRequest: ForgotPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ForgotPasswordResult>;
77
77
 
78
78
  /**
79
79
  * Reset a user\'s password using a valid reset token.
@@ -115,10 +115,10 @@ export interface AuthPasswordResetApiInterface {
115
115
  export class AuthPasswordResetApi extends runtime.BaseAPI implements AuthPasswordResetApiInterface {
116
116
 
117
117
  /**
118
- * Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`.
118
+ * Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`. **Sending the email yourself:** pass `return_link: true` (with `redirect_url`) and Zyphr mints the token but sends nothing, returning the link in `data.link`. When no link is minted, `data.link` is null and `data.link_suppressed_reason` says why. Unlike the default response, this reveals whether the address is registered — acceptable only because the endpoint requires your application secret, so it must only be called server-side.
119
119
  * Request a password reset
120
120
  */
121
- async forgotPasswordRaw(requestParameters: AuthPasswordResetApiForgotPasswordOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SuccessResult>> {
121
+ async forgotPasswordRaw(requestParameters: AuthPasswordResetApiForgotPasswordOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ForgotPasswordResult>> {
122
122
  if (requestParameters['forgotPasswordRequest'] == null) {
123
123
  throw new runtime.RequiredError(
124
124
  'forgotPasswordRequest',
@@ -162,14 +162,14 @@ export class AuthPasswordResetApi extends runtime.BaseAPI implements AuthPasswor
162
162
  body: ForgotPasswordRequestToJSON(requestParameters['forgotPasswordRequest']),
163
163
  }, initOverrides);
164
164
 
165
- return new runtime.JSONApiResponse(response, (jsonValue) => SuccessResultFromJSON(jsonValue));
165
+ return new runtime.JSONApiResponse(response, (jsonValue) => ForgotPasswordResultFromJSON(jsonValue));
166
166
  }
167
167
 
168
168
  /**
169
- * Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`.
169
+ * Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`. **Sending the email yourself:** pass `return_link: true` (with `redirect_url`) and Zyphr mints the token but sends nothing, returning the link in `data.link`. When no link is minted, `data.link` is null and `data.link_suppressed_reason` says why. Unlike the default response, this reveals whether the address is registered — acceptable only because the endpoint requires your application secret, so it must only be called server-side.
170
170
  * Request a password reset
171
171
  */
172
- async forgotPassword(forgotPasswordRequest: ForgotPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SuccessResult> {
172
+ async forgotPassword(forgotPasswordRequest: ForgotPasswordRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ForgotPasswordResult> {
173
173
  const response = await this.forgotPasswordRaw({ forgotPasswordRequest: forgotPasswordRequest }, initOverrides);
174
174
  return await response.value();
175
175
  }
@@ -175,7 +175,7 @@ export interface AuthUserDirectoryApiInterface {
175
175
  getEndUserClaims(userId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetEndUserClaims200Response>;
176
176
 
177
177
  /**
178
- * Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset\'s. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application\'s redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
178
+ * Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset\'s. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application\'s redirect_uris allowlist (custom schemes such as yourapp://path are permitted). **Sending the email yourself:** pass `return_link: true` with a `send_link` and Zyphr mints that link but sends nothing, returning it in `data.link` (`link_sent` stays false). The same `link_suppressed_reason` values apply when no link can be minted.
179
179
  * @summary Pre-provision (invite) an end user (server-side admin)
180
180
  * @param {InviteEndUserRequest} inviteEndUserRequest
181
181
  * @param {*} [options] Override http request option.
@@ -185,7 +185,7 @@ export interface AuthUserDirectoryApiInterface {
185
185
  inviteEndUserRaw(requestParameters: AuthUserDirectoryApiInviteEndUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InviteEndUser200Response>>;
186
186
 
187
187
  /**
188
- * Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset\'s. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application\'s redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
188
+ * Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset\'s. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application\'s redirect_uris allowlist (custom schemes such as yourapp://path are permitted). **Sending the email yourself:** pass `return_link: true` with a `send_link` and Zyphr mints that link but sends nothing, returning it in `data.link` (`link_sent` stays false). The same `link_suppressed_reason` values apply when no link can be minted.
189
189
  * Pre-provision (invite) an end user (server-side admin)
190
190
  */
191
191
  inviteEndUser(inviteEndUserRequest: InviteEndUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InviteEndUser200Response>;
@@ -539,7 +539,7 @@ export class AuthUserDirectoryApi extends runtime.BaseAPI implements AuthUserDir
539
539
  }
540
540
 
541
541
  /**
542
- * Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset\'s. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application\'s redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
542
+ * Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset\'s. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application\'s redirect_uris allowlist (custom schemes such as yourapp://path are permitted). **Sending the email yourself:** pass `return_link: true` with a `send_link` and Zyphr mints that link but sends nothing, returning it in `data.link` (`link_sent` stays false). The same `link_suppressed_reason` values apply when no link can be minted.
543
543
  * Pre-provision (invite) an end user (server-side admin)
544
544
  */
545
545
  async inviteEndUserRaw(requestParameters: AuthUserDirectoryApiInviteEndUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<InviteEndUser200Response>> {
@@ -590,7 +590,7 @@ export class AuthUserDirectoryApi extends runtime.BaseAPI implements AuthUserDir
590
590
  }
591
591
 
592
592
  /**
593
- * Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset\'s. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application\'s redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
593
+ * Secret-key-scoped pre-provisioning for an end user. Creates a passwordless user in the authenticating application (idempotent on email — an existing, non-deleted user is reused, not duplicated) and, when `send_link` is set, sends a first-login link so the user can set up their account without self-registration. - `send_link: \"invitation\"` sends the `invitation` auth email: a set-password link (valid 7 days) redeemed at `POST /auth/reset-password`, so the invitee ends up with a password. It has its own per-application template, separate from password reset\'s. Not sent to an identity that can already sign in. - `send_link: \"password_reset\"` sends a set-password email using the password-reset template. - `send_link: \"magic\"` sends a magic-link sign-in email. The user still has no credential afterwards. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required whenever `send_link` is not \"none\"; it must match the application\'s redirect_uris allowlist (custom schemes such as yourapp://path are permitted). **Sending the email yourself:** pass `return_link: true` with a `send_link` and Zyphr mints that link but sends nothing, returning it in `data.link` (`link_sent` stays false). The same `link_suppressed_reason` values apply when no link can be minted.
594
594
  * Pre-provision (invite) an end user (server-side admin)
595
595
  */
596
596
  async inviteEndUser(inviteEndUserRequest: InviteEndUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<InviteEndUser200Response> {
@@ -31,6 +31,15 @@ export interface ForgotPasswordRequest {
31
31
  * @memberof ForgotPasswordRequest
32
32
  */
33
33
  redirectUrl?: string;
34
+ /**
35
+ * When true, Zyphr mints the token but sends no email, and returns the
36
+ * link in `data.link` so you can render and send the email yourself
37
+ * (for example through `POST /v1/emails`). Requires `redirect_url`.
38
+ *
39
+ * @type {boolean}
40
+ * @memberof ForgotPasswordRequest
41
+ */
42
+ returnLink?: boolean;
34
43
  }
35
44
 
36
45
  /**
@@ -53,6 +62,7 @@ export function ForgotPasswordRequestFromJSONTyped(json: any, ignoreDiscriminato
53
62
 
54
63
  'email': json['email'],
55
64
  'redirectUrl': json['redirect_url'] == null ? undefined : json['redirect_url'],
65
+ 'returnLink': json['return_link'] == null ? undefined : json['return_link'],
56
66
  };
57
67
  }
58
68
 
@@ -69,6 +79,7 @@ export function ForgotPasswordRequestToJSONTyped(value?: ForgotPasswordRequest |
69
79
 
70
80
  'email': value['email'],
71
81
  'redirect_url': value['redirectUrl'],
82
+ 'return_link': value['returnLink'],
72
83
  };
73
84
  }
74
85
 
@@ -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 { ForgotPasswordResultData } from './ForgotPasswordResultData';
17
+ import {
18
+ ForgotPasswordResultDataFromJSON,
19
+ ForgotPasswordResultDataFromJSONTyped,
20
+ ForgotPasswordResultDataToJSON,
21
+ ForgotPasswordResultDataToJSONTyped,
22
+ } from './ForgotPasswordResultData';
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 ForgotPasswordResult
35
+ */
36
+ export interface ForgotPasswordResult {
37
+ /**
38
+ *
39
+ * @type {ForgotPasswordResultData}
40
+ * @memberof ForgotPasswordResult
41
+ */
42
+ data?: ForgotPasswordResultData;
43
+ /**
44
+ *
45
+ * @type {GetDomain200ResponseMeta}
46
+ * @memberof ForgotPasswordResult
47
+ */
48
+ meta?: GetDomain200ResponseMeta;
49
+ }
50
+
51
+ /**
52
+ * Check if a given object implements the ForgotPasswordResult interface.
53
+ */
54
+ export function instanceOfForgotPasswordResult(value: object): value is ForgotPasswordResult {
55
+ return true;
56
+ }
57
+
58
+ export function ForgotPasswordResultFromJSON(json: any): ForgotPasswordResult {
59
+ return ForgotPasswordResultFromJSONTyped(json, false);
60
+ }
61
+
62
+ export function ForgotPasswordResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): ForgotPasswordResult {
63
+ if (json == null) {
64
+ return json;
65
+ }
66
+ return {
67
+
68
+ 'data': json['data'] == null ? undefined : ForgotPasswordResultDataFromJSON(json['data']),
69
+ 'meta': json['meta'] == null ? undefined : GetDomain200ResponseMetaFromJSON(json['meta']),
70
+ };
71
+ }
72
+
73
+ export function ForgotPasswordResultToJSON(json: any): ForgotPasswordResult {
74
+ return ForgotPasswordResultToJSONTyped(json, false);
75
+ }
76
+
77
+ export function ForgotPasswordResultToJSONTyped(value?: ForgotPasswordResult | null, ignoreDiscriminator: boolean = false): any {
78
+ if (value == null) {
79
+ return value;
80
+ }
81
+
82
+ return {
83
+
84
+ 'data': ForgotPasswordResultDataToJSON(value['data']),
85
+ 'meta': GetDomain200ResponseMetaToJSON(value['meta']),
86
+ };
87
+ }
88
+
@@ -0,0 +1,100 @@
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 ForgotPasswordResultData
28
+ */
29
+ export interface ForgotPasswordResultData {
30
+ /**
31
+ *
32
+ * @type {boolean}
33
+ * @memberof ForgotPasswordResultData
34
+ */
35
+ success?: boolean;
36
+ /**
37
+ * Present only when `return_link` was true; null when no link was minted.
38
+ * @type {ReturnedAuthLink}
39
+ * @memberof ForgotPasswordResultData
40
+ */
41
+ link?: ReturnedAuthLink | null;
42
+ /**
43
+ * Present only when `return_link` was true and `link` is null.
44
+ * @type {string}
45
+ * @memberof ForgotPasswordResultData
46
+ */
47
+ linkSuppressedReason?: ForgotPasswordResultDataLinkSuppressedReasonEnum;
48
+ }
49
+
50
+
51
+ /**
52
+ * @export
53
+ */
54
+ export const ForgotPasswordResultDataLinkSuppressedReasonEnum = {
55
+ USER_NOT_FOUND: 'user_not_found',
56
+ IDENTITY_HAS_OTHER_AUTH_METHODS: 'identity_has_other_auth_methods'
57
+ } as const;
58
+ export type ForgotPasswordResultDataLinkSuppressedReasonEnum = typeof ForgotPasswordResultDataLinkSuppressedReasonEnum[keyof typeof ForgotPasswordResultDataLinkSuppressedReasonEnum];
59
+
60
+
61
+ /**
62
+ * Check if a given object implements the ForgotPasswordResultData interface.
63
+ */
64
+ export function instanceOfForgotPasswordResultData(value: object): value is ForgotPasswordResultData {
65
+ return true;
66
+ }
67
+
68
+ export function ForgotPasswordResultDataFromJSON(json: any): ForgotPasswordResultData {
69
+ return ForgotPasswordResultDataFromJSONTyped(json, false);
70
+ }
71
+
72
+ export function ForgotPasswordResultDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): ForgotPasswordResultData {
73
+ if (json == null) {
74
+ return json;
75
+ }
76
+ return {
77
+
78
+ 'success': json['success'] == null ? undefined : json['success'],
79
+ 'link': json['link'] == null ? undefined : ReturnedAuthLinkFromJSON(json['link']),
80
+ 'linkSuppressedReason': json['link_suppressed_reason'] == null ? undefined : json['link_suppressed_reason'],
81
+ };
82
+ }
83
+
84
+ export function ForgotPasswordResultDataToJSON(json: any): ForgotPasswordResultData {
85
+ return ForgotPasswordResultDataToJSONTyped(json, false);
86
+ }
87
+
88
+ export function ForgotPasswordResultDataToJSONTyped(value?: ForgotPasswordResultData | null, ignoreDiscriminator: boolean = false): any {
89
+ if (value == null) {
90
+ return value;
91
+ }
92
+
93
+ return {
94
+
95
+ 'success': value['success'],
96
+ 'link': ReturnedAuthLinkToJSON(value['link']),
97
+ 'link_suppressed_reason': value['linkSuppressedReason'],
98
+ };
99
+ }
100
+
@@ -13,6 +13,14 @@
13
13
  */
14
14
 
15
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
+
16
24
  /**
17
25
  *
18
26
  * @export
@@ -37,6 +45,12 @@ export interface InviteEndUser200ResponseData {
37
45
  * @memberof InviteEndUser200ResponseData
38
46
  */
39
47
  linkSent?: boolean;
48
+ /**
49
+ *
50
+ * @type {ReturnedAuthLink}
51
+ * @memberof InviteEndUser200ResponseData
52
+ */
53
+ link?: ReturnedAuthLink;
40
54
  /**
41
55
  * Present only when `send_link` was requested and `link_sent` is false — explains why,
42
56
  * so a caller can distinguish "suppressed by design" from "delivery failed".
@@ -86,6 +100,7 @@ export function InviteEndUser200ResponseDataFromJSONTyped(json: any, ignoreDiscr
86
100
  'userId': json['user_id'] == null ? undefined : json['user_id'],
87
101
  'created': json['created'] == null ? undefined : json['created'],
88
102
  'linkSent': json['link_sent'] == null ? undefined : json['link_sent'],
103
+ 'link': json['link'] == null ? undefined : ReturnedAuthLinkFromJSON(json['link']),
89
104
  'linkSuppressedReason': json['link_suppressed_reason'] == null ? undefined : json['link_suppressed_reason'],
90
105
  };
91
106
  }
@@ -104,6 +119,7 @@ export function InviteEndUser200ResponseDataToJSONTyped(value?: InviteEndUser200
104
119
  'user_id': value['userId'],
105
120
  'created': value['created'],
106
121
  'link_sent': value['linkSent'],
122
+ 'link': ReturnedAuthLinkToJSON(value['link']),
107
123
  'link_suppressed_reason': value['linkSuppressedReason'],
108
124
  };
109
125
  }
@@ -49,6 +49,12 @@ export interface InviteEndUserRequest {
49
49
  * @memberof InviteEndUserRequest
50
50
  */
51
51
  redirectUrl?: string;
52
+ /**
53
+ * Return the link in `data.link` instead of emailing it. Requires `send_link` other than "none".
54
+ * @type {boolean}
55
+ * @memberof InviteEndUserRequest
56
+ */
57
+ returnLink?: boolean;
52
58
  }
53
59
 
54
60
 
@@ -87,6 +93,7 @@ export function InviteEndUserRequestFromJSONTyped(json: any, ignoreDiscriminator
87
93
  'metadata': json['metadata'] == null ? undefined : json['metadata'],
88
94
  'sendLink': json['send_link'] == null ? undefined : json['send_link'],
89
95
  'redirectUrl': json['redirect_url'] == null ? undefined : json['redirect_url'],
96
+ 'returnLink': json['return_link'] == null ? undefined : json['return_link'],
90
97
  };
91
98
  }
92
99
 
@@ -106,6 +113,7 @@ export function InviteEndUserRequestToJSONTyped(value?: InviteEndUserRequest | n
106
113
  'metadata': value['metadata'],
107
114
  'send_link': value['sendLink'],
108
115
  'redirect_url': value['redirectUrl'],
116
+ 'return_link': value['returnLink'],
109
117
  };
110
118
  }
111
119
 
@@ -31,6 +31,15 @@ export interface MagicLinkSendRequest {
31
31
  * @memberof MagicLinkSendRequest
32
32
  */
33
33
  redirectUrl?: string;
34
+ /**
35
+ * When true, Zyphr mints the token but sends no email, and returns the
36
+ * link in `data.link` so you can render and send the email yourself
37
+ * (for example through `POST /v1/emails`). Requires `redirect_url`.
38
+ *
39
+ * @type {boolean}
40
+ * @memberof MagicLinkSendRequest
41
+ */
42
+ returnLink?: boolean;
34
43
  }
35
44
 
36
45
  /**
@@ -53,6 +62,7 @@ export function MagicLinkSendRequestFromJSONTyped(json: any, ignoreDiscriminator
53
62
 
54
63
  'email': json['email'],
55
64
  'redirectUrl': json['redirect_url'] == null ? undefined : json['redirect_url'],
65
+ 'returnLink': json['return_link'] == null ? undefined : json['return_link'],
56
66
  };
57
67
  }
58
68
 
@@ -69,6 +79,7 @@ export function MagicLinkSendRequestToJSONTyped(value?: MagicLinkSendRequest | n
69
79
 
70
80
  'email': value['email'],
71
81
  'redirect_url': value['redirectUrl'],
82
+ 'return_link': value['returnLink'],
72
83
  };
73
84
  }
74
85