@firebase/remote-config 0.4.11 → 0.5.0-canary.144bc3709
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 +115 -10
- package/dist/esm/index.esm2017.js.map +1 -1
- package/dist/esm/src/api.d.ts +12 -1
- package/dist/esm/src/client/remote_config_fetch_client.d.ts +6 -0
- package/dist/esm/src/constants.d.ts +3 -0
- package/dist/esm/src/errors.d.ts +5 -1
- package/dist/esm/src/public_types.d.ts +16 -0
- package/dist/esm/src/storage/storage.d.ts +21 -2
- package/dist/esm/src/storage/storage_cache.d.ts +4 -1
- package/dist/index.cjs.js +115 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/remote-config-public.d.ts +29 -0
- package/dist/remote-config.d.ts +29 -0
- package/dist/src/api.d.ts +12 -1
- package/dist/src/client/remote_config_fetch_client.d.ts +6 -0
- package/dist/src/constants.d.ts +3 -0
- package/dist/src/errors.d.ts +5 -1
- package/dist/src/public_types.d.ts +16 -0
- package/dist/src/storage/storage.d.ts +21 -2
- package/dist/src/storage/storage_cache.d.ts +4 -1
- package/package.json +7 -7
|
@@ -121,6 +121,22 @@ export type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle';
|
|
|
121
121
|
* @public
|
|
122
122
|
*/
|
|
123
123
|
export type LogLevel = 'debug' | 'error' | 'silent';
|
|
124
|
+
/**
|
|
125
|
+
* Defines the type for representing custom signals and their values.
|
|
126
|
+
*
|
|
127
|
+
* <p>The values in CustomSignals must be one of the following types:
|
|
128
|
+
*
|
|
129
|
+
* <ul>
|
|
130
|
+
* <li><code>string</code>
|
|
131
|
+
* <li><code>number</code>
|
|
132
|
+
* <li><code>null</code>
|
|
133
|
+
* </ul>
|
|
134
|
+
*
|
|
135
|
+
* @public
|
|
136
|
+
*/
|
|
137
|
+
export interface CustomSignals {
|
|
138
|
+
[key: string]: string | number | null;
|
|
139
|
+
}
|
|
124
140
|
declare module '@firebase/component' {
|
|
125
141
|
interface NameServiceMapping {
|
|
126
142
|
'remote-config': RemoteConfig;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { FetchStatus } from '@firebase/remote-config-types';
|
|
17
|
+
import { FetchStatus, CustomSignals } from '@firebase/remote-config-types';
|
|
18
18
|
import { FetchResponse, FirebaseRemoteConfigObject } from '../client/remote_config_fetch_client';
|
|
19
19
|
/**
|
|
20
20
|
* A general-purpose store keyed by app + namespace + {@link
|
|
@@ -39,7 +39,7 @@ export interface ThrottleMetadata {
|
|
|
39
39
|
*
|
|
40
40
|
* <p>This seems like a small price to avoid potentially subtle bugs caused by a typo.
|
|
41
41
|
*/
|
|
42
|
-
type ProjectNamespaceKeyFieldValue = 'active_config' | 'active_config_etag' | 'last_fetch_status' | 'last_successful_fetch_timestamp_millis' | 'last_successful_fetch_response' | 'settings' | 'throttle_metadata';
|
|
42
|
+
type ProjectNamespaceKeyFieldValue = 'active_config' | 'active_config_etag' | 'last_fetch_status' | 'last_successful_fetch_timestamp_millis' | 'last_successful_fetch_response' | 'settings' | 'throttle_metadata' | 'custom_signals';
|
|
43
43
|
export declare function openDatabase(): Promise<IDBDatabase>;
|
|
44
44
|
/**
|
|
45
45
|
* Abstracts data persistence.
|
|
@@ -68,6 +68,25 @@ export declare class Storage {
|
|
|
68
68
|
getThrottleMetadata(): Promise<ThrottleMetadata | undefined>;
|
|
69
69
|
setThrottleMetadata(metadata: ThrottleMetadata): Promise<void>;
|
|
70
70
|
deleteThrottleMetadata(): Promise<void>;
|
|
71
|
+
getCustomSignals(): Promise<CustomSignals | undefined>;
|
|
72
|
+
setCustomSignals(customSignals: CustomSignals): Promise<CustomSignals>;
|
|
73
|
+
/**
|
|
74
|
+
* Gets a value from the database using the provided transaction.
|
|
75
|
+
*
|
|
76
|
+
* @param key The key of the value to get.
|
|
77
|
+
* @param transaction The transaction to use for the operation.
|
|
78
|
+
* @returns The value associated with the key, or undefined if no such value exists.
|
|
79
|
+
*/
|
|
80
|
+
getWithTransaction<T>(key: ProjectNamespaceKeyFieldValue, transaction: IDBTransaction): Promise<T | undefined>;
|
|
81
|
+
/**
|
|
82
|
+
* Sets a value in the database using the provided transaction.
|
|
83
|
+
*
|
|
84
|
+
* @param key The key of the value to set.
|
|
85
|
+
* @param value The value to set.
|
|
86
|
+
* @param transaction The transaction to use for the operation.
|
|
87
|
+
* @returns A promise that resolves when the operation is complete.
|
|
88
|
+
*/
|
|
89
|
+
setWithTransaction<T>(key: ProjectNamespaceKeyFieldValue, value: T, transaction: IDBTransaction): Promise<void>;
|
|
71
90
|
get<T>(key: ProjectNamespaceKeyFieldValue): Promise<T | undefined>;
|
|
72
91
|
set<T>(key: ProjectNamespaceKeyFieldValue, value: T): Promise<void>;
|
|
73
92
|
delete(key: ProjectNamespaceKeyFieldValue): Promise<void>;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { FetchStatus } from '@firebase/remote-config-types';
|
|
17
|
+
import { FetchStatus, CustomSignals } from '@firebase/remote-config-types';
|
|
18
18
|
import { FirebaseRemoteConfigObject } from '../client/remote_config_fetch_client';
|
|
19
19
|
import { Storage } from './storage';
|
|
20
20
|
/**
|
|
@@ -29,12 +29,14 @@ export declare class StorageCache {
|
|
|
29
29
|
private lastFetchStatus?;
|
|
30
30
|
private lastSuccessfulFetchTimestampMillis?;
|
|
31
31
|
private activeConfig?;
|
|
32
|
+
private customSignals?;
|
|
32
33
|
/**
|
|
33
34
|
* Memory-only getters
|
|
34
35
|
*/
|
|
35
36
|
getLastFetchStatus(): FetchStatus | undefined;
|
|
36
37
|
getLastSuccessfulFetchTimestampMillis(): number | undefined;
|
|
37
38
|
getActiveConfig(): FirebaseRemoteConfigObject | undefined;
|
|
39
|
+
getCustomSignals(): CustomSignals | undefined;
|
|
38
40
|
/**
|
|
39
41
|
* Read-ahead getter
|
|
40
42
|
*/
|
|
@@ -45,4 +47,5 @@ export declare class StorageCache {
|
|
|
45
47
|
setLastFetchStatus(status: FetchStatus): Promise<void>;
|
|
46
48
|
setLastSuccessfulFetchTimestampMillis(timestampMillis: number): Promise<void>;
|
|
47
49
|
setActiveConfig(activeConfig: FirebaseRemoteConfigObject): Promise<void>;
|
|
50
|
+
setCustomSignals(customSignals: CustomSignals): Promise<void>;
|
|
48
51
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@firebase/remote-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0-canary.144bc3709",
|
|
4
4
|
"description": "The Remote Config package of the Firebase JS SDK",
|
|
5
5
|
"author": "Firebase <firebase-support@google.com> (https://firebase.google.com/)",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -37,18 +37,18 @@
|
|
|
37
37
|
"typings:internal": "node ../../scripts/build/use_typings.js ./dist/src/index.d.ts"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@firebase/app": "0.
|
|
40
|
+
"@firebase/app": "0.10.18-canary.144bc3709"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@firebase/installations": "0.6.
|
|
44
|
-
"@firebase/logger": "0.4.4",
|
|
45
|
-
"@firebase/util": "1.10.
|
|
46
|
-
"@firebase/component": "0.6.
|
|
43
|
+
"@firebase/installations": "0.6.12-canary.144bc3709",
|
|
44
|
+
"@firebase/logger": "0.4.4-canary.144bc3709",
|
|
45
|
+
"@firebase/util": "1.10.3-canary.144bc3709",
|
|
46
|
+
"@firebase/component": "0.6.12-canary.144bc3709",
|
|
47
47
|
"tslib": "^2.1.0"
|
|
48
48
|
},
|
|
49
49
|
"license": "Apache-2.0",
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@firebase/app": "0.10.
|
|
51
|
+
"@firebase/app": "0.10.18-canary.144bc3709",
|
|
52
52
|
"rollup": "2.79.1",
|
|
53
53
|
"rollup-plugin-typescript2": "0.31.2",
|
|
54
54
|
"typescript": "5.5.4"
|