-
Notifications
You must be signed in to change notification settings - Fork 384
/
extension.yaml
111 lines (93 loc) · 3.92 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
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: firestore-shorten-urls-bitly
version: 0.1.14
specVersion: v1beta
displayName: Shorten URLs in Firestore
description:
Shortens URLs written to a specified Cloud Firestore collection (uses Bitly).
license: Apache-2.0
sourceUrl: https://github.com/firebase/extensions/tree/master/firestore-shorten-urls-bitly
releaseNotesUrl: https://github.com/firebase/extensions/blob/master/firestore-shorten-urls-bitly/CHANGELOG.md
author:
authorName: Firebase
url: https://firebase.google.com
contributors:
- authorName: Chris Bianca
email: chris@csfrequency.com
url: https://github.com/chrisbianca
- authorName: Kevin Cheung
email: kevincheung@google.com
url: https://github.com/kevinthecheung
- authorName: Invertase
email: oss@invertase.io
url: https://github.com/invertase
billingRequired: true
roles:
- role: datastore.user
reason: Allows the extension to write shortened URLs to Cloud Firestore.
resources:
- name: fsurlshortener
type: firebaseextensions.v1beta.function
description:
Listens for writes of new URLs to your specified Cloud Firestore collection, shortens the URLs,
then writes the shortened form back to the same document.
properties:
runtime: nodejs18
eventTrigger:
eventType: providers/cloud.firestore/eventTypes/document.write
resource: projects/${param:PROJECT_ID}/databases/(default)/documents/${param:COLLECTION_PATH}/{documentId}
externalServices:
- name: Bitly
PricingUri: https://bitly.com/pages/pricing
params:
- param: BITLY_ACCESS_TOKEN
label: Bitly access token
type: secret
description: >
What is your Bitly access token? Generate this access token using [Bitly](https://bitly.com/a/oauth_apps).
example: a1b2c3d4e5f6g7
required: true
- param: COLLECTION_PATH
label: Collection path
description: >
What is the path to the collection that contains the URLs that you want to shorten?
example: urls
validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
validationErrorMessage: Must be a valid Cloud Firestore collection
default: urls
required: true
- param: URL_FIELD_NAME
label: URL field name
description: >
What is the name of the field that contains the original long URLs that you want to shorten?
example: url
default: url
required: true
- param: SHORT_URL_FIELD_NAME
label: Short URL field name
description: >
What is the name of the field where you want to store your shortened URLs?
example: shortUrl
default: shortUrl
required: true
events:
- type: firebase.extensions.firestore-shorten-urls-bitly.v1.onStart
description: Occurs when a trigger has been called within the Extension, and will include data such as the context of the trigger request.
- type: firebase.extensions.firestore-shorten-urls-bitly.v1.onSuccess
description: Occurs when image resizing completes successfully. The event will contain further details about specific formats and sizes.
- type: firebase.extensions.firestore-shorten-urls-bitly.v1.onError
description: Occurs when an issue has been experienced in the Extension. This will include any error data that has been included within the Error Exception.
- type: firebase.extensions.firestore-shorten-urls-bitly.v1.onCompletion
description: Occurs when the function is settled. Provides no customized data other than the context.