@wix/auto_sdk_identity_authentication 1.0.68 → 1.0.70

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.
@@ -2,6 +2,77 @@ import { NonNullablePaths } from '@wix/sdk-types';
2
2
 
3
3
  interface Authentication {
4
4
  }
5
+ /**
6
+ * Published for a passed check as well as a rejected one, so a consumer can tell a rejection rate
7
+ * from a rejection count.
8
+ *
9
+ * The caller's IP, geo and user agent are deliberately not fields: they travel as call-scope aspects
10
+ * in the message headers, which only reach a single-record subscription - a batch handler runs on an
11
+ * orphan CallScope and loses them.
12
+ */
13
+ interface CaptchaVerification {
14
+ /** @format GUID */
15
+ eventId?: string;
16
+ /** When the check happened, not when this was published. */
17
+ eventTime?: Date | null;
18
+ flow?: CaptchaFlowWithLiterals;
19
+ identityType?: CaptchaIdentityTypeWithLiterals;
20
+ outcome?: CaptchaOutcomeWithLiterals;
21
+ captchaKind?: CaptchaKindWithLiterals;
22
+ /**
23
+ * How far the assessment landed from the minimum it was judged against, positive for a pass. A
24
+ * margin rather than a raw score because that minimum differs by surface and OS, so raw scores are
25
+ * not comparable across channels.
26
+ *
27
+ * Absent when no score decided the outcome - an inauthentic token, no token at all, or a
28
+ * PerimeterX escalation where reCAPTCHA itself passed.
29
+ * @min -1
30
+ * @max 1
31
+ */
32
+ minScoreMargin?: number | null;
33
+ /**
34
+ * Google's reasons for the score: AUTOMATION, UNEXPECTED_ENVIRONMENT, TOO_MUCH_TRAFFIC, ...
35
+ * @maxLength 100
36
+ * @maxSize 100
37
+ */
38
+ reasons?: string[];
39
+ }
40
+ declare enum CaptchaFlow {
41
+ REGISTER = "REGISTER",
42
+ /** Not published yet. */
43
+ LOGIN = "LOGIN"
44
+ }
45
+ /** @enumType */
46
+ type CaptchaFlowWithLiterals = CaptchaFlow | 'REGISTER' | 'LOGIN';
47
+ declare enum CaptchaIdentityType {
48
+ USER = "USER",
49
+ /** Not published yet. */
50
+ MEMBER = "MEMBER"
51
+ }
52
+ /** @enumType */
53
+ type CaptchaIdentityTypeWithLiterals = CaptchaIdentityType | 'USER' | 'MEMBER';
54
+ declare enum CaptchaOutcome {
55
+ PASSED = "PASSED",
56
+ LOW_SCORE = "LOW_SCORE",
57
+ /** Rejected as inauthentic, which is independent of the score. */
58
+ INVALID_TOKEN = "INVALID_TOKEN",
59
+ MISSING_TOKEN = "MISSING_TOKEN",
60
+ /**
61
+ * Escalated to a visible challenge. PerimeterX can cause this while reCAPTCHA itself passed, so it
62
+ * does not on its own mean the captcha scored badly - `reasons` distinguishes them.
63
+ */
64
+ VISIBLE_REQUIRED = "VISIBLE_REQUIRED"
65
+ }
66
+ /** @enumType */
67
+ type CaptchaOutcomeWithLiterals = CaptchaOutcome | 'PASSED' | 'LOW_SCORE' | 'INVALID_TOKEN' | 'MISSING_TOKEN' | 'VISIBLE_REQUIRED';
68
+ declare enum CaptchaKind {
69
+ INVISIBLE = "INVISIBLE",
70
+ VISIBLE = "VISIBLE",
71
+ /** Verified against a site key the client registered itself (branded and headless apps). */
72
+ CLIENT_SITE_KEY = "CLIENT_SITE_KEY"
73
+ }
74
+ /** @enumType */
75
+ type CaptchaKindWithLiterals = CaptchaKind | 'INVISIBLE' | 'VISIBLE' | 'CLIENT_SITE_KEY';
5
76
  interface RegisterV2Request {
6
77
  /** Identifier of the registering member. */
7
78
  loginId: LoginId;
@@ -905,8 +976,6 @@ interface VerifyRequest extends VerifyRequestFactorDataOneOf {
905
976
  webauthnData?: WebAuthnVerifyData;
906
977
  /** RecoveryCode response from a one-time code. */
907
978
  recoveryCodeData?: RecoveryCodeVerifyData;
908
- /** Password for first factor verification. */
909
- passwordData?: PasswordVerifyData;
910
979
  /**
911
980
  * State token from the initial authentication response.
912
981
  *
@@ -944,8 +1013,6 @@ interface VerifyRequestFactorDataOneOf {
944
1013
  webauthnData?: WebAuthnVerifyData;
945
1014
  /** RecoveryCode response from a one-time code. */
946
1015
  recoveryCodeData?: RecoveryCodeVerifyData;
947
- /** Password for first factor verification. */
948
- passwordData?: PasswordVerifyData;
949
1016
  }
950
1017
  interface SmsVerifyData {
951
1018
  /**
@@ -999,13 +1066,6 @@ interface RecoveryCodeVerifyData {
999
1066
  */
1000
1067
  code?: string | null;
1001
1068
  }
1002
- interface PasswordVerifyData {
1003
- /**
1004
- * @minLength 1
1005
- * @maxLength 100
1006
- */
1007
- password?: string;
1008
- }
1009
1069
  interface GetWebauthnChallengeRequest {
1010
1070
  /**
1011
1071
  * Identifier of the member requesting the WebAuthn challenge.
@@ -1018,6 +1078,97 @@ interface GetWebauthnChallengeResponse {
1018
1078
  /** The challenge that will be used for a WebAuthn authentication ceremony. */
1019
1079
  webauthn?: WebAuthnChallengeData;
1020
1080
  }
1081
+ interface MessageEnvelope {
1082
+ /**
1083
+ * App instance ID.
1084
+ * @format GUID
1085
+ */
1086
+ instanceId?: string | null;
1087
+ /**
1088
+ * Event type.
1089
+ * @maxLength 150
1090
+ */
1091
+ eventType?: string;
1092
+ /** The identification type and identity data. */
1093
+ identity?: IdentificationData;
1094
+ /** Stringify payload. */
1095
+ data?: string;
1096
+ /** Details related to the account */
1097
+ accountInfo?: AccountInfo;
1098
+ }
1099
+ interface IdentificationData extends IdentificationDataIdOneOf {
1100
+ /**
1101
+ * ID of a site visitor that has not logged in to the site.
1102
+ * @format GUID
1103
+ */
1104
+ anonymousVisitorId?: string;
1105
+ /**
1106
+ * ID of a site visitor that has logged in to the site.
1107
+ * @format GUID
1108
+ */
1109
+ memberId?: string;
1110
+ /**
1111
+ * ID of a Wix user (site owner, contributor, etc.).
1112
+ * @format GUID
1113
+ */
1114
+ wixUserId?: string;
1115
+ /**
1116
+ * ID of an app.
1117
+ * @format GUID
1118
+ */
1119
+ appId?: string;
1120
+ /** @readonly */
1121
+ identityType?: WebhookIdentityTypeWithLiterals;
1122
+ }
1123
+ /** @oneof */
1124
+ interface IdentificationDataIdOneOf {
1125
+ /**
1126
+ * ID of a site visitor that has not logged in to the site.
1127
+ * @format GUID
1128
+ */
1129
+ anonymousVisitorId?: string;
1130
+ /**
1131
+ * ID of a site visitor that has logged in to the site.
1132
+ * @format GUID
1133
+ */
1134
+ memberId?: string;
1135
+ /**
1136
+ * ID of a Wix user (site owner, contributor, etc.).
1137
+ * @format GUID
1138
+ */
1139
+ wixUserId?: string;
1140
+ /**
1141
+ * ID of an app.
1142
+ * @format GUID
1143
+ */
1144
+ appId?: string;
1145
+ }
1146
+ declare enum WebhookIdentityType {
1147
+ UNKNOWN = "UNKNOWN",
1148
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1149
+ MEMBER = "MEMBER",
1150
+ WIX_USER = "WIX_USER",
1151
+ APP = "APP"
1152
+ }
1153
+ /** @enumType */
1154
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
1155
+ interface AccountInfo {
1156
+ /**
1157
+ * ID of the Wix account associated with the event.
1158
+ * @format GUID
1159
+ */
1160
+ accountId?: string | null;
1161
+ /**
1162
+ * ID of the parent Wix account. Only included when accountId belongs to a child account.
1163
+ * @format GUID
1164
+ */
1165
+ parentAccountId?: string | null;
1166
+ /**
1167
+ * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
1168
+ * @format GUID
1169
+ */
1170
+ siteId?: string | null;
1171
+ }
1021
1172
  /** @docsIgnore */
1022
1173
  type RegisterV2ApplicationErrors = {
1023
1174
  code?: 'UNIMPLEMENTED_FEATURE';
@@ -1298,4 +1449,4 @@ interface LogoutOptions {
1298
1449
  clientId?: string | null;
1299
1450
  }
1300
1451
 
1301
- export { type Address, AddressTag, type AddressTagWithLiterals, type AddressWrapper, type Authentication, type AuthenticatorConnection, type CallVerifyData, type CaptchaToken, type CaptchaTokenTokenOneOf, type ChangePasswordRequest, type ChangePasswordResponse, type ConnectIdpRequest, type Connection, type ConnectionTypeOneOf, type CustomField, type CustomValue, type CustomValueValueOneOf, DeliveryMethod, type DeliveryMethodWithLiterals, type Email, EmailTag, type EmailTagWithLiterals, type EmailValidationFailure, type ExternalEmailVerifyData, type Factor, FactorStatus, type FactorStatusWithLiterals, FactorType, type FactorTypeWithLiterals, type GetWebauthnChallengeRequest, type GetWebauthnChallengeResponse, type HeadersEntry, type Identity, type IdentityProfile, type IdpConnection, type ListValue, type LoginCallbackRequest, type LoginId, type LoginIdTypeOneOf, type LoginV2ApplicationErrors, type LoginV2Options, type LoginV2Request, type LoginV2ValidationErrors, type LoginWithIdpConnectionRedirectRequest, type LoginWithIdpConnectionRequest, type LoginWithIdpConnectionTokenParamsRequest, type LogoutOptions, type LogoutRequest, type MapValue, type Metadata, type MfaChallengeData, MfaReason, type MfaReasonWithLiterals, type PasswordVerifyData, type PathParametersEntry, type Phone, PhoneTag, type PhoneTagWithLiterals, PrivacyStatus, type PrivacyStatusWithLiterals, type PushChallengeData, type PushVerifyData, type QueryParametersEntry, type RawHttpRequest, type RawHttpResponse, Reason, type ReasonWithLiterals, type RecaptchaForClientSiteKey, type RecoveryCodeVerifyData, 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, type V1CustomValue, type V1CustomValueValueOneOf, type V1Factor, type V1ListValue, type V1MapValue, V1Reason, type V1ReasonWithLiterals, type ValidateEmailRequest, type ValidateEmailResponse, type VerificationChallenge, type VerificationChallengeFactorChallengeDataOneOf, type VerifyRequest, type VerifyRequestFactorDataOneOf, type WebAuthnChallengeData, type WebAuthnVerifyData, changePassword, loginV2, logout, registerV2, signOn, validateEmail };
1452
+ export { type AccountInfo, type Address, AddressTag, type AddressTagWithLiterals, type AddressWrapper, type Authentication, type AuthenticatorConnection, type CallVerifyData, CaptchaFlow, type CaptchaFlowWithLiterals, CaptchaIdentityType, type CaptchaIdentityTypeWithLiterals, CaptchaKind, type CaptchaKindWithLiterals, CaptchaOutcome, type CaptchaOutcomeWithLiterals, type CaptchaToken, type CaptchaTokenTokenOneOf, type CaptchaVerification, type ChangePasswordRequest, type ChangePasswordResponse, type ConnectIdpRequest, type Connection, type ConnectionTypeOneOf, type CustomField, type CustomValue, type CustomValueValueOneOf, DeliveryMethod, type DeliveryMethodWithLiterals, type Email, EmailTag, type EmailTagWithLiterals, type EmailValidationFailure, type ExternalEmailVerifyData, type Factor, FactorStatus, type FactorStatusWithLiterals, FactorType, type FactorTypeWithLiterals, type GetWebauthnChallengeRequest, type GetWebauthnChallengeResponse, type HeadersEntry, type IdentificationData, type IdentificationDataIdOneOf, type Identity, type IdentityProfile, type IdpConnection, type ListValue, type LoginCallbackRequest, type LoginId, type LoginIdTypeOneOf, type LoginV2ApplicationErrors, type LoginV2Options, type LoginV2Request, type LoginV2ValidationErrors, type LoginWithIdpConnectionRedirectRequest, type LoginWithIdpConnectionRequest, type LoginWithIdpConnectionTokenParamsRequest, type LogoutOptions, type LogoutRequest, type MapValue, type MessageEnvelope, type Metadata, type MfaChallengeData, MfaReason, type MfaReasonWithLiterals, type PathParametersEntry, type Phone, PhoneTag, type PhoneTagWithLiterals, PrivacyStatus, type PrivacyStatusWithLiterals, type PushChallengeData, type PushVerifyData, type QueryParametersEntry, type RawHttpRequest, type RawHttpResponse, Reason, type ReasonWithLiterals, type RecaptchaForClientSiteKey, type RecoveryCodeVerifyData, 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, type V1CustomValue, type V1CustomValueValueOneOf, type V1Factor, type V1ListValue, type V1MapValue, V1Reason, type V1ReasonWithLiterals, type ValidateEmailRequest, type ValidateEmailResponse, type VerificationChallenge, type VerificationChallengeFactorChallengeDataOneOf, type VerifyRequest, type VerifyRequestFactorDataOneOf, type WebAuthnChallengeData, type WebAuthnVerifyData, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, changePassword, loginV2, logout, registerV2, signOn, validateEmail };
@@ -21,6 +21,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var index_typings_exports = {};
22
22
  __export(index_typings_exports, {
23
23
  AddressTag: () => AddressTag,
24
+ CaptchaFlow: () => CaptchaFlow,
25
+ CaptchaIdentityType: () => CaptchaIdentityType,
26
+ CaptchaKind: () => CaptchaKind,
27
+ CaptchaOutcome: () => CaptchaOutcome,
24
28
  DeliveryMethod: () => DeliveryMethod,
25
29
  EmailTag: () => EmailTag,
26
30
  FactorStatus: () => FactorStatus,
@@ -34,6 +38,7 @@ __export(index_typings_exports, {
34
38
  StatusName: () => StatusName,
35
39
  TenantType: () => TenantType,
36
40
  V1Reason: () => V1Reason,
41
+ WebhookIdentityType: () => WebhookIdentityType,
37
42
  changePassword: () => changePassword2,
38
43
  loginV2: () => loginV22,
39
44
  logout: () => logout2,
@@ -382,6 +387,30 @@ var TRANSFORM_PATHS_02 = [{ path: "profile.addresses.address" }];
382
387
  var TRANSFORM_PATHS_12 = [
383
388
  { path: "identity.identityProfile.addresses.address" }
384
389
  ];
390
+ var CaptchaFlow = /* @__PURE__ */ ((CaptchaFlow2) => {
391
+ CaptchaFlow2["REGISTER"] = "REGISTER";
392
+ CaptchaFlow2["LOGIN"] = "LOGIN";
393
+ return CaptchaFlow2;
394
+ })(CaptchaFlow || {});
395
+ var CaptchaIdentityType = /* @__PURE__ */ ((CaptchaIdentityType2) => {
396
+ CaptchaIdentityType2["USER"] = "USER";
397
+ CaptchaIdentityType2["MEMBER"] = "MEMBER";
398
+ return CaptchaIdentityType2;
399
+ })(CaptchaIdentityType || {});
400
+ var CaptchaOutcome = /* @__PURE__ */ ((CaptchaOutcome2) => {
401
+ CaptchaOutcome2["PASSED"] = "PASSED";
402
+ CaptchaOutcome2["LOW_SCORE"] = "LOW_SCORE";
403
+ CaptchaOutcome2["INVALID_TOKEN"] = "INVALID_TOKEN";
404
+ CaptchaOutcome2["MISSING_TOKEN"] = "MISSING_TOKEN";
405
+ CaptchaOutcome2["VISIBLE_REQUIRED"] = "VISIBLE_REQUIRED";
406
+ return CaptchaOutcome2;
407
+ })(CaptchaOutcome || {});
408
+ var CaptchaKind = /* @__PURE__ */ ((CaptchaKind2) => {
409
+ CaptchaKind2["INVISIBLE"] = "INVISIBLE";
410
+ CaptchaKind2["VISIBLE"] = "VISIBLE";
411
+ CaptchaKind2["CLIENT_SITE_KEY"] = "CLIENT_SITE_KEY";
412
+ return CaptchaKind2;
413
+ })(CaptchaKind || {});
385
414
  var PrivacyStatus = /* @__PURE__ */ ((PrivacyStatus2) => {
386
415
  PrivacyStatus2["UNDEFINED"] = "UNDEFINED";
387
416
  PrivacyStatus2["PUBLIC"] = "PUBLIC";
@@ -492,6 +521,14 @@ var DeliveryMethod = /* @__PURE__ */ ((DeliveryMethod2) => {
492
521
  DeliveryMethod2["WHATSAPP"] = "WHATSAPP";
493
522
  return DeliveryMethod2;
494
523
  })(DeliveryMethod || {});
524
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
525
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
526
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
527
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
528
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
529
+ WebhookIdentityType2["APP"] = "APP";
530
+ return WebhookIdentityType2;
531
+ })(WebhookIdentityType || {});
495
532
  async function registerV22(loginId, options) {
496
533
  const { httpClient, sideEffects } = arguments[2];
497
534
  const payload = (0, import_transform_paths2.transformPaths)(
@@ -715,6 +752,10 @@ async function logout2(options) {
715
752
  // Annotate the CommonJS export names for ESM import in node:
716
753
  0 && (module.exports = {
717
754
  AddressTag,
755
+ CaptchaFlow,
756
+ CaptchaIdentityType,
757
+ CaptchaKind,
758
+ CaptchaOutcome,
718
759
  DeliveryMethod,
719
760
  EmailTag,
720
761
  FactorStatus,
@@ -728,6 +769,7 @@ async function logout2(options) {
728
769
  StatusName,
729
770
  TenantType,
730
771
  V1Reason,
772
+ WebhookIdentityType,
731
773
  changePassword,
732
774
  loginV2,
733
775
  logout,