@depup/firebase__remote-config-compat 0.2.22-depup.0
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/README.md +31 -0
- package/changes.json +10 -0
- package/dist/esm/index.esm.js +117 -0
- package/dist/esm/index.esm.js.map +1 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/src/index.d.ts +27 -0
- package/dist/esm/src/remoteConfig.d.ts +52 -0
- package/dist/esm/src/remoteConfig.test.d.ts +17 -0
- package/dist/esm/test/setup.d.ts +17 -0
- package/dist/esm/test/util.d.ts +20 -0
- package/dist/index.cjs.js +123 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/src/index.d.ts +45 -0
- package/dist/src/remoteConfig.d.ts +52 -0
- package/dist/src/remoteConfig.test.d.ts +17 -0
- package/dist/test/setup.d.ts +17 -0
- package/dist/test/util.d.ts +20 -0
- package/package.json +91 -0
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# @depup/firebase__remote-config-compat
|
|
2
|
+
|
|
3
|
+
> Dependency-bumped version of [@firebase/remote-config-compat](https://www.npmjs.com/package/@firebase/remote-config-compat)
|
|
4
|
+
|
|
5
|
+
Generated by [DepUp](https://github.com/depup/npm) -- all production
|
|
6
|
+
dependencies bumped to latest versions.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
npm install @depup/firebase__remote-config-compat
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
| Field | Value |
|
|
15
|
+
|-------|-------|
|
|
16
|
+
| Original | [@firebase/remote-config-compat](https://www.npmjs.com/package/@firebase/remote-config-compat) @ 0.2.22 |
|
|
17
|
+
| Processed | 2026-03-17 |
|
|
18
|
+
| Smoke test | failed |
|
|
19
|
+
| Deps updated | 1 |
|
|
20
|
+
|
|
21
|
+
## Dependency Changes
|
|
22
|
+
|
|
23
|
+
| Dependency | From | To |
|
|
24
|
+
|------------|------|-----|
|
|
25
|
+
| tslib | ^2.1.0 | ^2.8.1 |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
Source: https://github.com/depup/npm | Original: https://www.npmjs.com/package/@firebase/remote-config-compat
|
|
30
|
+
|
|
31
|
+
License inherited from the original package.
|
package/changes.json
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import firebase from '@firebase/app-compat';
|
|
2
|
+
import { Component } from '@firebase/component';
|
|
3
|
+
import { activate, ensureInitialized, fetchConfig, fetchAndActivate, getAll, getBoolean, getNumber, getString, getValue, setLogLevel, isSupported } from '@firebase/remote-config';
|
|
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
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const name = "@firebase/remote-config-compat";
|
|
84
|
+
const version = "0.2.22";
|
|
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
|
+
}
|
|
116
|
+
registerRemoteConfigCompat(firebase);
|
|
117
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../src/remoteConfig.ts","../../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, _FirebaseService } from '@firebase/app-compat';\nimport {\n Value as ValueCompat,\n FetchStatus as FetchSTatusCompat,\n Settings as SettingsCompat,\n LogLevel as RemoteConfigLogLevel,\n RemoteConfig as RemoteConfigCompat\n} from '@firebase/remote-config-types';\nimport {\n RemoteConfig,\n setLogLevel,\n activate,\n ensureInitialized,\n fetchAndActivate,\n fetchConfig,\n getAll,\n getBoolean,\n getNumber,\n getString,\n getValue,\n isSupported\n} from '@firebase/remote-config';\n\nexport { isSupported };\n\nexport class RemoteConfigCompatImpl\n implements RemoteConfigCompat, _FirebaseService\n{\n constructor(public app: FirebaseApp, readonly _delegate: RemoteConfig) {}\n\n get defaultConfig(): { [key: string]: string | number | boolean } {\n return this._delegate.defaultConfig;\n }\n\n set defaultConfig(value: { [key: string]: string | number | boolean }) {\n this._delegate.defaultConfig = value;\n }\n\n get fetchTimeMillis(): number {\n return this._delegate.fetchTimeMillis;\n }\n\n get lastFetchStatus(): FetchSTatusCompat {\n return this._delegate.lastFetchStatus;\n }\n\n get settings(): SettingsCompat {\n return this._delegate.settings;\n }\n\n set settings(value: SettingsCompat) {\n this._delegate.settings = value;\n }\n\n activate(): Promise<boolean> {\n return activate(this._delegate);\n }\n\n ensureInitialized(): Promise<void> {\n return ensureInitialized(this._delegate);\n }\n\n /**\n * @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than\n * {@link Settings.fetchTimeoutInSeconds} or\n * {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.\n */\n fetch(): Promise<void> {\n return fetchConfig(this._delegate);\n }\n\n fetchAndActivate(): Promise<boolean> {\n return fetchAndActivate(this._delegate);\n }\n\n getAll(): { [key: string]: ValueCompat } {\n return getAll(this._delegate);\n }\n\n getBoolean(key: string): boolean {\n return getBoolean(this._delegate, key);\n }\n\n getNumber(key: string): number {\n return getNumber(this._delegate, key);\n }\n\n getString(key: string): string {\n return getString(this._delegate, key);\n }\n\n getValue(key: string): ValueCompat {\n return getValue(this._delegate, key);\n }\n\n // Based on packages/firestore/src/util/log.ts but not static because we need per-instance levels\n // to differentiate 2p and 3p use-cases.\n setLogLevel(logLevel: RemoteConfigLogLevel): void {\n setLogLevel(this._delegate, logLevel);\n }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport firebase, { _FirebaseNamespace } from '@firebase/app-compat';\nimport {\n Component,\n ComponentContainer,\n ComponentType,\n InstanceFactoryOptions\n} from '@firebase/component';\nimport { RemoteConfigCompatImpl, isSupported } from './remoteConfig';\nimport { name as packageName, version } from '../package.json';\nimport { RemoteConfig as RemoteConfigCompat } from '@firebase/remote-config-types';\n\nfunction registerRemoteConfigCompat(\n firebaseInstance: _FirebaseNamespace\n): void {\n firebaseInstance.INTERNAL.registerComponent(\n new Component(\n 'remoteConfig-compat',\n remoteConfigFactory,\n ComponentType.PUBLIC\n )\n .setMultipleInstances(true)\n .setServiceProps({ isSupported })\n );\n\n firebaseInstance.registerVersion(packageName, version);\n}\n\nfunction remoteConfigFactory(\n container: ComponentContainer,\n { instanceIdentifier: namespace }: InstanceFactoryOptions\n): RemoteConfigCompatImpl {\n const app = container.getProvider('app-compat').getImmediate();\n // The following call will always succeed because rc `import {...} from '@firebase/remote-config'`\n const remoteConfig = container.getProvider('remote-config').getImmediate({\n identifier: namespace\n });\n\n return new RemoteConfigCompatImpl(app, remoteConfig);\n}\n\nregisterRemoteConfigCompat(firebase as _FirebaseNamespace);\n\ndeclare module '@firebase/app-compat' {\n interface FirebaseNamespace {\n remoteConfig: {\n (app?: FirebaseApp): RemoteConfigCompat;\n };\n }\n interface FirebaseApp {\n remoteConfig(): RemoteConfigCompat;\n }\n}\n"],"names":["packageName"],"mappings":";;;;AAAA;;;;;;;;;;;;;;;AAeG;MA2BU,sBAAsB,CAAA;IAGjC,WAAmB,CAAA,GAAgB,EAAW,SAAuB,EAAA;QAAlD,IAAG,CAAA,GAAA,GAAH,GAAG,CAAa;QAAW,IAAS,CAAA,SAAA,GAAT,SAAS,CAAc;KAAI;AAEzE,IAAA,IAAI,aAAa,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;KACrC;IAED,IAAI,aAAa,CAAC,KAAmD,EAAA;AACnE,QAAA,IAAI,CAAC,SAAS,CAAC,aAAa,GAAG,KAAK,CAAC;KACtC;AAED,IAAA,IAAI,eAAe,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC;KACvC;AAED,IAAA,IAAI,eAAe,GAAA;AACjB,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC;KACvC;AAED,IAAA,IAAI,QAAQ,GAAA;AACV,QAAA,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;KAChC;IAED,IAAI,QAAQ,CAAC,KAAqB,EAAA;AAChC,QAAA,IAAI,CAAC,SAAS,CAAC,QAAQ,GAAG,KAAK,CAAC;KACjC;IAED,QAAQ,GAAA;AACN,QAAA,OAAO,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KACjC;IAED,iBAAiB,GAAA;AACf,QAAA,OAAO,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KAC1C;AAED;;;;AAIG;IACH,KAAK,GAAA;AACH,QAAA,OAAO,WAAW,C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AC,WAAW,CAAC,YAAY,CAAC,CAAC,YAAY,EAAE,CAAC;;IAE/D,MAAM,YAAY,GAAG,SAAS,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,YAAY,CAAC;AACvE,QAAA,UAAU,EAAE,SAAS;AACtB,KAAA,CAAC,CAAC;AAEH,IAAA,OAAO,IAAI,sBAAsB,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC;AACvD,CAAC;AAED,0BAA0B,CAAC,QAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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';
|
|
@@ -0,0 +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 {};
|
|
@@ -0,0 +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;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var firebase = require('@firebase/app-compat');
|
|
4
|
+
var component = require('@firebase/component');
|
|
5
|
+
var remoteConfig = require('@firebase/remote-config');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
+
|
|
9
|
+
var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
|
|
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
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const name = "@firebase/remote-config-compat";
|
|
90
|
+
const version = "0.2.22";
|
|
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
|
+
}
|
|
122
|
+
registerRemoteConfigCompat(firebase__default["default"]);
|
|
123
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/remoteConfig.ts","../src/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FirebaseApp, _FirebaseService } from '@firebase/app-compat';\nimport {\n Value as ValueCompat,\n FetchStatus as FetchSTatusCompat,\n Settings as SettingsCompat,\n LogLevel as RemoteConfigLogLevel,\n RemoteConfig as RemoteConfigCompat\n} from '@firebase/remote-config-types';\nimport {\n RemoteConfig,\n setLogLevel,\n activate,\n ensureInitialized,\n fetchAndActivate,\n fetchConfig,\n getAll,\n getBoolean,\n getNumber,\n getString,\n getValue,\n isSupported\n} from '@firebase/remote-config';\n\nexport { isSupported };\n\nexport class RemoteConfigCompatImpl\n implements RemoteConfigCompat, _FirebaseService\n{\n constructor(public app: FirebaseApp, readonly _delegate: RemoteConfig) {}\n\n get defaultConfig(): { [key: string]: string | number | boolean } {\n return this._delegate.defaultConfig;\n }\n\n set defaultConfig(value: { [key: string]: string | number | boolean }) {\n this._delegate.defaultConfig = value;\n }\n\n get fetchTimeMillis(): number {\n return this._delegate.fetchTimeMillis;\n }\n\n get lastFetchStatus(): FetchSTatusCompat {\n return this._delegate.lastFetchStatus;\n }\n\n get settings(): SettingsCompat {\n return this._delegate.settings;\n }\n\n set settings(value: SettingsCompat) {\n this._delegate.settings = value;\n }\n\n activate(): Promise<boolean> {\n return activate(this._delegate);\n }\n\n ensureInitialized(): Promise<void> {\n return ensureInitialized(this._delegate);\n }\n\n /**\n * @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than\n * {@link Settings.fetchTimeoutInSeconds} or\n * {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.\n */\n fetch(): Promise<void> {\n return fetchConfig(this._delegate);\n }\n\n fetchAndActivate(): Promise<boolean> {\n return fetchAndActivate(this._delegate);\n }\n\n getAll(): { [key: string]: ValueCompat } {\n return getAll(this._delegate);\n }\n\n getBoolean(key: string): boolean {\n return getBoolean(this._delegate, key);\n }\n\n getNumber(key: string): number {\n return getNumber(this._delegate, key);\n }\n\n getString(key: string): string {\n return getString(this._delegate, key);\n }\n\n getValue(key: string): ValueCompat {\n return getValue(this._delegate, key);\n }\n\n // Based on packages/firestore/src/util/log.ts but not static because we need per-instance levels\n // to differentiate 2p and 3p use-cases.\n setLogLevel(logLevel: RemoteConfigLogLevel): void {\n setLogLevel(this._delegate, logLevel);\n }\n}\n","/**\n * @license\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport firebase, { _FirebaseNamespace } from '@firebase/app-compat';\nimport {\n Component,\n ComponentContainer,\n ComponentType,\n InstanceFactoryOptions\n} from '@firebase/component';\nimport { RemoteConfigCompatImpl, isSupported } from './remoteConfig';\nimport { name as packageName, version } from '../package.json';\nimport { RemoteConfig as RemoteConfigCompat } from '@firebase/remote-config-types';\n\nfunction registerRemoteConfigCompat(\n firebaseInstance: _FirebaseNamespace\n): void {\n firebaseInstance.INTERNAL.registerComponent(\n new Component(\n 'remoteConfig-compat',\n remoteConfigFactory,\n ComponentType.PUBLIC\n )\n .setMultipleInstances(true)\n .setServiceProps({ isSupported })\n );\n\n firebaseInstance.registerVersion(packageName, version);\n}\n\nfunction remoteConfigFactory(\n container: ComponentContainer,\n { instanceIdentifier: namespace }: InstanceFactoryOptions\n): RemoteConfigCompatImpl {\n const app = container.getProvider('app-compat').getImmediate();\n // The following call will always succeed because rc `import {...} from '@firebase/remote-config'`\n const remoteConfig = container.getProvider('remote-config').getImmediate({\n identifier: namespace\n });\n\n return new RemoteConfigCompatImpl(app, remoteConfig);\n}\n\nregisterRemoteConfigCompat(firebase as _FirebaseNamespace);\n\ndeclare module '@firebase/app-compat' {\n interface FirebaseNamespace {\n remoteConfig: {\n (app?: FirebaseApp): RemoteConfigCompat;\n };\n }\n interface FirebaseApp {\n remoteConfig(): RemoteConfigCompat;\n }\n}\n"],"names":["activate","ensureInitialized","fetchConfig","fetchAndActivate","getAll","getBoolean","getNumber","getString","getValue","setLogLevel","Component","isSupported","packageName","firebase"],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;MA2BU,sBAAsB,CAAA;IAGjC,WAAmB,CAAA,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CAAC;;"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
|
|
29
|
+
import { FirebaseApp as FirebaseAppCompat } from "@firebase/app-compat";
|
|
30
|
+
import { type Value, type RemoteConfigOptions, type RemoteConfig, type ConfigUpdateObserver, type Unsubscribe, type CustomSignals, type LogLevel } from "@firebase/remote-config";
|
|
31
|
+
declare module "@firebase/remote-config" {
|
|
32
|
+
function activate(remoteConfig: RemoteConfigCompat): Promise<boolean>;
|
|
33
|
+
function ensureInitialized(remoteConfig: RemoteConfigCompat): Promise<void>;
|
|
34
|
+
function fetchAndActivate(remoteConfig: RemoteConfigCompat): Promise<boolean>;
|
|
35
|
+
function fetchConfig(remoteConfig: RemoteConfigCompat): Promise<void>;
|
|
36
|
+
function getAll(remoteConfig: RemoteConfigCompat): Record<string, Value>;
|
|
37
|
+
function getBoolean(remoteConfig: RemoteConfigCompat, key: string): boolean;
|
|
38
|
+
function getNumber(remoteConfig: RemoteConfigCompat, key: string): number;
|
|
39
|
+
function getRemoteConfig(app?: FirebaseAppCompat, options?: RemoteConfigOptions): RemoteConfig;
|
|
40
|
+
function getString(remoteConfig: RemoteConfigCompat, key: string): string;
|
|
41
|
+
function getValue(remoteConfig: RemoteConfigCompat, key: string): Value;
|
|
42
|
+
function onConfigUpdate(remoteConfig: RemoteConfigCompat, observer: ConfigUpdateObserver): Unsubscribe;
|
|
43
|
+
function setCustomSignals(remoteConfig: RemoteConfigCompat, customSignals: CustomSignals): Promise<void>;
|
|
44
|
+
function setLogLevel(remoteConfig: RemoteConfigCompat, logLevel: LogLevel): void;
|
|
45
|
+
}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +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';
|
|
@@ -0,0 +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 {};
|
|
@@ -0,0 +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;
|
package/package.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@depup/firebase__remote-config-compat",
|
|
3
|
+
"version": "0.2.22-depup.0",
|
|
4
|
+
"description": "[DepUp] The compatibility package of Remote Config",
|
|
5
|
+
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
|
+
"main": "dist/index.cjs.js",
|
|
7
|
+
"browser": "dist/esm/index.esm.js",
|
|
8
|
+
"module": "dist/esm/index.esm.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/src/index.d.ts",
|
|
12
|
+
"require": "./dist/index.cjs.js",
|
|
13
|
+
"default": "./dist/esm/index.esm.js"
|
|
14
|
+
},
|
|
15
|
+
"./package.json": "./package.json"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"changes.json",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"lint": "eslint -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
|
|
24
|
+
"lint:fix": "eslint --fix -c .eslintrc.js '**/*.ts' --ignore-path '../../.gitignore'",
|
|
25
|
+
"build": "rollup -c",
|
|
26
|
+
"build:release": "yarn build && yarn add-compat-overloads",
|
|
27
|
+
"build:deps": "lerna run --scope @firebase/remote-config-compat --include-dependencies build",
|
|
28
|
+
"dev": "rollup -c -w",
|
|
29
|
+
"test": "run-p --npm-path npm lint test:all",
|
|
30
|
+
"test:all": "run-p --npm-path npm test:browser",
|
|
31
|
+
"test:ci": "node ../../scripts/run_tests_in_ci.js -s test:all",
|
|
32
|
+
"test:browser": "karma start",
|
|
33
|
+
"test:browser:debug": "karma start --browsers Chrome --auto-watch",
|
|
34
|
+
"trusted-type-check": "tsec -p tsconfig.json --noEmit",
|
|
35
|
+
"add-compat-overloads": "ts-node-script ../../scripts/build/create-overloads.ts -i ../remote-config/dist/remote-config-public.d.ts -o dist/src/index.d.ts -a -r RemoteConfig:RemoteConfigCompat -r FirebaseApp:FirebaseAppCompat --moduleToEnhance @firebase/remote-config"
|
|
36
|
+
},
|
|
37
|
+
"license": "Apache-2.0",
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"@firebase/app-compat": "0.x"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@firebase/remote-config": "0.8.1",
|
|
43
|
+
"@firebase/remote-config-types": "0.5.0",
|
|
44
|
+
"@firebase/util": "1.14.0",
|
|
45
|
+
"@firebase/logger": "0.5.0",
|
|
46
|
+
"@firebase/component": "0.7.1",
|
|
47
|
+
"tslib": "^2.8.1"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"rollup": "2.79.2",
|
|
51
|
+
"@rollup/plugin-json": "6.1.0",
|
|
52
|
+
"rollup-plugin-replace": "2.2.0",
|
|
53
|
+
"rollup-plugin-typescript2": "0.36.0",
|
|
54
|
+
"typescript": "5.5.4",
|
|
55
|
+
"@firebase/app-compat": "0.5.9"
|
|
56
|
+
},
|
|
57
|
+
"repository": {
|
|
58
|
+
"directory": "packages/remote-config-compat",
|
|
59
|
+
"type": "git",
|
|
60
|
+
"url": "git+https://github.com/firebase/firebase-js-sdk.git"
|
|
61
|
+
},
|
|
62
|
+
"bugs": {
|
|
63
|
+
"url": "https://github.com/firebase/firebase-js-sdk/issues"
|
|
64
|
+
},
|
|
65
|
+
"typings": "dist/src/index.d.ts",
|
|
66
|
+
"nyc": {
|
|
67
|
+
"extension": [
|
|
68
|
+
".ts"
|
|
69
|
+
],
|
|
70
|
+
"reportDir": "./coverage/node"
|
|
71
|
+
},
|
|
72
|
+
"keywords": [
|
|
73
|
+
"depup",
|
|
74
|
+
"dependency-bumped",
|
|
75
|
+
"updated-deps",
|
|
76
|
+
"@firebase/remote-config-compat"
|
|
77
|
+
],
|
|
78
|
+
"depup": {
|
|
79
|
+
"changes": {
|
|
80
|
+
"tslib": {
|
|
81
|
+
"from": "^2.1.0",
|
|
82
|
+
"to": "^2.8.1"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"depsUpdated": 1,
|
|
86
|
+
"originalPackage": "@firebase/remote-config-compat",
|
|
87
|
+
"originalVersion": "0.2.22",
|
|
88
|
+
"processedAt": "2026-03-17T16:32:22.512Z",
|
|
89
|
+
"smokeTest": "failed"
|
|
90
|
+
}
|
|
91
|
+
}
|