@zyphr-dev/node-sdk 0.1.64 → 0.1.66

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 CHANGED
@@ -3640,7 +3640,9 @@ function ApplicationSelfResponseToJSONTyped(value, ignoreDiscriminator = false)
3640
3640
  var AuthEmailType = {
3641
3641
  MAGIC_LINK: "magic_link",
3642
3642
  PASSWORD_RESET: "password_reset",
3643
- EMAIL_VERIFICATION: "email_verification"
3643
+ EMAIL_VERIFICATION: "email_verification",
3644
+ EMAIL_OTP: "email_otp",
3645
+ INVITATION: "invitation"
3644
3646
  };
3645
3647
  function instanceOfAuthEmailType(value) {
3646
3648
  for (const key in AuthEmailType) {
@@ -4812,7 +4814,9 @@ function BulkUpsertAuthEmailTemplatesRequestFromJSONTyped(json, ignoreDiscrimina
4812
4814
  return {
4813
4815
  "magicLink": json["magic_link"] == null ? void 0 : UpsertAuthEmailTemplateRequestFromJSON(json["magic_link"]),
4814
4816
  "passwordReset": json["password_reset"] == null ? void 0 : UpsertAuthEmailTemplateRequestFromJSON(json["password_reset"]),
4815
- "emailVerification": json["email_verification"] == null ? void 0 : UpsertAuthEmailTemplateRequestFromJSON(json["email_verification"])
4817
+ "emailVerification": json["email_verification"] == null ? void 0 : UpsertAuthEmailTemplateRequestFromJSON(json["email_verification"]),
4818
+ "emailOtp": json["email_otp"] == null ? void 0 : UpsertAuthEmailTemplateRequestFromJSON(json["email_otp"]),
4819
+ "invitation": json["invitation"] == null ? void 0 : UpsertAuthEmailTemplateRequestFromJSON(json["invitation"])
4816
4820
  };
4817
4821
  }
4818
4822
  function BulkUpsertAuthEmailTemplatesRequestToJSON(json) {
@@ -4825,7 +4829,9 @@ function BulkUpsertAuthEmailTemplatesRequestToJSONTyped(value, ignoreDiscriminat
4825
4829
  return {
4826
4830
  "magic_link": UpsertAuthEmailTemplateRequestToJSON(value["magicLink"]),
4827
4831
  "password_reset": UpsertAuthEmailTemplateRequestToJSON(value["passwordReset"]),
4828
- "email_verification": UpsertAuthEmailTemplateRequestToJSON(value["emailVerification"])
4832
+ "email_verification": UpsertAuthEmailTemplateRequestToJSON(value["emailVerification"]),
4833
+ "email_otp": UpsertAuthEmailTemplateRequestToJSON(value["emailOtp"]),
4834
+ "invitation": UpsertAuthEmailTemplateRequestToJSON(value["invitation"])
4829
4835
  };
4830
4836
  }
4831
4837
 
@@ -9254,6 +9260,7 @@ function InviteEndUser200ResponseToJSONTyped(value, ignoreDiscriminator = false)
9254
9260
 
9255
9261
  // src/src/models/InviteEndUserRequest.ts
9256
9262
  var InviteEndUserRequestSendLinkEnum = {
9263
+ INVITATION: "invitation",
9257
9264
  MAGIC: "magic",
9258
9265
  PASSWORD_RESET: "password_reset",
9259
9266
  NONE: "none"
@@ -9669,8 +9676,10 @@ function MagicLinkVerifyResponseDataFromJSONTyped(json, ignoreDiscriminator) {
9669
9676
  return json;
9670
9677
  }
9671
9678
  return {
9679
+ "mfaRequired": json["mfa_required"] == null ? void 0 : json["mfa_required"],
9672
9680
  "user": json["user"] == null ? void 0 : AuthUserFromJSON(json["user"]),
9673
9681
  "tokens": json["tokens"] == null ? void 0 : AuthTokensFromJSON(json["tokens"]),
9682
+ "mfaChallenge": json["mfa_challenge"] == null ? void 0 : AuthLoginResultMfaChallengeFromJSON(json["mfa_challenge"]),
9674
9683
  "isNewUser": json["is_new_user"] == null ? void 0 : json["is_new_user"]
9675
9684
  };
9676
9685
  }
@@ -9682,8 +9691,10 @@ function MagicLinkVerifyResponseDataToJSONTyped(value, ignoreDiscriminator = fal
9682
9691
  return value;
9683
9692
  }
9684
9693
  return {
9694
+ "mfa_required": value["mfaRequired"],
9685
9695
  "user": AuthUserToJSON(value["user"]),
9686
9696
  "tokens": AuthTokensToJSON(value["tokens"]),
9697
+ "mfa_challenge": AuthLoginResultMfaChallengeToJSON(value["mfaChallenge"]),
9687
9698
  "is_new_user": value["isNewUser"]
9688
9699
  };
9689
9700
  }
@@ -20117,7 +20128,7 @@ var AuthEmailOTPApi = class extends BaseAPI {
20117
20128
  // src/src/apis/AuthEmailTemplatesApi.ts
20118
20129
  var AuthEmailTemplatesApi = class extends BaseAPI {
20119
20130
  /**
20120
- * Atomic upsert of any subset of magic_link, password_reset, email_verification. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
20131
+ * Atomic upsert of any subset of magic_link, password_reset, email_verification, email_otp, invitation. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
20121
20132
  * Bulk-upsert auth email templates
20122
20133
  */
20123
20134
  async bulkUpsertAuthEmailTemplatesRaw(requestParameters, initOverrides) {
@@ -20156,7 +20167,7 @@ var AuthEmailTemplatesApi = class extends BaseAPI {
20156
20167
  return new JSONApiResponse(response, (jsonValue) => BulkUpsertAuthEmailTemplatesResponseFromJSON(jsonValue));
20157
20168
  }
20158
20169
  /**
20159
- * Atomic upsert of any subset of magic_link, password_reset, email_verification. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
20170
+ * Atomic upsert of any subset of magic_link, password_reset, email_verification, email_otp, invitation. Validates all inputs before any write; if any one fails validation or MJML compile, none are saved. Designed for one-shot migration imports from Auth0/Firebase/Clerk/Cognito.
20160
20171
  * Bulk-upsert auth email templates
20161
20172
  */
20162
20173
  async bulkUpsertAuthEmailTemplates(bulkUpsertAuthEmailTemplatesRequest, initOverrides) {
@@ -21165,7 +21176,7 @@ var AuthMagicLinksApi = class extends BaseAPI {
21165
21176
  return await response.value();
21166
21177
  }
21167
21178
  /**
21168
- * Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag.
21179
+ * 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.
21169
21180
  * Verify a magic link
21170
21181
  */
21171
21182
  async verifyMagicLinkRaw(requestParameters, initOverrides) {
@@ -21204,7 +21215,7 @@ var AuthMagicLinksApi = class extends BaseAPI {
21204
21215
  return new JSONApiResponse(response, (jsonValue) => MagicLinkVerifyResponseFromJSON(jsonValue));
21205
21216
  }
21206
21217
  /**
21207
- * Verify a magic link token and authenticate the user. Returns auth result with is_new_user flag.
21218
+ * 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.
21208
21219
  * Verify a magic link
21209
21220
  */
21210
21221
  async verifyMagicLink(magicLinkVerifyRequest, initOverrides) {
@@ -23184,7 +23195,7 @@ var AuthUserDirectoryApi = class extends BaseAPI {
23184
23195
  return await response.value();
23185
23196
  }
23186
23197
  /**
23187
- * 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: \"magic\"` sends a magic-link sign-in email. - `send_link: \"password_reset\"` sends a set-password email. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required when `send_link` is \"magic\" or \"password_reset\"; it must match the application\'s redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
23198
+ * 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).
23188
23199
  * Pre-provision (invite) an end user (server-side admin)
23189
23200
  */
23190
23201
  async inviteEndUserRaw(requestParameters, initOverrides) {
@@ -23223,7 +23234,7 @@ var AuthUserDirectoryApi = class extends BaseAPI {
23223
23234
  return new JSONApiResponse(response, (jsonValue) => InviteEndUser200ResponseFromJSON(jsonValue));
23224
23235
  }
23225
23236
  /**
23226
- * 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: \"magic\"` sends a magic-link sign-in email. - `send_link: \"password_reset\"` sends a set-password email. - `send_link: \"none\"` (default) creates the user with no email. A `redirect_url` is required when `send_link` is \"magic\" or \"password_reset\"; it must match the application\'s redirect_uris allowlist (custom schemes such as yourapp://path are permitted).
23237
+ * 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).
23227
23238
  * Pre-provision (invite) an end user (server-side admin)
23228
23239
  */
23229
23240
  async inviteEndUser(inviteEndUserRequest, initOverrides) {
@@ -26647,7 +26658,7 @@ var SubscribersApi = class extends BaseAPI {
26647
26658
  return await response.value();
26648
26659
  }
26649
26660
  /**
26650
- * Upsert a subscriber by external_id. If a subscriber with the given external_id already exists, it will be updated.
26661
+ * Upsert a subscriber by external_id. If a subscriber with the given external_id already exists, it will be updated; fields you omit keep their existing values. A new subscriber\'s timezone defaults to UTC and locale to en.
26651
26662
  * Create or update a subscriber
26652
26663
  */
26653
26664
  async createSubscriberRaw(requestParameters, initOverrides) {
@@ -26678,7 +26689,7 @@ var SubscribersApi = class extends BaseAPI {
26678
26689
  return new JSONApiResponse(response, (jsonValue) => SubscriberResponseFromJSON(jsonValue));
26679
26690
  }
26680
26691
  /**
26681
- * Upsert a subscriber by external_id. If a subscriber with the given external_id already exists, it will be updated.
26692
+ * Upsert a subscriber by external_id. If a subscriber with the given external_id already exists, it will be updated; fields you omit keep their existing values. A new subscriber\'s timezone defaults to UTC and locale to en.
26682
26693
  * Create or update a subscriber
26683
26694
  */
26684
26695
  async createSubscriber(createSubscriberRequest, initOverrides) {