@firebase/auth 1.3.0 → 1.3.1-canary.6e4e475f6
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/auth-public.d.ts +25 -4
- package/dist/auth.d.ts +25 -4
- package/dist/browser-cjs/{index-68b50c51.js → index-e3e2566b.js} +133 -127
- package/dist/browser-cjs/index-e3e2566b.js.map +1 -0
- package/dist/browser-cjs/index.js +1 -1
- package/dist/browser-cjs/index.rn.d.ts +1 -0
- package/dist/browser-cjs/internal.js +1 -1
- package/dist/browser-cjs/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/browser-cjs/src/api/index.d.ts +10 -0
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/browser-cjs/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/dist/cordova/index.js +2 -2
- package/dist/cordova/index.rn.d.ts +1 -0
- package/dist/cordova/internal.js +2 -2
- package/dist/cordova/{popup_redirect-0a78e29a.js → popup_redirect-9973210d.js} +183 -214
- package/dist/cordova/popup_redirect-9973210d.js.map +1 -0
- package/dist/cordova/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/cordova/src/api/index.d.ts +10 -0
- package/dist/cordova/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/cordova/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/dist/esm2017/{index-9a76d29a.js → index-aaffd0fc.js} +133 -127
- package/dist/esm2017/index-aaffd0fc.js.map +1 -0
- package/dist/esm2017/index.js +1 -1
- package/dist/esm2017/index.rn.d.ts +1 -0
- package/dist/esm2017/internal.js +2 -2
- package/dist/esm2017/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/esm2017/src/api/index.d.ts +10 -0
- package/dist/esm2017/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/esm2017/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/dist/esm5/{index-3f0ee8ce.js → index-044bfa44.js} +183 -214
- package/dist/esm5/index-044bfa44.js.map +1 -0
- package/dist/esm5/index.js +1 -1
- package/dist/esm5/index.rn.d.ts +1 -0
- package/dist/esm5/internal.js +2 -2
- package/dist/esm5/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/esm5/src/api/index.d.ts +10 -0
- package/dist/esm5/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/esm5/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/dist/index.rn.d.ts +1 -0
- package/dist/index.webworker.esm5.js +141 -172
- package/dist/index.webworker.esm5.js.map +1 -1
- package/dist/node/index.js +1 -1
- package/dist/node/index.rn.d.ts +1 -0
- package/dist/node/internal.js +1 -1
- package/dist/node/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/node/src/api/index.d.ts +10 -0
- package/dist/node/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/node/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/dist/node/{totp-cceb0d01.js → totp-c47e7a9e.js} +179 -210
- package/dist/node/totp-c47e7a9e.js.map +1 -0
- package/dist/node-esm/index.js +1 -1
- package/dist/node-esm/index.rn.d.ts +1 -0
- package/dist/node-esm/internal.js +2 -2
- package/dist/node-esm/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/node-esm/src/api/index.d.ts +10 -0
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/node-esm/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/dist/node-esm/{totp-64a935f2.js → totp-898d4014.js} +129 -123
- package/dist/node-esm/totp-898d4014.js.map +1 -0
- package/dist/rn/{index-1dd41d18.js → index-9dc6fdd2.js} +359 -218
- package/dist/rn/index-9dc6fdd2.js.map +1 -0
- package/dist/rn/index.js +3 -1
- package/dist/rn/index.js.map +1 -1
- package/dist/rn/index.rn.d.ts +1 -0
- package/dist/rn/internal.js +3 -177
- package/dist/rn/internal.js.map +1 -1
- package/dist/rn/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/rn/src/api/index.d.ts +10 -0
- package/dist/rn/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/rn/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/dist/src/api/authentication/recaptcha.d.ts +2 -2
- package/dist/src/api/index.d.ts +10 -0
- package/dist/src/platform_browser/recaptcha/recaptcha.d.ts +18 -3
- package/dist/src/platform_browser/recaptcha/recaptcha_enterprise_verifier.d.ts +3 -0
- package/package.json +12 -12
- package/dist/browser-cjs/index-68b50c51.js.map +0 -1
- package/dist/cordova/popup_redirect-0a78e29a.js.map +0 -1
- package/dist/esm2017/index-9a76d29a.js.map +0 -1
- package/dist/esm5/index-3f0ee8ce.js.map +0 -1
- package/dist/node/totp-cceb0d01.js.map +0 -1
- package/dist/node-esm/totp-64a935f2.js.map +0 -1
- package/dist/rn/index-1dd41d18.js.map +0 -1
|
@@ -22,13 +22,13 @@ interface GetRecaptchaConfigRequest {
|
|
|
22
22
|
clientType?: RecaptchaClientType;
|
|
23
23
|
version?: RecaptchaVersion;
|
|
24
24
|
}
|
|
25
|
-
interface
|
|
25
|
+
export interface RecaptchaEnforcementProviderState {
|
|
26
26
|
provider: string;
|
|
27
27
|
enforcementState: string;
|
|
28
28
|
}
|
|
29
29
|
export interface GetRecaptchaConfigResponse {
|
|
30
30
|
recaptchaKey: string;
|
|
31
|
-
recaptchaEnforcementState:
|
|
31
|
+
recaptchaEnforcementState: RecaptchaEnforcementProviderState[];
|
|
32
32
|
}
|
|
33
33
|
export declare function getRecaptchaConfig(auth: Auth, request: GetRecaptchaConfigRequest): Promise<GetRecaptchaConfigResponse>;
|
|
34
34
|
export {};
|
|
@@ -69,6 +69,15 @@ export declare const enum RecaptchaActionName {
|
|
|
69
69
|
GET_OOB_CODE = "getOobCode",
|
|
70
70
|
SIGN_UP_PASSWORD = "signUpPassword"
|
|
71
71
|
}
|
|
72
|
+
export declare const enum EnforcementState {
|
|
73
|
+
ENFORCE = "ENFORCE",
|
|
74
|
+
AUDIT = "AUDIT",
|
|
75
|
+
OFF = "OFF",
|
|
76
|
+
ENFORCEMENT_STATE_UNSPECIFIED = "ENFORCEMENT_STATE_UNSPECIFIED"
|
|
77
|
+
}
|
|
78
|
+
export declare const enum RecaptchaProvider {
|
|
79
|
+
EMAIL_PASSWORD_PROVIDER = "EMAIL_PASSWORD_PROVIDER"
|
|
80
|
+
}
|
|
72
81
|
export declare const DEFAULT_API_TIMEOUT_MS: Delay;
|
|
73
82
|
export declare function _addTidIfNecessary<T extends {
|
|
74
83
|
tenantId?: string;
|
|
@@ -77,6 +86,7 @@ export declare function _performApiRequest<T, V>(auth: Auth, method: HttpMethod,
|
|
|
77
86
|
export declare function _performFetchWithErrorHandling<V>(auth: Auth, customErrorMap: Partial<ServerErrorMap<ServerError>>, fetchFn: () => Promise<Response>): Promise<V>;
|
|
78
87
|
export declare function _performSignInRequest<T, V extends IdTokenResponse>(auth: Auth, method: HttpMethod, path: Endpoint, request?: T, customErrorMap?: Partial<ServerErrorMap<ServerError>>): Promise<V>;
|
|
79
88
|
export declare function _getFinalTarget(auth: Auth, host: string, path: string, query: string): string;
|
|
89
|
+
export declare function _parseEnforcementState(enforcementStateStr: string): EnforcementState;
|
|
80
90
|
interface PotentialResponse extends IdTokenResponse {
|
|
81
91
|
email?: string;
|
|
82
92
|
phoneNumber?: string;
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { RecaptchaParameters } from '../../model/public_types';
|
|
18
|
-
import { GetRecaptchaConfigResponse } from '../../api/authentication/recaptcha';
|
|
18
|
+
import { GetRecaptchaConfigResponse, RecaptchaEnforcementProviderState } from '../../api/authentication/recaptcha';
|
|
19
|
+
import { EnforcementState } from '../../api/index';
|
|
19
20
|
export interface Recaptcha {
|
|
20
21
|
render: (container: HTMLElement, parameters: RecaptchaParameters) => number;
|
|
21
22
|
getResponse: (id: number) => string;
|
|
@@ -49,8 +50,22 @@ export declare class RecaptchaConfig {
|
|
|
49
50
|
*/
|
|
50
51
|
siteKey: string;
|
|
51
52
|
/**
|
|
52
|
-
* The
|
|
53
|
+
* The list of providers and their enablement status for reCAPTCHA Enterprise.
|
|
53
54
|
*/
|
|
54
|
-
|
|
55
|
+
recaptchaEnforcementState: RecaptchaEnforcementProviderState[];
|
|
55
56
|
constructor(response: GetRecaptchaConfigResponse);
|
|
57
|
+
/**
|
|
58
|
+
* Returns the reCAPTCHA Enterprise enforcement state for the given provider.
|
|
59
|
+
*
|
|
60
|
+
* @param providerStr - The provider whose enforcement state is to be returned.
|
|
61
|
+
* @returns The reCAPTCHA Enterprise enforcement state for the given provider.
|
|
62
|
+
*/
|
|
63
|
+
getProviderEnforcementState(providerStr: string): EnforcementState | null;
|
|
64
|
+
/**
|
|
65
|
+
* Returns true if the reCAPTCHA Enterprise enforcement state for the provider is set to ENFORCE or AUDIT.
|
|
66
|
+
*
|
|
67
|
+
* @param providerStr - The provider whose enablement state is to be returned.
|
|
68
|
+
* @returns Whether or not reCAPTCHA Enterprise protection is enabled for the given provider.
|
|
69
|
+
*/
|
|
70
|
+
isProviderEnabled(providerStr: string): boolean;
|
|
56
71
|
}
|
|
@@ -39,4 +39,7 @@ export declare class RecaptchaEnterpriseVerifier {
|
|
|
39
39
|
verify(action?: string, forceRefresh?: boolean): Promise<string>;
|
|
40
40
|
}
|
|
41
41
|
export declare function injectRecaptchaFields<T>(auth: AuthInternal, request: T, action: RecaptchaActionName, captchaResp?: boolean): Promise<T>;
|
|
42
|
+
declare type ActionMethod<TRequest, TResponse> = (auth: Auth, request: TRequest) => Promise<TResponse>;
|
|
43
|
+
export declare function handleRecaptchaFlow<TRequest, TResponse>(authInstance: AuthInternal, request: TRequest, actionName: RecaptchaActionName, actionMethod: ActionMethod<TRequest, TResponse>): Promise<TResponse>;
|
|
42
44
|
export declare function _initializeRecaptchaConfig(auth: Auth): Promise<void>;
|
|
45
|
+
export {};
|
|
@@ -22,13 +22,13 @@ interface GetRecaptchaConfigRequest {
|
|
|
22
22
|
clientType?: RecaptchaClientType;
|
|
23
23
|
version?: RecaptchaVersion;
|
|
24
24
|
}
|
|
25
|
-
interface
|
|
25
|
+
export interface RecaptchaEnforcementProviderState {
|
|
26
26
|
provider: string;
|
|
27
27
|
enforcementState: string;
|
|
28
28
|
}
|
|
29
29
|
export interface GetRecaptchaConfigResponse {
|
|
30
30
|
recaptchaKey: string;
|
|
31
|
-
recaptchaEnforcementState:
|
|
31
|
+
recaptchaEnforcementState: RecaptchaEnforcementProviderState[];
|
|
32
32
|
}
|
|
33
33
|
export declare function getRecaptchaConfig(auth: Auth, request: GetRecaptchaConfigRequest): Promise<GetRecaptchaConfigResponse>;
|
|
34
34
|
export {};
|
package/dist/src/api/index.d.ts
CHANGED
|
@@ -69,6 +69,15 @@ export declare const enum RecaptchaActionName {
|
|
|
69
69
|
GET_OOB_CODE = "getOobCode",
|
|
70
70
|
SIGN_UP_PASSWORD = "signUpPassword"
|
|
71
71
|
}
|
|
72
|
+
export declare const enum EnforcementState {
|
|
73
|
+
ENFORCE = "ENFORCE",
|
|
74
|
+
AUDIT = "AUDIT",
|
|
75
|
+
OFF = "OFF",
|
|
76
|
+
ENFORCEMENT_STATE_UNSPECIFIED = "ENFORCEMENT_STATE_UNSPECIFIED"
|
|
77
|
+
}
|
|
78
|
+
export declare const enum RecaptchaProvider {
|
|
79
|
+
EMAIL_PASSWORD_PROVIDER = "EMAIL_PASSWORD_PROVIDER"
|
|
80
|
+
}
|
|
72
81
|
export declare const DEFAULT_API_TIMEOUT_MS: Delay;
|
|
73
82
|
export declare function _addTidIfNecessary<T extends {
|
|
74
83
|
tenantId?: string;
|
|
@@ -77,6 +86,7 @@ export declare function _performApiRequest<T, V>(auth: Auth, method: HttpMethod,
|
|
|
77
86
|
export declare function _performFetchWithErrorHandling<V>(auth: Auth, customErrorMap: Partial<ServerErrorMap<ServerError>>, fetchFn: () => Promise<Response>): Promise<V>;
|
|
78
87
|
export declare function _performSignInRequest<T, V extends IdTokenResponse>(auth: Auth, method: HttpMethod, path: Endpoint, request?: T, customErrorMap?: Partial<ServerErrorMap<ServerError>>): Promise<V>;
|
|
79
88
|
export declare function _getFinalTarget(auth: Auth, host: string, path: string, query: string): string;
|
|
89
|
+
export declare function _parseEnforcementState(enforcementStateStr: string): EnforcementState;
|
|
80
90
|
interface PotentialResponse extends IdTokenResponse {
|
|
81
91
|
email?: string;
|
|
82
92
|
phoneNumber?: string;
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
import { RecaptchaParameters } from '../../model/public_types';
|
|
18
|
-
import { GetRecaptchaConfigResponse } from '../../api/authentication/recaptcha';
|
|
18
|
+
import { GetRecaptchaConfigResponse, RecaptchaEnforcementProviderState } from '../../api/authentication/recaptcha';
|
|
19
|
+
import { EnforcementState } from '../../api/index';
|
|
19
20
|
export interface Recaptcha {
|
|
20
21
|
render: (container: HTMLElement, parameters: RecaptchaParameters) => number;
|
|
21
22
|
getResponse: (id: number) => string;
|
|
@@ -49,8 +50,22 @@ export declare class RecaptchaConfig {
|
|
|
49
50
|
*/
|
|
50
51
|
siteKey: string;
|
|
51
52
|
/**
|
|
52
|
-
* The
|
|
53
|
+
* The list of providers and their enablement status for reCAPTCHA Enterprise.
|
|
53
54
|
*/
|
|
54
|
-
|
|
55
|
+
recaptchaEnforcementState: RecaptchaEnforcementProviderState[];
|
|
55
56
|
constructor(response: GetRecaptchaConfigResponse);
|
|
57
|
+
/**
|
|
58
|
+
* Returns the reCAPTCHA Enterprise enforcement state for the given provider.
|
|
59
|
+
*
|
|
60
|
+
* @param providerStr - The provider whose enforcement state is to be returned.
|
|
61
|
+
* @returns The reCAPTCHA Enterprise enforcement state for the given provider.
|
|
62
|
+
*/
|
|
63
|
+
getProviderEnforcementState(providerStr: string): EnforcementState | null;
|
|
64
|
+
/**
|
|
65
|
+
* Returns true if the reCAPTCHA Enterprise enforcement state for the provider is set to ENFORCE or AUDIT.
|
|
66
|
+
*
|
|
67
|
+
* @param providerStr - The provider whose enablement state is to be returned.
|
|
68
|
+
* @returns Whether or not reCAPTCHA Enterprise protection is enabled for the given provider.
|
|
69
|
+
*/
|
|
70
|
+
isProviderEnabled(providerStr: string): boolean;
|
|
56
71
|
}
|
|
@@ -39,4 +39,7 @@ export declare class RecaptchaEnterpriseVerifier {
|
|
|
39
39
|
verify(action?: string, forceRefresh?: boolean): Promise<string>;
|
|
40
40
|
}
|
|
41
41
|
export declare function injectRecaptchaFields<T>(auth: AuthInternal, request: T, action: RecaptchaActionName, captchaResp?: boolean): Promise<T>;
|
|
42
|
+
declare type ActionMethod<TRequest, TResponse> = (auth: Auth, request: TRequest) => Promise<TResponse>;
|
|
43
|
+
export declare function handleRecaptchaFlow<TRequest, TResponse>(authInstance: AuthInternal, request: TRequest, actionName: RecaptchaActionName, actionMethod: ActionMethod<TRequest, TResponse>): Promise<TResponse>;
|
|
42
44
|
export declare function _initializeRecaptchaConfig(auth: Auth): Promise<void>;
|
|
45
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/auth",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1-canary.6e4e475f6",
|
|
4
4
|
"description": "The Firebase Authenticaton component of the Firebase JS SDK.",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/node/index.js",
|
|
@@ -78,11 +78,11 @@
|
|
|
78
78
|
"build:release": "yarn build && yarn typings:public",
|
|
79
79
|
"build:scripts": "tsc -moduleResolution node --module commonjs scripts/*.ts && ls scripts/*.js | xargs -I % sh -c 'terser % -o %'",
|
|
80
80
|
"dev": "rollup -c -w",
|
|
81
|
-
"test": "run-p lint test:all",
|
|
82
|
-
"test:all": "run-p test:browser:unit test:node:unit test:integration test:browser:integration:prodbackend",
|
|
83
|
-
"test:integration": "firebase emulators:exec --project emulatedproject --only auth \"run-s test:browser:integration:local test:node:integration:local test:webdriver\"",
|
|
81
|
+
"test": "run-p --npm-path npm lint test:all",
|
|
82
|
+
"test:all": "run-p --npm-path npm test:browser:unit test:node:unit test:integration test:browser:integration:prodbackend",
|
|
83
|
+
"test:integration": "firebase emulators:exec --project emulatedproject --only auth \"run-s --npm-path npm test:browser:integration:local test:node:integration:local test:webdriver\"",
|
|
84
84
|
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
|
|
85
|
-
"test:integration:local": "run-s test:node:integration:local test:browser:integration:local test:webdriver",
|
|
85
|
+
"test:integration:local": "run-s --npm-path npm test:node:integration:local test:browser:integration:local test:webdriver",
|
|
86
86
|
"test:browser": "karma start --single-run --local",
|
|
87
87
|
"test:browser:unit": "karma start --single-run --unit",
|
|
88
88
|
"test:browser:integration": "karma start --single-run --integration",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"test:browser:unit:debug": "karma start --auto-watch --unit",
|
|
93
93
|
"test:cordova": "karma start --single-run --cordova",
|
|
94
94
|
"test:cordova:debug": "karma start --auto-watch --cordova",
|
|
95
|
-
"test:node": "run-s test:node:unit test:node:integration:local",
|
|
95
|
+
"test:node": "run-s --npm-path npm test:node:unit test:node:integration:local",
|
|
96
96
|
"test:node:unit": "ts-node -O '{\"module\": \"commonjs\", \"target\": \"es6\"}' scripts/run_node_tests.ts",
|
|
97
97
|
"test:node:integration": "ts-node -O '{\"module\": \"commonjs\", \"target\": \"es6\"}' scripts/run_node_tests.ts --integration",
|
|
98
98
|
"test:node:integration:local": "ts-node -O '{\"module\": \"commonjs\", \"target\": \"es6\"}' scripts/run_node_tests.ts --integration --local",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"typings:public": "node ../../scripts/build/use_typings.js ./dist/auth-public.d.ts"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
|
-
"@firebase/app": "0.
|
|
106
|
+
"@firebase/app": "0.9.21-canary.6e4e475f6",
|
|
107
107
|
"@react-native-async-storage/async-storage": "^1.18.1"
|
|
108
108
|
},
|
|
109
109
|
"peerDependenciesMeta": {
|
|
@@ -112,19 +112,19 @@
|
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
114
|
"dependencies": {
|
|
115
|
-
"@firebase/component": "0.6.4",
|
|
116
|
-
"@firebase/logger": "0.4.0",
|
|
117
|
-
"@firebase/util": "1.9.3",
|
|
115
|
+
"@firebase/component": "0.6.4-canary.6e4e475f6",
|
|
116
|
+
"@firebase/logger": "0.4.0-canary.6e4e475f6",
|
|
117
|
+
"@firebase/util": "1.9.3-canary.6e4e475f6",
|
|
118
118
|
"node-fetch": "2.6.7",
|
|
119
119
|
"tslib": "^2.1.0"
|
|
120
120
|
},
|
|
121
121
|
"license": "Apache-2.0",
|
|
122
122
|
"devDependencies": {
|
|
123
|
-
"@firebase/app": "0.9.
|
|
123
|
+
"@firebase/app": "0.9.21-canary.6e4e475f6",
|
|
124
124
|
"@rollup/plugin-json": "4.1.0",
|
|
125
125
|
"@rollup/plugin-strip": "2.1.0",
|
|
126
126
|
"@types/express": "4.17.17",
|
|
127
|
-
"chromedriver": "
|
|
127
|
+
"chromedriver": "114.0.2",
|
|
128
128
|
"rollup": "2.79.1",
|
|
129
129
|
"rollup-plugin-sourcemaps": "0.6.3",
|
|
130
130
|
"rollup-plugin-typescript2": "0.31.2",
|