Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change @returns statement to use function instead of Cloud Function #1232

Merged
merged 2 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/v1/providers/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class RefBuilder<Ref extends string> {
*
* @param handler Event handler that runs every time a Firebase Realtime Database
* write occurs.
* @returns A Cloud Function that you can export and deploy.
* @returns A function that you can export and deploy.
*/
onWrite(
handler: (
Expand All @@ -192,8 +192,7 @@ export class RefBuilder<Ref extends string> {
*
* @param handler Event handler which is run every time a Firebase Realtime Database
* write occurs.
* @returns A Cloud
* Function which you can export and deploy.
* @returns A function which you can export and deploy.
*/
onUpdate(
handler: (
Expand All @@ -210,7 +209,7 @@ export class RefBuilder<Ref extends string> {
*
* @param handler Event handler that runs every time new data is created in
* Firebase Realtime Database.
* @returns A Cloud Function that you can export and deploy.
* @returns A function that you can export and deploy.
*/
onCreate(
handler: (
Expand All @@ -234,7 +233,7 @@ export class RefBuilder<Ref extends string> {
*
* @param handler Event handler that runs every time data is deleted from
* Firebase Realtime Database.
* @returns A Cloud Function that you can export and deploy.
* @returns A function that you can export and deploy.
*/
onDelete(
handler: (
Expand Down
4 changes: 2 additions & 2 deletions src/v1/providers/pubsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class TopicBuilder {
*
* @param handler - Event handler that runs every time a Cloud Pub/Sub message
* is published.
* @returns A Cloud Function that you can export and deploy.
* @returns A function that you can export and deploy.
*/
onPublish(
handler: (message: Message, context: EventContext) => PromiseLike<any> | any
Expand Down Expand Up @@ -142,7 +142,7 @@ export class ScheduleBuilder {
*
* @param handler - Handler that fires whenever the associated
* scheduler job sends a Pub/Sub message.
* @returns A Cloud Function that you can export and deploy.
* @returns A function that you can export and deploy.
*/
onRun(handler: (context: EventContext) => PromiseLike<any> | any) {
const cloudFunction = makeCloudFunction({
Expand Down
2 changes: 1 addition & 1 deletion src/v1/providers/remoteConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const service = "firebaseremoteconfig.googleapis.com";
* @param handler A function that takes the updated Remote Config
* template version metadata as an argument.
*
* @returns A Cloud Function that you can export and deploy.
* @returns A function that you can export and deploy.
*/
export function onUpdate(
handler: (version: TemplateVersion, context: EventContext) => PromiseLike<any> | any
Expand Down
8 changes: 4 additions & 4 deletions src/v1/providers/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class ObjectBuilder {
* @param handler Event handler which is run every time a Google Cloud Storage
* archival occurs.
*
* @returns A Cloud Function which you can export and deploy.
* @returns A function which you can export and deploy.
*/
onArchive(
handler: (object: ObjectMetadata, context: EventContext) => PromiseLike<any> | any
Expand All @@ -132,7 +132,7 @@ export class ObjectBuilder {
* @param handler Event handler which is run every time a Google Cloud Storage
* deletion occurs.
*
* @returns A Cloud Function which you can export and deploy.
* @returns A function which you can export and deploy.
*/
onDelete(
handler: (object: ObjectMetadata, context: EventContext) => PromiseLike<any> | any
Expand All @@ -151,7 +151,7 @@ export class ObjectBuilder {
* @param handler Event handler which is run every time a Google Cloud Storage
* object creation occurs.
*
* @returns A Cloud Function which you can export and deploy.
* @returns A function which you can export and deploy.
*/
onFinalize(
handler: (object: ObjectMetadata, context: EventContext) => PromiseLike<any> | any
Expand All @@ -166,7 +166,7 @@ export class ObjectBuilder {
* @param handler Event handler which is run every time a Google Cloud Storage
* metadata update occurs.
*
* @returns A Cloud Function which you can export and deploy.
* @returns A function which you can export and deploy.
*/
onMetadataUpdate(
handler: (object: ObjectMetadata, context: EventContext) => PromiseLike<any> | any
Expand Down
2 changes: 1 addition & 1 deletion src/v1/providers/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class TaskQueueBuilder {
/**
* Creates a handler for tasks sent to a Google Cloud Tasks queue.
* @param handler - A callback to handle task requests.
* @returns A Cloud Function you can export and deploy.
* @returns A function you can export and deploy.
*/
onDispatch(
handler: (data: any, context: TaskContext) => void | Promise<void>
Expand Down
6 changes: 3 additions & 3 deletions src/v2/providers/remoteConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export interface ConfigUpdateData {
* Event handler which triggers when data is updated in a Remote Config.
*
* @param handler - Event handler which is run every time a Remote Config update occurs.
* @returns A Cloud Function that you can export and deploy.
* @returns A function that you can export and deploy.
*/
export function onConfigUpdated(
handler: (event: CloudEvent<ConfigUpdateData>) => any | Promise<any>
Expand All @@ -100,7 +100,7 @@ export function onConfigUpdated(
*
* @param opts - Options that can be set on an individual event-handling function.
* @param handler - Event handler which is run every time a Remote Config update occurs.
* @returns A Cloud Function that you can export and deploy.
* @returns A function that you can export and deploy.
*/
export function onConfigUpdated(
opts: EventHandlerOptions,
Expand All @@ -112,7 +112,7 @@ export function onConfigUpdated(
*
* @param optsOrHandler - Options or an event handler.
* @param handler - Event handler which is run every time a Remote Config update occurs.
* @returns A Cloud Function that you can export and deploy.
* @returns A function that you can export and deploy.
*/
export function onConfigUpdated(
optsOrHandler:
Expand Down
4 changes: 2 additions & 2 deletions src/v2/providers/tasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export interface TaskQueueFunction<T = any> extends HttpsFunction {
* Creates a handler for tasks sent to a Google Cloud Tasks queue.
* @param handler - A callback to handle task requests.
* @typeParam Args - The interface for the request's `data` field.
* @returns A Cloud Function you can export and deploy.
* @returns A function you can export and deploy.
*/
export function onTaskDispatched<Args = any>(
handler: (request: Request<Args>) => void | Promise<void>
Expand All @@ -179,7 +179,7 @@ export function onTaskDispatched<Args = any>(
* @param options - Configuration for the task queue or Cloud Function.
* @param handler - A callback to handle task requests.
* @typeParam Args - The interface for the request's `data` field.
* @returns A Cloud Function you can export and deploy.
* @returns A function you can export and deploy.
*/
export function onTaskDispatched<Args = any>(
options: TaskQueueOptions,
Expand Down