/
extension.yaml
77 lines (68 loc) · 2.45 KB
/
extension.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: firestore-push-notification
version: 0.0.1
specVersion: v1beta
displayName: Trigger Push Notification
description: Sends a push notification based on the contents of a document in a Firestore collection.
license: Apache-2.0
author:
authorName: Cole Rogers
url: https://github.com/colerogers
billingRequired: true
roles:
- role: datastore.viewer
reason: Allows the extension to view changed documents in the Firestore collection.
resources:
- name: triggerNotification
type: firebaseextensions.v1beta.function
description:
Reads Firestore collection document and sends push notification based on content
properties:
location: ${LOCATION}
eventTrigger:
eventType: providers/cloud.firestore/eventTypes/document.write
resource: projects/${PROJECT_ID}/databases/(default)/documents/${NOTIFICATION_COLLECTION}/{id}
params:
- param: LOCATION
label: Cloud Functions location
description: >-
Where do you want to deploy the functions created for this extension?
You usually want a location close to your database. Realtime Database
instances are located in `us-central1`. For help selecting a
location, refer to the [location selection
guide](https://firebase.google.com/docs/functions/locations).
type: select
options:
- label: Iowa (us-central1)
value: us-central1
- label: South Carolina (us-east1)
value: us-east1
- label: Northern Virginia (us-east4)
value: us-east4
- label: Belgium (europe-west1)
value: europe-west1
- label: London (europe-west2)
value: europe-west2
- label: Frankfurt (europe-west3)
value: europe-west3
- label: Hong Kong (asia-east2)
value: asia-east2
- label: Tokyo (asia-northeast1)
value: asia-northeast1
default: us-central1
required: true
immutable: true
- param: NOTIFICATION_COLLECTION
label: Push Notification document collection
description: >-
The path to the collection that contains the documents used to send push notifications.
type: string
default: notification
validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
validationErrorMessage: Must be a valid Cloud Firestore collection
required: true
- param: FCM_SERVER_KEY
label: Firebase Cloud Messaging Server Key
description: >-
The server key found in your project settings under the cloud messaging tab
type: string
required: true