@@ -172,7 +172,22 @@ Functions Frameworks behave consistently.
172172
173173### Firebase RTDB events (tentative)
174174
175- (This information is still actively being worked on.)
175+ The ` resource ` in the GCF HTTP representation is of the form
176+ ` projects/_/instances/{instance-id}/refs/{ref-path} ` . Additionally,
177+ there is a top-level ` domain ` property, which is used to determine the ` location ` part
178+ of the CloudEvent representation:
179+
180+ - The ` domain ` property must be present as a string; if it's missing, the conversion should fail.
181+ - If the ` domain ` value is ` firebaseio.com ` , the location is ` us-central1 ` .
182+ - Otherwise, the location is the value of ` domain ` before the first period. For example,
183+ a ` domain ` value of ` europe-west1.firebasedatabase.app ` would lead to a location value
184+ of ` europe-west1 ` .
185+
186+ In the CloudEvent representation, this information is split between
187+ the ` source ` and the ` subject ` :
188+
189+ - ` source ` : ` //firestore.googleapis.com/projects/_/locations/{location}/instances/{instance-id} `
190+ - ` subject: refs/{ref-path} `
176191
177192### Firebase analytics events (tentative)
178193
@@ -184,7 +199,9 @@ the `source` attributes:
184199- ` source ` : ` //firebaseanalytics.googleapis.com/projects/{project-id}/apps/{app-id} `
185200- ` subject ` : ` events/{event-name} `
186201
187- TBD: Where the ` app-id ` part comes from.
202+ The ` app-id ` part it obtained from the data within the GCF HTTP representation, from
203+ a path of ` userDim.appInfo.appId ` (both the ` userDim ` and ` appInfo ` properties are
204+ expected to have object values; the ` appId ` property is expected to have a string value.)
188205
189206### Firebase auth events (tentative)
190207
@@ -202,7 +219,7 @@ respectively.
202219### Firestore document events (tentative)
203220
204221The ` resource ` in the GCF HTTP representation is of the form
205- `projects/{project-id}/databases/{database-id}/documents/{path-to-document}" .
222+ ` projects/{project-id}/databases/{database-id}/documents/{path-to-document} ` .
206223In the CloudEvent representation, this information is split between
207224the ` source ` and the ` subject ` :
208225
@@ -219,7 +236,7 @@ of raw JSON or a deserialized in-lanuage representation. The
219236- ` timestamp ` : The date/time this event was created. (String)
220237- ` eventType ` : The type of the event.
221238 For example: "google.pubsub.topic.publish". (String)
222- - `resource" : The resource that emitted the event. (The format of this
239+ - ` resource ` : The resource that emitted the event. (The format of this
223240 varies by language.)
224241
225242The Java Functions Framework additionally includes an ` attributes `
0 commit comments