@supabase/auth-js 2.104.0-canary.0 → 2.104.0-canary.2
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/main/GoTrueAdminApi.d.ts +9 -1
- package/dist/main/GoTrueAdminApi.d.ts.map +1 -1
- package/dist/main/GoTrueAdminApi.js +9 -1
- package/dist/main/GoTrueAdminApi.js.map +1 -1
- package/dist/main/GoTrueClient.d.ts +10 -2
- package/dist/main/GoTrueClient.d.ts.map +1 -1
- package/dist/main/GoTrueClient.js +16 -3
- package/dist/main/GoTrueClient.js.map +1 -1
- package/dist/main/lib/errors.d.ts +17 -2
- package/dist/main/lib/errors.d.ts.map +1 -1
- package/dist/main/lib/errors.js +13 -12
- package/dist/main/lib/errors.js.map +1 -1
- package/dist/main/lib/fetch.d.ts.map +1 -1
- package/dist/main/lib/fetch.js +4 -1
- package/dist/main/lib/fetch.js.map +1 -1
- package/dist/main/lib/types.d.ts +21 -21
- package/dist/main/lib/types.d.ts.map +1 -1
- package/dist/main/lib/types.js.map +1 -1
- package/dist/main/lib/version.d.ts +1 -1
- package/dist/main/lib/version.js +1 -1
- package/dist/module/GoTrueAdminApi.d.ts +9 -1
- package/dist/module/GoTrueAdminApi.d.ts.map +1 -1
- package/dist/module/GoTrueAdminApi.js +9 -1
- package/dist/module/GoTrueAdminApi.js.map +1 -1
- package/dist/module/GoTrueClient.d.ts +10 -2
- package/dist/module/GoTrueClient.d.ts.map +1 -1
- package/dist/module/GoTrueClient.js +16 -3
- package/dist/module/GoTrueClient.js.map +1 -1
- package/dist/module/lib/errors.d.ts +17 -2
- package/dist/module/lib/errors.d.ts.map +1 -1
- package/dist/module/lib/errors.js +13 -12
- package/dist/module/lib/errors.js.map +1 -1
- package/dist/module/lib/fetch.d.ts.map +1 -1
- package/dist/module/lib/fetch.js +4 -1
- package/dist/module/lib/fetch.js.map +1 -1
- package/dist/module/lib/types.d.ts +21 -21
- package/dist/module/lib/types.d.ts.map +1 -1
- package/dist/module/lib/types.js.map +1 -1
- package/dist/module/lib/version.d.ts +1 -1
- package/dist/module/lib/version.js +1 -1
- package/dist/tsconfig.module.tsbuildinfo +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/GoTrueAdminApi.ts +9 -1
- package/src/GoTrueClient.ts +15 -3
- package/src/lib/errors.ts +43 -8
- package/src/lib/fetch.ts +4 -1
- package/src/lib/types.ts +28 -40
- package/src/lib/version.ts +1 -1
package/src/lib/types.ts
CHANGED
|
@@ -609,16 +609,14 @@ export type SignInAnonymouslyCredentials = {
|
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
611
|
|
|
612
|
-
export type SignUpWithPasswordCredentials =
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
channel?: 'sms' | 'whatsapp' // only for phone
|
|
619
|
-
}
|
|
612
|
+
export type SignUpWithPasswordCredentials = PasswordCredentialsBase & {
|
|
613
|
+
options?: {
|
|
614
|
+
emailRedirectTo?: string // only for email
|
|
615
|
+
data?: object
|
|
616
|
+
captchaToken?: string
|
|
617
|
+
channel?: 'sms' | 'whatsapp' // only for phone
|
|
620
618
|
}
|
|
621
|
-
|
|
619
|
+
}
|
|
622
620
|
|
|
623
621
|
type PasswordCredentialsBase =
|
|
624
622
|
| { email: string; password: string }
|
|
@@ -995,11 +993,11 @@ type MFAVerifyTOTPParamFields = {
|
|
|
995
993
|
code: string
|
|
996
994
|
}
|
|
997
995
|
|
|
998
|
-
export type MFAVerifyTOTPParams =
|
|
996
|
+
export type MFAVerifyTOTPParams = MFAVerifyParamsBase & MFAVerifyTOTPParamFields
|
|
999
997
|
|
|
1000
998
|
type MFAVerifyPhoneParamFields = MFAVerifyTOTPParamFields
|
|
1001
999
|
|
|
1002
|
-
export type MFAVerifyPhoneParams =
|
|
1000
|
+
export type MFAVerifyPhoneParams = MFAVerifyParamsBase & MFAVerifyPhoneParamFields
|
|
1003
1001
|
|
|
1004
1002
|
type MFAVerifyWebauthnParamFieldsBase = {
|
|
1005
1003
|
/** Relying party ID */
|
|
@@ -1032,7 +1030,7 @@ export type MFAVerifyWebauthnParamFields<T extends 'create' | 'request' = 'creat
|
|
|
1032
1030
|
* @see {@link https://w3c.github.io/webauthn/#sctn-verifying-assertion W3C WebAuthn Spec - Verifying an Authentication Assertion}
|
|
1033
1031
|
*/
|
|
1034
1032
|
export type MFAVerifyWebauthnParams<T extends 'create' | 'request' = 'create' | 'request'> =
|
|
1035
|
-
|
|
1033
|
+
MFAVerifyParamsBase & MFAVerifyWebauthnParamFields<T>
|
|
1036
1034
|
|
|
1037
1035
|
export type MFAVerifyParams = MFAVerifyTOTPParams | MFAVerifyPhoneParams | MFAVerifyWebauthnParams
|
|
1038
1036
|
|
|
@@ -1044,16 +1042,14 @@ type MFAChallengeParamsBase = {
|
|
|
1044
1042
|
const MFATOTPChannels = ['sms', 'whatsapp'] as const
|
|
1045
1043
|
export type MFATOTPChannel = (typeof MFATOTPChannels)[number]
|
|
1046
1044
|
|
|
1047
|
-
export type MFAChallengeTOTPParams =
|
|
1045
|
+
export type MFAChallengeTOTPParams = MFAChallengeParamsBase
|
|
1048
1046
|
|
|
1049
1047
|
type MFAChallengePhoneParamFields<Channel extends MFATOTPChannel = MFATOTPChannel> = {
|
|
1050
1048
|
/** Messaging channel to use (e.g. whatsapp or sms). Only relevant for phone factors */
|
|
1051
1049
|
channel: Channel
|
|
1052
1050
|
}
|
|
1053
1051
|
|
|
1054
|
-
export type MFAChallengePhoneParams =
|
|
1055
|
-
MFAChallengeParamsBase & MFAChallengePhoneParamFields
|
|
1056
|
-
>
|
|
1052
|
+
export type MFAChallengePhoneParams = MFAChallengeParamsBase & MFAChallengePhoneParamFields
|
|
1057
1053
|
|
|
1058
1054
|
/** WebAuthn parameters for WebAuthn factor challenge */
|
|
1059
1055
|
type MFAChallengeWebauthnParamFields = {
|
|
@@ -1070,9 +1066,7 @@ type MFAChallengeWebauthnParamFields = {
|
|
|
1070
1066
|
* Includes Relying Party information needed for WebAuthn ceremonies.
|
|
1071
1067
|
* @see {@link https://w3c.github.io/webauthn/#sctn-rp-operations W3C WebAuthn Spec - Relying Party Operations}
|
|
1072
1068
|
*/
|
|
1073
|
-
export type MFAChallengeWebauthnParams =
|
|
1074
|
-
MFAChallengeParamsBase & MFAChallengeWebauthnParamFields
|
|
1075
|
-
>
|
|
1069
|
+
export type MFAChallengeWebauthnParams = MFAChallengeParamsBase & MFAChallengeWebauthnParamFields
|
|
1076
1070
|
|
|
1077
1071
|
export type MFAChallengeParams =
|
|
1078
1072
|
| MFAChallengeTOTPParams
|
|
@@ -1083,9 +1077,8 @@ type MFAChallengeAndVerifyParamsBase = Omit<MFAVerifyParamsBase, 'challengeId'>
|
|
|
1083
1077
|
|
|
1084
1078
|
type MFAChallengeAndVerifyTOTPParamFields = MFAVerifyTOTPParamFields
|
|
1085
1079
|
|
|
1086
|
-
type MFAChallengeAndVerifyTOTPParams =
|
|
1087
|
-
|
|
1088
|
-
>
|
|
1080
|
+
type MFAChallengeAndVerifyTOTPParams = MFAChallengeAndVerifyParamsBase &
|
|
1081
|
+
MFAChallengeAndVerifyTOTPParamFields
|
|
1089
1082
|
|
|
1090
1083
|
export type MFAChallengeAndVerifyParams = MFAChallengeAndVerifyTOTPParams
|
|
1091
1084
|
|
|
@@ -1142,7 +1135,7 @@ type AuthMFAChallengeTOTPResponseFields = {
|
|
|
1142
1135
|
}
|
|
1143
1136
|
|
|
1144
1137
|
export type AuthMFAChallengeTOTPResponse = RequestResult<
|
|
1145
|
-
|
|
1138
|
+
AuthMFAChallengeResponseBase<'totp'> & AuthMFAChallengeTOTPResponseFields
|
|
1146
1139
|
>
|
|
1147
1140
|
|
|
1148
1141
|
type AuthMFAChallengePhoneResponseFields = {
|
|
@@ -1150,7 +1143,7 @@ type AuthMFAChallengePhoneResponseFields = {
|
|
|
1150
1143
|
}
|
|
1151
1144
|
|
|
1152
1145
|
export type AuthMFAChallengePhoneResponse = RequestResult<
|
|
1153
|
-
|
|
1146
|
+
AuthMFAChallengeResponseBase<'phone'> & AuthMFAChallengePhoneResponseFields
|
|
1154
1147
|
>
|
|
1155
1148
|
|
|
1156
1149
|
type AuthMFAChallengeWebauthnResponseFields = {
|
|
@@ -1171,7 +1164,7 @@ type AuthMFAChallengeWebauthnResponseFields = {
|
|
|
1171
1164
|
* @see {@link https://w3c.github.io/webauthn/#sctn-credential-creation W3C WebAuthn Spec - Credential Creation}
|
|
1172
1165
|
*/
|
|
1173
1166
|
export type AuthMFAChallengeWebauthnResponse = RequestResult<
|
|
1174
|
-
|
|
1167
|
+
AuthMFAChallengeResponseBase<'webauthn'> & AuthMFAChallengeWebauthnResponseFields
|
|
1175
1168
|
>
|
|
1176
1169
|
|
|
1177
1170
|
type AuthMFAChallengeWebauthnResponseFieldsJSON = {
|
|
@@ -1190,9 +1183,8 @@ type AuthMFAChallengeWebauthnResponseFieldsJSON = {
|
|
|
1190
1183
|
* JSON-serializable version of WebAuthn challenge response.
|
|
1191
1184
|
* Used for server communication with base64url-encoded binary fields.
|
|
1192
1185
|
*/
|
|
1193
|
-
export type AuthMFAChallengeWebauthnResponseDataJSON =
|
|
1194
|
-
|
|
1195
|
-
>
|
|
1186
|
+
export type AuthMFAChallengeWebauthnResponseDataJSON = AuthMFAChallengeResponseBase<'webauthn'> &
|
|
1187
|
+
AuthMFAChallengeWebauthnResponseFieldsJSON
|
|
1196
1188
|
|
|
1197
1189
|
/**
|
|
1198
1190
|
* Server response type for WebAuthn MFA challenge.
|
|
@@ -1211,11 +1203,11 @@ export type AuthMFAListFactorsResponse<T extends typeof FactorTypes = typeof Fac
|
|
|
1211
1203
|
RequestResult<
|
|
1212
1204
|
{
|
|
1213
1205
|
/** All available factors (verified and unverified). */
|
|
1214
|
-
all:
|
|
1206
|
+
all: Factor[]
|
|
1215
1207
|
|
|
1216
1208
|
// Dynamically create a property for each factor type with only verified factors
|
|
1217
1209
|
} & {
|
|
1218
|
-
[K in T[number]]:
|
|
1210
|
+
[K in T[number]]: Factor<K, 'verified'>[]
|
|
1219
1211
|
}
|
|
1220
1212
|
>
|
|
1221
1213
|
|
|
@@ -1837,15 +1829,13 @@ type MFAEnrollTOTPParamFields = {
|
|
|
1837
1829
|
issuer?: string
|
|
1838
1830
|
}
|
|
1839
1831
|
|
|
1840
|
-
export type MFAEnrollTOTPParams =
|
|
1832
|
+
export type MFAEnrollTOTPParams = MFAEnrollParamsBase<'totp'> & MFAEnrollTOTPParamFields
|
|
1841
1833
|
|
|
1842
1834
|
type MFAEnrollPhoneParamFields = {
|
|
1843
1835
|
/** Phone number associated with a factor. Number should conform to E.164 format */
|
|
1844
1836
|
phone: string
|
|
1845
1837
|
}
|
|
1846
|
-
export type MFAEnrollPhoneParams =
|
|
1847
|
-
MFAEnrollParamsBase<'phone'> & MFAEnrollPhoneParamFields
|
|
1848
|
-
>
|
|
1838
|
+
export type MFAEnrollPhoneParams = MFAEnrollParamsBase<'phone'> & MFAEnrollPhoneParamFields
|
|
1849
1839
|
|
|
1850
1840
|
type MFAEnrollWebauthnFields = {
|
|
1851
1841
|
/** no extra fields for now, kept for consistency and for possible future changes */
|
|
@@ -1856,9 +1846,7 @@ type MFAEnrollWebauthnFields = {
|
|
|
1856
1846
|
* Creates an unverified WebAuthn factor that must be verified with a credential.
|
|
1857
1847
|
* @see {@link https://w3c.github.io/webauthn/#sctn-registering-a-new-credential W3C WebAuthn Spec - Registering a New Credential}
|
|
1858
1848
|
*/
|
|
1859
|
-
export type MFAEnrollWebauthnParams =
|
|
1860
|
-
MFAEnrollParamsBase<'webauthn'> & MFAEnrollWebauthnFields
|
|
1861
|
-
>
|
|
1849
|
+
export type MFAEnrollWebauthnParams = MFAEnrollParamsBase<'webauthn'> & MFAEnrollWebauthnFields
|
|
1862
1850
|
|
|
1863
1851
|
type AuthMFAEnrollResponseBase<T extends FactorType> = {
|
|
1864
1852
|
/** ID of the factor that was just enrolled (in an unverified state). */
|
|
@@ -1891,7 +1879,7 @@ type AuthMFAEnrollTOTPResponseFields = {
|
|
|
1891
1879
|
}
|
|
1892
1880
|
|
|
1893
1881
|
export type AuthMFAEnrollTOTPResponse = RequestResult<
|
|
1894
|
-
|
|
1882
|
+
AuthMFAEnrollResponseBase<'totp'> & AuthMFAEnrollTOTPResponseFields
|
|
1895
1883
|
>
|
|
1896
1884
|
|
|
1897
1885
|
type AuthMFAEnrollPhoneResponseFields = {
|
|
@@ -1900,7 +1888,7 @@ type AuthMFAEnrollPhoneResponseFields = {
|
|
|
1900
1888
|
}
|
|
1901
1889
|
|
|
1902
1890
|
export type AuthMFAEnrollPhoneResponse = RequestResult<
|
|
1903
|
-
|
|
1891
|
+
AuthMFAEnrollResponseBase<'phone'> & AuthMFAEnrollPhoneResponseFields
|
|
1904
1892
|
>
|
|
1905
1893
|
|
|
1906
1894
|
type AuthMFAEnrollWebauthnFields = {
|
|
@@ -1913,7 +1901,7 @@ type AuthMFAEnrollWebauthnFields = {
|
|
|
1913
1901
|
* @see {@link https://w3c.github.io/webauthn/#sctn-registering-a-new-credential W3C WebAuthn Spec - Registering a New Credential}
|
|
1914
1902
|
*/
|
|
1915
1903
|
export type AuthMFAEnrollWebauthnResponse = RequestResult<
|
|
1916
|
-
|
|
1904
|
+
AuthMFAEnrollResponseBase<'webauthn'> & AuthMFAEnrollWebauthnFields
|
|
1917
1905
|
>
|
|
1918
1906
|
|
|
1919
1907
|
export type JwtHeader = {
|
package/src/lib/version.ts
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
// - Debugging and support (identifying which version is running)
|
|
5
5
|
// - Telemetry and logging (version reporting in errors/analytics)
|
|
6
6
|
// - Ensuring build artifacts match the published package version
|
|
7
|
-
export const version = '2.104.0-canary.
|
|
7
|
+
export const version = '2.104.0-canary.2'
|