@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.cjs CHANGED
@@ -1216,6 +1216,10 @@ __export(index_exports, {
1216
1216
  RequestMetaToJSON: () => RequestMetaToJSON,
1217
1217
  RequestMetaToJSONTyped: () => RequestMetaToJSONTyped,
1218
1218
  RequiredError: () => RequiredError,
1219
+ ResendEmailVerificationRequestFromJSON: () => ResendEmailVerificationRequestFromJSON,
1220
+ ResendEmailVerificationRequestFromJSONTyped: () => ResendEmailVerificationRequestFromJSONTyped,
1221
+ ResendEmailVerificationRequestToJSON: () => ResendEmailVerificationRequestToJSON,
1222
+ ResendEmailVerificationRequestToJSONTyped: () => ResendEmailVerificationRequestToJSONTyped,
1219
1223
  ResetPasswordRequestFromJSON: () => ResetPasswordRequestFromJSON,
1220
1224
  ResetPasswordRequestFromJSONTyped: () => ResetPasswordRequestFromJSONTyped,
1221
1225
  ResetPasswordRequestToJSON: () => ResetPasswordRequestToJSON,
@@ -2468,6 +2472,7 @@ __export(index_exports, {
2468
2472
  instanceOfReorderWorkflowStepsRequest: () => instanceOfReorderWorkflowStepsRequest,
2469
2473
  instanceOfReplayWebhookEventsRequest: () => instanceOfReplayWebhookEventsRequest,
2470
2474
  instanceOfRequestMeta: () => instanceOfRequestMeta,
2475
+ instanceOfResendEmailVerificationRequest: () => instanceOfResendEmailVerificationRequest,
2471
2476
  instanceOfResetPasswordRequest: () => instanceOfResetPasswordRequest,
2472
2477
  instanceOfResetPasswordResponse: () => instanceOfResetPasswordResponse,
2473
2478
  instanceOfResubscribeRequest: () => instanceOfResubscribeRequest,
@@ -3574,6 +3579,7 @@ function instanceOfApplicationSelf(value) {
3574
3579
  if (!("signingAlgorithm" in value) || value["signingAlgorithm"] === void 0) return false;
3575
3580
  if (!("testRecipients" in value) || value["testRecipients"] === void 0) return false;
3576
3581
  if (!("authEmailMode" in value) || value["authEmailMode"] === void 0) return false;
3582
+ if (!("passwordDisallowBreached" in value) || value["passwordDisallowBreached"] === void 0) return false;
3577
3583
  return true;
3578
3584
  }
3579
3585
  function ApplicationSelfFromJSON(json) {
@@ -3589,7 +3595,8 @@ function ApplicationSelfFromJSONTyped(json, ignoreDiscriminator) {
3589
3595
  "environment": json["environment"],
3590
3596
  "signingAlgorithm": json["signing_algorithm"],
3591
3597
  "testRecipients": json["test_recipients"],
3592
- "authEmailMode": json["auth_email_mode"]
3598
+ "authEmailMode": json["auth_email_mode"],
3599
+ "passwordDisallowBreached": json["password_disallow_breached"]
3593
3600
  };
3594
3601
  }
3595
3602
  function ApplicationSelfToJSON(json) {
@@ -3605,7 +3612,8 @@ function ApplicationSelfToJSONTyped(value, ignoreDiscriminator = false) {
3605
3612
  "environment": value["environment"],
3606
3613
  "signing_algorithm": value["signingAlgorithm"],
3607
3614
  "test_recipients": value["testRecipients"],
3608
- "auth_email_mode": value["authEmailMode"]
3615
+ "auth_email_mode": value["authEmailMode"],
3616
+ "password_disallow_breached": value["passwordDisallowBreached"]
3609
3617
  };
3610
3618
  }
3611
3619
 
@@ -5077,7 +5085,8 @@ function ConfirmEmailVerificationResponseDataFromJSONTyped(json, ignoreDiscrimin
5077
5085
  }
5078
5086
  return {
5079
5087
  "success": json["success"] == null ? void 0 : json["success"],
5080
- "email": json["email"] == null ? void 0 : json["email"]
5088
+ "email": json["email"] == null ? void 0 : json["email"],
5089
+ "alreadyVerified": json["already_verified"] == null ? void 0 : json["already_verified"]
5081
5090
  };
5082
5091
  }
5083
5092
  function ConfirmEmailVerificationResponseDataToJSON(json) {
@@ -5089,7 +5098,8 @@ function ConfirmEmailVerificationResponseDataToJSONTyped(value, ignoreDiscrimina
5089
5098
  }
5090
5099
  return {
5091
5100
  "success": value["success"],
5092
- "email": value["email"]
5101
+ "email": value["email"],
5102
+ "already_verified": value["alreadyVerified"]
5093
5103
  };
5094
5104
  }
5095
5105
 
@@ -12929,6 +12939,33 @@ function ReplayWebhookEventsRequestToJSONTyped(value, ignoreDiscriminator = fals
12929
12939
  };
12930
12940
  }
12931
12941
 
12942
+ // src/src/models/ResendEmailVerificationRequest.ts
12943
+ function instanceOfResendEmailVerificationRequest(value) {
12944
+ return true;
12945
+ }
12946
+ function ResendEmailVerificationRequestFromJSON(json) {
12947
+ return ResendEmailVerificationRequestFromJSONTyped(json, false);
12948
+ }
12949
+ function ResendEmailVerificationRequestFromJSONTyped(json, ignoreDiscriminator) {
12950
+ if (json == null) {
12951
+ return json;
12952
+ }
12953
+ return {
12954
+ "redirectUrl": json["redirect_url"] == null ? void 0 : json["redirect_url"]
12955
+ };
12956
+ }
12957
+ function ResendEmailVerificationRequestToJSON(json) {
12958
+ return ResendEmailVerificationRequestToJSONTyped(json, false);
12959
+ }
12960
+ function ResendEmailVerificationRequestToJSONTyped(value, ignoreDiscriminator = false) {
12961
+ if (value == null) {
12962
+ return value;
12963
+ }
12964
+ return {
12965
+ "redirect_url": value["redirectUrl"]
12966
+ };
12967
+ }
12968
+
12932
12969
  // src/src/models/ResetPasswordRequest.ts
12933
12970
  function instanceOfResetPasswordRequest(value) {
12934
12971
  if (!("token" in value) || value["token"] === void 0) return false;
@@ -14963,7 +15000,8 @@ function SetSelfApplicationTestRecipientsRequestFromJSONTyped(json, ignoreDiscri
14963
15000
  }
14964
15001
  return {
14965
15002
  "testRecipients": json["test_recipients"] == null ? void 0 : json["test_recipients"],
14966
- "authEmailMode": json["auth_email_mode"] == null ? void 0 : json["auth_email_mode"]
15003
+ "authEmailMode": json["auth_email_mode"] == null ? void 0 : json["auth_email_mode"],
15004
+ "passwordDisallowBreached": json["password_disallow_breached"] == null ? void 0 : json["password_disallow_breached"]
14967
15005
  };
14968
15006
  }
14969
15007
  function SetSelfApplicationTestRecipientsRequestToJSON(json) {
@@ -14975,7 +15013,8 @@ function SetSelfApplicationTestRecipientsRequestToJSONTyped(value, ignoreDiscrim
14975
15013
  }
14976
15014
  return {
14977
15015
  "test_recipients": value["testRecipients"],
14978
- "auth_email_mode": value["authEmailMode"]
15016
+ "auth_email_mode": value["authEmailMode"],
15017
+ "password_disallow_breached": value["passwordDisallowBreached"]
14979
15018
  };
14980
15019
  }
14981
15020
 
@@ -20403,7 +20442,7 @@ var AuthEmailTemplatesApi = class extends BaseAPI {
20403
20442
  // src/src/apis/AuthEmailVerificationApi.ts
20404
20443
  var AuthEmailVerificationApi = class extends BaseAPI {
20405
20444
  /**
20406
- * Verify the user\'s email using the token from the verification email.
20445
+ * 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.
20407
20446
  * Confirm email verification
20408
20447
  */
20409
20448
  async confirmEmailVerificationRaw(requestParameters, initOverrides) {
@@ -20432,7 +20471,7 @@ var AuthEmailVerificationApi = class extends BaseAPI {
20432
20471
  return new JSONApiResponse(response, (jsonValue) => ConfirmEmailVerificationResponseFromJSON(jsonValue));
20433
20472
  }
20434
20473
  /**
20435
- * Verify the user\'s email using the token from the verification email.
20474
+ * 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.
20436
20475
  * Confirm email verification
20437
20476
  */
20438
20477
  async confirmEmailVerification(confirmEmailVerificationRequest, initOverrides) {
@@ -20465,7 +20504,7 @@ var AuthEmailVerificationApi = class extends BaseAPI {
20465
20504
  method: "POST",
20466
20505
  headers: headerParameters,
20467
20506
  query: queryParameters,
20468
- body: SendEmailVerificationRequestToJSON(requestParameters["sendEmailVerificationRequest"])
20507
+ body: ResendEmailVerificationRequestToJSON(requestParameters["resendEmailVerificationRequest"])
20469
20508
  }, initOverrides);
20470
20509
  return new JSONApiResponse(response, (jsonValue) => SuccessResultFromJSON(jsonValue));
20471
20510
  }
@@ -20473,12 +20512,12 @@ var AuthEmailVerificationApi = class extends BaseAPI {
20473
20512
  * Resend the verification email to the authenticated user. Rate limited to once per 60 seconds.
20474
20513
  * Resend email verification
20475
20514
  */
20476
- async resendEmailVerification(sendEmailVerificationRequest, initOverrides) {
20477
- const response = await this.resendEmailVerificationRaw({ sendEmailVerificationRequest }, initOverrides);
20515
+ async resendEmailVerification(resendEmailVerificationRequest, initOverrides) {
20516
+ const response = await this.resendEmailVerificationRaw({ resendEmailVerificationRequest }, initOverrides);
20478
20517
  return await response.value();
20479
20518
  }
20480
20519
  /**
20481
- * Send an email verification link to the authenticated user.
20520
+ * 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.
20482
20521
  * Send email verification
20483
20522
  */
20484
20523
  async sendEmailVerificationRaw(requestParameters, initOverrides) {
@@ -20508,7 +20547,7 @@ var AuthEmailVerificationApi = class extends BaseAPI {
20508
20547
  return new JSONApiResponse(response, (jsonValue) => SuccessResultFromJSON(jsonValue));
20509
20548
  }
20510
20549
  /**
20511
- * Send an email verification link to the authenticated user.
20550
+ * 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.
20512
20551
  * Send email verification
20513
20552
  */
20514
20553
  async sendEmailVerification(sendEmailVerificationRequest, initOverrides) {
@@ -30701,6 +30740,10 @@ var SDK_VERSION = "0.1.0";
30701
30740
  RequestMetaToJSON,
30702
30741
  RequestMetaToJSONTyped,
30703
30742
  RequiredError,
30743
+ ResendEmailVerificationRequestFromJSON,
30744
+ ResendEmailVerificationRequestFromJSONTyped,
30745
+ ResendEmailVerificationRequestToJSON,
30746
+ ResendEmailVerificationRequestToJSONTyped,
30704
30747
  ResetPasswordRequestFromJSON,
30705
30748
  ResetPasswordRequestFromJSONTyped,
30706
30749
  ResetPasswordRequestToJSON,
@@ -31953,6 +31996,7 @@ var SDK_VERSION = "0.1.0";
31953
31996
  instanceOfReorderWorkflowStepsRequest,
31954
31997
  instanceOfReplayWebhookEventsRequest,
31955
31998
  instanceOfRequestMeta,
31999
+ instanceOfResendEmailVerificationRequest,
31956
32000
  instanceOfResetPasswordRequest,
31957
32001
  instanceOfResetPasswordResponse,
31958
32002
  instanceOfResubscribeRequest,