Skip to content
Merged
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
91 changes: 91 additions & 0 deletions src/handler-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,16 @@ export class HandlerBuilder {
};
}

/**
* Create a handler for Remote Config events.

* `remoteConfig.onUpdate` handles events that update a Remote Config template.

* @example
* ```javascript
* exports.myFunction = functions.handler.remoteConfig.onUpdate() => { ... })
* ```
*/
get remoteConfig() {
return {
onUpdate: (
Expand All @@ -233,6 +243,16 @@ export class HandlerBuilder {
};
}

/**
* Create a handler for Anlytics events.

* `event.onLog` handles the logging of Analytics conversion events.

* @example
* ```javascript
* exports.myFunction = functions.handler.analytics.event.onLog((event) => { ... })
* ```
*/
get analytics() {
return {
get event() {
Expand All @@ -241,6 +261,39 @@ export class HandlerBuilder {
};
}

/**
* Create a handler for Storage events.
*
* `object.onArchive` handles archival of Storage objects.
*
* @example
* ```javascript
* exports.myFunction = functions.handler.storage.object.onArchive(async (object) => { ... })
* ```

* `object.onDelete` handles Storage object deletions.
*
* @example
* ```javascript
* exports.myFunction = functions.handler.storage.object.onDelete(async (object) => { ... })
* ```

* `object.onFinalize` handles the creation of Storage objects.
*
* @example
* ```javascript
* exports.myFunction = functions.handler.storage.object.onFinalize(async (object) =>
* { ... })
* ```

* `object.onMetadataUpdate` handles changes to the metadata of existing Storage objects.
*
* @example
* ```javascript
* exports.myFunction = functions.handler.storage.object.onMetadataUpdate(async (object) =>
* { ... })
* ```
*/
get storage() {
return {
get bucket() {
Expand All @@ -253,6 +306,16 @@ export class HandlerBuilder {
};
}

/**
* Create a handler for Cloud Pub/Sub events.

* `pubsub.onPublish` handles the publication of messages to a topic.

* @example
* ```javascript
* exports.myFunction = functions.handler.pubsub.topic.onPublish((message) => { ... })
* ```
*/
get pubsub() {
return {
get topic() {
Expand All @@ -264,6 +327,24 @@ export class HandlerBuilder {
};
}

/**
* Create a handler for Firebase Auth events.
*
* `user.onCreate` handles user creations.
*
* @example
* ```javascript
* exports.myFunction = functions.handler.auth.user.onCreate((user) => { ... })
* ```

* `user.onDelete` handles user deletions.
*
* @example
* ```javascript
* exports.myFunction = functions.handler.auth.user.onDelete((user => { ... })
* ```

*/
get auth() {
return {
get user() {
Expand All @@ -272,6 +353,16 @@ export class HandlerBuilder {
};
}

/**
* Create a handler for Test Lab events.

* `testMatrix.onComplete` handles the completion of a test matrix.

* @example
* ```javascript
* exports.myFunction = functions.handler.testLab.testMatrix.onComplete((testMatrix) => { ... })
* ```
*/
get testLab() {
return {
get testMatrix() {
Expand Down