@firebase/remote-config 0.4.10 → 0.4.11

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 (57) hide show
  1. package/dist/esm/index.esm2017.js +1193 -1193
  2. package/dist/esm/index.esm2017.js.map +1 -1
  3. package/dist/esm/src/api.d.ts +115 -115
  4. package/dist/esm/src/api2.d.ts +40 -40
  5. package/dist/esm/src/client/caching_client.d.ts +45 -45
  6. package/dist/esm/src/client/remote_config_fetch_client.d.ts +123 -123
  7. package/dist/esm/src/client/rest_client.d.ts +40 -40
  8. package/dist/esm/src/client/retrying_client.d.ts +49 -49
  9. package/dist/esm/src/constants.d.ts +17 -17
  10. package/dist/esm/src/errors.d.ts +62 -62
  11. package/dist/esm/src/index.d.ts +14 -14
  12. package/dist/esm/src/language.d.ts +26 -26
  13. package/dist/esm/src/public_types.d.ts +128 -128
  14. package/dist/esm/src/register.d.ts +2 -2
  15. package/dist/esm/src/remote_config.d.ts +79 -79
  16. package/dist/esm/src/storage/storage.d.ts +76 -76
  17. package/dist/esm/src/storage/storage_cache.d.ts +48 -48
  18. package/dist/esm/src/value.d.ts +26 -26
  19. package/dist/esm/test/client/caching_client.test.d.ts +17 -17
  20. package/dist/esm/test/client/rest_client.test.d.ts +17 -17
  21. package/dist/esm/test/client/retrying_client.test.d.ts +17 -17
  22. package/dist/esm/test/errors.test.d.ts +17 -17
  23. package/dist/esm/test/language.test.d.ts +17 -17
  24. package/dist/esm/test/remote_config.test.d.ts +17 -17
  25. package/dist/esm/test/setup.d.ts +17 -17
  26. package/dist/esm/test/storage/storage.test.d.ts +17 -17
  27. package/dist/esm/test/storage/storage_cache.test.d.ts +17 -17
  28. package/dist/esm/test/value.test.d.ts +17 -17
  29. package/dist/index.cjs.js +1193 -1193
  30. package/dist/index.cjs.js.map +1 -1
  31. package/dist/src/api.d.ts +115 -115
  32. package/dist/src/api2.d.ts +40 -40
  33. package/dist/src/client/caching_client.d.ts +45 -45
  34. package/dist/src/client/remote_config_fetch_client.d.ts +123 -123
  35. package/dist/src/client/rest_client.d.ts +40 -40
  36. package/dist/src/client/retrying_client.d.ts +49 -49
  37. package/dist/src/constants.d.ts +17 -17
  38. package/dist/src/errors.d.ts +62 -62
  39. package/dist/src/index.d.ts +14 -14
  40. package/dist/src/language.d.ts +26 -26
  41. package/dist/src/public_types.d.ts +128 -128
  42. package/dist/src/register.d.ts +2 -2
  43. package/dist/src/remote_config.d.ts +79 -79
  44. package/dist/src/storage/storage.d.ts +76 -76
  45. package/dist/src/storage/storage_cache.d.ts +48 -48
  46. package/dist/src/value.d.ts +26 -26
  47. package/dist/test/client/caching_client.test.d.ts +17 -17
  48. package/dist/test/client/rest_client.test.d.ts +17 -17
  49. package/dist/test/client/retrying_client.test.d.ts +17 -17
  50. package/dist/test/errors.test.d.ts +17 -17
  51. package/dist/test/language.test.d.ts +17 -17
  52. package/dist/test/remote_config.test.d.ts +17 -17
  53. package/dist/test/setup.d.ts +17 -17
  54. package/dist/test/storage/storage.test.d.ts +17 -17
  55. package/dist/test/storage/storage_cache.test.d.ts +17 -17
  56. package/dist/test/value.test.d.ts +17 -17
  57. package/package.json +7 -7
@@ -1,40 +1,40 @@
1
- /**
2
- * @license
3
- * Copyright 2019 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 { FetchResponse, RemoteConfigFetchClient, FetchRequest } from './remote_config_fetch_client';
18
- import { _FirebaseInstallationsInternal } from '@firebase/installations';
19
- /**
20
- * Implements the Client abstraction for the Remote Config REST API.
21
- */
22
- export declare class RestClient implements RemoteConfigFetchClient {
23
- private readonly firebaseInstallations;
24
- private readonly sdkVersion;
25
- private readonly namespace;
26
- private readonly projectId;
27
- private readonly apiKey;
28
- private readonly appId;
29
- constructor(firebaseInstallations: _FirebaseInstallationsInternal, sdkVersion: string, namespace: string, projectId: string, apiKey: string, appId: string);
30
- /**
31
- * Fetches from the Remote Config REST API.
32
- *
33
- * @throws a {@link ErrorCode.FETCH_NETWORK} error if {@link GlobalFetch#fetch} can't
34
- * connect to the network.
35
- * @throws a {@link ErrorCode.FETCH_PARSE} error if {@link Response#json} can't parse the
36
- * fetch response.
37
- * @throws a {@link ErrorCode.FETCH_STATUS} error if the service returns an HTTP error status.
38
- */
39
- fetch(request: FetchRequest): Promise<FetchResponse>;
40
- }
1
+ /**
2
+ * @license
3
+ * Copyright 2019 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 { FetchResponse, RemoteConfigFetchClient, FetchRequest } from './remote_config_fetch_client';
18
+ import { _FirebaseInstallationsInternal } from '@firebase/installations';
19
+ /**
20
+ * Implements the Client abstraction for the Remote Config REST API.
21
+ */
22
+ export declare class RestClient implements RemoteConfigFetchClient {
23
+ private readonly firebaseInstallations;
24
+ private readonly sdkVersion;
25
+ private readonly namespace;
26
+ private readonly projectId;
27
+ private readonly apiKey;
28
+ private readonly appId;
29
+ constructor(firebaseInstallations: _FirebaseInstallationsInternal, sdkVersion: string, namespace: string, projectId: string, apiKey: string, appId: string);
30
+ /**
31
+ * Fetches from the Remote Config REST API.
32
+ *
33
+ * @throws a {@link ErrorCode.FETCH_NETWORK} error if {@link GlobalFetch#fetch} can't
34
+ * connect to the network.
35
+ * @throws a {@link ErrorCode.FETCH_PARSE} error if {@link Response#json} can't parse the
36
+ * fetch response.
37
+ * @throws a {@link ErrorCode.FETCH_STATUS} error if the service returns an HTTP error status.
38
+ */
39
+ fetch(request: FetchRequest): Promise<FetchResponse>;
40
+ }
@@ -1,49 +1,49 @@
1
- /**
2
- * @license
3
- * Copyright 2019 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 { RemoteConfigAbortSignal, RemoteConfigFetchClient, FetchResponse, FetchRequest } from './remote_config_fetch_client';
18
- import { ThrottleMetadata, Storage } from '../storage/storage';
19
- /**
20
- * Supports waiting on a backoff by:
21
- *
22
- * <ul>
23
- * <li>Promisifying setTimeout, so we can set a timeout in our Promise chain</li>
24
- * <li>Listening on a signal bus for abort events, just like the Fetch API</li>
25
- * <li>Failing in the same way the Fetch API fails, so timing out a live request and a throttled
26
- * request appear the same.</li>
27
- * </ul>
28
- *
29
- * <p>Visible for testing.
30
- */
31
- export declare function setAbortableTimeout(signal: RemoteConfigAbortSignal, throttleEndTimeMillis: number): Promise<void>;
32
- /**
33
- * Decorates a Client with retry logic.
34
- *
35
- * <p>Comparable to CachingClient, but uses backoff logic instead of cache max age and doesn't cache
36
- * responses (because the SDK has no use for error responses).
37
- */
38
- export declare class RetryingClient implements RemoteConfigFetchClient {
39
- private readonly client;
40
- private readonly storage;
41
- constructor(client: RemoteConfigFetchClient, storage: Storage);
42
- fetch(request: FetchRequest): Promise<FetchResponse>;
43
- /**
44
- * A recursive helper for attempting a fetch request repeatedly.
45
- *
46
- * @throws any non-retriable errors.
47
- */
48
- attemptFetch(request: FetchRequest, { throttleEndTimeMillis, backoffCount }: ThrottleMetadata): Promise<FetchResponse>;
49
- }
1
+ /**
2
+ * @license
3
+ * Copyright 2019 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 { RemoteConfigAbortSignal, RemoteConfigFetchClient, FetchResponse, FetchRequest } from './remote_config_fetch_client';
18
+ import { ThrottleMetadata, Storage } from '../storage/storage';
19
+ /**
20
+ * Supports waiting on a backoff by:
21
+ *
22
+ * <ul>
23
+ * <li>Promisifying setTimeout, so we can set a timeout in our Promise chain</li>
24
+ * <li>Listening on a signal bus for abort events, just like the Fetch API</li>
25
+ * <li>Failing in the same way the Fetch API fails, so timing out a live request and a throttled
26
+ * request appear the same.</li>
27
+ * </ul>
28
+ *
29
+ * <p>Visible for testing.
30
+ */
31
+ export declare function setAbortableTimeout(signal: RemoteConfigAbortSignal, throttleEndTimeMillis: number): Promise<void>;
32
+ /**
33
+ * Decorates a Client with retry logic.
34
+ *
35
+ * <p>Comparable to CachingClient, but uses backoff logic instead of cache max age and doesn't cache
36
+ * responses (because the SDK has no use for error responses).
37
+ */
38
+ export declare class RetryingClient implements RemoteConfigFetchClient {
39
+ private readonly client;
40
+ private readonly storage;
41
+ constructor(client: RemoteConfigFetchClient, storage: Storage);
42
+ fetch(request: FetchRequest): Promise<FetchResponse>;
43
+ /**
44
+ * A recursive helper for attempting a fetch request repeatedly.
45
+ *
46
+ * @throws any non-retriable errors.
47
+ */
48
+ attemptFetch(request: FetchRequest, { throttleEndTimeMillis, backoffCount }: ThrottleMetadata): Promise<FetchResponse>;
49
+ }
@@ -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
- export declare const RC_COMPONENT_NAME = "remote-config";
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 RC_COMPONENT_NAME = "remote-config";
@@ -1,62 +1,62 @@
1
- /**
2
- * @license
3
- * Copyright 2019 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 ErrorCode {
19
- REGISTRATION_WINDOW = "registration-window",
20
- REGISTRATION_PROJECT_ID = "registration-project-id",
21
- REGISTRATION_API_KEY = "registration-api-key",
22
- REGISTRATION_APP_ID = "registration-app-id",
23
- STORAGE_OPEN = "storage-open",
24
- STORAGE_GET = "storage-get",
25
- STORAGE_SET = "storage-set",
26
- STORAGE_DELETE = "storage-delete",
27
- FETCH_NETWORK = "fetch-client-network",
28
- FETCH_TIMEOUT = "fetch-timeout",
29
- FETCH_THROTTLE = "fetch-throttle",
30
- FETCH_PARSE = "fetch-client-parse",
31
- FETCH_STATUS = "fetch-status",
32
- INDEXED_DB_UNAVAILABLE = "indexed-db-unavailable"
33
- }
34
- interface ErrorParams {
35
- [ErrorCode.STORAGE_OPEN]: {
36
- originalErrorMessage: string | undefined;
37
- };
38
- [ErrorCode.STORAGE_GET]: {
39
- originalErrorMessage: string | undefined;
40
- };
41
- [ErrorCode.STORAGE_SET]: {
42
- originalErrorMessage: string | undefined;
43
- };
44
- [ErrorCode.STORAGE_DELETE]: {
45
- originalErrorMessage: string | undefined;
46
- };
47
- [ErrorCode.FETCH_NETWORK]: {
48
- originalErrorMessage: string;
49
- };
50
- [ErrorCode.FETCH_THROTTLE]: {
51
- throttleEndTimeMillis: number;
52
- };
53
- [ErrorCode.FETCH_PARSE]: {
54
- originalErrorMessage: string;
55
- };
56
- [ErrorCode.FETCH_STATUS]: {
57
- httpStatus: number;
58
- };
59
- }
60
- export declare const ERROR_FACTORY: ErrorFactory<ErrorCode, ErrorParams>;
61
- export declare function hasErrorCode(e: Error, errorCode: ErrorCode): boolean;
62
- export {};
1
+ /**
2
+ * @license
3
+ * Copyright 2019 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 ErrorCode {
19
+ REGISTRATION_WINDOW = "registration-window",
20
+ REGISTRATION_PROJECT_ID = "registration-project-id",
21
+ REGISTRATION_API_KEY = "registration-api-key",
22
+ REGISTRATION_APP_ID = "registration-app-id",
23
+ STORAGE_OPEN = "storage-open",
24
+ STORAGE_GET = "storage-get",
25
+ STORAGE_SET = "storage-set",
26
+ STORAGE_DELETE = "storage-delete",
27
+ FETCH_NETWORK = "fetch-client-network",
28
+ FETCH_TIMEOUT = "fetch-timeout",
29
+ FETCH_THROTTLE = "fetch-throttle",
30
+ FETCH_PARSE = "fetch-client-parse",
31
+ FETCH_STATUS = "fetch-status",
32
+ INDEXED_DB_UNAVAILABLE = "indexed-db-unavailable"
33
+ }
34
+ interface ErrorParams {
35
+ [ErrorCode.STORAGE_OPEN]: {
36
+ originalErrorMessage: string | undefined;
37
+ };
38
+ [ErrorCode.STORAGE_GET]: {
39
+ originalErrorMessage: string | undefined;
40
+ };
41
+ [ErrorCode.STORAGE_SET]: {
42
+ originalErrorMessage: string | undefined;
43
+ };
44
+ [ErrorCode.STORAGE_DELETE]: {
45
+ originalErrorMessage: string | undefined;
46
+ };
47
+ [ErrorCode.FETCH_NETWORK]: {
48
+ originalErrorMessage: string;
49
+ };
50
+ [ErrorCode.FETCH_THROTTLE]: {
51
+ throttleEndTimeMillis: number;
52
+ };
53
+ [ErrorCode.FETCH_PARSE]: {
54
+ originalErrorMessage: string;
55
+ };
56
+ [ErrorCode.FETCH_STATUS]: {
57
+ httpStatus: number;
58
+ };
59
+ }
60
+ export declare const ERROR_FACTORY: ErrorFactory<ErrorCode, ErrorParams>;
61
+ export declare function hasErrorCode(e: Error, errorCode: ErrorCode): boolean;
62
+ export {};
@@ -1,14 +1,14 @@
1
- /**
2
- * The Firebase Remote Config Web SDK.
3
- * This SDK does not work in a Node.js environment.
4
- *
5
- * @packageDocumentation
6
- */
7
- declare global {
8
- interface Window {
9
- FIREBASE_REMOTE_CONFIG_URL_BASE: string;
10
- }
11
- }
12
- export * from './api';
13
- export * from './api2';
14
- export * from './public_types';
1
+ /**
2
+ * The Firebase Remote Config Web SDK.
3
+ * This SDK does not work in a Node.js environment.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ declare global {
8
+ interface Window {
9
+ FIREBASE_REMOTE_CONFIG_URL_BASE: string;
10
+ }
11
+ }
12
+ export * from './api';
13
+ export * from './api2';
14
+ export * from './public_types';
@@ -1,26 +1,26 @@
1
- /**
2
- * @license
3
- * Copyright 2019 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
- /**
18
- * Attempts to get the most accurate browser language setting.
19
- *
20
- * <p>Adapted from getUserLanguage in packages/auth/src/utils.js for TypeScript.
21
- *
22
- * <p>Defers default language specification to server logic for consistency.
23
- *
24
- * @param navigatorLanguage Enables tests to override read-only {@link NavigatorLanguage}.
25
- */
26
- export declare function getUserLanguage(navigatorLanguage?: NavigatorLanguage): string;
1
+ /**
2
+ * @license
3
+ * Copyright 2019 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
+ /**
18
+ * Attempts to get the most accurate browser language setting.
19
+ *
20
+ * <p>Adapted from getUserLanguage in packages/auth/src/utils.js for TypeScript.
21
+ *
22
+ * <p>Defers default language specification to server logic for consistency.
23
+ *
24
+ * @param navigatorLanguage Enables tests to override read-only {@link NavigatorLanguage}.
25
+ */
26
+ export declare function getUserLanguage(navigatorLanguage?: NavigatorLanguage): string;