@zyphr-dev/node-sdk 0.1.44 → 0.1.46
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 +257 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +217 -14
- package/dist/index.d.ts +217 -14
- package/dist/index.js +241 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +3 -0
- package/src/clientAuth.ts +34 -8
- package/src/src/apis/AuthApplicationApi.ts +69 -0
- package/src/src/apis/AuthUserProfileApi.ts +76 -0
- package/src/src/models/ApplicationSelf.ts +9 -0
- package/src/src/models/ChangePasswordRequest.ts +75 -0
- package/src/src/models/SetSelfApplicationTestRecipientsRequest.ts +66 -0
- package/src/src/models/WebhookDelivery.ts +12 -4
- package/src/src/models/WebhookDeliveryDetail.ts +12 -4
- package/src/src/models/WebhookEventType.ts +80 -0
- package/src/src/models/WebhookEventTypesResponseData.ts +12 -4
- package/src/src/models/WebhookTestEventResponseData.ts +14 -4
- package/src/src/models/index.ts +3 -0
package/dist/index.js
CHANGED
|
@@ -865,6 +865,7 @@ function instanceOfApplicationSelf(value) {
|
|
|
865
865
|
if (!("name" in value) || value["name"] === void 0) return false;
|
|
866
866
|
if (!("environment" in value) || value["environment"] === void 0) return false;
|
|
867
867
|
if (!("signingAlgorithm" in value) || value["signingAlgorithm"] === void 0) return false;
|
|
868
|
+
if (!("testRecipients" in value) || value["testRecipients"] === void 0) return false;
|
|
868
869
|
return true;
|
|
869
870
|
}
|
|
870
871
|
function ApplicationSelfFromJSON(json) {
|
|
@@ -878,7 +879,8 @@ function ApplicationSelfFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
878
879
|
"id": json["id"],
|
|
879
880
|
"name": json["name"],
|
|
880
881
|
"environment": json["environment"],
|
|
881
|
-
"signingAlgorithm": json["signing_algorithm"]
|
|
882
|
+
"signingAlgorithm": json["signing_algorithm"],
|
|
883
|
+
"testRecipients": json["test_recipients"]
|
|
882
884
|
};
|
|
883
885
|
}
|
|
884
886
|
function ApplicationSelfToJSON(json) {
|
|
@@ -892,7 +894,8 @@ function ApplicationSelfToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
892
894
|
"id": value["id"],
|
|
893
895
|
"name": value["name"],
|
|
894
896
|
"environment": value["environment"],
|
|
895
|
-
"signing_algorithm": value["signingAlgorithm"]
|
|
897
|
+
"signing_algorithm": value["signingAlgorithm"],
|
|
898
|
+
"test_recipients": value["testRecipients"]
|
|
896
899
|
};
|
|
897
900
|
}
|
|
898
901
|
|
|
@@ -2205,6 +2208,37 @@ function CategoryResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
2205
2208
|
};
|
|
2206
2209
|
}
|
|
2207
2210
|
|
|
2211
|
+
// src/src/models/ChangePasswordRequest.ts
|
|
2212
|
+
function instanceOfChangePasswordRequest(value) {
|
|
2213
|
+
if (!("currentPassword" in value) || value["currentPassword"] === void 0) return false;
|
|
2214
|
+
if (!("newPassword" in value) || value["newPassword"] === void 0) return false;
|
|
2215
|
+
return true;
|
|
2216
|
+
}
|
|
2217
|
+
function ChangePasswordRequestFromJSON(json) {
|
|
2218
|
+
return ChangePasswordRequestFromJSONTyped(json, false);
|
|
2219
|
+
}
|
|
2220
|
+
function ChangePasswordRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
2221
|
+
if (json == null) {
|
|
2222
|
+
return json;
|
|
2223
|
+
}
|
|
2224
|
+
return {
|
|
2225
|
+
"currentPassword": json["current_password"],
|
|
2226
|
+
"newPassword": json["new_password"]
|
|
2227
|
+
};
|
|
2228
|
+
}
|
|
2229
|
+
function ChangePasswordRequestToJSON(json) {
|
|
2230
|
+
return ChangePasswordRequestToJSONTyped(json, false);
|
|
2231
|
+
}
|
|
2232
|
+
function ChangePasswordRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2233
|
+
if (value == null) {
|
|
2234
|
+
return value;
|
|
2235
|
+
}
|
|
2236
|
+
return {
|
|
2237
|
+
"current_password": value["currentPassword"],
|
|
2238
|
+
"new_password": value["newPassword"]
|
|
2239
|
+
};
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2208
2242
|
// src/src/models/GetDomain200ResponseMeta.ts
|
|
2209
2243
|
function instanceOfGetDomain200ResponseMeta(value) {
|
|
2210
2244
|
return true;
|
|
@@ -11959,6 +11993,34 @@ function SetPreferencesRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
11959
11993
|
};
|
|
11960
11994
|
}
|
|
11961
11995
|
|
|
11996
|
+
// src/src/models/SetSelfApplicationTestRecipientsRequest.ts
|
|
11997
|
+
function instanceOfSetSelfApplicationTestRecipientsRequest(value) {
|
|
11998
|
+
if (!("testRecipients" in value) || value["testRecipients"] === void 0) return false;
|
|
11999
|
+
return true;
|
|
12000
|
+
}
|
|
12001
|
+
function SetSelfApplicationTestRecipientsRequestFromJSON(json) {
|
|
12002
|
+
return SetSelfApplicationTestRecipientsRequestFromJSONTyped(json, false);
|
|
12003
|
+
}
|
|
12004
|
+
function SetSelfApplicationTestRecipientsRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
12005
|
+
if (json == null) {
|
|
12006
|
+
return json;
|
|
12007
|
+
}
|
|
12008
|
+
return {
|
|
12009
|
+
"testRecipients": json["test_recipients"]
|
|
12010
|
+
};
|
|
12011
|
+
}
|
|
12012
|
+
function SetSelfApplicationTestRecipientsRequestToJSON(json) {
|
|
12013
|
+
return SetSelfApplicationTestRecipientsRequestToJSONTyped(json, false);
|
|
12014
|
+
}
|
|
12015
|
+
function SetSelfApplicationTestRecipientsRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
12016
|
+
if (value == null) {
|
|
12017
|
+
return value;
|
|
12018
|
+
}
|
|
12019
|
+
return {
|
|
12020
|
+
"test_recipients": value["testRecipients"]
|
|
12021
|
+
};
|
|
12022
|
+
}
|
|
12023
|
+
|
|
11962
12024
|
// src/src/models/SignInAnonymouslyRequest.ts
|
|
11963
12025
|
function instanceOfSignInAnonymouslyRequest(value) {
|
|
11964
12026
|
if (!("deviceId" in value) || value["deviceId"] === void 0) return false;
|
|
@@ -15791,6 +15853,61 @@ function WebhookDeleteResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
15791
15853
|
};
|
|
15792
15854
|
}
|
|
15793
15855
|
|
|
15856
|
+
// src/src/models/WebhookEventType.ts
|
|
15857
|
+
var WebhookEventType = {
|
|
15858
|
+
EMAIL_QUEUED: "email.queued",
|
|
15859
|
+
EMAIL_SENT: "email.sent",
|
|
15860
|
+
EMAIL_DELIVERED: "email.delivered",
|
|
15861
|
+
EMAIL_BOUNCED: "email.bounced",
|
|
15862
|
+
EMAIL_SOFT_BOUNCED: "email.soft_bounced",
|
|
15863
|
+
EMAIL_COMPLAINED: "email.complained",
|
|
15864
|
+
EMAIL_OPENED: "email.opened",
|
|
15865
|
+
EMAIL_CLICKED: "email.clicked",
|
|
15866
|
+
EMAIL_FAILED: "email.failed",
|
|
15867
|
+
EMAIL_SUPPRESSED: "email.suppressed",
|
|
15868
|
+
EMAIL_RECEIVED: "email.received",
|
|
15869
|
+
PUSH_SENT: "push.sent",
|
|
15870
|
+
PUSH_DELIVERED: "push.delivered",
|
|
15871
|
+
PUSH_FAILED: "push.failed",
|
|
15872
|
+
PUSH_EXPIRED: "push.expired",
|
|
15873
|
+
USER_CREATED: "user.created",
|
|
15874
|
+
USER_LOGIN: "user.login",
|
|
15875
|
+
USER_LOGOUT: "user.logout",
|
|
15876
|
+
USER_PASSWORD_CHANGED: "user.password_changed",
|
|
15877
|
+
USER_PASSWORD_RESET_REQUESTED: "user.password_reset_requested",
|
|
15878
|
+
USER_EMAIL_VERIFIED: "user.email_verified",
|
|
15879
|
+
USER_PHONE_VERIFIED: "user.phone_verified",
|
|
15880
|
+
USER_DELETED: "user.deleted",
|
|
15881
|
+
USER_SESSION_REVOKED: "user.session_revoked",
|
|
15882
|
+
USER_MFA_ENABLED: "user.mfa_enabled",
|
|
15883
|
+
USER_MFA_DISABLED: "user.mfa_disabled",
|
|
15884
|
+
USER_IMPERSONATED: "user.impersonated",
|
|
15885
|
+
DOMAIN_VERIFIED: "domain.verified",
|
|
15886
|
+
DOMAIN_VERIFICATION_FAILED: "domain.verification_failed"
|
|
15887
|
+
};
|
|
15888
|
+
function instanceOfWebhookEventType(value) {
|
|
15889
|
+
for (const key in WebhookEventType) {
|
|
15890
|
+
if (Object.prototype.hasOwnProperty.call(WebhookEventType, key)) {
|
|
15891
|
+
if (WebhookEventType[key] === value) {
|
|
15892
|
+
return true;
|
|
15893
|
+
}
|
|
15894
|
+
}
|
|
15895
|
+
}
|
|
15896
|
+
return false;
|
|
15897
|
+
}
|
|
15898
|
+
function WebhookEventTypeFromJSON(json) {
|
|
15899
|
+
return WebhookEventTypeFromJSONTyped(json, false);
|
|
15900
|
+
}
|
|
15901
|
+
function WebhookEventTypeFromJSONTyped(json, ignoreDiscriminator) {
|
|
15902
|
+
return json;
|
|
15903
|
+
}
|
|
15904
|
+
function WebhookEventTypeToJSON(value) {
|
|
15905
|
+
return value;
|
|
15906
|
+
}
|
|
15907
|
+
function WebhookEventTypeToJSONTyped(value, ignoreDiscriminator) {
|
|
15908
|
+
return value;
|
|
15909
|
+
}
|
|
15910
|
+
|
|
15794
15911
|
// src/src/models/WebhookDelivery.ts
|
|
15795
15912
|
var WebhookDeliveryStatusEnum = {
|
|
15796
15913
|
PENDING: "pending",
|
|
@@ -15813,7 +15930,7 @@ function WebhookDeliveryFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
15813
15930
|
"id": json["id"] == null ? void 0 : json["id"],
|
|
15814
15931
|
"msgId": json["msg_id"] == null ? void 0 : json["msg_id"],
|
|
15815
15932
|
"eventId": json["event_id"] == null ? void 0 : json["event_id"],
|
|
15816
|
-
"eventType": json["event_type"] == null ? void 0 : json["event_type"],
|
|
15933
|
+
"eventType": json["event_type"] == null ? void 0 : WebhookEventTypeFromJSON(json["event_type"]),
|
|
15817
15934
|
"status": json["status"] == null ? void 0 : json["status"],
|
|
15818
15935
|
"attempts": json["attempts"] == null ? void 0 : json["attempts"],
|
|
15819
15936
|
"maxAttempts": json["max_attempts"] == null ? void 0 : json["max_attempts"],
|
|
@@ -15839,7 +15956,7 @@ function WebhookDeliveryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
15839
15956
|
"id": value["id"],
|
|
15840
15957
|
"msg_id": value["msgId"],
|
|
15841
15958
|
"event_id": value["eventId"],
|
|
15842
|
-
"event_type": value["eventType"],
|
|
15959
|
+
"event_type": WebhookEventTypeToJSON(value["eventType"]),
|
|
15843
15960
|
"status": value["status"],
|
|
15844
15961
|
"attempts": value["attempts"],
|
|
15845
15962
|
"max_attempts": value["maxAttempts"],
|
|
@@ -15877,7 +15994,7 @@ function WebhookDeliveryDetailFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
15877
15994
|
"id": json["id"] == null ? void 0 : json["id"],
|
|
15878
15995
|
"msgId": json["msg_id"] == null ? void 0 : json["msg_id"],
|
|
15879
15996
|
"eventId": json["event_id"] == null ? void 0 : json["event_id"],
|
|
15880
|
-
"eventType": json["event_type"] == null ? void 0 : json["event_type"],
|
|
15997
|
+
"eventType": json["event_type"] == null ? void 0 : WebhookEventTypeFromJSON(json["event_type"]),
|
|
15881
15998
|
"status": json["status"] == null ? void 0 : json["status"],
|
|
15882
15999
|
"attempts": json["attempts"] == null ? void 0 : json["attempts"],
|
|
15883
16000
|
"maxAttempts": json["max_attempts"] == null ? void 0 : json["max_attempts"],
|
|
@@ -15907,7 +16024,7 @@ function WebhookDeliveryDetailToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
15907
16024
|
"id": value["id"],
|
|
15908
16025
|
"msg_id": value["msgId"],
|
|
15909
16026
|
"event_id": value["eventId"],
|
|
15910
|
-
"event_type": value["eventType"],
|
|
16027
|
+
"event_type": WebhookEventTypeToJSON(value["eventType"]),
|
|
15911
16028
|
"status": value["status"],
|
|
15912
16029
|
"attempts": value["attempts"],
|
|
15913
16030
|
"max_attempts": value["maxAttempts"],
|
|
@@ -16057,7 +16174,7 @@ function WebhookEventTypesResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
16057
16174
|
return json;
|
|
16058
16175
|
}
|
|
16059
16176
|
return {
|
|
16060
|
-
"eventTypes": json["event_types"] == null ? void 0 : json["event_types"],
|
|
16177
|
+
"eventTypes": json["event_types"] == null ? void 0 : json["event_types"].map(WebhookEventTypeFromJSON),
|
|
16061
16178
|
"registry": json["registry"] == null ? void 0 : json["registry"],
|
|
16062
16179
|
"categories": json["categories"] == null ? void 0 : json["categories"],
|
|
16063
16180
|
"apiVersion": json["api_version"] == null ? void 0 : json["api_version"]
|
|
@@ -16071,7 +16188,7 @@ function WebhookEventTypesResponseDataToJSONTyped(value, ignoreDiscriminator = f
|
|
|
16071
16188
|
return value;
|
|
16072
16189
|
}
|
|
16073
16190
|
return {
|
|
16074
|
-
"event_types": value["eventTypes"],
|
|
16191
|
+
"event_types": value["eventTypes"] == null ? void 0 : value["eventTypes"].map(WebhookEventTypeToJSON),
|
|
16075
16192
|
"registry": value["registry"],
|
|
16076
16193
|
"categories": value["categories"],
|
|
16077
16194
|
"api_version": value["apiVersion"]
|
|
@@ -16472,7 +16589,7 @@ function WebhookTestEventResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
16472
16589
|
}
|
|
16473
16590
|
return {
|
|
16474
16591
|
"deliveryId": json["delivery_id"] == null ? void 0 : json["delivery_id"],
|
|
16475
|
-
"eventType": json["event_type"] == null ? void 0 : json["event_type"],
|
|
16592
|
+
"eventType": json["event_type"] == null ? void 0 : WebhookEventTypeFromJSON(json["event_type"]),
|
|
16476
16593
|
"payload": json["payload"] == null ? void 0 : json["payload"],
|
|
16477
16594
|
"status": json["status"] == null ? void 0 : json["status"]
|
|
16478
16595
|
};
|
|
@@ -16486,7 +16603,7 @@ function WebhookTestEventResponseDataToJSONTyped(value, ignoreDiscriminator = fa
|
|
|
16486
16603
|
}
|
|
16487
16604
|
return {
|
|
16488
16605
|
"delivery_id": value["deliveryId"],
|
|
16489
|
-
"event_type": value["eventType"],
|
|
16606
|
+
"event_type": WebhookEventTypeToJSON(value["eventType"]),
|
|
16490
16607
|
"payload": value["payload"],
|
|
16491
16608
|
"status": value["status"]
|
|
16492
16609
|
};
|
|
@@ -16736,6 +16853,43 @@ var AuthApplicationApi = class extends BaseAPI {
|
|
|
16736
16853
|
const response = await this.getSelfApplicationRaw(initOverrides);
|
|
16737
16854
|
return await response.value();
|
|
16738
16855
|
}
|
|
16856
|
+
/**
|
|
16857
|
+
* Set `test_recipients` — the per-application auth-email allowlist — on the application whose credentials authenticated this request. When non-empty, this allowlist gates ALL auth emails (only listed addresses receive them); an EMPTY array clears it and disables the gate. Lets an integrator manage the allowlist from their own infrastructure config instead of the dashboard. Application-SECRET scoped (server-side write): requires X-Application-Key AND X-Application-Secret. Mutates ONLY the authenticating application — it never takes an application id from the request, so there is no cross-tenant write path. The response mirrors GET /auth/application exactly (never returns secrets).
|
|
16858
|
+
* Set the authenticating application\'s auth-email test allowlist
|
|
16859
|
+
*/
|
|
16860
|
+
async setSelfApplicationTestRecipientsRaw(requestParameters, initOverrides) {
|
|
16861
|
+
if (requestParameters["setSelfApplicationTestRecipientsRequest"] == null) {
|
|
16862
|
+
throw new RequiredError(
|
|
16863
|
+
"setSelfApplicationTestRecipientsRequest",
|
|
16864
|
+
'Required parameter "setSelfApplicationTestRecipientsRequest" was null or undefined when calling setSelfApplicationTestRecipients().'
|
|
16865
|
+
);
|
|
16866
|
+
}
|
|
16867
|
+
const queryParameters = {};
|
|
16868
|
+
const headerParameters = {};
|
|
16869
|
+
headerParameters["Content-Type"] = "application/json";
|
|
16870
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
16871
|
+
headerParameters["X-Application-Secret"] = await this.configuration.apiKey("X-Application-Secret");
|
|
16872
|
+
}
|
|
16873
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
16874
|
+
headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
|
|
16875
|
+
}
|
|
16876
|
+
const response = await this.request({
|
|
16877
|
+
path: `/auth/application`,
|
|
16878
|
+
method: "PATCH",
|
|
16879
|
+
headers: headerParameters,
|
|
16880
|
+
query: queryParameters,
|
|
16881
|
+
body: SetSelfApplicationTestRecipientsRequestToJSON(requestParameters["setSelfApplicationTestRecipientsRequest"])
|
|
16882
|
+
}, initOverrides);
|
|
16883
|
+
return new JSONApiResponse(response, (jsonValue) => ApplicationSelfResponseFromJSON(jsonValue));
|
|
16884
|
+
}
|
|
16885
|
+
/**
|
|
16886
|
+
* Set `test_recipients` — the per-application auth-email allowlist — on the application whose credentials authenticated this request. When non-empty, this allowlist gates ALL auth emails (only listed addresses receive them); an EMPTY array clears it and disables the gate. Lets an integrator manage the allowlist from their own infrastructure config instead of the dashboard. Application-SECRET scoped (server-side write): requires X-Application-Key AND X-Application-Secret. Mutates ONLY the authenticating application — it never takes an application id from the request, so there is no cross-tenant write path. The response mirrors GET /auth/application exactly (never returns secrets).
|
|
16887
|
+
* Set the authenticating application\'s auth-email test allowlist
|
|
16888
|
+
*/
|
|
16889
|
+
async setSelfApplicationTestRecipients(setSelfApplicationTestRecipientsRequest, initOverrides) {
|
|
16890
|
+
const response = await this.setSelfApplicationTestRecipientsRaw({ setSelfApplicationTestRecipientsRequest }, initOverrides);
|
|
16891
|
+
return await response.value();
|
|
16892
|
+
}
|
|
16739
16893
|
};
|
|
16740
16894
|
|
|
16741
16895
|
// src/src/apis/AuthEmailOTPApi.ts
|
|
@@ -19482,6 +19636,47 @@ var ListEndUsersEnvironmentEnum = {
|
|
|
19482
19636
|
|
|
19483
19637
|
// src/src/apis/AuthUserProfileApi.ts
|
|
19484
19638
|
var AuthUserProfileApi = class extends BaseAPI {
|
|
19639
|
+
/**
|
|
19640
|
+
* Change the currently authenticated end user\'s password from a logged-in session. The caller must prove possession of the CURRENT password (`current_password`); the user is identified from the end-user token, not the request body, so a user can only change their own password. On success, all existing sessions are revoked and a fresh token pair is returned so the current session stays authenticated. Emits the `user.password_changed` webhook.
|
|
19641
|
+
* Change password (authenticated session)
|
|
19642
|
+
*/
|
|
19643
|
+
async changeEndUserPasswordRaw(requestParameters, initOverrides) {
|
|
19644
|
+
if (requestParameters["changePasswordRequest"] == null) {
|
|
19645
|
+
throw new RequiredError(
|
|
19646
|
+
"changePasswordRequest",
|
|
19647
|
+
'Required parameter "changePasswordRequest" was null or undefined when calling changeEndUserPassword().'
|
|
19648
|
+
);
|
|
19649
|
+
}
|
|
19650
|
+
const queryParameters = {};
|
|
19651
|
+
const headerParameters = {};
|
|
19652
|
+
headerParameters["Content-Type"] = "application/json";
|
|
19653
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
19654
|
+
const token = this.configuration.accessToken;
|
|
19655
|
+
const tokenString = await token("EndUserToken", []);
|
|
19656
|
+
if (tokenString) {
|
|
19657
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
19658
|
+
}
|
|
19659
|
+
}
|
|
19660
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
19661
|
+
headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
|
|
19662
|
+
}
|
|
19663
|
+
const response = await this.request({
|
|
19664
|
+
path: `/auth/users/change-password`,
|
|
19665
|
+
method: "POST",
|
|
19666
|
+
headers: headerParameters,
|
|
19667
|
+
query: queryParameters,
|
|
19668
|
+
body: ChangePasswordRequestToJSON(requestParameters["changePasswordRequest"])
|
|
19669
|
+
}, initOverrides);
|
|
19670
|
+
return new JSONApiResponse(response, (jsonValue) => RefreshTokenResponseFromJSON(jsonValue));
|
|
19671
|
+
}
|
|
19672
|
+
/**
|
|
19673
|
+
* Change the currently authenticated end user\'s password from a logged-in session. The caller must prove possession of the CURRENT password (`current_password`); the user is identified from the end-user token, not the request body, so a user can only change their own password. On success, all existing sessions are revoked and a fresh token pair is returned so the current session stays authenticated. Emits the `user.password_changed` webhook.
|
|
19674
|
+
* Change password (authenticated session)
|
|
19675
|
+
*/
|
|
19676
|
+
async changeEndUserPassword(changePasswordRequest, initOverrides) {
|
|
19677
|
+
const response = await this.changeEndUserPasswordRaw({ changePasswordRequest }, initOverrides);
|
|
19678
|
+
return await response.value();
|
|
19679
|
+
}
|
|
19485
19680
|
/**
|
|
19486
19681
|
* Delete the current end user account (GDPR right to erasure). This is a soft delete — the account is marked as deleted but data is retained for a period to allow for recovery or legal requirements.
|
|
19487
19682
|
* Delete current end user account
|
|
@@ -26140,10 +26335,18 @@ var ZyphrClient = class {
|
|
|
26140
26335
|
this.accessToken = options.accessToken;
|
|
26141
26336
|
const config = new Configuration({
|
|
26142
26337
|
basePath: options.baseUrl,
|
|
26143
|
-
// The
|
|
26144
|
-
// application key. End-user Bearer tokens are attached per-request via
|
|
26145
|
-
// authedRequest() so token rotation doesn't require rebuilding the client.
|
|
26338
|
+
// The publishable application key is sent automatically on every call.
|
|
26146
26339
|
apiKey: (name) => name === "X-Application-Key" ? this.applicationKey : "",
|
|
26340
|
+
// The stored end-user access token is also applied automatically: any
|
|
26341
|
+
// user-scoped generated method (which authenticates the EndUserToken
|
|
26342
|
+
// scheme) invokes this callback and attaches `Authorization: Bearer`.
|
|
26343
|
+
// The callback reads `this.accessToken` at call time, so setAccessToken()
|
|
26344
|
+
// takes effect on subsequent calls without rebuilding the client. When no
|
|
26345
|
+
// token is set it returns '', and the generated code adds no header — so
|
|
26346
|
+
// anonymous endpoints (login, register, password-reset) stay unauthenticated.
|
|
26347
|
+
// An explicit token passed to authedRequest() sets the header directly in
|
|
26348
|
+
// RequestInit, which overrides this callback.
|
|
26349
|
+
accessToken: async () => this.accessToken ?? "",
|
|
26147
26350
|
middleware: [errorMiddleware2]
|
|
26148
26351
|
});
|
|
26149
26352
|
this.auth = {
|
|
@@ -26163,7 +26366,7 @@ var ZyphrClient = class {
|
|
|
26163
26366
|
};
|
|
26164
26367
|
this.devices = new DevicesApi(config);
|
|
26165
26368
|
}
|
|
26166
|
-
/** Store the end-user access token
|
|
26369
|
+
/** Store the end-user access token; it is applied automatically to subsequent user-scoped calls. */
|
|
26167
26370
|
setAccessToken(accessToken) {
|
|
26168
26371
|
this.accessToken = accessToken;
|
|
26169
26372
|
}
|
|
@@ -26174,11 +26377,17 @@ var ZyphrClient = class {
|
|
|
26174
26377
|
/**
|
|
26175
26378
|
* Build request overrides that authenticate as the current end user: the
|
|
26176
26379
|
* stored Bearer token plus the publishable application key required by
|
|
26177
|
-
* user-scoped endpoints.
|
|
26380
|
+
* user-scoped endpoints.
|
|
26381
|
+
*
|
|
26382
|
+
* The stored token is now applied automatically to user-scoped calls, so this
|
|
26383
|
+
* is no longer required for authentication. It remains useful to authenticate
|
|
26384
|
+
* a single call with a different token — a token passed here sets the header
|
|
26385
|
+
* directly in RequestInit and overrides the stored token for that call.
|
|
26178
26386
|
*
|
|
26179
26387
|
* @example
|
|
26180
26388
|
* ```ts
|
|
26181
|
-
*
|
|
26389
|
+
* // Authenticate one call as a different user, without changing stored state:
|
|
26390
|
+
* const me = await zyphr.auth.profile.getEndUser(zyphr.authedRequest(otherToken));
|
|
26182
26391
|
* ```
|
|
26183
26392
|
*/
|
|
26184
26393
|
authedRequest(accessToken) {
|
|
@@ -26416,6 +26625,10 @@ export {
|
|
|
26416
26625
|
CategoryResponseToJSONTyped,
|
|
26417
26626
|
CategoryToJSON,
|
|
26418
26627
|
CategoryToJSONTyped,
|
|
26628
|
+
ChangePasswordRequestFromJSON,
|
|
26629
|
+
ChangePasswordRequestFromJSONTyped,
|
|
26630
|
+
ChangePasswordRequestToJSON,
|
|
26631
|
+
ChangePasswordRequestToJSONTyped,
|
|
26419
26632
|
CloseWaaSEndpointCircuit200ResponseDataFromJSON,
|
|
26420
26633
|
CloseWaaSEndpointCircuit200ResponseDataFromJSONTyped,
|
|
26421
26634
|
CloseWaaSEndpointCircuit200ResponseDataStateEnum,
|
|
@@ -27596,6 +27809,10 @@ export {
|
|
|
27596
27809
|
SetPreferencesRequestPreferencesInnerToJSONTyped,
|
|
27597
27810
|
SetPreferencesRequestToJSON,
|
|
27598
27811
|
SetPreferencesRequestToJSONTyped,
|
|
27812
|
+
SetSelfApplicationTestRecipientsRequestFromJSON,
|
|
27813
|
+
SetSelfApplicationTestRecipientsRequestFromJSONTyped,
|
|
27814
|
+
SetSelfApplicationTestRecipientsRequestToJSON,
|
|
27815
|
+
SetSelfApplicationTestRecipientsRequestToJSONTyped,
|
|
27599
27816
|
SignInAnonymouslyRequestFromJSON,
|
|
27600
27817
|
SignInAnonymouslyRequestFromJSONTyped,
|
|
27601
27818
|
SignInAnonymouslyRequestToJSON,
|
|
@@ -28178,6 +28395,11 @@ export {
|
|
|
28178
28395
|
WebhookDeliveryStatusEnum,
|
|
28179
28396
|
WebhookDeliveryToJSON,
|
|
28180
28397
|
WebhookDeliveryToJSONTyped,
|
|
28398
|
+
WebhookEventType,
|
|
28399
|
+
WebhookEventTypeFromJSON,
|
|
28400
|
+
WebhookEventTypeFromJSONTyped,
|
|
28401
|
+
WebhookEventTypeToJSON,
|
|
28402
|
+
WebhookEventTypeToJSONTyped,
|
|
28181
28403
|
WebhookEventTypesResponseDataFromJSON,
|
|
28182
28404
|
WebhookEventTypesResponseDataFromJSONTyped,
|
|
28183
28405
|
WebhookEventTypesResponseDataToJSON,
|
|
@@ -28372,6 +28594,7 @@ export {
|
|
|
28372
28594
|
instanceOfCategory,
|
|
28373
28595
|
instanceOfCategoryListResponse,
|
|
28374
28596
|
instanceOfCategoryResponse,
|
|
28597
|
+
instanceOfChangePasswordRequest,
|
|
28375
28598
|
instanceOfCloseWaaSEndpointCircuit200Response,
|
|
28376
28599
|
instanceOfCloseWaaSEndpointCircuit200ResponseData,
|
|
28377
28600
|
instanceOfConfirmEmailVerificationRequest,
|
|
@@ -28650,6 +28873,7 @@ export {
|
|
|
28650
28873
|
instanceOfSetEndUserClaimsRequest,
|
|
28651
28874
|
instanceOfSetPreferencesRequest,
|
|
28652
28875
|
instanceOfSetPreferencesRequestPreferencesInner,
|
|
28876
|
+
instanceOfSetSelfApplicationTestRecipientsRequest,
|
|
28653
28877
|
instanceOfSignInAnonymouslyRequest,
|
|
28654
28878
|
instanceOfSignInWithGameCenterRequest,
|
|
28655
28879
|
instanceOfSignInWithGooglePlayGamesRequest,
|
|
@@ -28787,6 +29011,7 @@ export {
|
|
|
28787
29011
|
instanceOfWebhookDeliveryResponse,
|
|
28788
29012
|
instanceOfWebhookDeliveryRetryResponse,
|
|
28789
29013
|
instanceOfWebhookDeliveryRetryResponseData,
|
|
29014
|
+
instanceOfWebhookEventType,
|
|
28790
29015
|
instanceOfWebhookEventTypesResponse,
|
|
28791
29016
|
instanceOfWebhookEventTypesResponseData,
|
|
28792
29017
|
instanceOfWebhookIpsResponse,
|