@zyphr-dev/node-sdk 0.1.44 → 0.1.45

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
@@ -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,60 @@ 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_RECEIVED: "email.received",
15868
+ PUSH_SENT: "push.sent",
15869
+ PUSH_DELIVERED: "push.delivered",
15870
+ PUSH_FAILED: "push.failed",
15871
+ PUSH_EXPIRED: "push.expired",
15872
+ USER_CREATED: "user.created",
15873
+ USER_LOGIN: "user.login",
15874
+ USER_LOGOUT: "user.logout",
15875
+ USER_PASSWORD_CHANGED: "user.password_changed",
15876
+ USER_PASSWORD_RESET_REQUESTED: "user.password_reset_requested",
15877
+ USER_EMAIL_VERIFIED: "user.email_verified",
15878
+ USER_PHONE_VERIFIED: "user.phone_verified",
15879
+ USER_DELETED: "user.deleted",
15880
+ USER_SESSION_REVOKED: "user.session_revoked",
15881
+ USER_MFA_ENABLED: "user.mfa_enabled",
15882
+ USER_MFA_DISABLED: "user.mfa_disabled",
15883
+ USER_IMPERSONATED: "user.impersonated",
15884
+ DOMAIN_VERIFIED: "domain.verified",
15885
+ DOMAIN_VERIFICATION_FAILED: "domain.verification_failed"
15886
+ };
15887
+ function instanceOfWebhookEventType(value) {
15888
+ for (const key in WebhookEventType) {
15889
+ if (Object.prototype.hasOwnProperty.call(WebhookEventType, key)) {
15890
+ if (WebhookEventType[key] === value) {
15891
+ return true;
15892
+ }
15893
+ }
15894
+ }
15895
+ return false;
15896
+ }
15897
+ function WebhookEventTypeFromJSON(json) {
15898
+ return WebhookEventTypeFromJSONTyped(json, false);
15899
+ }
15900
+ function WebhookEventTypeFromJSONTyped(json, ignoreDiscriminator) {
15901
+ return json;
15902
+ }
15903
+ function WebhookEventTypeToJSON(value) {
15904
+ return value;
15905
+ }
15906
+ function WebhookEventTypeToJSONTyped(value, ignoreDiscriminator) {
15907
+ return value;
15908
+ }
15909
+
15794
15910
  // src/src/models/WebhookDelivery.ts
15795
15911
  var WebhookDeliveryStatusEnum = {
15796
15912
  PENDING: "pending",
@@ -15813,7 +15929,7 @@ function WebhookDeliveryFromJSONTyped(json, ignoreDiscriminator) {
15813
15929
  "id": json["id"] == null ? void 0 : json["id"],
15814
15930
  "msgId": json["msg_id"] == null ? void 0 : json["msg_id"],
15815
15931
  "eventId": json["event_id"] == null ? void 0 : json["event_id"],
15816
- "eventType": json["event_type"] == null ? void 0 : json["event_type"],
15932
+ "eventType": json["event_type"] == null ? void 0 : WebhookEventTypeFromJSON(json["event_type"]),
15817
15933
  "status": json["status"] == null ? void 0 : json["status"],
15818
15934
  "attempts": json["attempts"] == null ? void 0 : json["attempts"],
15819
15935
  "maxAttempts": json["max_attempts"] == null ? void 0 : json["max_attempts"],
@@ -15839,7 +15955,7 @@ function WebhookDeliveryToJSONTyped(value, ignoreDiscriminator = false) {
15839
15955
  "id": value["id"],
15840
15956
  "msg_id": value["msgId"],
15841
15957
  "event_id": value["eventId"],
15842
- "event_type": value["eventType"],
15958
+ "event_type": WebhookEventTypeToJSON(value["eventType"]),
15843
15959
  "status": value["status"],
15844
15960
  "attempts": value["attempts"],
15845
15961
  "max_attempts": value["maxAttempts"],
@@ -15877,7 +15993,7 @@ function WebhookDeliveryDetailFromJSONTyped(json, ignoreDiscriminator) {
15877
15993
  "id": json["id"] == null ? void 0 : json["id"],
15878
15994
  "msgId": json["msg_id"] == null ? void 0 : json["msg_id"],
15879
15995
  "eventId": json["event_id"] == null ? void 0 : json["event_id"],
15880
- "eventType": json["event_type"] == null ? void 0 : json["event_type"],
15996
+ "eventType": json["event_type"] == null ? void 0 : WebhookEventTypeFromJSON(json["event_type"]),
15881
15997
  "status": json["status"] == null ? void 0 : json["status"],
15882
15998
  "attempts": json["attempts"] == null ? void 0 : json["attempts"],
15883
15999
  "maxAttempts": json["max_attempts"] == null ? void 0 : json["max_attempts"],
@@ -15907,7 +16023,7 @@ function WebhookDeliveryDetailToJSONTyped(value, ignoreDiscriminator = false) {
15907
16023
  "id": value["id"],
15908
16024
  "msg_id": value["msgId"],
15909
16025
  "event_id": value["eventId"],
15910
- "event_type": value["eventType"],
16026
+ "event_type": WebhookEventTypeToJSON(value["eventType"]),
15911
16027
  "status": value["status"],
15912
16028
  "attempts": value["attempts"],
15913
16029
  "max_attempts": value["maxAttempts"],
@@ -16057,7 +16173,7 @@ function WebhookEventTypesResponseDataFromJSONTyped(json, ignoreDiscriminator) {
16057
16173
  return json;
16058
16174
  }
16059
16175
  return {
16060
- "eventTypes": json["event_types"] == null ? void 0 : json["event_types"],
16176
+ "eventTypes": json["event_types"] == null ? void 0 : json["event_types"].map(WebhookEventTypeFromJSON),
16061
16177
  "registry": json["registry"] == null ? void 0 : json["registry"],
16062
16178
  "categories": json["categories"] == null ? void 0 : json["categories"],
16063
16179
  "apiVersion": json["api_version"] == null ? void 0 : json["api_version"]
@@ -16071,7 +16187,7 @@ function WebhookEventTypesResponseDataToJSONTyped(value, ignoreDiscriminator = f
16071
16187
  return value;
16072
16188
  }
16073
16189
  return {
16074
- "event_types": value["eventTypes"],
16190
+ "event_types": value["eventTypes"] == null ? void 0 : value["eventTypes"].map(WebhookEventTypeToJSON),
16075
16191
  "registry": value["registry"],
16076
16192
  "categories": value["categories"],
16077
16193
  "api_version": value["apiVersion"]
@@ -16472,7 +16588,7 @@ function WebhookTestEventResponseDataFromJSONTyped(json, ignoreDiscriminator) {
16472
16588
  }
16473
16589
  return {
16474
16590
  "deliveryId": json["delivery_id"] == null ? void 0 : json["delivery_id"],
16475
- "eventType": json["event_type"] == null ? void 0 : json["event_type"],
16591
+ "eventType": json["event_type"] == null ? void 0 : WebhookEventTypeFromJSON(json["event_type"]),
16476
16592
  "payload": json["payload"] == null ? void 0 : json["payload"],
16477
16593
  "status": json["status"] == null ? void 0 : json["status"]
16478
16594
  };
@@ -16486,7 +16602,7 @@ function WebhookTestEventResponseDataToJSONTyped(value, ignoreDiscriminator = fa
16486
16602
  }
16487
16603
  return {
16488
16604
  "delivery_id": value["deliveryId"],
16489
- "event_type": value["eventType"],
16605
+ "event_type": WebhookEventTypeToJSON(value["eventType"]),
16490
16606
  "payload": value["payload"],
16491
16607
  "status": value["status"]
16492
16608
  };
@@ -16736,6 +16852,43 @@ var AuthApplicationApi = class extends BaseAPI {
16736
16852
  const response = await this.getSelfApplicationRaw(initOverrides);
16737
16853
  return await response.value();
16738
16854
  }
16855
+ /**
16856
+ * 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).
16857
+ * Set the authenticating application\'s auth-email test allowlist
16858
+ */
16859
+ async setSelfApplicationTestRecipientsRaw(requestParameters, initOverrides) {
16860
+ if (requestParameters["setSelfApplicationTestRecipientsRequest"] == null) {
16861
+ throw new RequiredError(
16862
+ "setSelfApplicationTestRecipientsRequest",
16863
+ 'Required parameter "setSelfApplicationTestRecipientsRequest" was null or undefined when calling setSelfApplicationTestRecipients().'
16864
+ );
16865
+ }
16866
+ const queryParameters = {};
16867
+ const headerParameters = {};
16868
+ headerParameters["Content-Type"] = "application/json";
16869
+ if (this.configuration && this.configuration.apiKey) {
16870
+ headerParameters["X-Application-Secret"] = await this.configuration.apiKey("X-Application-Secret");
16871
+ }
16872
+ if (this.configuration && this.configuration.apiKey) {
16873
+ headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
16874
+ }
16875
+ const response = await this.request({
16876
+ path: `/auth/application`,
16877
+ method: "PATCH",
16878
+ headers: headerParameters,
16879
+ query: queryParameters,
16880
+ body: SetSelfApplicationTestRecipientsRequestToJSON(requestParameters["setSelfApplicationTestRecipientsRequest"])
16881
+ }, initOverrides);
16882
+ return new JSONApiResponse(response, (jsonValue) => ApplicationSelfResponseFromJSON(jsonValue));
16883
+ }
16884
+ /**
16885
+ * 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).
16886
+ * Set the authenticating application\'s auth-email test allowlist
16887
+ */
16888
+ async setSelfApplicationTestRecipients(setSelfApplicationTestRecipientsRequest, initOverrides) {
16889
+ const response = await this.setSelfApplicationTestRecipientsRaw({ setSelfApplicationTestRecipientsRequest }, initOverrides);
16890
+ return await response.value();
16891
+ }
16739
16892
  };
16740
16893
 
16741
16894
  // src/src/apis/AuthEmailOTPApi.ts
@@ -19482,6 +19635,47 @@ var ListEndUsersEnvironmentEnum = {
19482
19635
 
19483
19636
  // src/src/apis/AuthUserProfileApi.ts
19484
19637
  var AuthUserProfileApi = class extends BaseAPI {
19638
+ /**
19639
+ * 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.
19640
+ * Change password (authenticated session)
19641
+ */
19642
+ async changeEndUserPasswordRaw(requestParameters, initOverrides) {
19643
+ if (requestParameters["changePasswordRequest"] == null) {
19644
+ throw new RequiredError(
19645
+ "changePasswordRequest",
19646
+ 'Required parameter "changePasswordRequest" was null or undefined when calling changeEndUserPassword().'
19647
+ );
19648
+ }
19649
+ const queryParameters = {};
19650
+ const headerParameters = {};
19651
+ headerParameters["Content-Type"] = "application/json";
19652
+ if (this.configuration && this.configuration.accessToken) {
19653
+ const token = this.configuration.accessToken;
19654
+ const tokenString = await token("EndUserToken", []);
19655
+ if (tokenString) {
19656
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
19657
+ }
19658
+ }
19659
+ if (this.configuration && this.configuration.apiKey) {
19660
+ headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
19661
+ }
19662
+ const response = await this.request({
19663
+ path: `/auth/users/change-password`,
19664
+ method: "POST",
19665
+ headers: headerParameters,
19666
+ query: queryParameters,
19667
+ body: ChangePasswordRequestToJSON(requestParameters["changePasswordRequest"])
19668
+ }, initOverrides);
19669
+ return new JSONApiResponse(response, (jsonValue) => RefreshTokenResponseFromJSON(jsonValue));
19670
+ }
19671
+ /**
19672
+ * 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.
19673
+ * Change password (authenticated session)
19674
+ */
19675
+ async changeEndUserPassword(changePasswordRequest, initOverrides) {
19676
+ const response = await this.changeEndUserPasswordRaw({ changePasswordRequest }, initOverrides);
19677
+ return await response.value();
19678
+ }
19485
19679
  /**
19486
19680
  * 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
19681
  * Delete current end user account
@@ -26416,6 +26610,10 @@ export {
26416
26610
  CategoryResponseToJSONTyped,
26417
26611
  CategoryToJSON,
26418
26612
  CategoryToJSONTyped,
26613
+ ChangePasswordRequestFromJSON,
26614
+ ChangePasswordRequestFromJSONTyped,
26615
+ ChangePasswordRequestToJSON,
26616
+ ChangePasswordRequestToJSONTyped,
26419
26617
  CloseWaaSEndpointCircuit200ResponseDataFromJSON,
26420
26618
  CloseWaaSEndpointCircuit200ResponseDataFromJSONTyped,
26421
26619
  CloseWaaSEndpointCircuit200ResponseDataStateEnum,
@@ -27596,6 +27794,10 @@ export {
27596
27794
  SetPreferencesRequestPreferencesInnerToJSONTyped,
27597
27795
  SetPreferencesRequestToJSON,
27598
27796
  SetPreferencesRequestToJSONTyped,
27797
+ SetSelfApplicationTestRecipientsRequestFromJSON,
27798
+ SetSelfApplicationTestRecipientsRequestFromJSONTyped,
27799
+ SetSelfApplicationTestRecipientsRequestToJSON,
27800
+ SetSelfApplicationTestRecipientsRequestToJSONTyped,
27599
27801
  SignInAnonymouslyRequestFromJSON,
27600
27802
  SignInAnonymouslyRequestFromJSONTyped,
27601
27803
  SignInAnonymouslyRequestToJSON,
@@ -28178,6 +28380,11 @@ export {
28178
28380
  WebhookDeliveryStatusEnum,
28179
28381
  WebhookDeliveryToJSON,
28180
28382
  WebhookDeliveryToJSONTyped,
28383
+ WebhookEventType,
28384
+ WebhookEventTypeFromJSON,
28385
+ WebhookEventTypeFromJSONTyped,
28386
+ WebhookEventTypeToJSON,
28387
+ WebhookEventTypeToJSONTyped,
28181
28388
  WebhookEventTypesResponseDataFromJSON,
28182
28389
  WebhookEventTypesResponseDataFromJSONTyped,
28183
28390
  WebhookEventTypesResponseDataToJSON,
@@ -28372,6 +28579,7 @@ export {
28372
28579
  instanceOfCategory,
28373
28580
  instanceOfCategoryListResponse,
28374
28581
  instanceOfCategoryResponse,
28582
+ instanceOfChangePasswordRequest,
28375
28583
  instanceOfCloseWaaSEndpointCircuit200Response,
28376
28584
  instanceOfCloseWaaSEndpointCircuit200ResponseData,
28377
28585
  instanceOfConfirmEmailVerificationRequest,
@@ -28650,6 +28858,7 @@ export {
28650
28858
  instanceOfSetEndUserClaimsRequest,
28651
28859
  instanceOfSetPreferencesRequest,
28652
28860
  instanceOfSetPreferencesRequestPreferencesInner,
28861
+ instanceOfSetSelfApplicationTestRecipientsRequest,
28653
28862
  instanceOfSignInAnonymouslyRequest,
28654
28863
  instanceOfSignInWithGameCenterRequest,
28655
28864
  instanceOfSignInWithGooglePlayGamesRequest,
@@ -28787,6 +28996,7 @@ export {
28787
28996
  instanceOfWebhookDeliveryResponse,
28788
28997
  instanceOfWebhookDeliveryRetryResponse,
28789
28998
  instanceOfWebhookDeliveryRetryResponseData,
28999
+ instanceOfWebhookEventType,
28790
29000
  instanceOfWebhookEventTypesResponse,
28791
29001
  instanceOfWebhookEventTypesResponseData,
28792
29002
  instanceOfWebhookIpsResponse,