@firebase/remote-config-compat 0.2.10-canary.a97ac88db → 0.2.10-canary.e577a408c
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/esm/index.esm2017.js +107 -107
- package/dist/esm/src/index.d.ts +27 -27
- package/dist/esm/src/remoteConfig.d.ts +52 -52
- package/dist/esm/src/remoteConfig.test.d.ts +17 -17
- package/dist/esm/test/setup.d.ts +17 -17
- package/dist/esm/test/util.d.ts +20 -20
- package/dist/index.cjs.js +107 -107
- package/dist/src/index.d.ts +136 -38
- package/dist/src/remoteConfig.d.ts +52 -52
- package/dist/src/remoteConfig.test.d.ts +17 -17
- package/dist/test/setup.d.ts +17 -17
- package/dist/test/util.d.ts +20 -20
- package/package.json +9 -9
|
@@ -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-canary.
|
|
84
|
+
const version = "0.2.10-canary.e577a408c";
|
|
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
|
package/dist/esm/src/index.d.ts
CHANGED
|
@@ -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';
|
package/dist/esm/test/setup.d.ts
CHANGED
|
@@ -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 {};
|
package/dist/esm/test/util.d.ts
CHANGED
|
@@ -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-canary.
|
|
90
|
+
const version = "0.2.10-canary.e577a408c";
|
|
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
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,43 +1,141 @@
|
|
|
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";
|
|
31
31
|
declare module "@firebase/remote-config" {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
function
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
/**
|
|
33
|
+
* Makes the last fetched config available to the getters.
|
|
34
|
+
* @param remoteConfig - The {@link RemoteConfig} instance.
|
|
35
|
+
* @returns A `Promise` which resolves to true if the current call activated the fetched configs.
|
|
36
|
+
* If the fetched configs were already activated, the `Promise` will resolve to false.
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export declare function activate(remoteConfig: RemoteConfigCompat): Promise<boolean>;
|
|
41
|
+
/**
|
|
42
|
+
* Ensures the last activated config are available to the getters.
|
|
43
|
+
* @param remoteConfig - The {@link RemoteConfig} instance.
|
|
44
|
+
*
|
|
45
|
+
* @returns A `Promise` that resolves when the last activated config is available to the getters.
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
export declare function ensureInitialized(remoteConfig: RemoteConfigCompat): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* Performs fetch and activate operations, as a convenience.
|
|
52
|
+
*
|
|
53
|
+
* @param remoteConfig - The {@link RemoteConfig} instance.
|
|
54
|
+
*
|
|
55
|
+
* @returns A `Promise` which resolves to true if the current call activated the fetched configs.
|
|
56
|
+
* If the fetched configs were already activated, the `Promise` will resolve to false.
|
|
57
|
+
*
|
|
58
|
+
* @public
|
|
59
|
+
*/
|
|
60
|
+
export declare function fetchAndActivate(remoteConfig: RemoteConfigCompat): Promise<boolean>;
|
|
61
|
+
/**
|
|
62
|
+
* Fetches and caches configuration from the Remote Config service.
|
|
63
|
+
* @param remoteConfig - The {@link RemoteConfig} instance.
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
export declare function fetchConfig(remoteConfig: RemoteConfigCompat): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Gets all config.
|
|
69
|
+
*
|
|
70
|
+
* @param remoteConfig - The {@link RemoteConfig} instance.
|
|
71
|
+
* @returns All config.
|
|
72
|
+
*
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
export declare function getAll(remoteConfig: RemoteConfigCompat): Record<string, Value>;
|
|
76
|
+
/**
|
|
77
|
+
* Gets the value for the given key as a boolean.
|
|
78
|
+
*
|
|
79
|
+
* Convenience method for calling <code>remoteConfig.getValue(key).asBoolean()</code>.
|
|
80
|
+
*
|
|
81
|
+
* @param remoteConfig - The {@link RemoteConfig} instance.
|
|
82
|
+
* @param key - The name of the parameter.
|
|
83
|
+
*
|
|
84
|
+
* @returns The value for the given key as a boolean.
|
|
85
|
+
* @public
|
|
86
|
+
*/
|
|
87
|
+
export declare function getBoolean(remoteConfig: RemoteConfigCompat, key: string): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Gets the value for the given key as a number.
|
|
90
|
+
*
|
|
91
|
+
* Convenience method for calling <code>remoteConfig.getValue(key).asNumber()</code>.
|
|
92
|
+
*
|
|
93
|
+
* @param remoteConfig - The {@link RemoteConfig} instance.
|
|
94
|
+
* @param key - The name of the parameter.
|
|
95
|
+
*
|
|
96
|
+
* @returns The value for the given key as a number.
|
|
97
|
+
*
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
|
+
export declare function getNumber(remoteConfig: RemoteConfigCompat, key: string): number;
|
|
101
|
+
/**
|
|
102
|
+
*
|
|
103
|
+
* @param app - The {@link @firebase/app#FirebaseApp} instance.
|
|
104
|
+
* @returns A {@link RemoteConfig} instance.
|
|
105
|
+
*
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
108
|
+
export declare function getRemoteConfig(app?: FirebaseAppCompat): RemoteConfig;
|
|
109
|
+
/**
|
|
110
|
+
* Gets the value for the given key as a string.
|
|
111
|
+
* Convenience method for calling <code>remoteConfig.getValue(key).asString()</code>.
|
|
112
|
+
*
|
|
113
|
+
* @param remoteConfig - The {@link RemoteConfig} instance.
|
|
114
|
+
* @param key - The name of the parameter.
|
|
115
|
+
*
|
|
116
|
+
* @returns The value for the given key as a string.
|
|
117
|
+
*
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
export declare function getString(remoteConfig: RemoteConfigCompat, key: string): string;
|
|
121
|
+
/**
|
|
122
|
+
* Gets the {@link Value} for the given key.
|
|
123
|
+
*
|
|
124
|
+
* @param remoteConfig - The {@link RemoteConfig} instance.
|
|
125
|
+
* @param key - The name of the parameter.
|
|
126
|
+
*
|
|
127
|
+
* @returns The value for the given key.
|
|
128
|
+
*
|
|
129
|
+
* @public
|
|
130
|
+
*/
|
|
131
|
+
export declare function getValue(remoteConfig: RemoteConfigCompat, key: string): Value;
|
|
132
|
+
/**
|
|
133
|
+
* Defines the log level to use.
|
|
134
|
+
*
|
|
135
|
+
* @param remoteConfig - The {@link RemoteConfig} instance.
|
|
136
|
+
* @param logLevel - The log level to set.
|
|
137
|
+
*
|
|
138
|
+
* @public
|
|
139
|
+
*/
|
|
140
|
+
export declare function setLogLevel(remoteConfig: RemoteConfigCompat, logLevel: LogLevel): void;
|
|
43
141
|
}
|
|
@@ -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';
|
package/dist/test/setup.d.ts
CHANGED
|
@@ -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 {};
|
package/dist/test/util.d.ts
CHANGED
|
@@ -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-canary.
|
|
3
|
+
"version": "0.2.10-canary.e577a408c",
|
|
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",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
},
|
|
35
35
|
"license": "Apache-2.0",
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@firebase/app-compat": "0.2.
|
|
37
|
+
"@firebase/app-compat": "0.2.45-canary.e577a408c"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@firebase/remote-config": "0.4.10-canary.
|
|
41
|
-
"@firebase/remote-config-types": "0.3.2-canary.
|
|
42
|
-
"@firebase/util": "1.10.1-canary.
|
|
43
|
-
"@firebase/logger": "0.4.3-canary.
|
|
44
|
-
"@firebase/component": "0.6.10-canary.
|
|
40
|
+
"@firebase/remote-config": "0.4.10-canary.e577a408c",
|
|
41
|
+
"@firebase/remote-config-types": "0.3.2-canary.e577a408c",
|
|
42
|
+
"@firebase/util": "1.10.1-canary.e577a408c",
|
|
43
|
+
"@firebase/logger": "0.4.3-canary.e577a408c",
|
|
44
|
+
"@firebase/component": "0.6.10-canary.e577a408c",
|
|
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": "
|
|
53
|
-
"@firebase/app-compat": "0.2.
|
|
52
|
+
"typescript": "5.5.4",
|
|
53
|
+
"@firebase/app-compat": "0.2.45-canary.e577a408c"
|
|
54
54
|
},
|
|
55
55
|
"repository": {
|
|
56
56
|
"directory": "packages/remote-config-compat",
|