-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextension.yaml
118 lines (104 loc) · 4.77 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Learn detailed information about the fields of an extension.yaml file in the docs:
# https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml
# install using firebase ext:install . --project=hugo-website-reev
name: twilio-whatsapp # Identifier for your extension
version: 0.0.6 # Follow semver versioning
specVersion: v1beta # Version of the Firebase Extensions specification
author:
authorName: reev technologies
email: [email protected]
url: https://reev.tech
# Friendly display name for your extension (~3-5 words)
displayName: Twilio WhatsApp
# Brief description of the task your extension performs (~1 sentence)
description: >-
Send WhatsApp messages based on the changes in Cloud Firestore collection.
license: Apache-2.0 # https://spdx.org/licenses/
# Public URL for the source code of your extension
sourceUrl: https://github.com/reev-create/twilio-whatsapp
# Specify whether a paid-tier billing plan is required to use your extension.
# Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#billing-required-field
billingRequired: true
# In an `apis` field, list any Google APIs (like Cloud Translation, BigQuery, etc.)
# required for your extension to operate.
# Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#apis-field
# In a `roles` field, list any IAM access roles required for your extension to operate.
# Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#roles-field
# In the `resources` field, list each of your extension's functions, including the trigger for each function.
# Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#resources-field
roles:
- role: datastore.user
reason: Allows this extension to access Cloud Firestore to read and process added whatsapp messages documents.
resources:
- name: twilioWhatsApp
type: firebaseextensions.v1beta.function
description:
Processes document changes in the specified Cloud Firestore collection,
delivers whatsapp messaging using twilio, and updates the document with delivery status information.
properties:
location: ${LOCATION}
eventTrigger:
eventType: providers/cloud.firestore/eventTypes/document.write
resource: projects/${PROJECT_ID}/databases/(default)/documents/${WA_COLLECTION}/{id}
# In the `params` field, set up your extension's user-configured parameters.
# Learn more in the docs: https://firebase.google.com/docs/extensions/alpha/ref-extension-yaml#params-field
params:
- param: LOCATION
label: Cloud Functions location
description: >-
Where do you want to deploy the functions created for this extension?
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: WA_COLLECTION
label: WhatsApp messaging documents collection
description: >-
What is the path to the collection that contains the documents used to build and send the whatsapp messages?
type: string
default: messages
validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
validationErrorMessage: Must be a valid Cloud Firestore collection
required: true
- param: TWILIO_FROM_PHONENUMBER
label: Twilio FROM phone number
description: >-
The twilio registered phone number to use as the sender.
type: string
example: +1234567890
required: true
- param: TWILIO_ACCOUNT_SID
label: Twilio Account SID
description: >-
Twilio Registered Account SID. Used to authenticate requests.
For help refer to the [Official Twilio Documentation](https://www.twilio.com/docs/whatsapp/quickstart/node#gather-your-twilio-account-information)
type: string
example: ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
required: true
- param: TWILIO_AUTH_TOKEN
label: Twilio Auth Token
description: >-
Twilio Registered Auth Token. Used to authenticate requests.
For help refer to the [Official Twilio Documentation](https://www.twilio.com/docs/whatsapp/quickstart/node#gather-your-twilio-account-information)
type: string
example: YOUR_AUTH_TOKEN
required: true