@firebase/app-check 0.8.9 → 0.8.10

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.
Files changed (61) hide show
  1. package/dist/esm/index.esm2017.js +1632 -1632
  2. package/dist/esm/index.esm2017.js.map +1 -1
  3. package/dist/esm/src/api.d.ts +105 -105
  4. package/dist/esm/src/api.test.d.ts +17 -17
  5. package/dist/esm/src/client.d.ts +30 -30
  6. package/dist/esm/src/client.test.d.ts +17 -17
  7. package/dist/esm/src/constants.d.ts +40 -40
  8. package/dist/esm/src/debug.d.ts +22 -22
  9. package/dist/esm/src/debug.test.d.ts +17 -17
  10. package/dist/esm/src/errors.d.ts +61 -61
  11. package/dist/esm/src/factory.d.ts +31 -31
  12. package/dist/esm/src/index.d.ts +14 -14
  13. package/dist/esm/src/indexeddb.d.ts +22 -22
  14. package/dist/esm/src/internal-api.d.ts +44 -44
  15. package/dist/esm/src/internal-api.test.d.ts +17 -17
  16. package/dist/esm/src/logger.d.ts +18 -18
  17. package/dist/esm/src/proactive-refresh.d.ts +35 -35
  18. package/dist/esm/src/proactive-refresh.test.d.ts +17 -17
  19. package/dist/esm/src/providers.d.ts +108 -108
  20. package/dist/esm/src/providers.test.d.ts +17 -17
  21. package/dist/esm/src/public-types.d.ts +85 -85
  22. package/dist/esm/src/recaptcha.d.ts +43 -43
  23. package/dist/esm/src/recaptcha.test.d.ts +17 -17
  24. package/dist/esm/src/state.d.ts +54 -54
  25. package/dist/esm/src/storage.d.ts +27 -27
  26. package/dist/esm/src/storage.test.d.ts +17 -17
  27. package/dist/esm/src/types.d.ts +66 -66
  28. package/dist/esm/src/util.d.ts +21 -21
  29. package/dist/esm/test/setup.d.ts +17 -17
  30. package/dist/esm/test/util.d.ts +34 -34
  31. package/dist/index.cjs.js +1632 -1632
  32. package/dist/index.cjs.js.map +1 -1
  33. package/dist/src/api.d.ts +105 -105
  34. package/dist/src/api.test.d.ts +17 -17
  35. package/dist/src/client.d.ts +30 -30
  36. package/dist/src/client.test.d.ts +17 -17
  37. package/dist/src/constants.d.ts +40 -40
  38. package/dist/src/debug.d.ts +22 -22
  39. package/dist/src/debug.test.d.ts +17 -17
  40. package/dist/src/errors.d.ts +61 -61
  41. package/dist/src/factory.d.ts +31 -31
  42. package/dist/src/index.d.ts +14 -14
  43. package/dist/src/indexeddb.d.ts +22 -22
  44. package/dist/src/internal-api.d.ts +44 -44
  45. package/dist/src/internal-api.test.d.ts +17 -17
  46. package/dist/src/logger.d.ts +18 -18
  47. package/dist/src/proactive-refresh.d.ts +35 -35
  48. package/dist/src/proactive-refresh.test.d.ts +17 -17
  49. package/dist/src/providers.d.ts +108 -108
  50. package/dist/src/providers.test.d.ts +17 -17
  51. package/dist/src/public-types.d.ts +85 -85
  52. package/dist/src/recaptcha.d.ts +43 -43
  53. package/dist/src/recaptcha.test.d.ts +17 -17
  54. package/dist/src/state.d.ts +54 -54
  55. package/dist/src/storage.d.ts +27 -27
  56. package/dist/src/storage.test.d.ts +17 -17
  57. package/dist/src/types.d.ts +66 -66
  58. package/dist/src/util.d.ts +21 -21
  59. package/dist/test/setup.d.ts +17 -17
  60. package/dist/test/util.d.ts +34 -34
  61. package/package.json +6 -6
@@ -1,105 +1,105 @@
1
- /**
2
- * @license
3
- * Copyright 2020 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { AppCheck, AppCheckOptions, AppCheckTokenResult, Unsubscribe, PartialObserver } from './public-types';
18
- import { FirebaseApp } from '@firebase/app';
19
- import { AppCheckService } from './factory';
20
- declare module '@firebase/component' {
21
- interface NameServiceMapping {
22
- 'app-check': AppCheckService;
23
- }
24
- }
25
- export { ReCaptchaV3Provider, CustomProvider, ReCaptchaEnterpriseProvider } from './providers';
26
- /**
27
- * Activate App Check for the given app. Can be called only once per app.
28
- * @param app - the {@link @firebase/app#FirebaseApp} to activate App Check for
29
- * @param options - App Check initialization options
30
- * @public
31
- */
32
- export declare function initializeAppCheck(app: FirebaseApp | undefined, options: AppCheckOptions): AppCheck;
33
- /**
34
- * Set whether App Check will automatically refresh tokens as needed.
35
- *
36
- * @param appCheckInstance - The App Check service instance.
37
- * @param isTokenAutoRefreshEnabled - If true, the SDK automatically
38
- * refreshes App Check tokens as needed. This overrides any value set
39
- * during `initializeAppCheck()`.
40
- * @public
41
- */
42
- export declare function setTokenAutoRefreshEnabled(appCheckInstance: AppCheck, isTokenAutoRefreshEnabled: boolean): void;
43
- /**
44
- * Get the current App Check token. If `forceRefresh` is false, this function first
45
- * checks for a valid token in memory, then local persistence (IndexedDB).
46
- * If not found, or if `forceRefresh` is true, it makes a request to the
47
- * App Check endpoint for a fresh token. That request attaches
48
- * to the most recent in-flight request if one is present.
49
- *
50
- * @param appCheckInstance - The App Check service instance.
51
- * @param forceRefresh - If true, will always try to fetch a fresh token.
52
- * If false, will use a cached token if found in storage.
53
- * @public
54
- */
55
- export declare function getToken(appCheckInstance: AppCheck, forceRefresh?: boolean): Promise<AppCheckTokenResult>;
56
- /**
57
- * Requests a Firebase App Check token. This method should be used
58
- * only if you need to authorize requests to a non-Firebase backend.
59
- *
60
- * Returns limited-use tokens that are intended for use with your
61
- * non-Firebase backend endpoints that are protected with
62
- * <a href="https://firebase.google.com/docs/app-check/custom-resource-backend#replay-protection">
63
- * Replay Protection</a>. This method
64
- * does not affect the token generation behavior of the
65
- * #getAppCheckToken() method.
66
- *
67
- * @param appCheckInstance - The App Check service instance.
68
- * @returns The limited use token.
69
- * @public
70
- */
71
- export declare function getLimitedUseToken(appCheckInstance: AppCheck): Promise<AppCheckTokenResult>;
72
- /**
73
- * Registers a listener to changes in the token state. There can be more
74
- * than one listener registered at the same time for one or more
75
- * App Check instances. The listeners call back on the UI thread whenever
76
- * the current token associated with this App Check instance changes.
77
- *
78
- * @param appCheckInstance - The App Check service instance.
79
- * @param observer - An object with `next`, `error`, and `complete`
80
- * properties. `next` is called with an
81
- * {@link AppCheckTokenResult}
82
- * whenever the token changes. `error` is optional and is called if an
83
- * error is thrown by the listener (the `next` function). `complete`
84
- * is unused, as the token stream is unending.
85
- *
86
- * @returns A function that unsubscribes this listener.
87
- * @public
88
- */
89
- export declare function onTokenChanged(appCheckInstance: AppCheck, observer: PartialObserver<AppCheckTokenResult>): Unsubscribe;
90
- /**
91
- * Registers a listener to changes in the token state. There can be more
92
- * than one listener registered at the same time for one or more
93
- * App Check instances. The listeners call back on the UI thread whenever
94
- * the current token associated with this App Check instance changes.
95
- *
96
- * @param appCheckInstance - The App Check service instance.
97
- * @param onNext - When the token changes, this function is called with an
98
- * {@link AppCheckTokenResult}.
99
- * @param onError - Optional. Called if there is an error thrown by the
100
- * listener (the `onNext` function).
101
- * @param onCompletion - Currently unused, as the token stream is unending.
102
- * @returns A function that unsubscribes this listener.
103
- * @public
104
- */
105
- export declare function onTokenChanged(appCheckInstance: AppCheck, onNext: (tokenResult: AppCheckTokenResult) => void, onError?: (error: Error) => void, onCompletion?: () => void): Unsubscribe;
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { AppCheck, AppCheckOptions, AppCheckTokenResult, Unsubscribe, PartialObserver } from './public-types';
18
+ import { FirebaseApp } from '@firebase/app';
19
+ import { AppCheckService } from './factory';
20
+ declare module '@firebase/component' {
21
+ interface NameServiceMapping {
22
+ 'app-check': AppCheckService;
23
+ }
24
+ }
25
+ export { ReCaptchaV3Provider, CustomProvider, ReCaptchaEnterpriseProvider } from './providers';
26
+ /**
27
+ * Activate App Check for the given app. Can be called only once per app.
28
+ * @param app - the {@link @firebase/app#FirebaseApp} to activate App Check for
29
+ * @param options - App Check initialization options
30
+ * @public
31
+ */
32
+ export declare function initializeAppCheck(app: FirebaseApp | undefined, options: AppCheckOptions): AppCheck;
33
+ /**
34
+ * Set whether App Check will automatically refresh tokens as needed.
35
+ *
36
+ * @param appCheckInstance - The App Check service instance.
37
+ * @param isTokenAutoRefreshEnabled - If true, the SDK automatically
38
+ * refreshes App Check tokens as needed. This overrides any value set
39
+ * during `initializeAppCheck()`.
40
+ * @public
41
+ */
42
+ export declare function setTokenAutoRefreshEnabled(appCheckInstance: AppCheck, isTokenAutoRefreshEnabled: boolean): void;
43
+ /**
44
+ * Get the current App Check token. If `forceRefresh` is false, this function first
45
+ * checks for a valid token in memory, then local persistence (IndexedDB).
46
+ * If not found, or if `forceRefresh` is true, it makes a request to the
47
+ * App Check endpoint for a fresh token. That request attaches
48
+ * to the most recent in-flight request if one is present.
49
+ *
50
+ * @param appCheckInstance - The App Check service instance.
51
+ * @param forceRefresh - If true, will always try to fetch a fresh token.
52
+ * If false, will use a cached token if found in storage.
53
+ * @public
54
+ */
55
+ export declare function getToken(appCheckInstance: AppCheck, forceRefresh?: boolean): Promise<AppCheckTokenResult>;
56
+ /**
57
+ * Requests a Firebase App Check token. This method should be used
58
+ * only if you need to authorize requests to a non-Firebase backend.
59
+ *
60
+ * Returns limited-use tokens that are intended for use with your
61
+ * non-Firebase backend endpoints that are protected with
62
+ * <a href="https://firebase.google.com/docs/app-check/custom-resource-backend#replay-protection">
63
+ * Replay Protection</a>. This method
64
+ * does not affect the token generation behavior of the
65
+ * #getAppCheckToken() method.
66
+ *
67
+ * @param appCheckInstance - The App Check service instance.
68
+ * @returns The limited use token.
69
+ * @public
70
+ */
71
+ export declare function getLimitedUseToken(appCheckInstance: AppCheck): Promise<AppCheckTokenResult>;
72
+ /**
73
+ * Registers a listener to changes in the token state. There can be more
74
+ * than one listener registered at the same time for one or more
75
+ * App Check instances. The listeners call back on the UI thread whenever
76
+ * the current token associated with this App Check instance changes.
77
+ *
78
+ * @param appCheckInstance - The App Check service instance.
79
+ * @param observer - An object with `next`, `error`, and `complete`
80
+ * properties. `next` is called with an
81
+ * {@link AppCheckTokenResult}
82
+ * whenever the token changes. `error` is optional and is called if an
83
+ * error is thrown by the listener (the `next` function). `complete`
84
+ * is unused, as the token stream is unending.
85
+ *
86
+ * @returns A function that unsubscribes this listener.
87
+ * @public
88
+ */
89
+ export declare function onTokenChanged(appCheckInstance: AppCheck, observer: PartialObserver<AppCheckTokenResult>): Unsubscribe;
90
+ /**
91
+ * Registers a listener to changes in the token state. There can be more
92
+ * than one listener registered at the same time for one or more
93
+ * App Check instances. The listeners call back on the UI thread whenever
94
+ * the current token associated with this App Check instance changes.
95
+ *
96
+ * @param appCheckInstance - The App Check service instance.
97
+ * @param onNext - When the token changes, this function is called with an
98
+ * {@link AppCheckTokenResult}.
99
+ * @param onError - Optional. Called if there is an error thrown by the
100
+ * listener (the `onNext` function).
101
+ * @param onCompletion - Currently unused, as the token stream is unending.
102
+ * @returns A function that unsubscribes this listener.
103
+ * @public
104
+ */
105
+ export declare function onTokenChanged(appCheckInstance: AppCheck, onNext: (tokenResult: AppCheckTokenResult) => void, onError?: (error: Error) => void, onCompletion?: () => void): Unsubscribe;
@@ -1,17 +1,17 @@
1
- /**
2
- * @license
3
- * Copyright 2020 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import '../test/setup';
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
@@ -1,30 +1,30 @@
1
- /**
2
- * @license
3
- * Copyright 2020 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { FirebaseApp } from '@firebase/app';
18
- import { Provider } from '@firebase/component';
19
- import { AppCheckTokenInternal } from './types';
20
- interface AppCheckRequest {
21
- url: string;
22
- body: {
23
- [key: string]: string;
24
- };
25
- }
26
- export declare function exchangeToken({ url, body }: AppCheckRequest, heartbeatServiceProvider: Provider<'heartbeat'>): Promise<AppCheckTokenInternal>;
27
- export declare function getExchangeRecaptchaV3TokenRequest(app: FirebaseApp, reCAPTCHAToken: string): AppCheckRequest;
28
- export declare function getExchangeRecaptchaEnterpriseTokenRequest(app: FirebaseApp, reCAPTCHAToken: string): AppCheckRequest;
29
- export declare function getExchangeDebugTokenRequest(app: FirebaseApp, debugToken: string): AppCheckRequest;
30
- export {};
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { FirebaseApp } from '@firebase/app';
18
+ import { Provider } from '@firebase/component';
19
+ import { AppCheckTokenInternal } from './types';
20
+ interface AppCheckRequest {
21
+ url: string;
22
+ body: {
23
+ [key: string]: string;
24
+ };
25
+ }
26
+ export declare function exchangeToken({ url, body }: AppCheckRequest, heartbeatServiceProvider: Provider<'heartbeat'>): Promise<AppCheckTokenInternal>;
27
+ export declare function getExchangeRecaptchaV3TokenRequest(app: FirebaseApp, reCAPTCHAToken: string): AppCheckRequest;
28
+ export declare function getExchangeRecaptchaEnterpriseTokenRequest(app: FirebaseApp, reCAPTCHAToken: string): AppCheckRequest;
29
+ export declare function getExchangeDebugTokenRequest(app: FirebaseApp, debugToken: string): AppCheckRequest;
30
+ export {};
@@ -1,17 +1,17 @@
1
- /**
2
- * @license
3
- * Copyright 2020 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import '../test/setup';
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
@@ -1,40 +1,40 @@
1
- /**
2
- * @license
3
- * Copyright 2020 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- export declare const BASE_ENDPOINT = "https://content-firebaseappcheck.googleapis.com/v1";
18
- export declare const EXCHANGE_RECAPTCHA_TOKEN_METHOD = "exchangeRecaptchaV3Token";
19
- export declare const EXCHANGE_RECAPTCHA_ENTERPRISE_TOKEN_METHOD = "exchangeRecaptchaEnterpriseToken";
20
- export declare const EXCHANGE_DEBUG_TOKEN_METHOD = "exchangeDebugToken";
21
- export declare const TOKEN_REFRESH_TIME: {
22
- /**
23
- * The offset time before token natural expiration to run the refresh.
24
- * This is currently 5 minutes.
25
- */
26
- OFFSET_DURATION: number;
27
- /**
28
- * This is the first retrial wait after an error. This is currently
29
- * 30 seconds.
30
- */
31
- RETRIAL_MIN_WAIT: number;
32
- /**
33
- * This is the maximum retrial wait, currently 16 minutes.
34
- */
35
- RETRIAL_MAX_WAIT: number;
36
- };
37
- /**
38
- * One day in millis, for certain error code backoffs.
39
- */
40
- export declare const ONE_DAY: number;
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ export declare const BASE_ENDPOINT = "https://content-firebaseappcheck.googleapis.com/v1";
18
+ export declare const EXCHANGE_RECAPTCHA_TOKEN_METHOD = "exchangeRecaptchaV3Token";
19
+ export declare const EXCHANGE_RECAPTCHA_ENTERPRISE_TOKEN_METHOD = "exchangeRecaptchaEnterpriseToken";
20
+ export declare const EXCHANGE_DEBUG_TOKEN_METHOD = "exchangeDebugToken";
21
+ export declare const TOKEN_REFRESH_TIME: {
22
+ /**
23
+ * The offset time before token natural expiration to run the refresh.
24
+ * This is currently 5 minutes.
25
+ */
26
+ OFFSET_DURATION: number;
27
+ /**
28
+ * This is the first retrial wait after an error. This is currently
29
+ * 30 seconds.
30
+ */
31
+ RETRIAL_MIN_WAIT: number;
32
+ /**
33
+ * This is the maximum retrial wait, currently 16 minutes.
34
+ */
35
+ RETRIAL_MAX_WAIT: number;
36
+ };
37
+ /**
38
+ * One day in millis, for certain error code backoffs.
39
+ */
40
+ export declare const ONE_DAY: number;
@@ -1,22 +1,22 @@
1
- /**
2
- * @license
3
- * Copyright 2020 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- declare global {
18
- var FIREBASE_APPCHECK_DEBUG_TOKEN: boolean | string | undefined;
19
- }
20
- export declare function isDebugMode(): boolean;
21
- export declare function getDebugToken(): Promise<string>;
22
- export declare function initializeDebugMode(): void;
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ declare global {
18
+ var FIREBASE_APPCHECK_DEBUG_TOKEN: boolean | string | undefined;
19
+ }
20
+ export declare function isDebugMode(): boolean;
21
+ export declare function getDebugToken(): Promise<string>;
22
+ export declare function initializeDebugMode(): void;
@@ -1,17 +1,17 @@
1
- /**
2
- * @license
3
- * Copyright 2020 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import '../test/setup';
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import '../test/setup';
@@ -1,61 +1,61 @@
1
- /**
2
- * @license
3
- * Copyright 2020 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- import { ErrorFactory } from '@firebase/util';
18
- export declare const enum AppCheckError {
19
- ALREADY_INITIALIZED = "already-initialized",
20
- USE_BEFORE_ACTIVATION = "use-before-activation",
21
- FETCH_NETWORK_ERROR = "fetch-network-error",
22
- FETCH_PARSE_ERROR = "fetch-parse-error",
23
- FETCH_STATUS_ERROR = "fetch-status-error",
24
- STORAGE_OPEN = "storage-open",
25
- STORAGE_GET = "storage-get",
26
- STORAGE_WRITE = "storage-set",
27
- RECAPTCHA_ERROR = "recaptcha-error",
28
- THROTTLED = "throttled"
29
- }
30
- interface ErrorParams {
31
- [AppCheckError.ALREADY_INITIALIZED]: {
32
- appName: string;
33
- };
34
- [AppCheckError.USE_BEFORE_ACTIVATION]: {
35
- appName: string;
36
- };
37
- [AppCheckError.FETCH_NETWORK_ERROR]: {
38
- originalErrorMessage: string;
39
- };
40
- [AppCheckError.FETCH_PARSE_ERROR]: {
41
- originalErrorMessage: string;
42
- };
43
- [AppCheckError.FETCH_STATUS_ERROR]: {
44
- httpStatus: number;
45
- };
46
- [AppCheckError.STORAGE_OPEN]: {
47
- originalErrorMessage?: string;
48
- };
49
- [AppCheckError.STORAGE_GET]: {
50
- originalErrorMessage?: string;
51
- };
52
- [AppCheckError.STORAGE_WRITE]: {
53
- originalErrorMessage?: string;
54
- };
55
- [AppCheckError.THROTTLED]: {
56
- time: string;
57
- httpStatus: number;
58
- };
59
- }
60
- export declare const ERROR_FACTORY: ErrorFactory<AppCheckError, ErrorParams>;
61
- export {};
1
+ /**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { ErrorFactory } from '@firebase/util';
18
+ export declare const enum AppCheckError {
19
+ ALREADY_INITIALIZED = "already-initialized",
20
+ USE_BEFORE_ACTIVATION = "use-before-activation",
21
+ FETCH_NETWORK_ERROR = "fetch-network-error",
22
+ FETCH_PARSE_ERROR = "fetch-parse-error",
23
+ FETCH_STATUS_ERROR = "fetch-status-error",
24
+ STORAGE_OPEN = "storage-open",
25
+ STORAGE_GET = "storage-get",
26
+ STORAGE_WRITE = "storage-set",
27
+ RECAPTCHA_ERROR = "recaptcha-error",
28
+ THROTTLED = "throttled"
29
+ }
30
+ interface ErrorParams {
31
+ [AppCheckError.ALREADY_INITIALIZED]: {
32
+ appName: string;
33
+ };
34
+ [AppCheckError.USE_BEFORE_ACTIVATION]: {
35
+ appName: string;
36
+ };
37
+ [AppCheckError.FETCH_NETWORK_ERROR]: {
38
+ originalErrorMessage: string;
39
+ };
40
+ [AppCheckError.FETCH_PARSE_ERROR]: {
41
+ originalErrorMessage: string;
42
+ };
43
+ [AppCheckError.FETCH_STATUS_ERROR]: {
44
+ httpStatus: number;
45
+ };
46
+ [AppCheckError.STORAGE_OPEN]: {
47
+ originalErrorMessage?: string;
48
+ };
49
+ [AppCheckError.STORAGE_GET]: {
50
+ originalErrorMessage?: string;
51
+ };
52
+ [AppCheckError.STORAGE_WRITE]: {
53
+ originalErrorMessage?: string;
54
+ };
55
+ [AppCheckError.THROTTLED]: {
56
+ time: string;
57
+ httpStatus: number;
58
+ };
59
+ }
60
+ export declare const ERROR_FACTORY: ErrorFactory<AppCheckError, ErrorParams>;
61
+ export {};