-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathextension.yaml
More file actions
88 lines (79 loc) · 2.93 KB
/
extension.yaml
File metadata and controls
88 lines (79 loc) · 2.93 KB
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
name: storage-extract-image-text
version: 0.0.4
specVersion: v1beta
displayName: Image Text Extraction
description: Extracts text from images uploaded to storage and writes extracted text to Firestore.
license: Apache-2.0 # The license you want for the extension
author:
authorName: Firebase
url: https://firebase.google.com
sourceUrl: https://github.com/FirebaseExtended/experimental-extensions/tree/main/storage-extract-image-text
billingRequired: true
apis:
- apiName: vision.googleapis.com
reason: Powers all Vision tasks performed by the extension.
resources:
- name: extractText
type: firebaseextensions.v1beta.function
description: Listens to incoming Storage documents, executes OCR on them and writes extracted text to Firestore into a preconfigured collection.
properties:
location: ${param:LOCATION}
availableMemoryMb: 1024
eventTrigger:
eventType: google.storage.object.finalize
resource: projects/_/buckets/${param:IMG_BUCKET}
runtime: "nodejs10"
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: IMG_BUCKET
label: Cloud Storage bucket for images
description: >
To which Cloud Storage bucket will you upload images from which you want to extract text?
type: string
example: my-project-12345.appspot.com
validationRegex: ^([0-9a-z_.-]*)$
validationErrorMessage: Invalid storage bucket
default: ${STORAGE_BUCKET}
required: true
- param: COLLECTION_PATH
label: Collection path
description: >
What is the path to the collection where extracted text will be written to.
example: extractedText
validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
validationErrorMessage: Must be a valid Cloud Firestore Collection
default: extractedText
required: true
roles:
- role: storage.admin
reason: Allows the extension to write to your Cloud Storage.
- role: datastore.user
reason: Allows the extension to write to your Firestore Database instance.