@zyphr-dev/node-sdk 0.1.52 → 0.1.54

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.js CHANGED
@@ -871,6 +871,7 @@ function instanceOfApplicationSelf(value) {
871
871
  if (!("signingAlgorithm" in value) || value["signingAlgorithm"] === void 0) return false;
872
872
  if (!("testRecipients" in value) || value["testRecipients"] === void 0) return false;
873
873
  if (!("authEmailMode" in value) || value["authEmailMode"] === void 0) return false;
874
+ if (!("passwordDisallowBreached" in value) || value["passwordDisallowBreached"] === void 0) return false;
874
875
  return true;
875
876
  }
876
877
  function ApplicationSelfFromJSON(json) {
@@ -886,7 +887,8 @@ function ApplicationSelfFromJSONTyped(json, ignoreDiscriminator) {
886
887
  "environment": json["environment"],
887
888
  "signingAlgorithm": json["signing_algorithm"],
888
889
  "testRecipients": json["test_recipients"],
889
- "authEmailMode": json["auth_email_mode"]
890
+ "authEmailMode": json["auth_email_mode"],
891
+ "passwordDisallowBreached": json["password_disallow_breached"]
890
892
  };
891
893
  }
892
894
  function ApplicationSelfToJSON(json) {
@@ -902,7 +904,8 @@ function ApplicationSelfToJSONTyped(value, ignoreDiscriminator = false) {
902
904
  "environment": value["environment"],
903
905
  "signing_algorithm": value["signingAlgorithm"],
904
906
  "test_recipients": value["testRecipients"],
905
- "auth_email_mode": value["authEmailMode"]
907
+ "auth_email_mode": value["authEmailMode"],
908
+ "password_disallow_breached": value["passwordDisallowBreached"]
906
909
  };
907
910
  }
908
911
 
@@ -2374,7 +2377,8 @@ function ConfirmEmailVerificationResponseDataFromJSONTyped(json, ignoreDiscrimin
2374
2377
  }
2375
2378
  return {
2376
2379
  "success": json["success"] == null ? void 0 : json["success"],
2377
- "email": json["email"] == null ? void 0 : json["email"]
2380
+ "email": json["email"] == null ? void 0 : json["email"],
2381
+ "alreadyVerified": json["already_verified"] == null ? void 0 : json["already_verified"]
2378
2382
  };
2379
2383
  }
2380
2384
  function ConfirmEmailVerificationResponseDataToJSON(json) {
@@ -2386,7 +2390,8 @@ function ConfirmEmailVerificationResponseDataToJSONTyped(value, ignoreDiscrimina
2386
2390
  }
2387
2391
  return {
2388
2392
  "success": value["success"],
2389
- "email": value["email"]
2393
+ "email": value["email"],
2394
+ "already_verified": value["alreadyVerified"]
2390
2395
  };
2391
2396
  }
2392
2397
 
@@ -10226,6 +10231,33 @@ function ReplayWebhookEventsRequestToJSONTyped(value, ignoreDiscriminator = fals
10226
10231
  };
10227
10232
  }
10228
10233
 
10234
+ // src/src/models/ResendEmailVerificationRequest.ts
10235
+ function instanceOfResendEmailVerificationRequest(value) {
10236
+ return true;
10237
+ }
10238
+ function ResendEmailVerificationRequestFromJSON(json) {
10239
+ return ResendEmailVerificationRequestFromJSONTyped(json, false);
10240
+ }
10241
+ function ResendEmailVerificationRequestFromJSONTyped(json, ignoreDiscriminator) {
10242
+ if (json == null) {
10243
+ return json;
10244
+ }
10245
+ return {
10246
+ "redirectUrl": json["redirect_url"] == null ? void 0 : json["redirect_url"]
10247
+ };
10248
+ }
10249
+ function ResendEmailVerificationRequestToJSON(json) {
10250
+ return ResendEmailVerificationRequestToJSONTyped(json, false);
10251
+ }
10252
+ function ResendEmailVerificationRequestToJSONTyped(value, ignoreDiscriminator = false) {
10253
+ if (value == null) {
10254
+ return value;
10255
+ }
10256
+ return {
10257
+ "redirect_url": value["redirectUrl"]
10258
+ };
10259
+ }
10260
+
10229
10261
  // src/src/models/ResetPasswordRequest.ts
10230
10262
  function instanceOfResetPasswordRequest(value) {
10231
10263
  if (!("token" in value) || value["token"] === void 0) return false;
@@ -12260,7 +12292,8 @@ function SetSelfApplicationTestRecipientsRequestFromJSONTyped(json, ignoreDiscri
12260
12292
  }
12261
12293
  return {
12262
12294
  "testRecipients": json["test_recipients"] == null ? void 0 : json["test_recipients"],
12263
- "authEmailMode": json["auth_email_mode"] == null ? void 0 : json["auth_email_mode"]
12295
+ "authEmailMode": json["auth_email_mode"] == null ? void 0 : json["auth_email_mode"],
12296
+ "passwordDisallowBreached": json["password_disallow_breached"] == null ? void 0 : json["password_disallow_breached"]
12264
12297
  };
12265
12298
  }
12266
12299
  function SetSelfApplicationTestRecipientsRequestToJSON(json) {
@@ -12272,7 +12305,8 @@ function SetSelfApplicationTestRecipientsRequestToJSONTyped(value, ignoreDiscrim
12272
12305
  }
12273
12306
  return {
12274
12307
  "test_recipients": value["testRecipients"],
12275
- "auth_email_mode": value["authEmailMode"]
12308
+ "auth_email_mode": value["authEmailMode"],
12309
+ "password_disallow_breached": value["passwordDisallowBreached"]
12276
12310
  };
12277
12311
  }
12278
12312
 
@@ -17700,7 +17734,7 @@ var AuthEmailTemplatesApi = class extends BaseAPI {
17700
17734
  // src/src/apis/AuthEmailVerificationApi.ts
17701
17735
  var AuthEmailVerificationApi = class extends BaseAPI {
17702
17736
  /**
17703
- * Verify the user\'s email using the token from the verification email.
17737
+ * Verify the user\'s email using a token you collected yourself. IMPORTANT: the emailed verification LINK verifies the address server-side **on click** and then redirects to `redirect_url`. So if you take the token off that redirect and post it here, it is already redeemed — and this endpoint treats that as an idempotent **success** (`200` with `already_verified: true`), not an error. Only a genuinely invalid / expired / unknown token returns `400`. `send` / `confirm` / `resend` are NOT a mandatory matched set — `confirm` is for flows where you collect the token directly rather than landing the hosted redirect. Recommended pattern for the redirect landing: call `confirm`, ignore its result, then read the user\'s verified state back and report that — correct whether or not the link already consumed the token.
17704
17738
  * Confirm email verification
17705
17739
  */
17706
17740
  async confirmEmailVerificationRaw(requestParameters, initOverrides) {
@@ -17729,7 +17763,7 @@ var AuthEmailVerificationApi = class extends BaseAPI {
17729
17763
  return new JSONApiResponse(response, (jsonValue) => ConfirmEmailVerificationResponseFromJSON(jsonValue));
17730
17764
  }
17731
17765
  /**
17732
- * Verify the user\'s email using the token from the verification email.
17766
+ * Verify the user\'s email using a token you collected yourself. IMPORTANT: the emailed verification LINK verifies the address server-side **on click** and then redirects to `redirect_url`. So if you take the token off that redirect and post it here, it is already redeemed — and this endpoint treats that as an idempotent **success** (`200` with `already_verified: true`), not an error. Only a genuinely invalid / expired / unknown token returns `400`. `send` / `confirm` / `resend` are NOT a mandatory matched set — `confirm` is for flows where you collect the token directly rather than landing the hosted redirect. Recommended pattern for the redirect landing: call `confirm`, ignore its result, then read the user\'s verified state back and report that — correct whether or not the link already consumed the token.
17733
17767
  * Confirm email verification
17734
17768
  */
17735
17769
  async confirmEmailVerification(confirmEmailVerificationRequest, initOverrides) {
@@ -17762,7 +17796,7 @@ var AuthEmailVerificationApi = class extends BaseAPI {
17762
17796
  method: "POST",
17763
17797
  headers: headerParameters,
17764
17798
  query: queryParameters,
17765
- body: SendEmailVerificationRequestToJSON(requestParameters["sendEmailVerificationRequest"])
17799
+ body: ResendEmailVerificationRequestToJSON(requestParameters["resendEmailVerificationRequest"])
17766
17800
  }, initOverrides);
17767
17801
  return new JSONApiResponse(response, (jsonValue) => SuccessResultFromJSON(jsonValue));
17768
17802
  }
@@ -17770,12 +17804,12 @@ var AuthEmailVerificationApi = class extends BaseAPI {
17770
17804
  * Resend the verification email to the authenticated user. Rate limited to once per 60 seconds.
17771
17805
  * Resend email verification
17772
17806
  */
17773
- async resendEmailVerification(sendEmailVerificationRequest, initOverrides) {
17774
- const response = await this.resendEmailVerificationRaw({ sendEmailVerificationRequest }, initOverrides);
17807
+ async resendEmailVerification(resendEmailVerificationRequest, initOverrides) {
17808
+ const response = await this.resendEmailVerificationRaw({ resendEmailVerificationRequest }, initOverrides);
17775
17809
  return await response.value();
17776
17810
  }
17777
17811
  /**
17778
- * Send an email verification link to the authenticated user.
17812
+ * Send an email verification link to the authenticated user. 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. If the recipient is blocked by the application\'s `auth_email_mode=allowlist` gate, the request is still **accepted with 200** (mirroring `POST /auth/forgot-password`): no email is sent, and the suppression is recorded as a `messages` row (`status=suppressed`, `status_reason=recipient_not_allowlisted`) and an `email.suppressed` webhook. It is NOT a 500.
17779
17813
  * Send email verification
17780
17814
  */
17781
17815
  async sendEmailVerificationRaw(requestParameters, initOverrides) {
@@ -17805,7 +17839,7 @@ var AuthEmailVerificationApi = class extends BaseAPI {
17805
17839
  return new JSONApiResponse(response, (jsonValue) => SuccessResultFromJSON(jsonValue));
17806
17840
  }
17807
17841
  /**
17808
- * Send an email verification link to the authenticated user.
17842
+ * Send an email verification link to the authenticated user. 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. If the recipient is blocked by the application\'s `auth_email_mode=allowlist` gate, the request is still **accepted with 200** (mirroring `POST /auth/forgot-password`): no email is sent, and the suppression is recorded as a `messages` row (`status=suppressed`, `status_reason=recipient_not_allowlisted`) and an `email.suppressed` webhook. It is NOT a 500.
17809
17843
  * Send email verification
17810
17844
  */
17811
17845
  async sendEmailVerification(sendEmailVerificationRequest, initOverrides) {
@@ -27997,6 +28031,10 @@ export {
27997
28031
  RequestMetaToJSON,
27998
28032
  RequestMetaToJSONTyped,
27999
28033
  RequiredError,
28034
+ ResendEmailVerificationRequestFromJSON,
28035
+ ResendEmailVerificationRequestFromJSONTyped,
28036
+ ResendEmailVerificationRequestToJSON,
28037
+ ResendEmailVerificationRequestToJSONTyped,
28000
28038
  ResetPasswordRequestFromJSON,
28001
28039
  ResetPasswordRequestFromJSONTyped,
28002
28040
  ResetPasswordRequestToJSON,
@@ -29249,6 +29287,7 @@ export {
29249
29287
  instanceOfReorderWorkflowStepsRequest,
29250
29288
  instanceOfReplayWebhookEventsRequest,
29251
29289
  instanceOfRequestMeta,
29290
+ instanceOfResendEmailVerificationRequest,
29252
29291
  instanceOfResetPasswordRequest,
29253
29292
  instanceOfResetPasswordResponse,
29254
29293
  instanceOfResubscribeRequest,