@firebase/remote-config-compat 0.2.10 → 0.2.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.
@@ -2,116 +2,116 @@ import firebase from '@firebase/app-compat';
2
2
  import { Component } from '@firebase/component';
3
3
  import { activate, ensureInitialized, fetchConfig, fetchAndActivate, getAll, getBoolean, getNumber, getString, getValue, setLogLevel, isSupported } from '@firebase/remote-config';
4
4
 
5
- /**
6
- * @license
7
- * Copyright 2020 Google LLC
8
- *
9
- * Licensed under the Apache License, Version 2.0 (the "License");
10
- * you may not use this file except in compliance with the License.
11
- * You may obtain a copy of the License at
12
- *
13
- * http://www.apache.org/licenses/LICENSE-2.0
14
- *
15
- * Unless required by applicable law or agreed to in writing, software
16
- * distributed under the License is distributed on an "AS IS" BASIS,
17
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
- * See the License for the specific language governing permissions and
19
- * limitations under the License.
20
- */
21
- class RemoteConfigCompatImpl {
22
- constructor(app, _delegate) {
23
- this.app = app;
24
- this._delegate = _delegate;
25
- }
26
- get defaultConfig() {
27
- return this._delegate.defaultConfig;
28
- }
29
- set defaultConfig(value) {
30
- this._delegate.defaultConfig = value;
31
- }
32
- get fetchTimeMillis() {
33
- return this._delegate.fetchTimeMillis;
34
- }
35
- get lastFetchStatus() {
36
- return this._delegate.lastFetchStatus;
37
- }
38
- get settings() {
39
- return this._delegate.settings;
40
- }
41
- set settings(value) {
42
- this._delegate.settings = value;
43
- }
44
- activate() {
45
- return activate(this._delegate);
46
- }
47
- ensureInitialized() {
48
- return ensureInitialized(this._delegate);
49
- }
50
- /**
51
- * @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than
52
- * {@link Settings.fetchTimeoutInSeconds} or
53
- * {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.
54
- */
55
- fetch() {
56
- return fetchConfig(this._delegate);
57
- }
58
- fetchAndActivate() {
59
- return fetchAndActivate(this._delegate);
60
- }
61
- getAll() {
62
- return getAll(this._delegate);
63
- }
64
- getBoolean(key) {
65
- return getBoolean(this._delegate, key);
66
- }
67
- getNumber(key) {
68
- return getNumber(this._delegate, key);
69
- }
70
- getString(key) {
71
- return getString(this._delegate, key);
72
- }
73
- getValue(key) {
74
- return getValue(this._delegate, key);
75
- }
76
- // Based on packages/firestore/src/util/log.ts but not static because we need per-instance levels
77
- // to differentiate 2p and 3p use-cases.
78
- setLogLevel(logLevel) {
79
- setLogLevel(this._delegate, logLevel);
80
- }
5
+ /**
6
+ * @license
7
+ * Copyright 2020 Google LLC
8
+ *
9
+ * Licensed under the Apache License, Version 2.0 (the "License");
10
+ * you may not use this file except in compliance with the License.
11
+ * You may obtain a copy of the License at
12
+ *
13
+ * http://www.apache.org/licenses/LICENSE-2.0
14
+ *
15
+ * Unless required by applicable law or agreed to in writing, software
16
+ * distributed under the License is distributed on an "AS IS" BASIS,
17
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18
+ * See the License for the specific language governing permissions and
19
+ * limitations under the License.
20
+ */
21
+ class RemoteConfigCompatImpl {
22
+ constructor(app, _delegate) {
23
+ this.app = app;
24
+ this._delegate = _delegate;
25
+ }
26
+ get defaultConfig() {
27
+ return this._delegate.defaultConfig;
28
+ }
29
+ set defaultConfig(value) {
30
+ this._delegate.defaultConfig = value;
31
+ }
32
+ get fetchTimeMillis() {
33
+ return this._delegate.fetchTimeMillis;
34
+ }
35
+ get lastFetchStatus() {
36
+ return this._delegate.lastFetchStatus;
37
+ }
38
+ get settings() {
39
+ return this._delegate.settings;
40
+ }
41
+ set settings(value) {
42
+ this._delegate.settings = value;
43
+ }
44
+ activate() {
45
+ return activate(this._delegate);
46
+ }
47
+ ensureInitialized() {
48
+ return ensureInitialized(this._delegate);
49
+ }
50
+ /**
51
+ * @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than
52
+ * {@link Settings.fetchTimeoutInSeconds} or
53
+ * {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.
54
+ */
55
+ fetch() {
56
+ return fetchConfig(this._delegate);
57
+ }
58
+ fetchAndActivate() {
59
+ return fetchAndActivate(this._delegate);
60
+ }
61
+ getAll() {
62
+ return getAll(this._delegate);
63
+ }
64
+ getBoolean(key) {
65
+ return getBoolean(this._delegate, key);
66
+ }
67
+ getNumber(key) {
68
+ return getNumber(this._delegate, key);
69
+ }
70
+ getString(key) {
71
+ return getString(this._delegate, key);
72
+ }
73
+ getValue(key) {
74
+ return getValue(this._delegate, key);
75
+ }
76
+ // Based on packages/firestore/src/util/log.ts but not static because we need per-instance levels
77
+ // to differentiate 2p and 3p use-cases.
78
+ setLogLevel(logLevel) {
79
+ setLogLevel(this._delegate, logLevel);
80
+ }
81
81
  }
82
82
 
83
83
  const name = "@firebase/remote-config-compat";
84
- const version = "0.2.10";
84
+ const version = "0.2.11";
85
85
 
86
- /**
87
- * @license
88
- * Copyright 2020 Google LLC
89
- *
90
- * Licensed under the Apache License, Version 2.0 (the "License");
91
- * you may not use this file except in compliance with the License.
92
- * You may obtain a copy of the License at
93
- *
94
- * http://www.apache.org/licenses/LICENSE-2.0
95
- *
96
- * Unless required by applicable law or agreed to in writing, software
97
- * distributed under the License is distributed on an "AS IS" BASIS,
98
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
99
- * See the License for the specific language governing permissions and
100
- * limitations under the License.
101
- */
102
- function registerRemoteConfigCompat(firebaseInstance) {
103
- firebaseInstance.INTERNAL.registerComponent(new Component('remoteConfig-compat', remoteConfigFactory, "PUBLIC" /* ComponentType.PUBLIC */)
104
- .setMultipleInstances(true)
105
- .setServiceProps({ isSupported }));
106
- firebaseInstance.registerVersion(name, version);
107
- }
108
- function remoteConfigFactory(container, { instanceIdentifier: namespace }) {
109
- const app = container.getProvider('app-compat').getImmediate();
110
- // The following call will always succeed because rc `import {...} from '@firebase/remote-config'`
111
- const remoteConfig = container.getProvider('remote-config').getImmediate({
112
- identifier: namespace
113
- });
114
- return new RemoteConfigCompatImpl(app, remoteConfig);
115
- }
86
+ /**
87
+ * @license
88
+ * Copyright 2020 Google LLC
89
+ *
90
+ * Licensed under the Apache License, Version 2.0 (the "License");
91
+ * you may not use this file except in compliance with the License.
92
+ * You may obtain a copy of the License at
93
+ *
94
+ * http://www.apache.org/licenses/LICENSE-2.0
95
+ *
96
+ * Unless required by applicable law or agreed to in writing, software
97
+ * distributed under the License is distributed on an "AS IS" BASIS,
98
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
99
+ * See the License for the specific language governing permissions and
100
+ * limitations under the License.
101
+ */
102
+ function registerRemoteConfigCompat(firebaseInstance) {
103
+ firebaseInstance.INTERNAL.registerComponent(new Component('remoteConfig-compat', remoteConfigFactory, "PUBLIC" /* ComponentType.PUBLIC */)
104
+ .setMultipleInstances(true)
105
+ .setServiceProps({ isSupported }));
106
+ firebaseInstance.registerVersion(name, version);
107
+ }
108
+ function remoteConfigFactory(container, { instanceIdentifier: namespace }) {
109
+ const app = container.getProvider('app-compat').getImmediate();
110
+ // The following call will always succeed because rc `import {...} from '@firebase/remote-config'`
111
+ const remoteConfig = container.getProvider('remote-config').getImmediate({
112
+ identifier: namespace
113
+ });
114
+ return new RemoteConfigCompatImpl(app, remoteConfig);
115
+ }
116
116
  registerRemoteConfigCompat(firebase);
117
117
  //# sourceMappingURL=index.esm2017.js.map
@@ -1,27 +1,27 @@
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 { RemoteConfig as RemoteConfigCompat } from '@firebase/remote-config-types';
18
- declare module '@firebase/app-compat' {
19
- interface FirebaseNamespace {
20
- remoteConfig: {
21
- (app?: FirebaseApp): RemoteConfigCompat;
22
- };
23
- }
24
- interface FirebaseApp {
25
- remoteConfig(): RemoteConfigCompat;
26
- }
27
- }
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 { RemoteConfig as RemoteConfigCompat } from '@firebase/remote-config-types';
18
+ declare module '@firebase/app-compat' {
19
+ interface FirebaseNamespace {
20
+ remoteConfig: {
21
+ (app?: FirebaseApp): RemoteConfigCompat;
22
+ };
23
+ }
24
+ interface FirebaseApp {
25
+ remoteConfig(): RemoteConfigCompat;
26
+ }
27
+ }
@@ -1,52 +1,52 @@
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, _FirebaseService } from '@firebase/app-compat';
18
- import { Value as ValueCompat, FetchStatus as FetchSTatusCompat, Settings as SettingsCompat, LogLevel as RemoteConfigLogLevel, RemoteConfig as RemoteConfigCompat } from '@firebase/remote-config-types';
19
- import { RemoteConfig, isSupported } from '@firebase/remote-config';
20
- export { isSupported };
21
- export declare class RemoteConfigCompatImpl implements RemoteConfigCompat, _FirebaseService {
22
- app: FirebaseApp;
23
- readonly _delegate: RemoteConfig;
24
- constructor(app: FirebaseApp, _delegate: RemoteConfig);
25
- get defaultConfig(): {
26
- [key: string]: string | number | boolean;
27
- };
28
- set defaultConfig(value: {
29
- [key: string]: string | number | boolean;
30
- });
31
- get fetchTimeMillis(): number;
32
- get lastFetchStatus(): FetchSTatusCompat;
33
- get settings(): SettingsCompat;
34
- set settings(value: SettingsCompat);
35
- activate(): Promise<boolean>;
36
- ensureInitialized(): Promise<void>;
37
- /**
38
- * @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than
39
- * {@link Settings.fetchTimeoutInSeconds} or
40
- * {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.
41
- */
42
- fetch(): Promise<void>;
43
- fetchAndActivate(): Promise<boolean>;
44
- getAll(): {
45
- [key: string]: ValueCompat;
46
- };
47
- getBoolean(key: string): boolean;
48
- getNumber(key: string): number;
49
- getString(key: string): string;
50
- getValue(key: string): ValueCompat;
51
- setLogLevel(logLevel: RemoteConfigLogLevel): void;
52
- }
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, _FirebaseService } from '@firebase/app-compat';
18
+ import { Value as ValueCompat, FetchStatus as FetchSTatusCompat, Settings as SettingsCompat, LogLevel as RemoteConfigLogLevel, RemoteConfig as RemoteConfigCompat } from '@firebase/remote-config-types';
19
+ import { RemoteConfig, isSupported } from '@firebase/remote-config';
20
+ export { isSupported };
21
+ export declare class RemoteConfigCompatImpl implements RemoteConfigCompat, _FirebaseService {
22
+ app: FirebaseApp;
23
+ readonly _delegate: RemoteConfig;
24
+ constructor(app: FirebaseApp, _delegate: RemoteConfig);
25
+ get defaultConfig(): {
26
+ [key: string]: string | number | boolean;
27
+ };
28
+ set defaultConfig(value: {
29
+ [key: string]: string | number | boolean;
30
+ });
31
+ get fetchTimeMillis(): number;
32
+ get lastFetchStatus(): FetchSTatusCompat;
33
+ get settings(): SettingsCompat;
34
+ set settings(value: SettingsCompat);
35
+ activate(): Promise<boolean>;
36
+ ensureInitialized(): Promise<void>;
37
+ /**
38
+ * @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than
39
+ * {@link Settings.fetchTimeoutInSeconds} or
40
+ * {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.
41
+ */
42
+ fetch(): Promise<void>;
43
+ fetchAndActivate(): Promise<boolean>;
44
+ getAll(): {
45
+ [key: string]: ValueCompat;
46
+ };
47
+ getBoolean(key: string): boolean;
48
+ getNumber(key: string): number;
49
+ getString(key: string): string;
50
+ getValue(key: string): ValueCompat;
51
+ setLogLevel(logLevel: RemoteConfigLogLevel): void;
52
+ }
@@ -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,17 +1,17 @@
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
- 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
+ export {};
@@ -1,20 +1,20 @@
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 { FirebaseApp } from '@firebase/app-compat';
18
- import { RemoteConfig } from '@firebase/remote-config';
19
- export declare function getFakeApp(): FirebaseApp;
20
- export declare function getFakeModularRemoteConfig(): RemoteConfig;
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 { FirebaseApp } from '@firebase/app-compat';
18
+ import { RemoteConfig } from '@firebase/remote-config';
19
+ export declare function getFakeApp(): FirebaseApp;
20
+ export declare function getFakeModularRemoteConfig(): RemoteConfig;
package/dist/index.cjs.js CHANGED
@@ -8,116 +8,116 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
8
8
 
9
9
  var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
10
10
 
11
- /**
12
- * @license
13
- * Copyright 2020 Google LLC
14
- *
15
- * Licensed under the Apache License, Version 2.0 (the "License");
16
- * you may not use this file except in compliance with the License.
17
- * You may obtain a copy of the License at
18
- *
19
- * http://www.apache.org/licenses/LICENSE-2.0
20
- *
21
- * Unless required by applicable law or agreed to in writing, software
22
- * distributed under the License is distributed on an "AS IS" BASIS,
23
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
- * See the License for the specific language governing permissions and
25
- * limitations under the License.
26
- */
27
- class RemoteConfigCompatImpl {
28
- constructor(app, _delegate) {
29
- this.app = app;
30
- this._delegate = _delegate;
31
- }
32
- get defaultConfig() {
33
- return this._delegate.defaultConfig;
34
- }
35
- set defaultConfig(value) {
36
- this._delegate.defaultConfig = value;
37
- }
38
- get fetchTimeMillis() {
39
- return this._delegate.fetchTimeMillis;
40
- }
41
- get lastFetchStatus() {
42
- return this._delegate.lastFetchStatus;
43
- }
44
- get settings() {
45
- return this._delegate.settings;
46
- }
47
- set settings(value) {
48
- this._delegate.settings = value;
49
- }
50
- activate() {
51
- return remoteConfig.activate(this._delegate);
52
- }
53
- ensureInitialized() {
54
- return remoteConfig.ensureInitialized(this._delegate);
55
- }
56
- /**
57
- * @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than
58
- * {@link Settings.fetchTimeoutInSeconds} or
59
- * {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.
60
- */
61
- fetch() {
62
- return remoteConfig.fetchConfig(this._delegate);
63
- }
64
- fetchAndActivate() {
65
- return remoteConfig.fetchAndActivate(this._delegate);
66
- }
67
- getAll() {
68
- return remoteConfig.getAll(this._delegate);
69
- }
70
- getBoolean(key) {
71
- return remoteConfig.getBoolean(this._delegate, key);
72
- }
73
- getNumber(key) {
74
- return remoteConfig.getNumber(this._delegate, key);
75
- }
76
- getString(key) {
77
- return remoteConfig.getString(this._delegate, key);
78
- }
79
- getValue(key) {
80
- return remoteConfig.getValue(this._delegate, key);
81
- }
82
- // Based on packages/firestore/src/util/log.ts but not static because we need per-instance levels
83
- // to differentiate 2p and 3p use-cases.
84
- setLogLevel(logLevel) {
85
- remoteConfig.setLogLevel(this._delegate, logLevel);
86
- }
11
+ /**
12
+ * @license
13
+ * Copyright 2020 Google LLC
14
+ *
15
+ * Licensed under the Apache License, Version 2.0 (the "License");
16
+ * you may not use this file except in compliance with the License.
17
+ * You may obtain a copy of the License at
18
+ *
19
+ * http://www.apache.org/licenses/LICENSE-2.0
20
+ *
21
+ * Unless required by applicable law or agreed to in writing, software
22
+ * distributed under the License is distributed on an "AS IS" BASIS,
23
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
+ * See the License for the specific language governing permissions and
25
+ * limitations under the License.
26
+ */
27
+ class RemoteConfigCompatImpl {
28
+ constructor(app, _delegate) {
29
+ this.app = app;
30
+ this._delegate = _delegate;
31
+ }
32
+ get defaultConfig() {
33
+ return this._delegate.defaultConfig;
34
+ }
35
+ set defaultConfig(value) {
36
+ this._delegate.defaultConfig = value;
37
+ }
38
+ get fetchTimeMillis() {
39
+ return this._delegate.fetchTimeMillis;
40
+ }
41
+ get lastFetchStatus() {
42
+ return this._delegate.lastFetchStatus;
43
+ }
44
+ get settings() {
45
+ return this._delegate.settings;
46
+ }
47
+ set settings(value) {
48
+ this._delegate.settings = value;
49
+ }
50
+ activate() {
51
+ return remoteConfig.activate(this._delegate);
52
+ }
53
+ ensureInitialized() {
54
+ return remoteConfig.ensureInitialized(this._delegate);
55
+ }
56
+ /**
57
+ * @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than
58
+ * {@link Settings.fetchTimeoutInSeconds} or
59
+ * {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.
60
+ */
61
+ fetch() {
62
+ return remoteConfig.fetchConfig(this._delegate);
63
+ }
64
+ fetchAndActivate() {
65
+ return remoteConfig.fetchAndActivate(this._delegate);
66
+ }
67
+ getAll() {
68
+ return remoteConfig.getAll(this._delegate);
69
+ }
70
+ getBoolean(key) {
71
+ return remoteConfig.getBoolean(this._delegate, key);
72
+ }
73
+ getNumber(key) {
74
+ return remoteConfig.getNumber(this._delegate, key);
75
+ }
76
+ getString(key) {
77
+ return remoteConfig.getString(this._delegate, key);
78
+ }
79
+ getValue(key) {
80
+ return remoteConfig.getValue(this._delegate, key);
81
+ }
82
+ // Based on packages/firestore/src/util/log.ts but not static because we need per-instance levels
83
+ // to differentiate 2p and 3p use-cases.
84
+ setLogLevel(logLevel) {
85
+ remoteConfig.setLogLevel(this._delegate, logLevel);
86
+ }
87
87
  }
88
88
 
89
89
  const name = "@firebase/remote-config-compat";
90
- const version = "0.2.10";
90
+ const version = "0.2.11";
91
91
 
92
- /**
93
- * @license
94
- * Copyright 2020 Google LLC
95
- *
96
- * Licensed under the Apache License, Version 2.0 (the "License");
97
- * you may not use this file except in compliance with the License.
98
- * You may obtain a copy of the License at
99
- *
100
- * http://www.apache.org/licenses/LICENSE-2.0
101
- *
102
- * Unless required by applicable law or agreed to in writing, software
103
- * distributed under the License is distributed on an "AS IS" BASIS,
104
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
105
- * See the License for the specific language governing permissions and
106
- * limitations under the License.
107
- */
108
- function registerRemoteConfigCompat(firebaseInstance) {
109
- firebaseInstance.INTERNAL.registerComponent(new component.Component('remoteConfig-compat', remoteConfigFactory, "PUBLIC" /* ComponentType.PUBLIC */)
110
- .setMultipleInstances(true)
111
- .setServiceProps({ isSupported: remoteConfig.isSupported }));
112
- firebaseInstance.registerVersion(name, version);
113
- }
114
- function remoteConfigFactory(container, { instanceIdentifier: namespace }) {
115
- const app = container.getProvider('app-compat').getImmediate();
116
- // The following call will always succeed because rc `import {...} from '@firebase/remote-config'`
117
- const remoteConfig = container.getProvider('remote-config').getImmediate({
118
- identifier: namespace
119
- });
120
- return new RemoteConfigCompatImpl(app, remoteConfig);
121
- }
92
+ /**
93
+ * @license
94
+ * Copyright 2020 Google LLC
95
+ *
96
+ * Licensed under the Apache License, Version 2.0 (the "License");
97
+ * you may not use this file except in compliance with the License.
98
+ * You may obtain a copy of the License at
99
+ *
100
+ * http://www.apache.org/licenses/LICENSE-2.0
101
+ *
102
+ * Unless required by applicable law or agreed to in writing, software
103
+ * distributed under the License is distributed on an "AS IS" BASIS,
104
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
105
+ * See the License for the specific language governing permissions and
106
+ * limitations under the License.
107
+ */
108
+ function registerRemoteConfigCompat(firebaseInstance) {
109
+ firebaseInstance.INTERNAL.registerComponent(new component.Component('remoteConfig-compat', remoteConfigFactory, "PUBLIC" /* ComponentType.PUBLIC */)
110
+ .setMultipleInstances(true)
111
+ .setServiceProps({ isSupported: remoteConfig.isSupported }));
112
+ firebaseInstance.registerVersion(name, version);
113
+ }
114
+ function remoteConfigFactory(container, { instanceIdentifier: namespace }) {
115
+ const app = container.getProvider('app-compat').getImmediate();
116
+ // The following call will always succeed because rc `import {...} from '@firebase/remote-config'`
117
+ const remoteConfig = container.getProvider('remote-config').getImmediate({
118
+ identifier: namespace
119
+ });
120
+ return new RemoteConfigCompatImpl(app, remoteConfig);
121
+ }
122
122
  registerRemoteConfigCompat(firebase__default["default"]);
123
123
  //# sourceMappingURL=index.cjs.js.map
@@ -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 { RemoteConfig as RemoteConfigCompat } from '@firebase/remote-config-types';
18
- declare module '@firebase/app-compat' {
19
- interface FirebaseNamespace {
20
- remoteConfig: {
21
- (app?: FirebaseApp): RemoteConfigCompat;
22
- };
23
- }
24
- interface FirebaseApp {
25
- remoteConfig(): RemoteConfigCompat;
26
- }
27
- }
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 { RemoteConfig as RemoteConfigCompat } from '@firebase/remote-config-types';
18
+ declare module '@firebase/app-compat' {
19
+ interface FirebaseNamespace {
20
+ remoteConfig: {
21
+ (app?: FirebaseApp): RemoteConfigCompat;
22
+ };
23
+ }
24
+ interface FirebaseApp {
25
+ remoteConfig(): RemoteConfigCompat;
26
+ }
27
+ }
28
28
 
29
29
  import { FirebaseApp as FirebaseAppCompat } from "@firebase/app-compat";
30
30
  import { type Value, type RemoteConfig, type LogLevel } from "@firebase/remote-config";
@@ -1,52 +1,52 @@
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, _FirebaseService } from '@firebase/app-compat';
18
- import { Value as ValueCompat, FetchStatus as FetchSTatusCompat, Settings as SettingsCompat, LogLevel as RemoteConfigLogLevel, RemoteConfig as RemoteConfigCompat } from '@firebase/remote-config-types';
19
- import { RemoteConfig, isSupported } from '@firebase/remote-config';
20
- export { isSupported };
21
- export declare class RemoteConfigCompatImpl implements RemoteConfigCompat, _FirebaseService {
22
- app: FirebaseApp;
23
- readonly _delegate: RemoteConfig;
24
- constructor(app: FirebaseApp, _delegate: RemoteConfig);
25
- get defaultConfig(): {
26
- [key: string]: string | number | boolean;
27
- };
28
- set defaultConfig(value: {
29
- [key: string]: string | number | boolean;
30
- });
31
- get fetchTimeMillis(): number;
32
- get lastFetchStatus(): FetchSTatusCompat;
33
- get settings(): SettingsCompat;
34
- set settings(value: SettingsCompat);
35
- activate(): Promise<boolean>;
36
- ensureInitialized(): Promise<void>;
37
- /**
38
- * @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than
39
- * {@link Settings.fetchTimeoutInSeconds} or
40
- * {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.
41
- */
42
- fetch(): Promise<void>;
43
- fetchAndActivate(): Promise<boolean>;
44
- getAll(): {
45
- [key: string]: ValueCompat;
46
- };
47
- getBoolean(key: string): boolean;
48
- getNumber(key: string): number;
49
- getString(key: string): string;
50
- getValue(key: string): ValueCompat;
51
- setLogLevel(logLevel: RemoteConfigLogLevel): void;
52
- }
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, _FirebaseService } from '@firebase/app-compat';
18
+ import { Value as ValueCompat, FetchStatus as FetchSTatusCompat, Settings as SettingsCompat, LogLevel as RemoteConfigLogLevel, RemoteConfig as RemoteConfigCompat } from '@firebase/remote-config-types';
19
+ import { RemoteConfig, isSupported } from '@firebase/remote-config';
20
+ export { isSupported };
21
+ export declare class RemoteConfigCompatImpl implements RemoteConfigCompat, _FirebaseService {
22
+ app: FirebaseApp;
23
+ readonly _delegate: RemoteConfig;
24
+ constructor(app: FirebaseApp, _delegate: RemoteConfig);
25
+ get defaultConfig(): {
26
+ [key: string]: string | number | boolean;
27
+ };
28
+ set defaultConfig(value: {
29
+ [key: string]: string | number | boolean;
30
+ });
31
+ get fetchTimeMillis(): number;
32
+ get lastFetchStatus(): FetchSTatusCompat;
33
+ get settings(): SettingsCompat;
34
+ set settings(value: SettingsCompat);
35
+ activate(): Promise<boolean>;
36
+ ensureInitialized(): Promise<void>;
37
+ /**
38
+ * @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than
39
+ * {@link Settings.fetchTimeoutInSeconds} or
40
+ * {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.
41
+ */
42
+ fetch(): Promise<void>;
43
+ fetchAndActivate(): Promise<boolean>;
44
+ getAll(): {
45
+ [key: string]: ValueCompat;
46
+ };
47
+ getBoolean(key: string): boolean;
48
+ getNumber(key: string): number;
49
+ getString(key: string): string;
50
+ getValue(key: string): ValueCompat;
51
+ setLogLevel(logLevel: RemoteConfigLogLevel): void;
52
+ }
@@ -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,17 +1,17 @@
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
- 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
+ export {};
@@ -1,20 +1,20 @@
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 { FirebaseApp } from '@firebase/app-compat';
18
- import { RemoteConfig } from '@firebase/remote-config';
19
- export declare function getFakeApp(): FirebaseApp;
20
- export declare function getFakeModularRemoteConfig(): RemoteConfig;
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 { FirebaseApp } from '@firebase/app-compat';
18
+ import { RemoteConfig } from '@firebase/remote-config';
19
+ export declare function getFakeApp(): FirebaseApp;
20
+ export declare function getFakeModularRemoteConfig(): RemoteConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firebase/remote-config-compat",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "The compatibility package of Remote Config",
5
5
  "author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
6
6
  "main": "dist/index.cjs.js",
@@ -37,11 +37,11 @@
37
37
  "@firebase/app-compat": "0.x"
38
38
  },
39
39
  "dependencies": {
40
- "@firebase/remote-config": "0.4.10",
41
- "@firebase/remote-config-types": "0.3.2",
42
- "@firebase/util": "1.10.1",
43
- "@firebase/logger": "0.4.3",
44
- "@firebase/component": "0.6.10",
40
+ "@firebase/remote-config": "0.4.11",
41
+ "@firebase/remote-config-types": "0.3.3",
42
+ "@firebase/util": "1.10.2",
43
+ "@firebase/logger": "0.4.4",
44
+ "@firebase/component": "0.6.11",
45
45
  "tslib": "^2.1.0"
46
46
  },
47
47
  "devDependencies": {
@@ -49,8 +49,8 @@
49
49
  "@rollup/plugin-json": "4.1.0",
50
50
  "rollup-plugin-replace": "2.2.0",
51
51
  "rollup-plugin-typescript2": "0.31.2",
52
- "typescript": "4.7.4",
53
- "@firebase/app-compat": "0.2.44"
52
+ "typescript": "5.5.4",
53
+ "@firebase/app-compat": "0.2.46"
54
54
  },
55
55
  "repository": {
56
56
  "directory": "packages/remote-config-compat",