Skip to content

Commit 1bd2736

Browse files
authoredMay 27, 2020
Fixes to reference doc generation for functions.https (#690)
1 parent b1f9b5a commit 1bd2736

File tree

7 files changed

+24
-5
lines changed

7 files changed

+24
-5
lines changed
 

‎docgen/content-sources/HOME.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
# Firebase Functions SDK Reference
22

3-
Functions SDK!!!
3+
The `firebase-functions` package provides an SDK for defining Cloud Functions for Firebase.
4+
5+
To get started using Cloud Functions, see
6+
[Get started: write, test, and deploy your first functions](/docs/functions/get-started).
7+
8+
For source code, see the [Cloud Functions for Firebase GitHub repo](https://github.com/firebase/firebase-functions).

‎docgen/content-sources/toc.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ toc:
9090
section:
9191
- title: 'HttpsError'
9292
path: /docs/reference/functions/providers_https_.httpserror.html
93+
- title: 'CallableContext'
94+
path: /docs/reference/functions/providers_https_.callablecontext.html
9395

9496
- title: 'functions.pubsub'
9597
path: /docs/reference/functions/providers_pubsub_.html

‎src/providers/https.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import { apps } from '../apps';
2828
import { HttpsFunction, optionsToTrigger, Runnable } from '../cloud-functions';
2929
import { DeploymentOptions } from '../function-configuration';
3030

31+
/** @hidden */
3132
export interface Request extends express.Request {
3233
rawBody: Buffer;
3334
}
@@ -127,6 +128,7 @@ export type FunctionsErrorCode =
127128
| 'data-loss'
128129
| 'unauthenticated';
129130

131+
/** @hidden */
130132
export type CanonicalErrorCodeName =
131133
| 'OK'
132134
| 'CANCELLED'
@@ -146,6 +148,7 @@ export type CanonicalErrorCodeName =
146148
| 'UNAVAILABLE'
147149
| 'DATA_LOSS';
148150

151+
/** @hidden */
149152
interface HttpErrorCode {
150153
canonicalName: CanonicalErrorCodeName;
151154
status: number;
@@ -180,6 +183,7 @@ const errorCodeMap: { [name in FunctionsErrorCode]: HttpErrorCode } = {
180183
'data-loss': { canonicalName: 'DATA_LOSS', status: 500 },
181184
};
182185

186+
/** @hidden */
183187
interface HttpErrorWireFormat {
184188
details?: unknown;
185189
message: string;
@@ -261,19 +265,22 @@ export interface CallableContext {
261265
rawRequest: Request;
262266
}
263267

264-
// The allowed interface for an http request for a callable function.
268+
// The allowed interface for an HTTP request to a Callable function.
269+
/** @hidden*/
265270
interface HttpRequest extends Request {
266271
body: {
267272
data: any;
268273
};
269274
}
270275

271-
// The format for the http body response to a callable function.
276+
/** @hidden */
277+
// The format for an HTTP body response from a Callable function.
272278
interface HttpResponseBody {
273279
result?: any;
274280
error?: HttpsError;
275281
}
276282

283+
/** @hidden */
277284
// Returns true if req is a properly formatted callable request.
278285
function isValidRequest(req: Request): req is HttpRequest {
279286
// The body must not be empty.
@@ -317,7 +324,9 @@ function isValidRequest(req: Request): req is HttpRequest {
317324
return true;
318325
}
319326

327+
/** @hidden */
320328
const LONG_TYPE = 'type.googleapis.com/google.protobuf.Int64Value';
329+
/** @hidden */
321330
const UNSIGNED_LONG_TYPE = 'type.googleapis.com/google.protobuf.UInt64Value';
322331

323332
/**
@@ -400,6 +409,7 @@ export function decode(data: any): any {
400409
return data;
401410
}
402411

412+
/** @hidden */
403413
const corsHandler = cors({ origin: true, methods: 'POST' });
404414

405415
/** @hidden */

‎src/setup.ts

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
// SOFTWARE.
2222

23+
/** @hidden */
2324
import { firebaseConfig } from './config';
2425

2526
// Set up for config and vars

‎src/utilities/assertions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/** @hidden
22
* @file Provides common assertion helpers which can be used to improve
33
* strictness of both type checking and runtime.
44
*/

‎src/utilities/path.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/**
1+
/** @hidden
22
* Removes leading and trailing slashes from a path.
33
*
44
* @param path A path to normalize, in POSIX format.

‎src/utils.ts

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
// SOFTWARE.
2222

23+
/** @hidden */
2324
import * as _ from 'lodash';
2425

2526
export function applyChange(src: any, dest: any) {

0 commit comments

Comments
 (0)
Please sign in to comment.