@firebase/remote-config-compat 0.2.9 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.esm2017.js +1 -1
- package/dist/index.cjs.js +46 -64
- package/dist/index.cjs.js.map +1 -1
- package/package.json +6 -8
- package/dist/esm/index.esm5.js +0 -135
- package/dist/esm/index.esm5.js.map +0 -1
package/dist/index.cjs.js
CHANGED
|
@@ -24,87 +24,70 @@ var firebase__default = /*#__PURE__*/_interopDefaultLegacy(firebase);
|
|
|
24
24
|
* See the License for the specific language governing permissions and
|
|
25
25
|
* limitations under the License.
|
|
26
26
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
class RemoteConfigCompatImpl {
|
|
28
|
+
constructor(app, _delegate) {
|
|
29
29
|
this.app = app;
|
|
30
30
|
this._delegate = _delegate;
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return this._delegate.lastFetchStatus;
|
|
52
|
-
},
|
|
53
|
-
enumerable: false,
|
|
54
|
-
configurable: true
|
|
55
|
-
});
|
|
56
|
-
Object.defineProperty(RemoteConfigCompatImpl.prototype, "settings", {
|
|
57
|
-
get: function () {
|
|
58
|
-
return this._delegate.settings;
|
|
59
|
-
},
|
|
60
|
-
set: function (value) {
|
|
61
|
-
this._delegate.settings = value;
|
|
62
|
-
},
|
|
63
|
-
enumerable: false,
|
|
64
|
-
configurable: true
|
|
65
|
-
});
|
|
66
|
-
RemoteConfigCompatImpl.prototype.activate = function () {
|
|
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() {
|
|
67
51
|
return remoteConfig.activate(this._delegate);
|
|
68
|
-
}
|
|
69
|
-
|
|
52
|
+
}
|
|
53
|
+
ensureInitialized() {
|
|
70
54
|
return remoteConfig.ensureInitialized(this._delegate);
|
|
71
|
-
}
|
|
55
|
+
}
|
|
72
56
|
/**
|
|
73
57
|
* @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than
|
|
74
58
|
* {@link Settings.fetchTimeoutInSeconds} or
|
|
75
59
|
* {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.
|
|
76
60
|
*/
|
|
77
|
-
|
|
61
|
+
fetch() {
|
|
78
62
|
return remoteConfig.fetchConfig(this._delegate);
|
|
79
|
-
}
|
|
80
|
-
|
|
63
|
+
}
|
|
64
|
+
fetchAndActivate() {
|
|
81
65
|
return remoteConfig.fetchAndActivate(this._delegate);
|
|
82
|
-
}
|
|
83
|
-
|
|
66
|
+
}
|
|
67
|
+
getAll() {
|
|
84
68
|
return remoteConfig.getAll(this._delegate);
|
|
85
|
-
}
|
|
86
|
-
|
|
69
|
+
}
|
|
70
|
+
getBoolean(key) {
|
|
87
71
|
return remoteConfig.getBoolean(this._delegate, key);
|
|
88
|
-
}
|
|
89
|
-
|
|
72
|
+
}
|
|
73
|
+
getNumber(key) {
|
|
90
74
|
return remoteConfig.getNumber(this._delegate, key);
|
|
91
|
-
}
|
|
92
|
-
|
|
75
|
+
}
|
|
76
|
+
getString(key) {
|
|
93
77
|
return remoteConfig.getString(this._delegate, key);
|
|
94
|
-
}
|
|
95
|
-
|
|
78
|
+
}
|
|
79
|
+
getValue(key) {
|
|
96
80
|
return remoteConfig.getValue(this._delegate, key);
|
|
97
|
-
}
|
|
81
|
+
}
|
|
98
82
|
// Based on packages/firestore/src/util/log.ts but not static because we need per-instance levels
|
|
99
83
|
// to differentiate 2p and 3p use-cases.
|
|
100
|
-
|
|
84
|
+
setLogLevel(logLevel) {
|
|
101
85
|
remoteConfig.setLogLevel(this._delegate, logLevel);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
}());
|
|
86
|
+
}
|
|
87
|
+
}
|
|
105
88
|
|
|
106
|
-
|
|
107
|
-
|
|
89
|
+
const name = "@firebase/remote-config-compat";
|
|
90
|
+
const version = "0.2.10";
|
|
108
91
|
|
|
109
92
|
/**
|
|
110
93
|
* @license
|
|
@@ -128,11 +111,10 @@ function registerRemoteConfigCompat(firebaseInstance) {
|
|
|
128
111
|
.setServiceProps({ isSupported: remoteConfig.isSupported }));
|
|
129
112
|
firebaseInstance.registerVersion(name, version);
|
|
130
113
|
}
|
|
131
|
-
function remoteConfigFactory(container,
|
|
132
|
-
|
|
133
|
-
var app = container.getProvider('app-compat').getImmediate();
|
|
114
|
+
function remoteConfigFactory(container, { instanceIdentifier: namespace }) {
|
|
115
|
+
const app = container.getProvider('app-compat').getImmediate();
|
|
134
116
|
// The following call will always succeed because rc `import {...} from '@firebase/remote-config'`
|
|
135
|
-
|
|
117
|
+
const remoteConfig = container.getProvider('remote-config').getImmediate({
|
|
136
118
|
identifier: namespace
|
|
137
119
|
});
|
|
138
120
|
return new RemoteConfigCompatImpl(app, remoteConfig);
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +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","packageName","firebase"],"mappings":";;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;
|
|
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,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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AI,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;KACvC;AAED,IAAA,QAAQ,CAAC,GAAW,EAAA;QAClB,OAAOC,qBAAQ,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;KACtC;;;AAID,IAAA,WAAW,CAAC,QAA8B,EAAA;AACxC,QAAAC,wBAAW,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;KACvC;AACF;;;;;ACrHD;;;;;;;;;;;;;;;AAeG;AAaH,SAAS,0BAA0B,CACjC,gBAAoC,EAAA;IAEpC,gBAAgB,CAAC,QAAQ,CAAC,iBAAiB,CACzC,IAAIC,mBAAS,CACX,qBAAqB,EACrB,mBAAmB,EAEpB,QAAA,4BAAA;SACE,oBAAoB,CAAC,IAAI,CAAC;AAC1B,SAAA,eAAe,CAAC,eAAEC,wBAAW,EAAE,CAAC,CACpC,CAAC;AAEF,IAAA,gBAAgB,CAAC,eAAe,CAACC,IAAW,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC;AAED,SAAS,mBAAmB,CAC1B,SAA6B,EAC7B,EAAE,kBAAkB,EAAE,SAAS,EAA0B,EAAA;IAEzD,MAAM,GAAG,GAAG,SAAS,CAAC,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,CAACC,4BAA8B,CAAC;;"}
|
package/package.json
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/remote-config-compat",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
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",
|
|
7
7
|
"browser": "dist/esm/index.esm2017.js",
|
|
8
8
|
"module": "dist/esm/index.esm2017.js",
|
|
9
|
-
"esm5": "dist/esm/index.esm5.js",
|
|
10
9
|
"exports": {
|
|
11
10
|
".": {
|
|
12
11
|
"types": "./dist/src/index.d.ts",
|
|
13
12
|
"require": "./dist/index.cjs.js",
|
|
14
|
-
"esm5": "./dist/esm/index.esm5.js",
|
|
15
13
|
"default": "./dist/esm/index.esm2017.js"
|
|
16
14
|
},
|
|
17
15
|
"./package.json": "./package.json"
|
|
@@ -39,11 +37,11 @@
|
|
|
39
37
|
"@firebase/app-compat": "0.x"
|
|
40
38
|
},
|
|
41
39
|
"dependencies": {
|
|
42
|
-
"@firebase/remote-config": "0.4.
|
|
40
|
+
"@firebase/remote-config": "0.4.10",
|
|
43
41
|
"@firebase/remote-config-types": "0.3.2",
|
|
44
|
-
"@firebase/util": "1.10.
|
|
45
|
-
"@firebase/logger": "0.4.
|
|
46
|
-
"@firebase/component": "0.6.
|
|
42
|
+
"@firebase/util": "1.10.1",
|
|
43
|
+
"@firebase/logger": "0.4.3",
|
|
44
|
+
"@firebase/component": "0.6.10",
|
|
47
45
|
"tslib": "^2.1.0"
|
|
48
46
|
},
|
|
49
47
|
"devDependencies": {
|
|
@@ -52,7 +50,7 @@
|
|
|
52
50
|
"rollup-plugin-replace": "2.2.0",
|
|
53
51
|
"rollup-plugin-typescript2": "0.31.2",
|
|
54
52
|
"typescript": "4.7.4",
|
|
55
|
-
"@firebase/app-compat": "0.2.
|
|
53
|
+
"@firebase/app-compat": "0.2.44"
|
|
56
54
|
},
|
|
57
55
|
"repository": {
|
|
58
56
|
"directory": "packages/remote-config-compat",
|
package/dist/esm/index.esm5.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
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
|
-
var RemoteConfigCompatImpl = /** @class */ (function () {
|
|
22
|
-
function RemoteConfigCompatImpl(app, _delegate) {
|
|
23
|
-
this.app = app;
|
|
24
|
-
this._delegate = _delegate;
|
|
25
|
-
}
|
|
26
|
-
Object.defineProperty(RemoteConfigCompatImpl.prototype, "defaultConfig", {
|
|
27
|
-
get: function () {
|
|
28
|
-
return this._delegate.defaultConfig;
|
|
29
|
-
},
|
|
30
|
-
set: function (value) {
|
|
31
|
-
this._delegate.defaultConfig = value;
|
|
32
|
-
},
|
|
33
|
-
enumerable: false,
|
|
34
|
-
configurable: true
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(RemoteConfigCompatImpl.prototype, "fetchTimeMillis", {
|
|
37
|
-
get: function () {
|
|
38
|
-
return this._delegate.fetchTimeMillis;
|
|
39
|
-
},
|
|
40
|
-
enumerable: false,
|
|
41
|
-
configurable: true
|
|
42
|
-
});
|
|
43
|
-
Object.defineProperty(RemoteConfigCompatImpl.prototype, "lastFetchStatus", {
|
|
44
|
-
get: function () {
|
|
45
|
-
return this._delegate.lastFetchStatus;
|
|
46
|
-
},
|
|
47
|
-
enumerable: false,
|
|
48
|
-
configurable: true
|
|
49
|
-
});
|
|
50
|
-
Object.defineProperty(RemoteConfigCompatImpl.prototype, "settings", {
|
|
51
|
-
get: function () {
|
|
52
|
-
return this._delegate.settings;
|
|
53
|
-
},
|
|
54
|
-
set: function (value) {
|
|
55
|
-
this._delegate.settings = value;
|
|
56
|
-
},
|
|
57
|
-
enumerable: false,
|
|
58
|
-
configurable: true
|
|
59
|
-
});
|
|
60
|
-
RemoteConfigCompatImpl.prototype.activate = function () {
|
|
61
|
-
return activate(this._delegate);
|
|
62
|
-
};
|
|
63
|
-
RemoteConfigCompatImpl.prototype.ensureInitialized = function () {
|
|
64
|
-
return ensureInitialized(this._delegate);
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* @throws a {@link ErrorCode.FETCH_CLIENT_TIMEOUT} if the request takes longer than
|
|
68
|
-
* {@link Settings.fetchTimeoutInSeconds} or
|
|
69
|
-
* {@link DEFAULT_FETCH_TIMEOUT_SECONDS}.
|
|
70
|
-
*/
|
|
71
|
-
RemoteConfigCompatImpl.prototype.fetch = function () {
|
|
72
|
-
return fetchConfig(this._delegate);
|
|
73
|
-
};
|
|
74
|
-
RemoteConfigCompatImpl.prototype.fetchAndActivate = function () {
|
|
75
|
-
return fetchAndActivate(this._delegate);
|
|
76
|
-
};
|
|
77
|
-
RemoteConfigCompatImpl.prototype.getAll = function () {
|
|
78
|
-
return getAll(this._delegate);
|
|
79
|
-
};
|
|
80
|
-
RemoteConfigCompatImpl.prototype.getBoolean = function (key) {
|
|
81
|
-
return getBoolean(this._delegate, key);
|
|
82
|
-
};
|
|
83
|
-
RemoteConfigCompatImpl.prototype.getNumber = function (key) {
|
|
84
|
-
return getNumber(this._delegate, key);
|
|
85
|
-
};
|
|
86
|
-
RemoteConfigCompatImpl.prototype.getString = function (key) {
|
|
87
|
-
return getString(this._delegate, key);
|
|
88
|
-
};
|
|
89
|
-
RemoteConfigCompatImpl.prototype.getValue = function (key) {
|
|
90
|
-
return getValue(this._delegate, key);
|
|
91
|
-
};
|
|
92
|
-
// Based on packages/firestore/src/util/log.ts but not static because we need per-instance levels
|
|
93
|
-
// to differentiate 2p and 3p use-cases.
|
|
94
|
-
RemoteConfigCompatImpl.prototype.setLogLevel = function (logLevel) {
|
|
95
|
-
setLogLevel(this._delegate, logLevel);
|
|
96
|
-
};
|
|
97
|
-
return RemoteConfigCompatImpl;
|
|
98
|
-
}());
|
|
99
|
-
|
|
100
|
-
var name = "@firebase/remote-config-compat";
|
|
101
|
-
var version = "0.2.9";
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* @license
|
|
105
|
-
* Copyright 2020 Google LLC
|
|
106
|
-
*
|
|
107
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
108
|
-
* you may not use this file except in compliance with the License.
|
|
109
|
-
* You may obtain a copy of the License at
|
|
110
|
-
*
|
|
111
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
112
|
-
*
|
|
113
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
114
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
115
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
116
|
-
* See the License for the specific language governing permissions and
|
|
117
|
-
* limitations under the License.
|
|
118
|
-
*/
|
|
119
|
-
function registerRemoteConfigCompat(firebaseInstance) {
|
|
120
|
-
firebaseInstance.INTERNAL.registerComponent(new Component('remoteConfig-compat', remoteConfigFactory, "PUBLIC" /* ComponentType.PUBLIC */)
|
|
121
|
-
.setMultipleInstances(true)
|
|
122
|
-
.setServiceProps({ isSupported: isSupported }));
|
|
123
|
-
firebaseInstance.registerVersion(name, version);
|
|
124
|
-
}
|
|
125
|
-
function remoteConfigFactory(container, _a) {
|
|
126
|
-
var namespace = _a.instanceIdentifier;
|
|
127
|
-
var app = container.getProvider('app-compat').getImmediate();
|
|
128
|
-
// The following call will always succeed because rc `import {...} from '@firebase/remote-config'`
|
|
129
|
-
var remoteConfig = container.getProvider('remote-config').getImmediate({
|
|
130
|
-
identifier: namespace
|
|
131
|
-
});
|
|
132
|
-
return new RemoteConfigCompatImpl(app, remoteConfig);
|
|
133
|
-
}
|
|
134
|
-
registerRemoteConfigCompat(firebase);
|
|
135
|
-
//# sourceMappingURL=index.esm5.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm5.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;AA2BH,IAAA,sBAAA,kBAAA,YAAA;IAGE,SAAmB,sBAAA,CAAA,GAAgB,EAAW,SAAuB,EAAA;QAAlD,IAAG,CAAA,GAAA,GAAH,GAAG,CAAa;QAAW,IAAS,CAAA,SAAA,GAAT,SAAS,CAAc;KAAI;AAEzE,IAAA,MAAA,CAAA,cAAA,CAAI,sBAAa,CAAA,SAAA,EAAA,eAAA,EAAA;AAAjB,QAAA,GAAA,EAAA,YAAA;AACE,YAAA,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;SACrC;AAED,QAAA,GAAA,EAAA,UAAkB,KAAmD,EAAA;AACnE,YAAA,IAAI,CAAC,SAAS,CAAC,aAAa,GAAG,KAAK,CAAC;SACtC;;;AAJA,KAAA,CAAA,CAAA;AAMD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