|
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | 15 | name: firestore-shorten-urls-bitly |
16 | | -version: 0.1.18 |
| 16 | +version: 0.2.0 |
17 | 17 | specVersion: v1beta |
18 | 18 |
|
19 | 19 | displayName: Shorten URLs in Firestore |
@@ -48,16 +48,26 @@ roles: |
48 | 48 |
|
49 | 49 | resources: |
50 | 50 | - name: fsurlshortener |
51 | | - type: firebaseextensions.v1beta.function |
| 51 | + type: firebaseextensions.v1beta.v2function |
52 | 52 | description: |
53 | 53 | Listens for writes of new URLs to your specified Cloud Firestore |
54 | 54 | collection, shortens the URLs, then writes the shortened form back to the |
55 | 55 | same document. |
56 | 56 | properties: |
57 | | - runtime: nodejs20 |
| 57 | + sourceDirectory: functions |
| 58 | + buildConfig: |
| 59 | + runtime: nodejs22 |
| 60 | + serviceConfig: |
| 61 | + timeoutSeconds: 120 |
58 | 62 | eventTrigger: |
59 | | - eventType: providers/cloud.firestore/eventTypes/document.write |
60 | | - resource: projects/${param:PROJECT_ID}/databases/(default)/documents/${param:COLLECTION_PATH}/{documentId} |
| 63 | + eventType: google.cloud.firestore.document.v1.written |
| 64 | + triggerRegion: ${DATABASE_REGION} |
| 65 | + eventFilters: |
| 66 | + - attribute: database |
| 67 | + value: ${DATABASE} |
| 68 | + - attribute: document |
| 69 | + value: ${COLLECTION_PATH}/{documentId} |
| 70 | + operator: match-path-pattern |
61 | 71 |
|
62 | 72 | externalServices: |
63 | 73 | - name: Bitly |
@@ -101,16 +111,143 @@ params: |
101 | 111 | default: shortUrl |
102 | 112 | required: true |
103 | 113 |
|
| 114 | + - param: DATABASE |
| 115 | + label: Firestore Instance ID |
| 116 | + description: > |
| 117 | + The Firestore database to use. Use "(default)" for the default database. |
| 118 | + You can view your available Firestore databases at |
| 119 | + [https://console.cloud.google.com/firestore/databases](https://console.cloud.google.com/firestore/databases). |
| 120 | + example: (default) |
| 121 | + default: (default) |
| 122 | + required: true |
| 123 | + |
| 124 | + - param: DATABASE_REGION |
| 125 | + label: Firestore Instance Location |
| 126 | + description: > |
| 127 | + Where is the Firestore database located? You can check your current |
| 128 | + database location at |
| 129 | + [https://console.cloud.google.com/firestore/databases](https://console.cloud.google.com/firestore/databases). |
| 130 | + type: select |
| 131 | + options: |
| 132 | + # Multi-region locations |
| 133 | + - label: Europe (multi-regional, eur3) |
| 134 | + value: eur3 |
| 135 | + - label: United States (multi-regional, nam5) |
| 136 | + value: nam5 |
| 137 | + - label: Europe (multi-regional) |
| 138 | + value: eu |
| 139 | + - label: United States (multi-regional) |
| 140 | + value: us |
| 141 | + |
| 142 | + # North America |
| 143 | + - label: Iowa (us-central1) |
| 144 | + value: us-central1 |
| 145 | + - label: Oregon (us-west1) |
| 146 | + value: us-west1 |
| 147 | + - label: Los Angeles (us-west2) |
| 148 | + value: us-west2 |
| 149 | + - label: Salt Lake City (us-west3) |
| 150 | + value: us-west3 |
| 151 | + - label: Las Vegas (us-west4) |
| 152 | + value: us-west4 |
| 153 | + - label: South Carolina (us-east1) |
| 154 | + value: us-east1 |
| 155 | + - label: Northern Virginia (us-east4) |
| 156 | + value: us-east4 |
| 157 | + - label: Columbus (us-east5) |
| 158 | + value: us-east5 |
| 159 | + - label: Dallas (us-south1) |
| 160 | + value: us-south1 |
| 161 | + - label: Montreal (northamerica-northeast1) |
| 162 | + value: northamerica-northeast1 |
| 163 | + - label: Toronto (northamerica-northeast2) |
| 164 | + value: northamerica-northeast2 |
| 165 | + - label: Queretaro (northamerica-south1) |
| 166 | + value: northamerica-south1 |
| 167 | + |
| 168 | + # South America |
| 169 | + - label: Sao Paulo (southamerica-east1) |
| 170 | + value: southamerica-east1 |
| 171 | + - label: Santiago (southamerica-west1) |
| 172 | + value: southamerica-west1 |
| 173 | + |
| 174 | + # Europe |
| 175 | + - label: Belgium (europe-west1) |
| 176 | + value: europe-west1 |
| 177 | + - label: London (europe-west2) |
| 178 | + value: europe-west2 |
| 179 | + - label: Frankfurt (europe-west3) |
| 180 | + value: europe-west3 |
| 181 | + - label: Netherlands (europe-west4) |
| 182 | + value: europe-west4 |
| 183 | + - label: Zurich (europe-west6) |
| 184 | + value: europe-west6 |
| 185 | + - label: Milan (europe-west8) |
| 186 | + value: europe-west8 |
| 187 | + - label: Paris (europe-west9) |
| 188 | + value: europe-west9 |
| 189 | + - label: Berlin (europe-west10) |
| 190 | + value: europe-west10 |
| 191 | + - label: Turin (europe-west12) |
| 192 | + value: europe-west12 |
| 193 | + - label: Madrid (europe-southwest1) |
| 194 | + value: europe-southwest1 |
| 195 | + - label: Finland (europe-north1) |
| 196 | + value: europe-north1 |
| 197 | + - label: Stockholm (europe-north2) |
| 198 | + value: europe-north2 |
| 199 | + - label: Warsaw (europe-central2) |
| 200 | + value: europe-central2 |
| 201 | + |
| 202 | + # Middle East |
| 203 | + - label: Doha (me-central1) |
| 204 | + value: me-central1 |
| 205 | + - label: Dammam (me-central2) |
| 206 | + value: me-central2 |
| 207 | + - label: Tel Aviv (me-west1) |
| 208 | + value: me-west1 |
| 209 | + |
| 210 | + # Asia |
| 211 | + - label: Mumbai (asia-south1) |
| 212 | + value: asia-south1 |
| 213 | + - label: Delhi (asia-south2) |
| 214 | + value: asia-south2 |
| 215 | + - label: Singapore (asia-southeast1) |
| 216 | + value: asia-southeast1 |
| 217 | + - label: Jakarta (asia-southeast2) |
| 218 | + value: asia-southeast2 |
| 219 | + - label: Taiwan (asia-east1) |
| 220 | + value: asia-east1 |
| 221 | + - label: Hong Kong (asia-east2) |
| 222 | + value: asia-east2 |
| 223 | + - label: Tokyo (asia-northeast1) |
| 224 | + value: asia-northeast1 |
| 225 | + - label: Osaka (asia-northeast2) |
| 226 | + value: asia-northeast2 |
| 227 | + - label: Seoul (asia-northeast3) |
| 228 | + value: asia-northeast3 |
| 229 | + |
| 230 | + # Australia |
| 231 | + - label: Sydney (australia-southeast1) |
| 232 | + value: australia-southeast1 |
| 233 | + - label: Melbourne (australia-southeast2) |
| 234 | + value: australia-southeast2 |
| 235 | + |
| 236 | + # Africa |
| 237 | + - label: Johannesburg (africa-south1) |
| 238 | + value: africa-south1 |
| 239 | + default: us |
| 240 | + required: true |
| 241 | + immutable: true |
| 242 | + |
104 | 243 | events: |
105 | 244 | - type: firebase.extensions.firestore-shorten-urls-bitly.v1.onStart |
106 | 245 | description: |
107 | 246 | Occurs when a trigger has been called within the Extension, and will |
108 | 247 | include data such as the context of the trigger request. |
109 | 248 |
|
110 | 249 | - type: firebase.extensions.firestore-shorten-urls-bitly.v1.onSuccess |
111 | | - description: |
112 | | - Occurs when image resizing completes successfully. The event will contain |
113 | | - further details about specific formats and sizes. |
| 250 | + description: Occurs when URL shortening completes successfully. |
114 | 251 |
|
115 | 252 | - type: firebase.extensions.firestore-shorten-urls-bitly.v1.onError |
116 | 253 | description: |
|
0 commit comments