Skip to content

Commit 2255b79

Browse files
author
kjelko
committed
Run docgen
1 parent d145636 commit 2255b79

File tree

8 files changed

+177
-14
lines changed

8 files changed

+177
-14
lines changed

common/api-review/remote-config.api.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,22 @@ export function fetchAndActivate(remoteConfig: RemoteConfig): Promise<boolean>;
2424
// @public
2525
export function fetchConfig(remoteConfig: RemoteConfig): Promise<void>;
2626

27+
// @public
28+
export interface FetchResponse {
29+
config?: FirebaseRemoteConfigObject;
30+
eTag?: string;
31+
status: number;
32+
}
33+
2734
// @public
2835
export type FetchStatus = 'no-fetch-yet' | 'success' | 'failure' | 'throttle';
2936

37+
// @public
38+
export interface FirebaseRemoteConfigObject {
39+
// (undocumented)
40+
[key: string]: string;
41+
}
42+
3043
// @public
3144
export function getAll(remoteConfig: RemoteConfig): Record<string, Value>;
3245

@@ -37,7 +50,7 @@ export function getBoolean(remoteConfig: RemoteConfig, key: string): boolean;
3750
export function getNumber(remoteConfig: RemoteConfig, key: string): number;
3851

3952
// @public (undocumented)
40-
export function getRemoteConfig(app?: FirebaseApp): RemoteConfig;
53+
export function getRemoteConfig(app?: FirebaseApp, options?: RemoteConfigOptions): RemoteConfig;
4154

4255
// @public
4356
export function getString(remoteConfig: RemoteConfig, key: string): string;
@@ -62,6 +75,12 @@ export interface RemoteConfig {
6275
settings: RemoteConfigSettings;
6376
}
6477

78+
// @public
79+
export interface RemoteConfigOptions {
80+
initialFetchResponse?: FetchResponse;
81+
templateId?: string;
82+
}
83+
6584
// @public
6685
export interface RemoteConfigSettings {
6786
fetchTimeoutMillis: number;

docs-devsite/_toc.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,8 +430,14 @@ toc:
430430
section:
431431
- title: CustomSignals
432432
path: /docs/reference/js/remote-config.customsignals.md
433+
- title: FetchResponse
434+
path: /docs/reference/js/remote-config.fetchresponse.md
435+
- title: FirebaseRemoteConfigObject
436+
path: /docs/reference/js/remote-config.firebaseremoteconfigobject.md
433437
- title: RemoteConfig
434438
path: /docs/reference/js/remote-config.remoteconfig.md
439+
- title: RemoteConfigOptions
440+
path: /docs/reference/js/remote-config.remoteconfigoptions.md
435441
- title: RemoteConfigSettings
436442
path: /docs/reference/js/remote-config.remoteconfigsettings.md
437443
- title: Value
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
Project: /docs/reference/js/_project.yaml
2+
Book: /docs/reference/_book.yaml
3+
page_type: reference
4+
5+
{% comment %}
6+
DO NOT EDIT THIS FILE!
7+
This is generated by the JS SDK team, and any local changes will be
8+
overwritten. Changes should be made in the source code at
9+
https://github.com/firebase/firebase-js-sdk
10+
{% endcomment %}
11+
12+
# FetchResponse interface
13+
Defines a successful response (200 or 304).
14+
15+
<p>Modeled after the native interface, but simplified for Remote Config's use case.
16+
17+
<b>Signature:</b>
18+
19+
```typescript
20+
export interface FetchResponse
21+
```
22+
23+
## Properties
24+
25+
| Property | Type | Description |
26+
| --- | --- | --- |
27+
| [config](./remote-config.fetchresponse.md#fetchresponseconfig) | [FirebaseRemoteConfigObject](./remote-config.firebaseremoteconfigobject.md#firebaseremoteconfigobject_interface) | Defines the map of parameters returned as "entries" in the fetch response body.<p>Only defined for 200 responses. |
28+
| [eTag](./remote-config.fetchresponse.md#fetchresponseetag) | string | Defines the ETag response header value.<p>Only defined for 200 and 304 responses. |
29+
| [status](./remote-config.fetchresponse.md#fetchresponsestatus) | number | The HTTP status, which is useful for differentiating success responses with data from those without.<p> is modeled after the native interface, so HTTP status is first-class.<p>Disambiguation: the fetch response returns a legacy "state" value that is redundant with the HTTP status code. The former is normalized into the latter. |
30+
31+
## FetchResponse.config
32+
33+
Defines the map of parameters returned as "entries" in the fetch response body.
34+
35+
<p>Only defined for 200 responses.
36+
37+
<b>Signature:</b>
38+
39+
```typescript
40+
config?: FirebaseRemoteConfigObject;
41+
```
42+
43+
## FetchResponse.eTag
44+
45+
Defines the ETag response header value.
46+
47+
<p>Only defined for 200 and 304 responses.
48+
49+
<b>Signature:</b>
50+
51+
```typescript
52+
eTag?: string;
53+
```
54+
55+
## FetchResponse.status
56+
57+
The HTTP status, which is useful for differentiating success responses with data from those without.
58+
59+
<p> is modeled after the native interface, so HTTP status is first-class.
60+
61+
<p>Disambiguation: the fetch response returns a legacy "state" value that is redundant with the HTTP status code. The former is normalized into the latter.
62+
63+
<b>Signature:</b>
64+
65+
```typescript
66+
status: number;
67+
```
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Project: /docs/reference/js/_project.yaml
2+
Book: /docs/reference/_book.yaml
3+
page_type: reference
4+
5+
{% comment %}
6+
DO NOT EDIT THIS FILE!
7+
This is generated by the JS SDK team, and any local changes will be
8+
overwritten. Changes should be made in the source code at
9+
https://github.com/firebase/firebase-js-sdk
10+
{% endcomment %}
11+
12+
# FirebaseRemoteConfigObject interface
13+
Defines a self-descriptive reference for config key-value pairs.
14+
15+
<b>Signature:</b>
16+
17+
```typescript
18+
export interface FirebaseRemoteConfigObject
19+
```

docs-devsite/remote-config.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm
1717
| Function | Description |
1818
| --- | --- |
1919
| <b>function(app, ...)</b> |
20-
| [getRemoteConfig(app)](./remote-config.md#getremoteconfig_cf608e1) | |
20+
| [getRemoteConfig(app, options)](./remote-config.md#getremoteconfig_61d368f) | |
2121
| <b>function(remoteConfig, ...)</b> |
2222
| [activate(remoteConfig)](./remote-config.md#activate_722a192) | Makes the last fetched config available to the getters. |
2323
| [ensureInitialized(remoteConfig)](./remote-config.md#ensureinitialized_722a192) | Ensures the last activated config are available to the getters. |
@@ -38,7 +38,10 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm
3838
| Interface | Description |
3939
| --- | --- |
4040
| [CustomSignals](./remote-config.customsignals.md#customsignals_interface) | Defines the type for representing custom signals and their values.<p>The values in CustomSignals must be one of the following types:<ul> <li><code>string</code> <li><code>number</code> <li><code>null</code> </ul> |
41+
| [FetchResponse](./remote-config.fetchresponse.md#fetchresponse_interface) | Defines a successful response (200 or 304).<p>Modeled after the native interface, but simplified for Remote Config's use case. |
42+
| [FirebaseRemoteConfigObject](./remote-config.firebaseremoteconfigobject.md#firebaseremoteconfigobject_interface) | Defines a self-descriptive reference for config key-value pairs. |
4143
| [RemoteConfig](./remote-config.remoteconfig.md#remoteconfig_interface) | The Firebase Remote Config service interface. |
44+
| [RemoteConfigOptions](./remote-config.remoteconfigoptions.md#remoteconfigoptions_interface) | Options for Remote Config initialization. |
4245
| [RemoteConfigSettings](./remote-config.remoteconfigsettings.md#remoteconfigsettings_interface) | Defines configuration options for the Remote Config SDK. |
4346
| [Value](./remote-config.value.md#value_interface) | Wraps a value with metadata and type-safe getters. |
4447

@@ -52,19 +55,20 @@ The Firebase Remote Config Web SDK. This SDK does not work in a Node.js environm
5255

5356
## function(app, ...)
5457

55-
### getRemoteConfig(app) {:#getremoteconfig_cf608e1}
58+
### getRemoteConfig(app, options) {:#getremoteconfig_61d368f}
5659

5760
<b>Signature:</b>
5861

5962
```typescript
60-
export declare function getRemoteConfig(app?: FirebaseApp): RemoteConfig;
63+
export declare function getRemoteConfig(app?: FirebaseApp, options?: RemoteConfigOptions): RemoteConfig;
6164
```
6265

6366
#### Parameters
6467

6568
| Parameter | Type | Description |
6669
| --- | --- | --- |
6770
| app | [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | The [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) instance. |
71+
| options | [RemoteConfigOptions](./remote-config.remoteconfigoptions.md#remoteconfigoptions_interface) | |
6872

6973
<b>Returns:</b>
7074

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
Project: /docs/reference/js/_project.yaml
2+
Book: /docs/reference/_book.yaml
3+
page_type: reference
4+
5+
{% comment %}
6+
DO NOT EDIT THIS FILE!
7+
This is generated by the JS SDK team, and any local changes will be
8+
overwritten. Changes should be made in the source code at
9+
https://github.com/firebase/firebase-js-sdk
10+
{% endcomment %}
11+
12+
# RemoteConfigOptions interface
13+
Options for Remote Config initialization.
14+
15+
<b>Signature:</b>
16+
17+
```typescript
18+
export interface RemoteConfigOptions
19+
```
20+
21+
## Properties
22+
23+
| Property | Type | Description |
24+
| --- | --- | --- |
25+
| [initialFetchResponse](./remote-config.remoteconfigoptions.md#remoteconfigoptionsinitialfetchresponse) | [FetchResponse](./remote-config.fetchresponse.md#fetchresponse_interface) | Hydrates the state with an initial fetch response. |
26+
| [templateId](./remote-config.remoteconfigoptions.md#remoteconfigoptionstemplateid) | string | The ID of the template to use. If not provided, defaults to "firebase". |
27+
28+
## RemoteConfigOptions.initialFetchResponse
29+
30+
Hydrates the state with an initial fetch response.
31+
32+
<b>Signature:</b>
33+
34+
```typescript
35+
initialFetchResponse?: FetchResponse;
36+
```
37+
38+
## RemoteConfigOptions.templateId
39+
40+
The ID of the template to use. If not provided, defaults to "firebase".
41+
42+
<b>Signature:</b>
43+
44+
```typescript
45+
templateId?: string;
46+
```

packages/remote-config/src/public_types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import { FirebaseApp } from '@firebase/app';
1919
import { FetchResponse } from './client/remote_config_fetch_client';
2020

21+
export { FetchResponse, FirebaseRemoteConfigObject } from './client/remote_config_fetch_client';
22+
2123
/**
2224
* Options for Remote Config initialization.
2325
*

packages/remote-config/test/storage/storage.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('Storage', () => {
6666
storage = getStorage();
6767
});
6868

69-
it(`sets and gets last fetch attempt status`, async () => {
69+
it('sets and gets last fetch attempt status', async () => {
7070
const expectedStatus = 'success';
7171

7272
await storage.setLastFetchStatus(expectedStatus);
@@ -76,7 +76,7 @@ describe('Storage', () => {
7676
expect(actualStatus).to.deep.eq(expectedStatus);
7777
});
7878

79-
it(`sets and gets last fetch success timestamp`, async () => {
79+
it('sets and gets last fetch success timestamp', async () => {
8080
const lastSuccessfulFetchTimestampMillis = 123;
8181

8282
await storage.setLastSuccessfulFetchTimestampMillis(
@@ -89,7 +89,7 @@ describe('Storage', () => {
8989
expect(actualMetadata).to.deep.eq(lastSuccessfulFetchTimestampMillis);
9090
});
9191

92-
it(`sets and gets last successful fetch response`, async () => {
92+
it('sets and gets last successful fetch response', async () => {
9393
const lastSuccessfulFetchResponse = { status: 200 } as FetchResponse;
9494

9595
await storage.setLastSuccessfulFetchResponse(lastSuccessfulFetchResponse);
@@ -99,7 +99,7 @@ describe('Storage', () => {
9999
expect(actualConfig).to.deep.eq(lastSuccessfulFetchResponse);
100100
});
101101

102-
it(`sets and gets active config`, async () => {
102+
it('sets and gets active config', async () => {
103103
const expectedConfig = { key: 'value' };
104104

105105
await storage.setActiveConfig(expectedConfig);
@@ -109,7 +109,7 @@ describe('Storage', () => {
109109
expect(storedConfig).to.deep.eq(expectedConfig);
110110
});
111111

112-
it(`sets and gets active config etag`, async () => {
112+
it('sets and gets active config etag', async () => {
113113
const expectedEtag = 'etag';
114114

115115
await storage.setActiveConfigEtag(expectedEtag);
@@ -119,7 +119,7 @@ describe('Storage', () => {
119119
expect(storedConfigEtag).to.deep.eq(expectedEtag);
120120
});
121121

122-
it(`sets, gets and deletes throttle metadata`, async () => {
122+
it('sets, gets and deletes throttle metadata', async () => {
123123
const expectedMetadata = {
124124
throttleEndTimeMillis: 1
125125
} as ThrottleMetadata;
@@ -137,7 +137,7 @@ describe('Storage', () => {
137137
expect(actualMetadata).to.be.undefined;
138138
});
139139

140-
it(`sets and gets custom signals`, async () => {
140+
it('sets and gets custom signals', async () => {
141141
const customSignals = { key: 'value', key1: 'value1', key2: 1 };
142142
const customSignalsInStorage = {
143143
key: 'value',
@@ -152,7 +152,7 @@ describe('Storage', () => {
152152
expect(storedCustomSignals).to.deep.eq(customSignalsInStorage);
153153
});
154154

155-
it(`upserts custom signals when key is present in storage`, async () => {
155+
it('upserts custom signals when key is present in storage', async () => {
156156
const customSignals = { key: 'value', key1: 'value1' };
157157
const updatedSignals = { key: 'value', key1: 'value2' };
158158

@@ -165,7 +165,7 @@ describe('Storage', () => {
165165
expect(storedCustomSignals).to.deep.eq(updatedSignals);
166166
});
167167

168-
it(`deletes custom signal when value supplied is null`, async () => {
168+
it('deletes custom signal when value supplied is null', async () => {
169169
const customSignals = { key: 'value', key1: 'value1' };
170170
const updatedSignals = { key: 'value' };
171171

@@ -178,7 +178,7 @@ describe('Storage', () => {
178178
expect(storedCustomSignals).to.deep.eq(updatedSignals);
179179
});
180180

181-
it(`throws an error when supplied with excess custom signals`, async () => {
181+
it('throws an error when supplied with excess custom signals', async () => {
182182
const customSignals: { [key: string]: string } = {};
183183
for (let i = 0; i < 101; i++) {
184184
customSignals[`key${i}`] = `value${i}`;

0 commit comments

Comments
 (0)