@wix/auto_sdk_identity_authentication 1.0.14 → 1.0.16

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.
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  interface Authentication {
2
4
  }
3
5
  interface RegisterV2Request {
@@ -819,6 +821,130 @@ interface WebAuthnVerifyData {
819
821
  */
820
822
  credential?: string | null;
821
823
  }
824
+ type RegisterV2ApplicationErrors = {
825
+ code?: 'UNIMPLEMENTED_FEATURE';
826
+ description?: string;
827
+ data?: Record<string, any>;
828
+ } | {
829
+ code?: 'THROTTLED_FEATURE';
830
+ description?: string;
831
+ data?: Record<string, any>;
832
+ } | {
833
+ code?: 'INVALID_CAPTCHA_TOKEN';
834
+ description?: string;
835
+ data?: Record<string, any>;
836
+ } | {
837
+ code?: 'CAPTCHA_TOKEN_REQUIRED';
838
+ description?: string;
839
+ data?: Record<string, any>;
840
+ } | {
841
+ code?: 'IP_ADDRESS_FILTERED';
842
+ description?: string;
843
+ data?: Record<string, any>;
844
+ } | {
845
+ code?: 'RECAPTCHA_FAILED';
846
+ description?: string;
847
+ data?: Record<string, any>;
848
+ } | {
849
+ code?: 'RECAPTCHA_REQUIRED';
850
+ description?: string;
851
+ data?: Record<string, any>;
852
+ } | {
853
+ code?: 'MISSING_CAPTCHA_TOKEN';
854
+ description?: string;
855
+ data?: Record<string, any>;
856
+ } | {
857
+ code?: 'USER_EMAIL_OFAC_ADDRESS';
858
+ description?: string;
859
+ data?: Record<string, any>;
860
+ } | {
861
+ code?: 'UNSUPPORTED_FIELD';
862
+ description?: string;
863
+ data?: Record<string, any>;
864
+ } | {
865
+ code?: 'ATTRIBUTE_NOT_FOUND';
866
+ description?: string;
867
+ data?: Record<string, any>;
868
+ } | {
869
+ code?: 'CLIENT_METADATA_NOT_FOUND';
870
+ description?: string;
871
+ data?: Record<string, any>;
872
+ } | {
873
+ code?: 'INVALID_LD_SESSION';
874
+ description?: string;
875
+ data?: Record<string, any>;
876
+ } | {
877
+ code?: 'DUPLICATE_EMAIL';
878
+ description?: string;
879
+ data?: Record<string, any>;
880
+ } | {
881
+ code?: 'COULD_NOT_CREATE_SET_ACCOUNT_USER';
882
+ description?: string;
883
+ data?: Record<string, any>;
884
+ } | {
885
+ code?: 'INVALID_USER_TYPE';
886
+ description?: string;
887
+ data?: Record<string, any>;
888
+ } | {
889
+ code?: 'REGISTRATION_TO_EDITORX_NOT_ALLOWED';
890
+ description?: string;
891
+ data?: Record<string, any>;
892
+ };
893
+ type RegisterV2ValidationErrors = {
894
+ ruleName?: 'PROVIDE_TENANT_ID';
895
+ } | {
896
+ ruleName?: 'INVALID_AUTHENTICATOR_ID';
897
+ } | {
898
+ ruleName?: 'VALUEֹֹ_TOO_SHORT';
899
+ } | {
900
+ ruleName?: 'VALUEֹֹ_TOO_LONG';
901
+ } | {
902
+ ruleName?: 'VALUE_DID_NOT_MATCH';
903
+ };
904
+ type LoginV2ApplicationErrors = {
905
+ code?: 'THROTTLED_FEATURE';
906
+ description?: string;
907
+ data?: Record<string, any>;
908
+ } | {
909
+ code?: 'INVALID_CAPTCHA_TOKEN';
910
+ description?: string;
911
+ data?: Record<string, any>;
912
+ } | {
913
+ code?: 'CAPTCHA_TOKEN_REQUIRED';
914
+ description?: string;
915
+ data?: Record<string, any>;
916
+ } | {
917
+ code?: 'REENROLLMENT_REQUIRED_BY_ADMIN';
918
+ description?: string;
919
+ data?: Record<string, any>;
920
+ } | {
921
+ code?: 'TRUSTED_CLIENTS_ONLY';
922
+ description?: string;
923
+ data?: Record<string, any>;
924
+ };
925
+ type LoginV2ValidationErrors = {
926
+ ruleName?: 'PROVIDE_TENANT_ID';
927
+ } | {
928
+ ruleName?: 'INVALID_AUTHENTICATOR_ID';
929
+ };
930
+ /**
931
+ * Registers a new member.
932
+ *
933
+ * Typically, after a successful registration, you generate and use member tokens for the
934
+ * registered member so that subsequent API calls are called as part of a member session.
935
+ * Use the `sessionToken` in the response to [get the site member's access and refresh tokens](https://dev.wix.com/docs/go-headless/coding/rest-api/visitors-and-members/handle-members-with-custom-login#get-the-site-members-access-and-refresh-tokens).
936
+ *
937
+ * If the email used to register the member already exists as a contact email, the registering
938
+ * member need to verify the email address using a code that is sent to the address.
939
+ * @param loginId - Identifier of the registering member.
940
+ * @public
941
+ * @requiredField loginId
942
+ * @fqn wix.iam.authentication.v1.AuthenticationService.RegisterV2
943
+ */
944
+ declare function registerV2(loginId: LoginId, options?: RegisterV2Options): Promise<NonNullablePaths<StateMachineResponse, `state` | `identity.connections` | `identity.connections.${number}.idpConnection.idpConnectionId` | `identity.connections.${number}.idpConnection.idpUserId` | `identity.connections.${number}.authenticatorConnection.authenticatorConnectionId` | `identity.connections.${number}.authenticatorConnection.reEnrollmentRequired` | `identity.identityProfile.emails` | `identity.identityProfile.phones` | `identity.identityProfile.labels` | `identity.identityProfile.privacyStatus` | `identity.identityProfile.customFields` | `identity.identityProfile.customFields.${number}.name` | `identity.identityProfile.customFields.${number}.value.strValue` | `identity.identityProfile.customFields.${number}.value.numValue` | `identity.identityProfile.secondaryEmails` | `identity.identityProfile.secondaryEmails.${number}.email` | `identity.identityProfile.secondaryEmails.${number}.tag` | `identity.identityProfile.phonesV2` | `identity.identityProfile.phonesV2.${number}.phone` | `identity.identityProfile.phonesV2.${number}.tag` | `identity.identityProfile.addresses` | `identity.identityProfile.addresses.${number}.tag` | `identity.metadata.tags` | `identity.email.address` | `identity.email.isVerified` | `identity.status.name` | `identity.status.reasons` | `identity.factors` | `identity.factors.${number}.factorId` | `identity.factors.${number}.type` | `identity.factors.${number}.status`> & {
945
+ __applicationErrorsType?: RegisterV2ApplicationErrors;
946
+ __validationErrorsType?: RegisterV2ValidationErrors;
947
+ }>;
822
948
  interface RegisterV2Options {
823
949
  /** Password of the registering member. */
824
950
  password?: string;
@@ -829,6 +955,21 @@ interface RegisterV2Options {
829
955
  /** Additional data that's relevant for the flow. */
830
956
  clientMetaData?: Record<string, any> | null;
831
957
  }
958
+ /**
959
+ * Logs in an existing member.
960
+ *
961
+ * Typically, after a successful login, you generate and use member tokens for the
962
+ * logged-in member so that subsequent API calls are called as part of a member session.
963
+ * Use the `sessionToken` in the response to [get the site member's access and refresh tokens](https://dev.wix.com/docs/go-headless/coding/rest-api/visitors-and-members/handle-members-with-custom-login#get-the-site-members-access-and-refresh-tokens).
964
+ * @param loginId - Identifier of identity logging in.
965
+ * @public
966
+ * @requiredField loginId
967
+ * @fqn wix.iam.authentication.v1.AuthenticationService.LoginV2
968
+ */
969
+ declare function loginV2(loginId: LoginId, options?: LoginV2Options): Promise<NonNullablePaths<StateMachineResponse, `state` | `identity.connections` | `identity.connections.${number}.idpConnection.idpConnectionId` | `identity.connections.${number}.idpConnection.idpUserId` | `identity.connections.${number}.authenticatorConnection.authenticatorConnectionId` | `identity.connections.${number}.authenticatorConnection.reEnrollmentRequired` | `identity.identityProfile.emails` | `identity.identityProfile.phones` | `identity.identityProfile.labels` | `identity.identityProfile.privacyStatus` | `identity.identityProfile.customFields` | `identity.identityProfile.customFields.${number}.name` | `identity.identityProfile.customFields.${number}.value.strValue` | `identity.identityProfile.customFields.${number}.value.numValue` | `identity.identityProfile.secondaryEmails` | `identity.identityProfile.secondaryEmails.${number}.email` | `identity.identityProfile.secondaryEmails.${number}.tag` | `identity.identityProfile.phonesV2` | `identity.identityProfile.phonesV2.${number}.phone` | `identity.identityProfile.phonesV2.${number}.tag` | `identity.identityProfile.addresses` | `identity.identityProfile.addresses.${number}.tag` | `identity.metadata.tags` | `identity.email.address` | `identity.email.isVerified` | `identity.status.name` | `identity.status.reasons` | `identity.factors` | `identity.factors.${number}.factorId` | `identity.factors.${number}.type` | `identity.factors.${number}.status`> & {
970
+ __applicationErrorsType?: LoginV2ApplicationErrors;
971
+ __validationErrorsType?: LoginV2ValidationErrors;
972
+ }>;
832
973
  interface LoginV2Options {
833
974
  /** Password of the identity logging in. */
834
975
  password?: string;
@@ -837,12 +978,36 @@ interface LoginV2Options {
837
978
  /** Additional data that's relevant for the flow. */
838
979
  clientMetaData?: Record<string, any> | null;
839
980
  }
981
+ /**
982
+ * Changes the password of a logged in user.
983
+ * @param newPassword - The new password to set for the logged in user
984
+ * @public
985
+ * @documentationMaturity preview
986
+ * @requiredField newPassword
987
+ * @permissionId IAM.CHANGE_PASSWORD
988
+ * @fqn wix.iam.authentication.v1.AuthenticationService.ChangePassword
989
+ */
990
+ declare function changePassword(newPassword: string): Promise<void>;
991
+ /** @public
992
+ * @documentationMaturity preview
993
+ * @fqn wix.iam.authentication.v1.AuthenticationService.LoginCallback
994
+ */
995
+ declare function loginCallback(options?: LoginCallbackOptions): Promise<NonNullablePaths<RawHttpResponse, `body` | `headers` | `headers.${number}.key` | `headers.${number}.value`>>;
840
996
  interface LoginCallbackOptions {
841
997
  /** state that that received on the redirect */
842
998
  state?: string;
843
999
  /** session token */
844
1000
  sessionToken?: string;
845
1001
  }
1002
+ /** @param loginId - the identifier of the identity
1003
+ * @public
1004
+ * @documentationMaturity preview
1005
+ * @requiredField loginId
1006
+ * @permissionId IAM.AUTHENTICAITON_SIGN_ON
1007
+ * @applicableIdentity APP
1008
+ * @fqn wix.iam.authentication.v1.AuthenticationService.SignOn
1009
+ */
1010
+ declare function signOn(loginId: LoginId, options?: SignOnOptions): Promise<NonNullablePaths<SignOnResponse, `sessionToken` | `identity.connections` | `identity.connections.${number}.idpConnection.idpConnectionId` | `identity.connections.${number}.idpConnection.idpUserId` | `identity.connections.${number}.authenticatorConnection.authenticatorConnectionId` | `identity.connections.${number}.authenticatorConnection.reEnrollmentRequired` | `identity.identityProfile.emails` | `identity.identityProfile.phones` | `identity.identityProfile.labels` | `identity.identityProfile.privacyStatus` | `identity.identityProfile.customFields` | `identity.identityProfile.customFields.${number}.name` | `identity.identityProfile.customFields.${number}.value.strValue` | `identity.identityProfile.customFields.${number}.value.numValue` | `identity.identityProfile.secondaryEmails` | `identity.identityProfile.secondaryEmails.${number}.email` | `identity.identityProfile.secondaryEmails.${number}.tag` | `identity.identityProfile.phonesV2` | `identity.identityProfile.phonesV2.${number}.phone` | `identity.identityProfile.phonesV2.${number}.tag` | `identity.identityProfile.addresses` | `identity.identityProfile.addresses.${number}.tag` | `identity.metadata.tags` | `identity.email.address` | `identity.email.isVerified` | `identity.status.name` | `identity.status.reasons` | `identity.factors` | `identity.factors.${number}.factorId` | `identity.factors.${number}.type` | `identity.factors.${number}.status`>>;
846
1011
  interface SignOnOptions {
847
1012
  /** profile of the identity */
848
1013
  profile?: IdentityProfile;
@@ -851,6 +1016,13 @@ interface SignOnOptions {
851
1016
  /** when false will create a new contact instead of merging the existing contact into the identity */
852
1017
  mergeExistingContact?: boolean;
853
1018
  }
1019
+ /**
1020
+ * Logs out a member.
1021
+ * @public
1022
+ * @documentationMaturity preview
1023
+ * @fqn wix.iam.authentication.v1.AuthenticationService.Logout
1024
+ */
1025
+ declare function logout(options?: LogoutOptions): Promise<NonNullablePaths<RawHttpResponse, `body` | `headers` | `headers.${number}.key` | `headers.${number}.value`>>;
854
1026
  interface LogoutOptions {
855
1027
  /**
856
1028
  * redirect after logout
@@ -863,6 +1035,12 @@ interface LogoutOptions {
863
1035
  */
864
1036
  clientId?: string | null;
865
1037
  }
1038
+ /** @public
1039
+ * @documentationMaturity preview
1040
+ * @requiredField factorType
1041
+ * @fqn wix.iam.authentication.v1.AuthenticationService.Verify
1042
+ */
1043
+ declare function verify(factorType: FactorTypeWithLiterals, options?: VerifyOptions): Promise<NonNullablePaths<StateMachineResponse, `state` | `identity.connections` | `identity.connections.${number}.idpConnection.idpConnectionId` | `identity.connections.${number}.idpConnection.idpUserId` | `identity.connections.${number}.authenticatorConnection.authenticatorConnectionId` | `identity.connections.${number}.authenticatorConnection.reEnrollmentRequired` | `identity.identityProfile.emails` | `identity.identityProfile.phones` | `identity.identityProfile.labels` | `identity.identityProfile.privacyStatus` | `identity.identityProfile.customFields` | `identity.identityProfile.customFields.${number}.name` | `identity.identityProfile.customFields.${number}.value.strValue` | `identity.identityProfile.customFields.${number}.value.numValue` | `identity.identityProfile.secondaryEmails` | `identity.identityProfile.secondaryEmails.${number}.email` | `identity.identityProfile.secondaryEmails.${number}.tag` | `identity.identityProfile.phonesV2` | `identity.identityProfile.phonesV2.${number}.phone` | `identity.identityProfile.phonesV2.${number}.tag` | `identity.identityProfile.addresses` | `identity.identityProfile.addresses.${number}.tag` | `identity.metadata.tags` | `identity.email.address` | `identity.email.isVerified` | `identity.status.name` | `identity.status.reasons` | `identity.factors` | `identity.factors.${number}.factorId` | `identity.factors.${number}.type` | `identity.factors.${number}.status`>>;
866
1044
  interface VerifyOptions extends VerifyOptionsFactorDataOneOf {
867
1045
  /**
868
1046
  * TODO: is this a reasonable maxLength?
@@ -887,4 +1065,4 @@ interface VerifyOptionsFactorDataOneOf {
887
1065
  webauthnData?: WebAuthnVerifyData;
888
1066
  }
889
1067
 
890
- export { type RequireMfaData as $, AddressTag as A, type StateMachineResponseStateDataOneOf as B, type CustomField as C, type Identity as D, EmailTag as E, type FactorTypeWithLiterals as F, type Connection as G, type ConnectionTypeOneOf as H, type IdentityProfile as I, type IdpConnection as J, type AuthenticatorConnection as K, type LoginId as L, MfaReason as M, type Metadata as N, type Email as O, PrivacyStatus as P, type StatusV2 as Q, type RegisterV2Options as R, type StateMachineResponse as S, TenantType as T, UserVerificationRequirement as U, type VerifyOptions as V, type Factor as W, type CustomValue as X, type CustomValueValueOneOf as Y, type ListValue as Z, type MapValue as _, type LoginV2Options as a, type V1Factor as a0, type MfaChallengeData as a1, type VerificationChallenge as a2, type VerificationChallengeFactorChallengeDataOneOf as a3, type PushChallengeData as a4, type WebAuthnChallengeData as a5, type PublicKeyCredentialDescriptor as a6, type AuthenticationExtensionInputs as a7, type AuthenticationExtensionInputsLargeBlobOperationOneOf as a8, type LoginV2Request as a9, type ChangePasswordRequest as aa, type ChangePasswordResponse as ab, type LoginWithIdpConnectionRequest as ac, type HeadersEntry as ad, type RawHttpRequest as ae, type PathParametersEntry as af, type QueryParametersEntry as ag, type LoginCallbackRequest as ah, type LoginWithIdpConnectionTokenParamsRequest as ai, type SignOnRequest as aj, type LogoutRequest as ak, type VerifyRequest as al, type VerifyRequestFactorDataOneOf as am, type SmsVerifyData as an, type CallVerifyData as ao, type ExternalEmailVerifyData as ap, type TotpVerifyData as aq, type PushVerifyData as ar, type WebAuthnVerifyData as as, type VerifyOptionsFactorDataOneOf as at, type LoginCallbackOptions as b, type RawHttpResponse as c, type SignOnOptions as d, type SignOnResponse as e, type LogoutOptions as f, PhoneTag as g, StateType as h, StatusName as i, Reason as j, FactorType as k, Status as l, FactorStatus as m, type Authentication as n, type RegisterV2Request as o, type LoginIdTypeOneOf as p, type V1CustomValue as q, type V1CustomValueValueOneOf as r, type V1ListValue as s, type V1MapValue as t, type SecondaryEmail as u, type Phone as v, type AddressWrapper as w, type Address as x, type CaptchaToken as y, type CaptchaTokenTokenOneOf as z };
1068
+ export { type Address, AddressTag, type AddressTagWithLiterals, type AddressWrapper, type Authentication, type AuthenticationExtensionInputs, type AuthenticationExtensionInputsLargeBlobOperationOneOf, type AuthenticatorConnection, type CallVerifyData, type CaptchaToken, type CaptchaTokenTokenOneOf, type ChangePasswordRequest, type ChangePasswordResponse, type Connection, type ConnectionTypeOneOf, type CustomField, type CustomValue, type CustomValueValueOneOf, type Email, EmailTag, type EmailTagWithLiterals, type ExternalEmailVerifyData, type Factor, FactorStatus, type FactorStatusWithLiterals, FactorType, type FactorTypeWithLiterals, type HeadersEntry, type Identity, type IdentityProfile, type IdpConnection, type ListValue, type LoginCallbackOptions, type LoginCallbackRequest, type LoginId, type LoginIdTypeOneOf, type LoginV2ApplicationErrors, type LoginV2Options, type LoginV2Request, type LoginV2ValidationErrors, type LoginWithIdpConnectionRequest, type LoginWithIdpConnectionTokenParamsRequest, type LogoutOptions, type LogoutRequest, type MapValue, type Metadata, type MfaChallengeData, MfaReason, type MfaReasonWithLiterals, type PathParametersEntry, type Phone, PhoneTag, type PhoneTagWithLiterals, PrivacyStatus, type PrivacyStatusWithLiterals, type PublicKeyCredentialDescriptor, type PushChallengeData, type PushVerifyData, type QueryParametersEntry, type RawHttpRequest, type RawHttpResponse, Reason, type ReasonWithLiterals, type RegisterV2ApplicationErrors, type RegisterV2Options, type RegisterV2Request, type RegisterV2ValidationErrors, type RequireMfaData, type SecondaryEmail, type SignOnOptions, type SignOnRequest, type SignOnResponse, type SmsVerifyData, type StateMachineResponse, type StateMachineResponseStateDataOneOf, StateType, type StateTypeWithLiterals, Status, StatusName, type StatusNameWithLiterals, type StatusV2, type StatusWithLiterals, TenantType, type TenantTypeWithLiterals, type TotpVerifyData, UserVerificationRequirement, type UserVerificationRequirementWithLiterals, type V1CustomValue, type V1CustomValueValueOneOf, type V1Factor, type V1ListValue, type V1MapValue, type VerificationChallenge, type VerificationChallengeFactorChallengeDataOneOf, type VerifyOptions, type VerifyOptionsFactorDataOneOf, type VerifyRequest, type VerifyRequestFactorDataOneOf, type WebAuthnChallengeData, type WebAuthnVerifyData, changePassword, loginCallback, loginV2, logout, registerV2, signOn, verify };