Skip to content

Commit d12b1d1

Browse files
colerogerstaeold
andauthored
Fix namespace v1 docs (#1204)
* added missing info to analytics * fixing https package * fixing pubsub * adding storage * change return to returns * Make it a link! * Unnecessary internal tag. Co-authored-by: Daniel Lee <[email protected]>
1 parent d7cc2e5 commit d12b1d1

File tree

7 files changed

+40
-42
lines changed

7 files changed

+40
-42
lines changed

src/common/providers/https.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import { TaskContext } from "./tasks";
3636

3737
const JWT_REGEX = /^[a-zA-Z0-9\-_=]+?\.[a-zA-Z0-9\-_=]+?\.([a-zA-Z0-9\-_=]+)?$/;
3838

39-
/** @hidden */
39+
/** An express request with the wire format representation of the request body. */
4040
export interface Request extends express.Request {
4141
/** The wire format representation of the request body. */
4242
rawBody: Buffer;
@@ -121,9 +121,9 @@ export interface CallableRequest<T = any> {
121121

122122
/**
123123
* The set of Firebase Functions status codes. The codes are the same at the
124-
* ones exposed by gRPC here:
125-
* https://github.com/grpc/grpc/blob/master/doc/statuscodes.md
124+
* ones exposed by {@link https://github.com/grpc/grpc/blob/master/doc/statuscodes.md | gRPC}.
126125
*
126+
* @remarks
127127
* Possible values:
128128
*
129129
* - `cancelled`: The operation was cancelled (typically by the caller).
@@ -527,7 +527,7 @@ export function unsafeDecodeAppCheckToken(token: string): DecodedAppCheckToken {
527527
*
528528
* @param {Request} req - Request sent to the Callable function.
529529
* @param {CallableContext} ctx - Context to be sent to callable function handler.
530-
* @return {CallableTokenStatus} Status of the token verifications.
530+
* @returns {CallableTokenStatus} Status of the token verifications.
531531
*/
532532
/** @internal */
533533
async function checkTokens(req: Request, ctx: CallableContext): Promise<CallableTokenStatus> {

src/v1/cloud-functions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ export interface Resource {
170170
* function - useful for unit testing.
171171
*/
172172
export interface Runnable<T> {
173+
/** Directly invoke the user defined function. */
173174
run: (data: T, context: any) => PromiseLike<any> | any;
174175
}
175176

src/v1/config.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ export { firebaseConfig } from "../common/config";
2727

2828
let singleton: Record<string, any>;
2929

30-
/**
31-
* @hidden
32-
* @internal
33-
*/
30+
/** @internal */
3431
export function resetCache(): void {
3532
singleton = undefined;
3633
}

src/v1/providers/analytics.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
import { CloudFunction, Event, EventContext, makeCloudFunction } from "../cloud-functions";
2424
import { DeploymentOptions } from "../function-configuration";
2525

26-
/** @hidden */
26+
/** @internal */
2727
export const provider = "google.analytics";
28-
/** @hidden */
28+
/** @internal */
2929
export const service = "app-measurement.com";
3030

3131
/**
@@ -34,13 +34,13 @@ export const service = "app-measurement.com";
3434
* @param analyticsEventType Name of the analytics event type to which
3535
* this Cloud Function is scoped.
3636
*
37-
* @return Analytics event builder interface.
37+
* @returns Analytics event builder interface.
3838
*/
3939
export function event(analyticsEventType: string) {
4040
return _eventWithOptions(analyticsEventType, {});
4141
}
4242

43-
/** @hidden */
43+
/** @internal */
4444
export function _eventWithOptions(analyticsEventType: string, options: DeploymentOptions) {
4545
return new AnalyticsEventBuilder(() => {
4646
if (!process.env.GCLOUD_PROJECT) {
@@ -53,7 +53,7 @@ export function _eventWithOptions(analyticsEventType: string, options: Deploymen
5353
/**
5454
* The Firebase Analytics event builder interface.
5555
*
56-
* Access via [`functions.analytics.event()`](functions.analytics#.event).
56+
* Access via `functions.analytics.event()`.
5757
*/
5858
export class AnalyticsEventBuilder {
5959
/** @hidden */
@@ -65,7 +65,7 @@ export class AnalyticsEventBuilder {
6565
* @param handler Event handler that fires every time a Firebase Analytics event
6666
* occurs.
6767
*
68-
* @return A function that you can export and deploy.
68+
* @returns A function that you can export and deploy.
6969
*/
7070
onLog(
7171
handler: (event: AnalyticsEvent, context: EventContext) => PromiseLike<any> | any

src/v1/providers/https.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function onCall(
5656
return _onCallWithOptions(handler, {});
5757
}
5858

59-
/** @hidden */
59+
/** @internal */
6060
export function _onRequestWithOptions(
6161
handler: (req: Request, resp: express.Response) => void | Promise<void>,
6262
options: DeploymentOptions
@@ -82,7 +82,7 @@ export function _onRequestWithOptions(
8282
return cloudFunction;
8383
}
8484

85-
/** @hidden */
85+
/** @internal */
8686
export function _onCallWithOptions(
8787
handler: (data: any, context: CallableContext) => any | Promise<any>,
8888
options: DeploymentOptions

src/v1/providers/pubsub.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
import { CloudFunction, EventContext, makeCloudFunction } from "../cloud-functions";
2424
import { DeploymentOptions, ScheduleRetryConfig } from "../function-configuration";
2525

26-
/** @hidden */
26+
/** @internal */
2727
export const provider = "google.pubsub";
28-
/** @hidden */
28+
/** @internal */
2929
export const service = "pubsub.googleapis.com";
3030

3131
/**
@@ -39,7 +39,7 @@ export function topic(topic: string) {
3939
return _topicWithOptions(topic, {});
4040
}
4141

42-
/** @hidden */
42+
/** @internal */
4343
export function _topicWithOptions(topic: string, options: DeploymentOptions): TopicBuilder {
4444
if (topic.indexOf("/") !== -1) {
4545
throw new Error("Topic name may not have a /");
@@ -56,7 +56,7 @@ export function _topicWithOptions(topic: string, options: DeploymentOptions): To
5656
/**
5757
* The Google Cloud Pub/Sub topic builder.
5858
*
59-
* Access via [`functions.pubsub.topic()`](providers_pubsub_.html#topic).
59+
* Access via `functions.pubsub.topic()`.
6060
*/
6161
export class TopicBuilder {
6262
/** @hidden */
@@ -68,7 +68,7 @@ export class TopicBuilder {
6868
*
6969
* @param handler - Event handler that runs every time a Cloud Pub/Sub message
7070
* is published.
71-
* @return A Cloud Function that you can export and deploy.
71+
* @returns A Cloud Function that you can export and deploy.
7272
*/
7373
onPublish(
7474
handler: (message: Message, context: EventContext) => PromiseLike<any> | any
@@ -89,13 +89,13 @@ export class TopicBuilder {
8989
* Registers a Cloud Function to run at specified times.
9090
*
9191
* @param schedule - The schedule, in Unix Crontab or AppEngine syntax.
92-
* @return ScheduleBuilder interface.
92+
* @returns ScheduleBuilder interface.
9393
*/
9494
export function schedule(schedule: string): ScheduleBuilder {
9595
return _scheduleWithOptions(schedule, {});
9696
}
9797

98-
/** @hidden */
98+
/** @internal */
9999
export function _scheduleWithOptions(
100100
schedule: string,
101101
options: DeploymentOptions
@@ -120,7 +120,7 @@ export function _scheduleWithOptions(
120120
* frequency. For more information, see
121121
* [Schedule functions](/docs/functions/schedule-functions).
122122
*
123-
* Access via [`functions.pubsub.schedule()`](providers_pubsub_.html#schedule).
123+
* Access via `functions.pubsub.schedule()`.
124124
*/
125125
export class ScheduleBuilder {
126126
/** @hidden */
@@ -142,7 +142,7 @@ export class ScheduleBuilder {
142142
*
143143
* @param handler - Handler that fires whenever the associated
144144
* scheduler job sends a Pub/Sub message.
145-
* @return A Cloud Function that you can export and deploy.
145+
* @returns A Cloud Function that you can export and deploy.
146146
*/
147147
onRun(handler: (context: EventContext) => PromiseLike<any> | any) {
148148
const cloudFunction = makeCloudFunction({
@@ -195,7 +195,7 @@ export class Message {
195195
/**
196196
* Returns a JSON-serializable representation of this object.
197197
*
198-
* @return A JSON-serializable representation of this object.
198+
* @returns A JSON-serializable representation of this object.
199199
*/
200200
toJSON(): any {
201201
return {

src/v1/providers/storage.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import { firebaseConfig } from "../../common/config";
2424
import { CloudFunction, EventContext, makeCloudFunction } from "../cloud-functions";
2525
import { DeploymentOptions } from "../function-configuration";
2626

27-
/** @hidden */
27+
/** @internal */
2828
export const provider = "google.storage";
29-
/** @hidden */
29+
/** @internal */
3030
export const service = "storage.googleapis.com";
3131

3232
/**
@@ -35,7 +35,7 @@ export const service = "storage.googleapis.com";
3535
* @param bucket Name of the bucket to which this Cloud Function is
3636
* scoped.
3737
*
38-
* @return Storage bucket builder interface.
38+
* @returns Storage bucket builder interface.
3939
*/
4040
export function bucket(bucket?: string) {
4141
return _bucketWithOptions({}, bucket);
@@ -45,13 +45,13 @@ export function bucket(bucket?: string) {
4545
* Registers a Cloud Function scoped to the default storage bucket for the
4646
* project.
4747
*
48-
* @return Storage object builder interface.
48+
* @returns Storage object builder interface.
4949
*/
5050
export function object() {
5151
return _objectWithOptions({});
5252
}
5353

54-
/** @hidden */
54+
/** @internal */
5555
export function _bucketWithOptions(options: DeploymentOptions, bucket?: string): BucketBuilder {
5656
const resourceGetter = () => {
5757
bucket = bucket || firebaseConfig().storageBucket;
@@ -69,24 +69,24 @@ export function _bucketWithOptions(options: DeploymentOptions, bucket?: string):
6969
return new BucketBuilder(resourceGetter, options);
7070
}
7171

72-
/** @hidden */
72+
/** @internal */
7373
export function _objectWithOptions(options: DeploymentOptions): ObjectBuilder {
7474
return _bucketWithOptions(options).object();
7575
}
7676

7777
/**
7878
* The Google Cloud Storage bucket builder interface.
7979
*
80-
* Access via [`functions.storage.bucket()`](providers_storage_.html#bucket).
80+
* Access via `functions.storage.bucket()`.
8181
*/
8282
export class BucketBuilder {
83-
/** @hidden */
83+
/** @internal */
8484
constructor(private triggerResource: () => string, private options: DeploymentOptions) {}
8585

8686
/**
8787
* Event handler which fires every time a Google Cloud Storage change occurs.
8888
*
89-
* @return Storage object builder interface scoped to the specified storage
89+
* @returns Storage object builder interface scoped to the specified storage
9090
* bucket.
9191
*/
9292
object() {
@@ -97,13 +97,13 @@ export class BucketBuilder {
9797
/**
9898
* The Google Cloud Storage object builder interface.
9999
*
100-
* Access via [`functions.storage.object()`](providers_storage_.html#object).
100+
* Access via `functions.storage.object()`.
101101
*/
102102
export class ObjectBuilder {
103-
/** @hidden */
103+
/** @internal */
104104
constructor(private triggerResource: () => string, private options: DeploymentOptions) {}
105105

106-
/** @hidden */
106+
/** @internal */
107107
onChange(): Error {
108108
throw new Error(
109109
'"onChange" is now deprecated, please use "onArchive", "onDelete", ' +
@@ -120,7 +120,7 @@ export class ObjectBuilder {
120120
* @param handler Event handler which is run every time a Google Cloud Storage
121121
* archival occurs.
122122
*
123-
* @return A Cloud Function which you can export and deploy.
123+
* @returns A Cloud Function which you can export and deploy.
124124
*/
125125
onArchive(
126126
handler: (object: ObjectMetadata, context: EventContext) => PromiseLike<any> | any
@@ -140,7 +140,7 @@ export class ObjectBuilder {
140140
* @param handler Event handler which is run every time a Google Cloud Storage
141141
* deletion occurs.
142142
*
143-
* @return A Cloud Function which you can export and deploy.
143+
* @returns A Cloud Function which you can export and deploy.
144144
*/
145145
onDelete(
146146
handler: (object: ObjectMetadata, context: EventContext) => PromiseLike<any> | any
@@ -159,7 +159,7 @@ export class ObjectBuilder {
159159
* @param handler Event handler which is run every time a Google Cloud Storage
160160
* object creation occurs.
161161
*
162-
* @return A Cloud Function which you can export and deploy.
162+
* @returns A Cloud Function which you can export and deploy.
163163
*/
164164
onFinalize(
165165
handler: (object: ObjectMetadata, context: EventContext) => PromiseLike<any> | any
@@ -174,7 +174,7 @@ export class ObjectBuilder {
174174
* @param handler Event handler which is run every time a Google Cloud Storage
175175
* metadata update occurs.
176176
*
177-
* @return A Cloud Function which you can export and deploy.
177+
* @returns A Cloud Function which you can export and deploy.
178178
*/
179179
onMetadataUpdate(
180180
handler: (object: ObjectMetadata, context: EventContext) => PromiseLike<any> | any

0 commit comments

Comments
 (0)