@zyphr-dev/node-sdk 0.1.51 → 0.1.53

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
@@ -909,6 +909,14 @@ __export(index_exports, {
909
909
  OAuthAuthorizationUrlResponseFromJSONTyped: () => OAuthAuthorizationUrlResponseFromJSONTyped,
910
910
  OAuthAuthorizationUrlResponseToJSON: () => OAuthAuthorizationUrlResponseToJSON,
911
911
  OAuthAuthorizationUrlResponseToJSONTyped: () => OAuthAuthorizationUrlResponseToJSONTyped,
912
+ OAuthAuthorizeResponseDataFromJSON: () => OAuthAuthorizeResponseDataFromJSON,
913
+ OAuthAuthorizeResponseDataFromJSONTyped: () => OAuthAuthorizeResponseDataFromJSONTyped,
914
+ OAuthAuthorizeResponseDataToJSON: () => OAuthAuthorizeResponseDataToJSON,
915
+ OAuthAuthorizeResponseDataToJSONTyped: () => OAuthAuthorizeResponseDataToJSONTyped,
916
+ OAuthAuthorizeResponseFromJSON: () => OAuthAuthorizeResponseFromJSON,
917
+ OAuthAuthorizeResponseFromJSONTyped: () => OAuthAuthorizeResponseFromJSONTyped,
918
+ OAuthAuthorizeResponseToJSON: () => OAuthAuthorizeResponseToJSON,
919
+ OAuthAuthorizeResponseToJSONTyped: () => OAuthAuthorizeResponseToJSONTyped,
912
920
  OAuthCallbackRequestFromJSON: () => OAuthCallbackRequestFromJSON,
913
921
  OAuthCallbackRequestFromJSONTyped: () => OAuthCallbackRequestFromJSONTyped,
914
922
  OAuthCallbackRequestToJSON: () => OAuthCallbackRequestToJSON,
@@ -941,6 +949,14 @@ __export(index_exports, {
941
949
  OAuthConnectionsResponseFromJSONTyped: () => OAuthConnectionsResponseFromJSONTyped,
942
950
  OAuthConnectionsResponseToJSON: () => OAuthConnectionsResponseToJSON,
943
951
  OAuthConnectionsResponseToJSONTyped: () => OAuthConnectionsResponseToJSONTyped,
952
+ OAuthLinkResponseDataFromJSON: () => OAuthLinkResponseDataFromJSON,
953
+ OAuthLinkResponseDataFromJSONTyped: () => OAuthLinkResponseDataFromJSONTyped,
954
+ OAuthLinkResponseDataToJSON: () => OAuthLinkResponseDataToJSON,
955
+ OAuthLinkResponseDataToJSONTyped: () => OAuthLinkResponseDataToJSONTyped,
956
+ OAuthLinkResponseFromJSON: () => OAuthLinkResponseFromJSON,
957
+ OAuthLinkResponseFromJSONTyped: () => OAuthLinkResponseFromJSONTyped,
958
+ OAuthLinkResponseToJSON: () => OAuthLinkResponseToJSON,
959
+ OAuthLinkResponseToJSONTyped: () => OAuthLinkResponseToJSONTyped,
944
960
  OAuthProviderFromJSON: () => OAuthProviderFromJSON,
945
961
  OAuthProviderFromJSONTyped: () => OAuthProviderFromJSONTyped,
946
962
  OAuthProviderInfoFromJSON: () => OAuthProviderInfoFromJSON,
@@ -2378,6 +2394,8 @@ __export(index_exports, {
2378
2394
  instanceOfMfaVerifyRequest: () => instanceOfMfaVerifyRequest,
2379
2395
  instanceOfOAuthAuthorizationUrlResponse: () => instanceOfOAuthAuthorizationUrlResponse,
2380
2396
  instanceOfOAuthAuthorizationUrlResponseData: () => instanceOfOAuthAuthorizationUrlResponseData,
2397
+ instanceOfOAuthAuthorizeResponse: () => instanceOfOAuthAuthorizeResponse,
2398
+ instanceOfOAuthAuthorizeResponseData: () => instanceOfOAuthAuthorizeResponseData,
2381
2399
  instanceOfOAuthCallbackRequest: () => instanceOfOAuthCallbackRequest,
2382
2400
  instanceOfOAuthCallbackResponse: () => instanceOfOAuthCallbackResponse,
2383
2401
  instanceOfOAuthCallbackResponseData: () => instanceOfOAuthCallbackResponseData,
@@ -2386,6 +2404,8 @@ __export(index_exports, {
2386
2404
  instanceOfOAuthConnectionInfoResponseData: () => instanceOfOAuthConnectionInfoResponseData,
2387
2405
  instanceOfOAuthConnectionsResponse: () => instanceOfOAuthConnectionsResponse,
2388
2406
  instanceOfOAuthConnectionsResponseData: () => instanceOfOAuthConnectionsResponseData,
2407
+ instanceOfOAuthLinkResponse: () => instanceOfOAuthLinkResponse,
2408
+ instanceOfOAuthLinkResponseData: () => instanceOfOAuthLinkResponseData,
2389
2409
  instanceOfOAuthProvider: () => instanceOfOAuthProvider,
2390
2410
  instanceOfOAuthProviderInfo: () => instanceOfOAuthProviderInfo,
2391
2411
  instanceOfOAuthProviderName: () => instanceOfOAuthProviderName,
@@ -3554,6 +3574,7 @@ function instanceOfApplicationSelf(value) {
3554
3574
  if (!("signingAlgorithm" in value) || value["signingAlgorithm"] === void 0) return false;
3555
3575
  if (!("testRecipients" in value) || value["testRecipients"] === void 0) return false;
3556
3576
  if (!("authEmailMode" in value) || value["authEmailMode"] === void 0) return false;
3577
+ if (!("passwordDisallowBreached" in value) || value["passwordDisallowBreached"] === void 0) return false;
3557
3578
  return true;
3558
3579
  }
3559
3580
  function ApplicationSelfFromJSON(json) {
@@ -3569,7 +3590,8 @@ function ApplicationSelfFromJSONTyped(json, ignoreDiscriminator) {
3569
3590
  "environment": json["environment"],
3570
3591
  "signingAlgorithm": json["signing_algorithm"],
3571
3592
  "testRecipients": json["test_recipients"],
3572
- "authEmailMode": json["auth_email_mode"]
3593
+ "authEmailMode": json["auth_email_mode"],
3594
+ "passwordDisallowBreached": json["password_disallow_breached"]
3573
3595
  };
3574
3596
  }
3575
3597
  function ApplicationSelfToJSON(json) {
@@ -3585,7 +3607,8 @@ function ApplicationSelfToJSONTyped(value, ignoreDiscriminator = false) {
3585
3607
  "environment": value["environment"],
3586
3608
  "signing_algorithm": value["signingAlgorithm"],
3587
3609
  "test_recipients": value["testRecipients"],
3588
- "auth_email_mode": value["authEmailMode"]
3610
+ "auth_email_mode": value["authEmailMode"],
3611
+ "password_disallow_breached": value["passwordDisallowBreached"]
3589
3612
  };
3590
3613
  }
3591
3614
 
@@ -10416,6 +10439,64 @@ function OAuthAuthorizationUrlResponseToJSONTyped(value, ignoreDiscriminator = f
10416
10439
  };
10417
10440
  }
10418
10441
 
10442
+ // src/src/models/OAuthAuthorizeResponseData.ts
10443
+ function instanceOfOAuthAuthorizeResponseData(value) {
10444
+ return true;
10445
+ }
10446
+ function OAuthAuthorizeResponseDataFromJSON(json) {
10447
+ return OAuthAuthorizeResponseDataFromJSONTyped(json, false);
10448
+ }
10449
+ function OAuthAuthorizeResponseDataFromJSONTyped(json, ignoreDiscriminator) {
10450
+ if (json == null) {
10451
+ return json;
10452
+ }
10453
+ return {
10454
+ "authorizationUrl": json["authorization_url"] == null ? void 0 : json["authorization_url"],
10455
+ "state": json["state"] == null ? void 0 : json["state"]
10456
+ };
10457
+ }
10458
+ function OAuthAuthorizeResponseDataToJSON(json) {
10459
+ return OAuthAuthorizeResponseDataToJSONTyped(json, false);
10460
+ }
10461
+ function OAuthAuthorizeResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
10462
+ if (value == null) {
10463
+ return value;
10464
+ }
10465
+ return {
10466
+ "authorization_url": value["authorizationUrl"],
10467
+ "state": value["state"]
10468
+ };
10469
+ }
10470
+
10471
+ // src/src/models/OAuthAuthorizeResponse.ts
10472
+ function instanceOfOAuthAuthorizeResponse(value) {
10473
+ return true;
10474
+ }
10475
+ function OAuthAuthorizeResponseFromJSON(json) {
10476
+ return OAuthAuthorizeResponseFromJSONTyped(json, false);
10477
+ }
10478
+ function OAuthAuthorizeResponseFromJSONTyped(json, ignoreDiscriminator) {
10479
+ if (json == null) {
10480
+ return json;
10481
+ }
10482
+ return {
10483
+ "data": json["data"] == null ? void 0 : OAuthAuthorizeResponseDataFromJSON(json["data"]),
10484
+ "meta": json["meta"] == null ? void 0 : RequestMetaFromJSON(json["meta"])
10485
+ };
10486
+ }
10487
+ function OAuthAuthorizeResponseToJSON(json) {
10488
+ return OAuthAuthorizeResponseToJSONTyped(json, false);
10489
+ }
10490
+ function OAuthAuthorizeResponseToJSONTyped(value, ignoreDiscriminator = false) {
10491
+ if (value == null) {
10492
+ return value;
10493
+ }
10494
+ return {
10495
+ "data": OAuthAuthorizeResponseDataToJSON(value["data"]),
10496
+ "meta": RequestMetaToJSON(value["meta"])
10497
+ };
10498
+ }
10499
+
10419
10500
  // src/src/models/OAuthCallbackRequest.ts
10420
10501
  function instanceOfOAuthCallbackRequest(value) {
10421
10502
  if (!("code" in value) || value["code"] === void 0) return false;
@@ -10711,6 +10792,64 @@ function OAuthConnectionsResponseToJSONTyped(value, ignoreDiscriminator = false)
10711
10792
  };
10712
10793
  }
10713
10794
 
10795
+ // src/src/models/OAuthLinkResponseData.ts
10796
+ function instanceOfOAuthLinkResponseData(value) {
10797
+ return true;
10798
+ }
10799
+ function OAuthLinkResponseDataFromJSON(json) {
10800
+ return OAuthLinkResponseDataFromJSONTyped(json, false);
10801
+ }
10802
+ function OAuthLinkResponseDataFromJSONTyped(json, ignoreDiscriminator) {
10803
+ if (json == null) {
10804
+ return json;
10805
+ }
10806
+ return {
10807
+ "success": json["success"] == null ? void 0 : json["success"],
10808
+ "providerInfo": json["provider_info"] == null ? void 0 : OAuthProviderInfoFromJSON(json["provider_info"])
10809
+ };
10810
+ }
10811
+ function OAuthLinkResponseDataToJSON(json) {
10812
+ return OAuthLinkResponseDataToJSONTyped(json, false);
10813
+ }
10814
+ function OAuthLinkResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
10815
+ if (value == null) {
10816
+ return value;
10817
+ }
10818
+ return {
10819
+ "success": value["success"],
10820
+ "provider_info": OAuthProviderInfoToJSON(value["providerInfo"])
10821
+ };
10822
+ }
10823
+
10824
+ // src/src/models/OAuthLinkResponse.ts
10825
+ function instanceOfOAuthLinkResponse(value) {
10826
+ return true;
10827
+ }
10828
+ function OAuthLinkResponseFromJSON(json) {
10829
+ return OAuthLinkResponseFromJSONTyped(json, false);
10830
+ }
10831
+ function OAuthLinkResponseFromJSONTyped(json, ignoreDiscriminator) {
10832
+ if (json == null) {
10833
+ return json;
10834
+ }
10835
+ return {
10836
+ "data": json["data"] == null ? void 0 : OAuthLinkResponseDataFromJSON(json["data"]),
10837
+ "meta": json["meta"] == null ? void 0 : RequestMetaFromJSON(json["meta"])
10838
+ };
10839
+ }
10840
+ function OAuthLinkResponseToJSON(json) {
10841
+ return OAuthLinkResponseToJSONTyped(json, false);
10842
+ }
10843
+ function OAuthLinkResponseToJSONTyped(value, ignoreDiscriminator = false) {
10844
+ if (value == null) {
10845
+ return value;
10846
+ }
10847
+ return {
10848
+ "data": OAuthLinkResponseDataToJSON(value["data"]),
10849
+ "meta": RequestMetaToJSON(value["meta"])
10850
+ };
10851
+ }
10852
+
10714
10853
  // src/src/models/OAuthProvider.ts
10715
10854
  function instanceOfOAuthProvider(value) {
10716
10855
  return true;
@@ -14827,7 +14966,8 @@ function SetSelfApplicationTestRecipientsRequestFromJSONTyped(json, ignoreDiscri
14827
14966
  }
14828
14967
  return {
14829
14968
  "testRecipients": json["test_recipients"] == null ? void 0 : json["test_recipients"],
14830
- "authEmailMode": json["auth_email_mode"] == null ? void 0 : json["auth_email_mode"]
14969
+ "authEmailMode": json["auth_email_mode"] == null ? void 0 : json["auth_email_mode"],
14970
+ "passwordDisallowBreached": json["password_disallow_breached"] == null ? void 0 : json["password_disallow_breached"]
14831
14971
  };
14832
14972
  }
14833
14973
  function SetSelfApplicationTestRecipientsRequestToJSON(json) {
@@ -14839,7 +14979,8 @@ function SetSelfApplicationTestRecipientsRequestToJSONTyped(value, ignoreDiscrim
14839
14979
  }
14840
14980
  return {
14841
14981
  "test_recipients": value["testRecipients"],
14842
- "auth_email_mode": value["authEmailMode"]
14982
+ "auth_email_mode": value["authEmailMode"],
14983
+ "password_disallow_breached": value["passwordDisallowBreached"]
14843
14984
  };
14844
14985
  }
14845
14986
 
@@ -20763,6 +20904,53 @@ var AuthMagicLinksApi = class extends BaseAPI {
20763
20904
 
20764
20905
  // src/src/apis/AuthOAuthApi.ts
20765
20906
  var AuthOAuthApi = class extends BaseAPI {
20907
+ /**
20908
+ * Complete an authenticated account-linking flow started via the link authorize endpoint. Attaches the resolved provider identity to the current end user. Rejects if the provider identity is already linked to a different account, if the provider did not verify the email, or if the linking session does not belong to the authenticated user.
20909
+ * Complete linking an OAuth provider to the current account
20910
+ */
20911
+ async completeOAuthLinkRaw(requestParameters, initOverrides) {
20912
+ if (requestParameters["provider"] == null) {
20913
+ throw new RequiredError(
20914
+ "provider",
20915
+ 'Required parameter "provider" was null or undefined when calling completeOAuthLink().'
20916
+ );
20917
+ }
20918
+ if (requestParameters["oAuthCallbackRequest"] == null) {
20919
+ throw new RequiredError(
20920
+ "oAuthCallbackRequest",
20921
+ 'Required parameter "oAuthCallbackRequest" was null or undefined when calling completeOAuthLink().'
20922
+ );
20923
+ }
20924
+ const queryParameters = {};
20925
+ const headerParameters = {};
20926
+ headerParameters["Content-Type"] = "application/json";
20927
+ if (this.configuration && this.configuration.accessToken) {
20928
+ const token = this.configuration.accessToken;
20929
+ const tokenString = await token("EndUserToken", []);
20930
+ if (tokenString) {
20931
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
20932
+ }
20933
+ }
20934
+ if (this.configuration && this.configuration.apiKey) {
20935
+ headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
20936
+ }
20937
+ const response = await this.request({
20938
+ path: `/auth/oauth/{provider}/link/callback`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters["provider"]))),
20939
+ method: "POST",
20940
+ headers: headerParameters,
20941
+ query: queryParameters,
20942
+ body: OAuthCallbackRequestToJSON(requestParameters["oAuthCallbackRequest"])
20943
+ }, initOverrides);
20944
+ return new JSONApiResponse(response, (jsonValue) => OAuthLinkResponseFromJSON(jsonValue));
20945
+ }
20946
+ /**
20947
+ * Complete an authenticated account-linking flow started via the link authorize endpoint. Attaches the resolved provider identity to the current end user. Rejects if the provider identity is already linked to a different account, if the provider did not verify the email, or if the linking session does not belong to the authenticated user.
20948
+ * Complete linking an OAuth provider to the current account
20949
+ */
20950
+ async completeOAuthLink(provider, oAuthCallbackRequest, initOverrides) {
20951
+ const response = await this.completeOAuthLinkRaw({ provider, oAuthCallbackRequest }, initOverrides);
20952
+ return await response.value();
20953
+ }
20766
20954
  /**
20767
20955
  * Disconnect an OAuth provider from the current user.
20768
20956
  * Disconnect OAuth provider
@@ -21065,6 +21253,54 @@ var AuthOAuthApi = class extends BaseAPI {
21065
21253
  const response = await this.refreshOAuthTokensRaw({ provider, refreshOAuthTokensRequest }, initOverrides);
21066
21254
  return await response.value();
21067
21255
  }
21256
+ /**
21257
+ * Begin an authenticated account-linking flow. Unlike the sign-in authorize endpoint, this binds the current end user into the OAuth state so the matching link callback attaches the returned provider identity to THIS account instead of finding-or-creating a user. Requires an end-user token.
21258
+ * Start linking an OAuth provider to the current account
21259
+ */
21260
+ async startOAuthLinkRaw(requestParameters, initOverrides) {
21261
+ if (requestParameters["provider"] == null) {
21262
+ throw new RequiredError(
21263
+ "provider",
21264
+ 'Required parameter "provider" was null or undefined when calling startOAuthLink().'
21265
+ );
21266
+ }
21267
+ if (requestParameters["redirectUri"] == null) {
21268
+ throw new RequiredError(
21269
+ "redirectUri",
21270
+ 'Required parameter "redirectUri" was null or undefined when calling startOAuthLink().'
21271
+ );
21272
+ }
21273
+ const queryParameters = {};
21274
+ if (requestParameters["redirectUri"] != null) {
21275
+ queryParameters["redirect_uri"] = requestParameters["redirectUri"];
21276
+ }
21277
+ const headerParameters = {};
21278
+ if (this.configuration && this.configuration.accessToken) {
21279
+ const token = this.configuration.accessToken;
21280
+ const tokenString = await token("EndUserToken", []);
21281
+ if (tokenString) {
21282
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
21283
+ }
21284
+ }
21285
+ if (this.configuration && this.configuration.apiKey) {
21286
+ headerParameters["X-Application-Key"] = await this.configuration.apiKey("X-Application-Key");
21287
+ }
21288
+ const response = await this.request({
21289
+ path: `/auth/oauth/{provider}/link`.replace(`{${"provider"}}`, encodeURIComponent(String(requestParameters["provider"]))),
21290
+ method: "GET",
21291
+ headers: headerParameters,
21292
+ query: queryParameters
21293
+ }, initOverrides);
21294
+ return new JSONApiResponse(response, (jsonValue) => OAuthAuthorizeResponseFromJSON(jsonValue));
21295
+ }
21296
+ /**
21297
+ * Begin an authenticated account-linking flow. Unlike the sign-in authorize endpoint, this binds the current end user into the OAuth state so the matching link callback attaches the returned provider identity to THIS account instead of finding-or-creating a user. Requires an end-user token.
21298
+ * Start linking an OAuth provider to the current account
21299
+ */
21300
+ async startOAuthLink(provider, redirectUri, initOverrides) {
21301
+ const response = await this.startOAuthLinkRaw({ provider, redirectUri }, initOverrides);
21302
+ return await response.value();
21303
+ }
21068
21304
  };
21069
21305
 
21070
21306
  // src/src/apis/AuthOrganizationsApi.ts
@@ -30163,6 +30399,14 @@ var SDK_VERSION = "0.1.0";
30163
30399
  OAuthAuthorizationUrlResponseFromJSONTyped,
30164
30400
  OAuthAuthorizationUrlResponseToJSON,
30165
30401
  OAuthAuthorizationUrlResponseToJSONTyped,
30402
+ OAuthAuthorizeResponseDataFromJSON,
30403
+ OAuthAuthorizeResponseDataFromJSONTyped,
30404
+ OAuthAuthorizeResponseDataToJSON,
30405
+ OAuthAuthorizeResponseDataToJSONTyped,
30406
+ OAuthAuthorizeResponseFromJSON,
30407
+ OAuthAuthorizeResponseFromJSONTyped,
30408
+ OAuthAuthorizeResponseToJSON,
30409
+ OAuthAuthorizeResponseToJSONTyped,
30166
30410
  OAuthCallbackRequestFromJSON,
30167
30411
  OAuthCallbackRequestFromJSONTyped,
30168
30412
  OAuthCallbackRequestToJSON,
@@ -30195,6 +30439,14 @@ var SDK_VERSION = "0.1.0";
30195
30439
  OAuthConnectionsResponseFromJSONTyped,
30196
30440
  OAuthConnectionsResponseToJSON,
30197
30441
  OAuthConnectionsResponseToJSONTyped,
30442
+ OAuthLinkResponseDataFromJSON,
30443
+ OAuthLinkResponseDataFromJSONTyped,
30444
+ OAuthLinkResponseDataToJSON,
30445
+ OAuthLinkResponseDataToJSONTyped,
30446
+ OAuthLinkResponseFromJSON,
30447
+ OAuthLinkResponseFromJSONTyped,
30448
+ OAuthLinkResponseToJSON,
30449
+ OAuthLinkResponseToJSONTyped,
30198
30450
  OAuthProviderFromJSON,
30199
30451
  OAuthProviderFromJSONTyped,
30200
30452
  OAuthProviderInfoFromJSON,
@@ -31632,6 +31884,8 @@ var SDK_VERSION = "0.1.0";
31632
31884
  instanceOfMfaVerifyRequest,
31633
31885
  instanceOfOAuthAuthorizationUrlResponse,
31634
31886
  instanceOfOAuthAuthorizationUrlResponseData,
31887
+ instanceOfOAuthAuthorizeResponse,
31888
+ instanceOfOAuthAuthorizeResponseData,
31635
31889
  instanceOfOAuthCallbackRequest,
31636
31890
  instanceOfOAuthCallbackResponse,
31637
31891
  instanceOfOAuthCallbackResponseData,
@@ -31640,6 +31894,8 @@ var SDK_VERSION = "0.1.0";
31640
31894
  instanceOfOAuthConnectionInfoResponseData,
31641
31895
  instanceOfOAuthConnectionsResponse,
31642
31896
  instanceOfOAuthConnectionsResponseData,
31897
+ instanceOfOAuthLinkResponse,
31898
+ instanceOfOAuthLinkResponseData,
31643
31899
  instanceOfOAuthProvider,
31644
31900
  instanceOfOAuthProviderInfo,
31645
31901
  instanceOfOAuthProviderName,