Skip to content

Commit 4eaddd9

Browse files
Merge main into release
2 parents ffbf5a6 + 1e8edb7 commit 4eaddd9

32 files changed

+3189
-2185
lines changed

.changeset/bright-scissors-care.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@firebase/functions': minor
3+
'firebase': minor
4+
---
5+
6+
Add `.stream()` api for callable functions for consuming streaming responses.

.changeset/four-baboons-behave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/vertexai': patch
3+
---
4+
5+
Clear fetch timeout after request completion. Fixes an issue that caused Node scripts to hang due to a pending timeout.

.changeset/funny-weeks-attack.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/data-connect": patch
3+
---
4+
5+
Fixed issue where multiple calls to connectDataConnectEmulator caused an exception

.changeset/neat-beans-rescue.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@firebase/messaging': patch
3+
---
4+
5+
Fix an issue where PushManager.subscribe() is called too soon after registering the default service worker.

common/api-review/functions.api.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,18 @@ export type FunctionsErrorCodeCore = 'ok' | 'cancelled' | 'unknown' | 'invalid-a
3535
export function getFunctions(app?: FirebaseApp, regionOrCustomDomain?: string): Functions;
3636

3737
// @public
38-
export type HttpsCallable<RequestData = unknown, ResponseData = unknown> = (data?: RequestData | null) => Promise<HttpsCallableResult<ResponseData>>;
38+
export interface HttpsCallable<RequestData = unknown, ResponseData = unknown, StreamData = unknown> {
39+
// (undocumented)
40+
(data?: RequestData | null): Promise<HttpsCallableResult<ResponseData>>;
41+
// (undocumented)
42+
stream: (data?: RequestData | null, options?: HttpsCallableStreamOptions) => Promise<HttpsCallableStreamResult<ResponseData, StreamData>>;
43+
}
3944

4045
// @public
41-
export function httpsCallable<RequestData = unknown, ResponseData = unknown>(functionsInstance: Functions, name: string, options?: HttpsCallableOptions): HttpsCallable<RequestData, ResponseData>;
46+
export function httpsCallable<RequestData = unknown, ResponseData = unknown, StreamData = unknown>(functionsInstance: Functions, name: string, options?: HttpsCallableOptions): HttpsCallable<RequestData, ResponseData, StreamData>;
4247

4348
// @public
44-
export function httpsCallableFromURL<RequestData = unknown, ResponseData = unknown>(functionsInstance: Functions, url: string, options?: HttpsCallableOptions): HttpsCallable<RequestData, ResponseData>;
49+
export function httpsCallableFromURL<RequestData = unknown, ResponseData = unknown, StreamData = unknown>(functionsInstance: Functions, url: string, options?: HttpsCallableOptions): HttpsCallable<RequestData, ResponseData, StreamData>;
4550

4651
// @public
4752
export interface HttpsCallableOptions {
@@ -54,5 +59,19 @@ export interface HttpsCallableResult<ResponseData = unknown> {
5459
readonly data: ResponseData;
5560
}
5661

62+
// @public
63+
export interface HttpsCallableStreamOptions {
64+
limitedUseAppCheckTokens?: boolean;
65+
signal?: AbortSignal;
66+
}
67+
68+
// @public
69+
export interface HttpsCallableStreamResult<ResponseData = unknown, StreamData = unknown> {
70+
// (undocumented)
71+
readonly data: Promise<ResponseData>;
72+
// (undocumented)
73+
readonly stream: AsyncIterable<StreamData>;
74+
}
75+
5776

5877
```

config/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Uncomment this if you'd like others to create their own Firebase project.

docs-devsite/_toc.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,16 @@ toc:
375375
path: /docs/reference/js/functions.functions.md
376376
- title: FunctionsError
377377
path: /docs/reference/js/functions.functionserror.md
378+
- title: HttpsCallable
379+
path: /docs/reference/js/functions.httpscallable.md
378380
- title: HttpsCallableOptions
379381
path: /docs/reference/js/functions.httpscallableoptions.md
380382
- title: HttpsCallableResult
381383
path: /docs/reference/js/functions.httpscallableresult.md
384+
- title: HttpsCallableStreamOptions
385+
path: /docs/reference/js/functions.httpscallablestreamoptions.md
386+
- title: HttpsCallableStreamResult
387+
path: /docs/reference/js/functions.httpscallablestreamresult.md
382388
- title: installations
383389
path: /docs/reference/js/installations.md
384390
section:
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
# HttpsCallable interface
13+
A reference to a "callable" HTTP trigger in Cloud Functions.
14+
15+
<b>Signature:</b>
16+
17+
```typescript
18+
export interface HttpsCallable<RequestData = unknown, ResponseData = unknown, StreamData = unknown>
19+
```
20+
21+
## Properties
22+
23+
| Property | Type | Description |
24+
| --- | --- | --- |
25+
| [stream](./functions.httpscallable.md#httpscallablestream) | (data?: RequestData \| null, options?: [HttpsCallableStreamOptions](./functions.httpscallablestreamoptions.md#httpscallablestreamoptions_interface)<!-- -->) =&gt; Promise&lt;[HttpsCallableStreamResult](./functions.httpscallablestreamresult.md#httpscallablestreamresult_interface)<!-- -->&lt;ResponseData, StreamData&gt;&gt; | |
26+
27+
## HttpsCallable.stream
28+
29+
<b>Signature:</b>
30+
31+
```typescript
32+
stream: (data?: RequestData | null, options?: HttpsCallableStreamOptions) => Promise<HttpsCallableStreamResult<ResponseData, StreamData>>;
33+
```

docs-devsite/functions.httpscallableoptions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ export interface HttpsCallableOptions
2222

2323
| Property | Type | Description |
2424
| --- | --- | --- |
25-
| [limitedUseAppCheckTokens](./functions.httpscallableoptions.md#httpscallableoptionslimiteduseappchecktokens) | boolean | If set to true, uses limited-use App Check token for callable function requests from this instance of [Functions](./functions.functions.md#functions_interface)<!-- -->. You must use limited-use tokens to call functions with replay protection enabled. By default, this is false. |
25+
| [limitedUseAppCheckTokens](./functions.httpscallableoptions.md#httpscallableoptionslimiteduseappchecktokens) | boolean | If set to true, uses a limited-use App Check token for callable function requests from this instance of [Functions](./functions.functions.md#functions_interface)<!-- -->. You must use limited-use tokens to call functions with replay protection enabled. By default, this is false. |
2626
| [timeout](./functions.httpscallableoptions.md#httpscallableoptionstimeout) | number | Time in milliseconds after which to cancel if there is no response. Default is 70000. |
2727

2828
## HttpsCallableOptions.limitedUseAppCheckTokens
2929

30-
If set to true, uses limited-use App Check token for callable function requests from this instance of [Functions](./functions.functions.md#functions_interface)<!-- -->. You must use limited-use tokens to call functions with replay protection enabled. By default, this is false.
30+
If set to true, uses a limited-use App Check token for callable function requests from this instance of [Functions](./functions.functions.md#functions_interface)<!-- -->. You must use limited-use tokens to call functions with replay protection enabled. By default, this is false.
3131

3232
<b>Signature:</b>
3333

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+
# HttpsCallableStreamOptions interface
13+
An interface for metadata about how a stream call should be executed.
14+
15+
<b>Signature:</b>
16+
17+
```typescript
18+
export interface HttpsCallableStreamOptions
19+
```
20+
21+
## Properties
22+
23+
| Property | Type | Description |
24+
| --- | --- | --- |
25+
| [limitedUseAppCheckTokens](./functions.httpscallablestreamoptions.md#httpscallablestreamoptionslimiteduseappchecktokens) | boolean | If set to true, uses a limited-use App Check token for callable function requests from this instance of [Functions](./functions.functions.md#functions_interface)<!-- -->. You must use limited-use tokens to call functions with replay protection enabled. By default, this is false. |
26+
| [signal](./functions.httpscallablestreamoptions.md#httpscallablestreamoptionssignal) | AbortSignal | An <code>AbortSignal</code> that can be used to cancel the streaming response. When the signal is aborted, the underlying HTTP connection will be terminated. |
27+
28+
## HttpsCallableStreamOptions.limitedUseAppCheckTokens
29+
30+
If set to true, uses a limited-use App Check token for callable function requests from this instance of [Functions](./functions.functions.md#functions_interface)<!-- -->. You must use limited-use tokens to call functions with replay protection enabled. By default, this is false.
31+
32+
<b>Signature:</b>
33+
34+
```typescript
35+
limitedUseAppCheckTokens?: boolean;
36+
```
37+
38+
## HttpsCallableStreamOptions.signal
39+
40+
An `AbortSignal` that can be used to cancel the streaming response. When the signal is aborted, the underlying HTTP connection will be terminated.
41+
42+
<b>Signature:</b>
43+
44+
```typescript
45+
signal?: AbortSignal;
46+
```

0 commit comments

Comments
 (0)