@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 +48 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -17
- package/dist/index.d.ts +56 -17
- package/dist/index.js +43 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +1 -0
- package/src/src/apis/AuthEmailVerificationApi.ts +20 -17
- package/src/src/models/ConfirmEmailVerificationResponseData.ts +8 -0
- package/src/src/models/ResendEmailVerificationRequest.ts +65 -0
- package/src/src/models/SendEmailVerificationRequest.ts +1 -1
- package/src/src/models/index.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -2377,7 +2377,8 @@ function ConfirmEmailVerificationResponseDataFromJSONTyped(json, ignoreDiscrimin
|
|
|
2377
2377
|
}
|
|
2378
2378
|
return {
|
|
2379
2379
|
"success": json["success"] == null ? void 0 : json["success"],
|
|
2380
|
-
"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"]
|
|
2381
2382
|
};
|
|
2382
2383
|
}
|
|
2383
2384
|
function ConfirmEmailVerificationResponseDataToJSON(json) {
|
|
@@ -2389,7 +2390,8 @@ function ConfirmEmailVerificationResponseDataToJSONTyped(value, ignoreDiscrimina
|
|
|
2389
2390
|
}
|
|
2390
2391
|
return {
|
|
2391
2392
|
"success": value["success"],
|
|
2392
|
-
"email": value["email"]
|
|
2393
|
+
"email": value["email"],
|
|
2394
|
+
"already_verified": value["alreadyVerified"]
|
|
2393
2395
|
};
|
|
2394
2396
|
}
|
|
2395
2397
|
|
|
@@ -10229,6 +10231,33 @@ function ReplayWebhookEventsRequestToJSONTyped(value, ignoreDiscriminator = fals
|
|
|
10229
10231
|
};
|
|
10230
10232
|
}
|
|
10231
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
|
+
|
|
10232
10261
|
// src/src/models/ResetPasswordRequest.ts
|
|
10233
10262
|
function instanceOfResetPasswordRequest(value) {
|
|
10234
10263
|
if (!("token" in value) || value["token"] === void 0) return false;
|
|
@@ -17705,7 +17734,7 @@ var AuthEmailTemplatesApi = class extends BaseAPI {
|
|
|
17705
17734
|
// src/src/apis/AuthEmailVerificationApi.ts
|
|
17706
17735
|
var AuthEmailVerificationApi = class extends BaseAPI {
|
|
17707
17736
|
/**
|
|
17708
|
-
* Verify the user\'s email using
|
|
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.
|
|
17709
17738
|
* Confirm email verification
|
|
17710
17739
|
*/
|
|
17711
17740
|
async confirmEmailVerificationRaw(requestParameters, initOverrides) {
|
|
@@ -17734,7 +17763,7 @@ var AuthEmailVerificationApi = class extends BaseAPI {
|
|
|
17734
17763
|
return new JSONApiResponse(response, (jsonValue) => ConfirmEmailVerificationResponseFromJSON(jsonValue));
|
|
17735
17764
|
}
|
|
17736
17765
|
/**
|
|
17737
|
-
* Verify the user\'s email using
|
|
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.
|
|
17738
17767
|
* Confirm email verification
|
|
17739
17768
|
*/
|
|
17740
17769
|
async confirmEmailVerification(confirmEmailVerificationRequest, initOverrides) {
|
|
@@ -17767,7 +17796,7 @@ var AuthEmailVerificationApi = class extends BaseAPI {
|
|
|
17767
17796
|
method: "POST",
|
|
17768
17797
|
headers: headerParameters,
|
|
17769
17798
|
query: queryParameters,
|
|
17770
|
-
body:
|
|
17799
|
+
body: ResendEmailVerificationRequestToJSON(requestParameters["resendEmailVerificationRequest"])
|
|
17771
17800
|
}, initOverrides);
|
|
17772
17801
|
return new JSONApiResponse(response, (jsonValue) => SuccessResultFromJSON(jsonValue));
|
|
17773
17802
|
}
|
|
@@ -17775,12 +17804,12 @@ var AuthEmailVerificationApi = class extends BaseAPI {
|
|
|
17775
17804
|
* Resend the verification email to the authenticated user. Rate limited to once per 60 seconds.
|
|
17776
17805
|
* Resend email verification
|
|
17777
17806
|
*/
|
|
17778
|
-
async resendEmailVerification(
|
|
17779
|
-
const response = await this.resendEmailVerificationRaw({
|
|
17807
|
+
async resendEmailVerification(resendEmailVerificationRequest, initOverrides) {
|
|
17808
|
+
const response = await this.resendEmailVerificationRaw({ resendEmailVerificationRequest }, initOverrides);
|
|
17780
17809
|
return await response.value();
|
|
17781
17810
|
}
|
|
17782
17811
|
/**
|
|
17783
|
-
* 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.
|
|
17784
17813
|
* Send email verification
|
|
17785
17814
|
*/
|
|
17786
17815
|
async sendEmailVerificationRaw(requestParameters, initOverrides) {
|
|
@@ -17810,7 +17839,7 @@ var AuthEmailVerificationApi = class extends BaseAPI {
|
|
|
17810
17839
|
return new JSONApiResponse(response, (jsonValue) => SuccessResultFromJSON(jsonValue));
|
|
17811
17840
|
}
|
|
17812
17841
|
/**
|
|
17813
|
-
* 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.
|
|
17814
17843
|
* Send email verification
|
|
17815
17844
|
*/
|
|
17816
17845
|
async sendEmailVerification(sendEmailVerificationRequest, initOverrides) {
|
|
@@ -28002,6 +28031,10 @@ export {
|
|
|
28002
28031
|
RequestMetaToJSON,
|
|
28003
28032
|
RequestMetaToJSONTyped,
|
|
28004
28033
|
RequiredError,
|
|
28034
|
+
ResendEmailVerificationRequestFromJSON,
|
|
28035
|
+
ResendEmailVerificationRequestFromJSONTyped,
|
|
28036
|
+
ResendEmailVerificationRequestToJSON,
|
|
28037
|
+
ResendEmailVerificationRequestToJSONTyped,
|
|
28005
28038
|
ResetPasswordRequestFromJSON,
|
|
28006
28039
|
ResetPasswordRequestFromJSONTyped,
|
|
28007
28040
|
ResetPasswordRequestToJSON,
|
|
@@ -29254,6 +29287,7 @@ export {
|
|
|
29254
29287
|
instanceOfReorderWorkflowStepsRequest,
|
|
29255
29288
|
instanceOfReplayWebhookEventsRequest,
|
|
29256
29289
|
instanceOfRequestMeta,
|
|
29290
|
+
instanceOfResendEmailVerificationRequest,
|
|
29257
29291
|
instanceOfResetPasswordRequest,
|
|
29258
29292
|
instanceOfResetPasswordResponse,
|
|
29259
29293
|
instanceOfResubscribeRequest,
|