@zyphr-dev/node-sdk 0.1.53 → 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,
@@ -5080,7 +5085,8 @@ function ConfirmEmailVerificationResponseDataFromJSONTyped(json, ignoreDiscrimin
5080
5085
  }
5081
5086
  return {
5082
5087
  "success": json["success"] == null ? void 0 : json["success"],
5083
- "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"]
5084
5090
  };
5085
5091
  }
5086
5092
  function ConfirmEmailVerificationResponseDataToJSON(json) {
@@ -5092,7 +5098,8 @@ function ConfirmEmailVerificationResponseDataToJSONTyped(value, ignoreDiscrimina
5092
5098
  }
5093
5099
  return {
5094
5100
  "success": value["success"],
5095
- "email": value["email"]
5101
+ "email": value["email"],
5102
+ "already_verified": value["alreadyVerified"]
5096
5103
  };
5097
5104
  }
5098
5105
 
@@ -12932,6 +12939,33 @@ function ReplayWebhookEventsRequestToJSONTyped(value, ignoreDiscriminator = fals
12932
12939
  };
12933
12940
  }
12934
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
+
12935
12969
  // src/src/models/ResetPasswordRequest.ts
12936
12970
  function instanceOfResetPasswordRequest(value) {
12937
12971
  if (!("token" in value) || value["token"] === void 0) return false;
@@ -20408,7 +20442,7 @@ var AuthEmailTemplatesApi = class extends BaseAPI {
20408
20442
  // src/src/apis/AuthEmailVerificationApi.ts
20409
20443
  var AuthEmailVerificationApi = class extends BaseAPI {
20410
20444
  /**
20411
- * 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.
20412
20446
  * Confirm email verification
20413
20447
  */
20414
20448
  async confirmEmailVerificationRaw(requestParameters, initOverrides) {
@@ -20437,7 +20471,7 @@ var AuthEmailVerificationApi = class extends BaseAPI {
20437
20471
  return new JSONApiResponse(response, (jsonValue) => ConfirmEmailVerificationResponseFromJSON(jsonValue));
20438
20472
  }
20439
20473
  /**
20440
- * 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.
20441
20475
  * Confirm email verification
20442
20476
  */
20443
20477
  async confirmEmailVerification(confirmEmailVerificationRequest, initOverrides) {
@@ -20470,7 +20504,7 @@ var AuthEmailVerificationApi = class extends BaseAPI {
20470
20504
  method: "POST",
20471
20505
  headers: headerParameters,
20472
20506
  query: queryParameters,
20473
- body: SendEmailVerificationRequestToJSON(requestParameters["sendEmailVerificationRequest"])
20507
+ body: ResendEmailVerificationRequestToJSON(requestParameters["resendEmailVerificationRequest"])
20474
20508
  }, initOverrides);
20475
20509
  return new JSONApiResponse(response, (jsonValue) => SuccessResultFromJSON(jsonValue));
20476
20510
  }
@@ -20478,12 +20512,12 @@ var AuthEmailVerificationApi = class extends BaseAPI {
20478
20512
  * Resend the verification email to the authenticated user. Rate limited to once per 60 seconds.
20479
20513
  * Resend email verification
20480
20514
  */
20481
- async resendEmailVerification(sendEmailVerificationRequest, initOverrides) {
20482
- const response = await this.resendEmailVerificationRaw({ sendEmailVerificationRequest }, initOverrides);
20515
+ async resendEmailVerification(resendEmailVerificationRequest, initOverrides) {
20516
+ const response = await this.resendEmailVerificationRaw({ resendEmailVerificationRequest }, initOverrides);
20483
20517
  return await response.value();
20484
20518
  }
20485
20519
  /**
20486
- * 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.
20487
20521
  * Send email verification
20488
20522
  */
20489
20523
  async sendEmailVerificationRaw(requestParameters, initOverrides) {
@@ -20513,7 +20547,7 @@ var AuthEmailVerificationApi = class extends BaseAPI {
20513
20547
  return new JSONApiResponse(response, (jsonValue) => SuccessResultFromJSON(jsonValue));
20514
20548
  }
20515
20549
  /**
20516
- * 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.
20517
20551
  * Send email verification
20518
20552
  */
20519
20553
  async sendEmailVerification(sendEmailVerificationRequest, initOverrides) {
@@ -30706,6 +30740,10 @@ var SDK_VERSION = "0.1.0";
30706
30740
  RequestMetaToJSON,
30707
30741
  RequestMetaToJSONTyped,
30708
30742
  RequiredError,
30743
+ ResendEmailVerificationRequestFromJSON,
30744
+ ResendEmailVerificationRequestFromJSONTyped,
30745
+ ResendEmailVerificationRequestToJSON,
30746
+ ResendEmailVerificationRequestToJSONTyped,
30709
30747
  ResetPasswordRequestFromJSON,
30710
30748
  ResetPasswordRequestFromJSONTyped,
30711
30749
  ResetPasswordRequestToJSON,
@@ -31958,6 +31996,7 @@ var SDK_VERSION = "0.1.0";
31958
31996
  instanceOfReorderWorkflowStepsRequest,
31959
31997
  instanceOfReplayWebhookEventsRequest,
31960
31998
  instanceOfRequestMeta,
31999
+ instanceOfResendEmailVerificationRequest,
31961
32000
  instanceOfResetPasswordRequest,
31962
32001
  instanceOfResetPasswordResponse,
31963
32002
  instanceOfResubscribeRequest,