From 936b3a7e9eb5397ef7c00d61f0d81a2b19c46974 Mon Sep 17 00:00:00 2001 From: Mais Alheraki Date: Mon, 22 Jan 2024 14:11:12 +0300 Subject: [PATCH] format(*): remove extension.yaml from .prettierignore (#1928) --- .prettierignore | 1 - auth-mailchimp-sync/extension.yaml | 13 +- delete-user-data/extension.yaml | 79 ++++++--- firestore-bigquery-export/README.md | 6 +- firestore-bigquery-export/extension.yaml | 130 +++++++++----- firestore-counter/extension.yaml | 44 +++-- firestore-send-email/README.md | 3 +- firestore-send-email/extension.yaml | 77 ++++++--- firestore-shorten-urls-bitly/extension.yaml | 32 ++-- firestore-translate-text/extension.yaml | 63 ++++--- rtdb-limit-child-nodes/extension.yaml | 20 ++- .../rtdb-uppercase-messages/extension.yaml | 12 +- storage-resize-images/README.md | 2 +- storage-resize-images/extension.yaml | 158 +++++++++++------- 14 files changed, 402 insertions(+), 238 deletions(-) diff --git a/.prettierignore b/.prettierignore index 4b80abf94..524d6f3d3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,4 @@ package.json -extension.yaml package-lock.json **/node_modules/** diff --git a/auth-mailchimp-sync/extension.yaml b/auth-mailchimp-sync/extension.yaml index 526bb9a33..6ad20e0ec 100644 --- a/auth-mailchimp-sync/extension.yaml +++ b/auth-mailchimp-sync/extension.yaml @@ -43,7 +43,9 @@ billingRequired: true roles: - role: firebaseauth.viewer - reason: Allows the extension to read existing users while handling lifecycle events. + reason: + Allows the extension to read existing users while handling lifecycle + events. resources: - name: addUserToList @@ -68,11 +70,10 @@ resources: eventTrigger: eventType: providers/firebase.auth/eventTypes/user.delete resource: projects/${param:PROJECT_ID} - + - name: addExistingUsersToList type: firebaseextensions.v1beta.function - description: - Adds existing users into the specified Mailchimp audience. + description: Adds existing users into the specified Mailchimp audience. properties: runtime: nodejs18 taskQueueTrigger: {} @@ -117,7 +118,8 @@ params: - param: DO_BACKFILL label: Import existing users into Mailchimp audience description: >- - Do you want to add existing users to the Mailchimp audience when you install or update this extension? + Do you want to add existing users to the Mailchimp audience when you + install or update this extension? type: select required: true options: @@ -126,7 +128,6 @@ params: - label: No value: false - lifecycleEvents: onInstall: function: addExistingUsersToList diff --git a/delete-user-data/extension.yaml b/delete-user-data/extension.yaml index 38cc534f3..97db2e780 100644 --- a/delete-user-data/extension.yaml +++ b/delete-user-data/extension.yaml @@ -50,7 +50,10 @@ roles: - role: storage.admin reason: Allows the extension to delete (user) data from Cloud Storage. - role: pubsub.admin - reason: Allows the extension to publish and subscribe to PubSub events. The extension uses PubSub to parallelize deletion and data discovery, no PubSub data is deleted. + reason: + Allows the extension to publish and subscribe to PubSub events. The + extension uses PubSub to parallelize deletion and data discovery, no + PubSub data is deleted. resources: - name: clearData @@ -86,14 +89,15 @@ params: - param: FIRESTORE_PATHS label: Cloud Firestore paths description: >- - Which paths in your Cloud Firestore instance contain data keyed on a user ID? Leave - empty if you don't use Cloud Firestore. + Which paths in your Cloud Firestore instance contain data keyed on a user + ID? Leave empty if you don't use Cloud Firestore. - Enter the full paths, separated by commas. Use `{UID}` as a placeholder for the user's UID. + Enter the full paths, separated by commas. Use `{UID}` as a placeholder + for the user's UID. - For example, if you have the collections `users` and `admins`, and each - collection has documents with User ID as document IDs, then enter - `users/{UID},admins/{UID}`. + For example, if you have the collections `users` and `admins`, and each + collection has documents with User ID as document IDs, then enter + `users/{UID},admins/{UID}`. type: string example: users/{UID},admins/{UID} required: false @@ -116,17 +120,22 @@ params: - param: SELECTED_DATABASE_INSTANCE label: Realtime Database instance description: > - What is the ID of the Realtime Database instance from which you want to delete user data (keyed on user ID)? + What is the ID of the Realtime Database instance from which you want to + delete user data (keyed on user ID)? type: string example: my-instance validationRegex: ^[^\.\$\#\]\[\/\x00-\x1F\x7F]+$ - validationErrorMessage: Invalid database instance. Make sure that you have entered just the instance ID, and not the entire database URL. + validationErrorMessage: + Invalid database instance. Make sure that you have entered just the + instance ID, and not the entire database URL. required: false - param: SELECTED_DATABASE_LOCATION label: Realtime Database location description: > - (Only applicable if you provided the `Realtime Database instance` parameter.) From which Realtime Database location do you want to delete data keyed on a user ID? + (Only applicable if you provided the `Realtime Database instance` + parameter.) From which Realtime Database location do you want to delete + data keyed on a user ID? type: select options: - label: United States @@ -141,12 +150,13 @@ params: - param: RTDB_PATHS label: Realtime Database paths description: >- - Which paths in your Realtime Database instance contain data keyed on a user ID? Leave - empty if you don't use Realtime Database. + Which paths in your Realtime Database instance contain data keyed on a + user ID? Leave empty if you don't use Realtime Database. - Enter the full paths, separated by commas. Use `{UID}` as a placeholder for the user's UID. + Enter the full paths, separated by commas. Use `{UID}` as a placeholder + for the user's UID. - For example: `users/{UID},admins/{UID}`. + For example: `users/{UID},admins/{UID}`. type: string example: users/{UID},admins/{UID} @@ -155,7 +165,7 @@ params: - param: CLOUD_STORAGE_BUCKET label: Cloud Storage bucket description: > - Which Google Cloud Storage bucket do you want to delete files from? + Which Google Cloud Storage bucket do you want to delete files from? type: string example: my-project-12345.appspot.com validationRegex: ^([0-9a-z_.-]*)$ @@ -166,8 +176,8 @@ params: - param: STORAGE_PATHS label: Cloud Storage paths description: >- - Where in Google Cloud Storage do you store data keyed on a user ID? Leave empty if you - don't use Cloud Storage. + Where in Google Cloud Storage do you store data keyed on a user ID? Leave + empty if you don't use Cloud Storage. Enter the full paths to files or directories in your Storage buckets, separated by commas. Use `{UID}` to represent the User ID of the deleted @@ -177,8 +187,8 @@ params: bucket with the file naming scheme `{UID}-pic.png`, enter `{DEFAULT}/{UID}-pic.png`. To also delete all the files in another bucket called my-app-logs with the file naming scheme `{UID}-logs.txt`, enter - `{DEFAULT}/{UID}-pic.png,my-app-logs/{UID}-logs.txt`. To *also* delete a User - ID-labeled directory and all its files (like `media/{UID}`), enter + `{DEFAULT}/{UID}-pic.png,my-app-logs/{UID}-logs.txt`. To *also* delete a + User ID-labeled directory and all its files (like `media/{UID}`), enter `{DEFAULT}/{UID}-pic.png,my-app-logs/{UID}-logs.txt,{DEFAULT}/media/{UID}`. type: string example: "{DEFAULT}/{UID}-pic.png,my-awesome-app-logs/{UID}-logs.txt" @@ -187,7 +197,8 @@ params: - param: ENABLE_AUTO_DISCOVERY label: Enable auto discovery description: >- - Enable the extension to automatically discover Firestore collections and documents to delete. + Enable the extension to automatically discover Firestore collections and + documents to delete. type: select options: - label: Yes @@ -200,7 +211,10 @@ params: - param: AUTO_DISCOVERY_SEARCH_DEPTH label: Auto discovery search depth description: >- - If auto discovery is enabled, how deep should auto discovery find collections and documents. For example, setting to `1` would only discover root collections and documents, whereas setting to `9` would search sub-collections 9 levels deep. Defaults to `3`. + If auto discovery is enabled, how deep should auto discovery find + collections and documents. For example, setting to `1` would only discover + root collections and documents, whereas setting to `9` would search + sub-collections 9 levels deep. Defaults to `3`. validation: ^[0-9] type: string default: 3 @@ -209,7 +223,11 @@ params: - param: AUTO_DISCOVERY_SEARCH_FIELDS label: Auto discovery search fields description: >- - If auto discovery is enabled, specify what document fields are used to associate the UID with the document. The extension will delete documents where the value for one or more of these fields matches the deleting user’s UID. If left empty, document fields will not be used in auto discovery. + If auto discovery is enabled, specify what document fields are used to + associate the UID with the document. The extension will delete documents + where the value for one or more of these fields matches the deleting + user’s UID. If left empty, document fields will not be used in auto + discovery. type: string default: "id,uid,userId" required: false @@ -217,17 +235,26 @@ params: - param: SEARCH_FUNCTION label: Search function URL description: >- - Specify a URL to call that will return a list of document paths to delete. The extension will send a `POST` request to the specified `URL`, with the `uid` of the deleted user will be provided in the body of the request. The endpoint specified should return an array of firestore paths to delete. + Specify a URL to call that will return a list of document paths to delete. + The extension will send a `POST` request to the specified `URL`, with the + `uid` of the deleted user will be provided in the body of the request. The + endpoint specified should return an array of firestore paths to delete. example: https://us-west1-my-project-id.cloudfunctions.net/myTransformFunction type: string required: false events: - type: firebase.extensions.delete-user-data.v1.firestore - description: Occurs when a set of Firestore paths has been marked for deletion following a delete user trigger. + description: + Occurs when a set of Firestore paths has been marked for deletion + following a delete user trigger. - type: firebase.extensions.delete-user-data.v1.database - description: Occurs when a set of Realtime Database paths has been marked for deletion following a delete user trigger. + description: + Occurs when a set of Realtime Database paths has been marked for deletion + following a delete user trigger. - type: firebase.extensions.delete-user-data.v1.storage - description: Occurs when a set of Storage paths has been marked for deletion following a delete user trigger. \ No newline at end of file + description: + Occurs when a set of Storage paths has been marked for deletion following + a delete user trigger. diff --git a/firestore-bigquery-export/README.md b/firestore-bigquery-export/README.md index 61b40dd8a..bcc4b97b7 100644 --- a/firestore-bigquery-export/README.md +++ b/firestore-bigquery-export/README.md @@ -134,8 +134,10 @@ To install an extension, your project must be on the [Blaze (pay as you go) plan * BigQuery Time Partitioning column name: BigQuery table column/schema field name for TimePartitioning. You can choose schema available as `timestamp` OR a new custom defined column that will be assigned to the selected Firestore Document field below. Defaults to pseudo column _PARTITIONTIME if unspecified. Cannot be changed if Table is already partitioned. * Firestore Document field name for BigQuery SQL Time Partitioning field option: This parameter will allow you to partition the BigQuery table created by the extension based on selected. The Firestore Document field value must be a top-level TIMESTAMP, DATETIME, DATE field BigQuery string format or Firestore timestamp(will be converted to BigQuery TIMESTAMP). Cannot be changed if Table is already partitioned. - example: `postDate`(Ensure that the Firestore-BigQuery export extension creates the dataset and table before initiating any backfill scripts. - This step is crucial for the partitioning to function correctly. It is essential for the script to insert data into an already partitioned table.) + example: `postDate`(Ensure that the Firestore-BigQuery export extension +creates the dataset and table before initiating any backfill scripts. + This step is crucial for the partitioning to function correctly. It is +essential for the script to insert data into an already partitioned table.) * BigQuery SQL Time Partitioning table schema field(column) type: Parameter for BigQuery SQL schema field type for the selected Time Partitioning Firestore Document field option. Cannot be changed if Table is already partitioned. diff --git a/firestore-bigquery-export/extension.yaml b/firestore-bigquery-export/extension.yaml index 68eb09eae..8023d9854 100644 --- a/firestore-bigquery-export/extension.yaml +++ b/firestore-bigquery-export/extension.yaml @@ -63,8 +63,9 @@ resources: - name: fsimportexistingdocs type: firebaseextensions.v1beta.function description: - Imports exisitng documents from the specified collection into BigQuery. Imported documents will have - a special changelog with the operation of `IMPORT` and the timestamp of epoch. + Imports exisitng documents from the specified collection into BigQuery. + Imported documents will have a special changelog with the operation of + `IMPORT` and the timestamp of epoch. properties: runtime: nodejs18 taskQueueTrigger: {} @@ -75,7 +76,7 @@ resources: A task-triggered function that gets called on BigQuery sync properties: runtime: nodejs18 - taskQueueTrigger: + taskQueueTrigger: rateLimits: maxConcurrentDispatches: 500 maxDispatchesPerSecond: ${param:MAX_DISPATCHES_PER_SECOND} @@ -103,8 +104,8 @@ params: - param: DATASET_LOCATION label: BigQuery Dataset location description: >- - Where do you want to deploy the BigQuery dataset created for this extension? For help selecting a - location, refer to the [location selection + Where do you want to deploy the BigQuery dataset created for this + extension? For help selecting a location, refer to the [location selection guide](https://cloud.google.com/bigquery/docs/locations). type: select options: @@ -173,8 +174,8 @@ params: - param: BIGQUERY_PROJECT_ID label: Project Id description: >- - Override the default project bigquery instance. - This can allow updates to be directed to a bigquery instance on another project. + Override the default project bigquery instance. This can allow updates to + be directed to a bigquery instance on another project. type: string default: ${PROJECT_ID} required: true @@ -184,19 +185,23 @@ params: description: >- What is the path of the collection that you would like to export? You may use `{wildcard}` notation to match a subcollection of all documents in a - collection (for example: `chatrooms/{chatid}/posts`). Parent Firestore Document IDs from `{wildcards}` - can be returned in `path_params` as a JSON formatted string. + collection (for example: `chatrooms/{chatid}/posts`). Parent Firestore + Document IDs from `{wildcards}` can be returned in `path_params` as a + JSON formatted string. type: string example: posts validationRegex: "^[^/]+(/[^/]+/[^/]+)*$" - validationErrorMessage: Firestore collection paths must be an odd number of segments separated by slashes, e.g. "path/to/collection". + validationErrorMessage: + Firestore collection paths must be an odd number of segments separated by + slashes, e.g. "path/to/collection". default: posts required: true - param: WILDCARD_IDS label: Enable Wildcard Column field with Parent Firestore Document IDs description: >- - If enabled, creates a column containing a JSON object of all wildcard ids from a documents path. + If enabled, creates a column containing a JSON object of all wildcard ids + from a documents path. type: select options: - label: No @@ -235,14 +240,14 @@ params: default: posts required: true - - param: TABLE_PARTITIONING label: BigQuery SQL table Time Partitioning option type description: >- - This parameter will allow you to partition the BigQuery table and BigQuery view - created by the extension based on data ingestion time. You may select the granularity of - partitioning based upon one of: HOUR, DAY, MONTH, YEAR. This will - generate one partition per day, hour, month or year, respectively. + This parameter will allow you to partition the BigQuery table and BigQuery + view created by the extension based on data ingestion time. You may + select the granularity of partitioning based upon one of: HOUR, DAY, + MONTH, YEAR. This will generate one partition per day, hour, month or + year, respectively. type: select options: - label: hour @@ -261,25 +266,38 @@ params: - param: TIME_PARTITIONING_FIELD label: BigQuery Time Partitioning column name description: >- - BigQuery table column/schema field name for TimePartitioning. You can choose schema available as `timestamp` OR a new custom defined column that will be assigned to the selected Firestore Document field below. Defaults to pseudo column _PARTITIONTIME if unspecified. Cannot be changed if Table is already partitioned. + BigQuery table column/schema field name for TimePartitioning. You can + choose schema available as `timestamp` OR a new custom defined column that + will be assigned to the selected Firestore Document field below. Defaults + to pseudo column _PARTITIONTIME if unspecified. Cannot be changed if Table + is already partitioned. type: string required: false - - param: TIME_PARTITIONING_FIRESTORE_FIELD - label: Firestore Document field name for BigQuery SQL Time Partitioning field option + label: + Firestore Document field name for BigQuery SQL Time Partitioning field + option description: >- - This parameter will allow you to partition the BigQuery table created by the extension based on selected. The Firestore Document field value must be a top-level TIMESTAMP, DATETIME, DATE field BigQuery string format or Firestore timestamp(will be converted to BigQuery TIMESTAMP). Cannot be changed if Table is already partitioned. - example: `postDate`(Ensure that the Firestore-BigQuery export extension creates the dataset and table before initiating any backfill scripts. - This step is crucial for the partitioning to function correctly. It is essential for the script to insert data into an already partitioned table.) + This parameter will allow you to partition the BigQuery table created by + the extension based on selected. The Firestore Document field value must + be a top-level TIMESTAMP, DATETIME, DATE field BigQuery string format or + Firestore timestamp(will be converted to BigQuery TIMESTAMP). Cannot be + changed if Table is already partitioned. + example: `postDate`(Ensure that the Firestore-BigQuery export extension + creates the dataset and table before initiating any backfill scripts. + This step is crucial for the partitioning to function correctly. It is + essential for the script to insert data into an already partitioned + table.) type: string required: false - - param: TIME_PARTITIONING_FIELD_TYPE label: BigQuery SQL Time Partitioning table schema field(column) type description: >- - Parameter for BigQuery SQL schema field type for the selected Time Partitioning Firestore Document field option. Cannot be changed if Table is already partitioned. + Parameter for BigQuery SQL schema field type for the selected Time + Partitioning Firestore Document field option. Cannot be changed if Table + is already partitioned. type: select options: - label: TIMESTAMP @@ -297,19 +315,25 @@ params: label: BigQuery SQL table clustering description: >- This parameter will allow you to set up Clustering for the BigQuery Table - created by the extension. (for example: `data,document_id,timestamp`- no whitespaces). You can select up to 4 comma separated fields. The order of the specified columns determines the sort order of the data. - Available schema extensions table fields for clustering: `document_id, document_name, timestamp, event_id, operation, data`. + created by the extension. (for example: `data,document_id,timestamp`- no + whitespaces). You can select up to 4 comma separated fields. The order of + the specified columns determines the sort order of the data. Available + schema extensions table fields for clustering: `document_id, + document_name, timestamp, event_id, operation, data`. type: string validationRegex: ^[^,\s]+(?:,[^,\s]+){0,3}$ - validationErrorMessage: No whitespaces. Max 4 fields. e.g. `data,timestamp,event_id,operation` + validationErrorMessage: + No whitespaces. Max 4 fields. e.g. `data,timestamp,event_id,operation` example: data,document_id,timestamp required: false - param: MAX_DISPATCHES_PER_SECOND label: Maximum number of synced documents per second description: >- - This parameter will set the maximum number of syncronised documents per second with BQ. Please note, any other external updates to a Big Query table will be included within this quota. - Ensure that you have a set a low enough number to componsate. Defaults to 10. + This parameter will set the maximum number of syncronised documents per + second with BQ. Please note, any other external updates to a Big Query + table will be included within this quota. Ensure that you have a set a low + enough number to componsate. Defaults to 10. type: string validationRegex: ^([1-9]|[1-9][0-9]|[1-4][0-9]{2}|500)$ validationErrorMessage: Please select a number between 1 and 500 @@ -319,15 +343,16 @@ params: - param: BACKUP_COLLECTION label: Backup Collection Name description: >- - This (optional) parameter will allow you to specify a collection for which failed BigQuery updates - will be written to. + This (optional) parameter will allow you to specify a collection for which + failed BigQuery updates will be written to. type: string - + - param: TRANSFORM_FUNCTION label: Transform function URL description: >- - Specify a function URL to call that will transform the payload that will be written to BigQuery. - See the pre-install documentation for more details. + Specify a function URL to call that will transform the payload that will + be written to BigQuery. See the pre-install documentation for more + details. example: https://us-west1-my-project-id.cloudfunctions.net/myTransformFunction type: string required: false @@ -335,8 +360,8 @@ params: - param: USE_NEW_SNAPSHOT_QUERY_SYNTAX label: Use new query syntax for snapshots description: >- - If enabled, snapshots will be generated with the new query syntax, which should be more performant, and avoid potential - resource limitations. + If enabled, snapshots will be generated with the new query syntax, which + should be more performant, and avoid potential resource limitations. type: select options: - label: Yes @@ -349,32 +374,45 @@ params: - param: KMS_KEY_NAME label: Cloud KMS key name description: >- - Instead of Google managing the key encryption keys that protect your data, you control and manage key encryption keys in Cloud KMS. - If this parameter is set, the extension will specify the KMS key name when creating the BQ table. See the PREINSTALL.md for more details. + Instead of Google managing the key encryption keys that protect your data, + you control and manage key encryption keys in Cloud KMS. If this parameter + is set, the extension will specify the KMS key name when creating the BQ + table. See the PREINSTALL.md for more details. type: string - validationRegex: 'projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)' - validationErrorMessage: The key name must be of the format 'projects/PROJECT_NAME/locations/KEY_RING_LOCATION/keyRings/KEY_RING_ID/cryptoKeys/KEY_ID'. + validationRegex: "projects/([^/]+)/locations/([^/]+)/keyRings/([^/]+)/cryptoKeys/([^/]+)" + validationErrorMessage: + The key name must be of the format + 'projects/PROJECT_NAME/locations/KEY_RING_LOCATION/keyRings/KEY_RING_ID/cryptoKeys/KEY_ID'. required: false events: - type: firebase.extensions.firestore-counter.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. + 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-counter.v1.onSuccess - description: Occurs when image resizing completes successfully. The event will contain further details about specific formats and sizes. + description: + Occurs when image resizing completes successfully. The event will contain + further details about specific formats and sizes. - type: firebase.extensions.firestore-counter.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. - + 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-counter.v1.onCompletion - description: Occurs when the function is settled. Provides no customized data other than the context. + description: + Occurs when the function is settled. Provides no customized data other + than the context. - type: firebase.extensions.big-query-export.v1.sync.start description: Occurs on a firestore document write event. lifecycleEvents: onInstall: function: initBigQuerySync - processingMessage: Configuring BigQuery Sync and running import if configured. + processingMessage: + Configuring BigQuery Sync and running import if configured. onUpdate: function: setupBigQuerySync processingMessage: Configuring BigQuery Sync diff --git a/firestore-counter/extension.yaml b/firestore-counter/extension.yaml index d79ec0cb9..8ea851a41 100644 --- a/firestore-counter/extension.yaml +++ b/firestore-counter/extension.yaml @@ -17,7 +17,9 @@ version: 0.2.10 specVersion: v1beta displayName: Distributed Counter -description: Records event counters at scale to accommodate high-velocity writes to Cloud Firestore. +description: + Records event counters at scale to accommodate high-velocity writes to Cloud + Firestore. license: Apache-2.0 @@ -47,7 +49,9 @@ roles: resources: - name: controllerCore type: firebaseextensions.v1beta.function - description: This scheduled function either aggregates shards itself, or it schedules and monitors workers to aggregate shards. + description: + This scheduled function either aggregates shards itself, or it schedules + and monitors workers to aggregate shards. properties: runtime: nodejs18 maxInstances: 1 @@ -56,7 +60,9 @@ resources: - name: onWrite type: firebaseextensions.v1beta.function - description: Listens for changes on counter shards that may need aggregating. This function is limited to max 1 instance. + description: + Listens for changes on counter shards that may need aggregating. This + function is limited to max 1 instance. properties: runtime: nodejs18 maxInstances: 1 @@ -67,9 +73,10 @@ resources: - name: worker type: firebaseextensions.v1beta.function - description: Monitors a range of shards and aggregates them, as needed. - There may be 0 or more worker functions running at any point in time. - The controllerCore function is responsible for scheduling and monitoring these workers. + description: + Monitors a range of shards and aggregates them, as needed. There may be 0 + or more worker functions running at any point in time. The controllerCore + function is responsible for scheduling and monitoring these workers. properties: runtime: nodejs18 eventTrigger: @@ -80,12 +87,14 @@ params: - param: INTERNAL_STATE_PATH label: Document path for internal state description: >- - What is the path to the document where the extension can keep its internal state? + What is the path to the document where the extension can keep its internal + state? example: _firebase_ext_/sharded_counter validationRegex: "^[^/]+/[^/]+(/[^/]+/[^/]+)*$" validationErrorMessage: - Enter a document path, not a collection path. The path must have an even number of segments, - for example, `my_collection/doc` or `my_collection/doc/subcollection/doc`, but not `my_collection`. + Enter a document path, not a collection path. The path must have an even + number of segments, for example, `my_collection/doc` or + `my_collection/doc/subcollection/doc`, but not `my_collection`. default: _firebase_ext_/sharded_counter required: true @@ -94,16 +103,23 @@ params: description: >- In minutes, how often should the function to aggregate shards be run? validationRegex: "^[1-9][0-9]*$" - validationErrorMessage: The number of minutes must be an integer value greater than zero. + validationErrorMessage: + The number of minutes must be an integer value greater than zero. default: "1" required: true events: - type: firebase.extensions.firestore-counter.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. + 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-counter.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. - + 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-counter.v1.onCompletion - description: Occurs when the function is settled. Provides no customized data other than the context. \ No newline at end of file + description: + Occurs when the function is settled. Provides no customized data other + than the context. diff --git a/firestore-send-email/README.md b/firestore-send-email/README.md index 6200e53d2..2c1f74a06 100644 --- a/firestore-send-email/README.md +++ b/firestore-send-email/README.md @@ -75,7 +75,8 @@ Secure format: `smtps://username@gmail.com@smtp.gmail.com:465` (username only) `smtps://smtp.gmail.com:465` (No username and password) Backwards Compatible (less secure): - `smtps://username@gmail.com:password@smtp.gmail.com:465`. (username and password) + `smtps://username@gmail.com:password@smtp.gmail.com:465`. (username and +password) * SMTP password: User password for the SMTP server diff --git a/firestore-send-email/extension.yaml b/firestore-send-email/extension.yaml index aea314bfe..eb5c95664 100644 --- a/firestore-send-email/extension.yaml +++ b/firestore-send-email/extension.yaml @@ -18,7 +18,8 @@ specVersion: v1beta displayName: Trigger Email from Firestore description: - Composes and sends an email based on the contents of a document written to a specified Cloud Firestore collection. + Composes and sends an email based on the contents of a document written to a + specified Cloud Firestore collection. license: Apache-2.0 @@ -40,14 +41,17 @@ billingRequired: true roles: - role: datastore.user - reason: Allows this extension to access Cloud Firestore to read and process added email documents. + reason: + Allows this extension to access Cloud Firestore to read and process added + email documents. resources: - name: processQueue type: firebaseextensions.v1beta.function description: Processes document changes in the specified Cloud Firestore collection, - delivers emails, and updates the document with delivery status information. + delivers emails, and updates the document with delivery status + information. properties: runtime: nodejs18 eventTrigger: @@ -58,19 +62,27 @@ params: - param: SMTP_CONNECTION_URI label: SMTP connection URI description: >- - A URI representing an SMTP server this extension can use to deliver email. Note that port 25 is blocked by Google Cloud Platform, so we recommend using port 587 for SMTP connections. If you're using the SMTPS protocol, we recommend using port 465. - In order to keep passwords secure, it is recommended to omit the password from the connection string while using the `SMTP Password` field for entering secrets and passwords. - Passwords and secrets should now be included in `SMTP password` field. + A URI representing an SMTP server this extension can use to deliver email. + Note that port 25 is blocked by Google Cloud Platform, so we recommend + using port 587 for SMTP connections. If you're using the SMTPS protocol, + we recommend using port 465. In order to keep passwords secure, it is + recommended to omit the password from the connection string while using + the `SMTP Password` field for entering secrets and passwords. Passwords + and secrets should now be included in `SMTP password` field. Secure format: `smtps://username@gmail.com@smtp.gmail.com:465` (username only) `smtps://smtp.gmail.com:465` (No username and password) Backwards Compatible (less secure): - `smtps://username@gmail.com:password@smtp.gmail.com:465`. (username and password) + `smtps://username@gmail.com:password@smtp.gmail.com:465`. (username and + password) type: string example: smtps://username@smtp.hostname.com:465 validationRegex: ^(smtp[s]*://(.*?(:[^:@]*)?@)?[^:@]+:[0-9]+(\\?[^ ]*)?)$ - validationErrorMessage: Invalid SMTP connection URI. Must be in the form `smtp(s)://username:password@hostname:port` or `smtp(s)://username@hostname:port`. + validationErrorMessage: + Invalid SMTP connection URI. Must be in the form + `smtp(s)://username:password@hostname:port` or + `smtp(s)://username@hostname:port`. required: true - param: SMTP_PASSWORD @@ -83,7 +95,8 @@ params: - param: MAIL_COLLECTION label: Email documents collection description: >- - What is the path to the collection that contains the documents used to build and send the emails? + What is the path to the collection that contains the documents used to + build and send the emails? type: string default: mail validationRegex: "^[^/]+(/[^/]+/[^/]+)*$" @@ -93,42 +106,47 @@ params: - param: DEFAULT_FROM label: Default FROM address description: >- - The email address to use as the sender's address (if it's not specified in the added email document). - You can optionally include a name with the email address (`Friendly Firebaser `). + The email address to use as the sender's address (if it's not specified in + the added email document). You can optionally include a name with the + email address (`Friendly Firebaser `). type: string example: foobar@example.com validationRegex: ^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$|^.*<(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})>$ - validationErrorMessage: Must be a valid email address or valid name plus email address + validationErrorMessage: + Must be a valid email address or valid name plus email address required: true - param: DEFAULT_REPLY_TO label: Default REPLY-TO address description: >- - The email address to use as the reply-to address (if it's not specified in the added email document). + The email address to use as the reply-to address (if it's not specified in + the added email document). type: string - param: USERS_COLLECTION label: Users collection description: >- - A collection of documents keyed by user UID. - If the `toUids`, `ccUids`, and/or `bccUids` recipient options are used in the added email document, - this extension delivers email to the `email` field based on lookups in this collection. + A collection of documents keyed by user UID. If the `toUids`, `ccUids`, + and/or `bccUids` recipient options are used in the added email document, + this extension delivers email to the `email` field based on lookups in + this collection. type: string - param: TEMPLATES_COLLECTION label: Templates collection description: >- - A collection of email templates keyed by name. - This extension can render an email using a [Handlebar](https://handlebarsjs.com/) template, - if the template is specified in the added email document. + A collection of email templates keyed by name. This extension can render + an email using a [Handlebar](https://handlebarsjs.com/) template, if the + template is specified in the added email document. type: string - param: TTL_EXPIRE_TYPE label: Firestore TTL type description: >- - Do you want the firestore records to be marked with an expireAt field for a TTL policy? - If "Never" is selected then no expireAt field will be added. - Otherwise you may specify the unit of time specified by the TTL_EXPIRE_VALUE parameter. Defaults to "Never". + Do you want the firestore records to be marked with an expireAt field for + a TTL policy? If "Never" is selected then no expireAt field will be added. + Otherwise you may specify the unit of time specified by the + TTL_EXPIRE_VALUE parameter. Defaults to "Never". type: select options: - label: Never @@ -149,17 +167,22 @@ params: - param: TTL_EXPIRE_VALUE label: Firestore TTL value description: >- - In the units specified by TTL_EXPIRE_TYPE, how long do you want records to be ineligible for deletion by a TTL policy? This parameter requires the Firestore TTL type parameter - to be set to a value other than `Never`. For example, if `Firestore TTL type` is set to `Day` then setting this parameter to `1` will specify a TTL of 1 day. + In the units specified by TTL_EXPIRE_TYPE, how long do you want records to + be ineligible for deletion by a TTL policy? This parameter requires the + Firestore TTL type parameter to be set to a value other than `Never`. For + example, if `Firestore TTL type` is set to `Day` then setting this + parameter to `1` will specify a TTL of 1 day. validationRegex: "^[1-9][0-9]*$" - validationErrorMessage: The value must be an integer value greater than zero. + validationErrorMessage: + The value must be an integer value greater than zero. default: "1" required: true - param: TLS_OPTIONS label: TLS Options description: >- - A JSON value representing TLS options. For more information, see https://nodejs.org/api/tls.html#tls_class_tls_tlssocket + A JSON value representing TLS options. For more information, see + https://nodejs.org/api/tls.html#tls_class_tls_tlssocket required: false events: @@ -177,7 +200,7 @@ events: - type: firebase.extensions.firestore-send-email.v1.onSuccess description: Occurs when the extension successfully sends an email. - + - type: firebase.extensions.firestore-send-email.v1.onComplete description: Occurs when the extension completes execution. diff --git a/firestore-shorten-urls-bitly/extension.yaml b/firestore-shorten-urls-bitly/extension.yaml index 0dbfc8e81..324d9faad 100644 --- a/firestore-shorten-urls-bitly/extension.yaml +++ b/firestore-shorten-urls-bitly/extension.yaml @@ -50,8 +50,9 @@ 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. + 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: @@ -67,14 +68,16 @@ params: 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). + 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? + 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 @@ -84,7 +87,8 @@ params: - 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? + What is the name of the field that contains the original long URLs that + you want to shorten? example: url default: url required: true @@ -99,13 +103,21 @@ params: 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. + 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. + 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. - + 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. \ No newline at end of file + description: + Occurs when the function is settled. Provides no customized data other + than the context. diff --git a/firestore-translate-text/extension.yaml b/firestore-translate-text/extension.yaml index c1ba892dd..7fa725605 100644 --- a/firestore-translate-text/extension.yaml +++ b/firestore-translate-text/extension.yaml @@ -16,14 +16,12 @@ name: firestore-translate-text version: 0.1.15 specVersion: v1beta -tags: - [ - ai - ] +tags: [ai] displayName: Translate Text in Firestore description: - Translates strings written to a Cloud Firestore collection into multiple languages (uses Cloud Translation API). + Translates strings written to a Cloud Firestore collection into multiple + languages (uses Cloud Translation API). license: Apache-2.0 @@ -46,7 +44,9 @@ billingRequired: true apis: - apiName: translate.googleapis.com - reason: To use Google Translate to translate strings into your specified target languages. + reason: + To use Google Translate to translate strings into your specified target + languages. roles: - role: datastore.user @@ -56,8 +56,9 @@ resources: - name: fstranslate type: firebaseextensions.v1beta.function description: - Listens for writes of new strings to your specified Cloud Firestore collection, translates the strings, - then writes the translated strings back to the same document. + Listens for writes of new strings to your specified Cloud Firestore + collection, translates the strings, then writes the translated strings + back to the same document. properties: runtime: nodejs18 eventTrigger: @@ -67,8 +68,9 @@ resources: - name: fstranslatebackfill type: firebaseextensions.v1beta.function description: - Searches your specified Cloud Firestore collection for existing documents, translates the strings into any missing languages, - then writes the translated strings back to the same document. + Searches your specified Cloud Firestore collection for existing documents, + translates the strings into any missing languages, then writes the + translated strings back to the same document. properties: runtime: nodejs18 availableMemoryMb: 1024 @@ -79,9 +81,10 @@ params: - param: LANGUAGES label: Target languages for translations, as a comma-separated list description: > - Into which target languages do you want to translate new strings? - The languages are identified using ISO-639-1 codes in a comma-separated list, for example: en,es,de,fr. - For these codes, visit the [supported languages list](https://cloud.google.com/translate/docs/languages). + Into which target languages do you want to translate new strings? The + languages are identified using ISO-639-1 codes in a comma-separated list, + for example: en,es,de,fr. For these codes, visit the [supported languages + list](https://cloud.google.com/translate/docs/languages). example: en,es,de,fr validationRegex: "^[a-zA-Z,-]*[a-zA-Z-]{2,}$" validationErrorMessage: @@ -92,7 +95,8 @@ params: - param: COLLECTION_PATH label: Collection path description: > - What is the path to the collection that contains the strings that you want to translate? + What is the path to the collection that contains the strings that you want + to translate? example: translations validationRegex: "^[^/]+(/[^/]+/[^/]+)*$" validationErrorMessage: Must be a valid Cloud Firestore Collection @@ -102,7 +106,8 @@ params: - param: INPUT_FIELD_NAME label: Input field name description: > - What is the name of the field that contains the string that you want to translate? + What is the name of the field that contains the string that you want to + translate? example: input default: input required: true @@ -118,8 +123,9 @@ params: - param: LANGUAGES_FIELD_NAME label: Languages field name description: > - What is the name of the field that contains the languages that you want to translate into? This field is - optional. If you don't specify it, the extension will use the languages specified in the LANGUAGES parameter. + What is the name of the field that contains the languages that you want to + translate into? This field is optional. If you don't specify it, the + extension will use the languages specified in the LANGUAGES parameter. example: languages default: languages required: false @@ -127,8 +133,9 @@ params: - param: DO_BACKFILL label: Translate existing documents? description: > - Should existing documents in the Firestore collection be translated as well? - If you've added new languages since a document was translated, this will fill those in as well. + Should existing documents in the Firestore collection be translated as + well? If you've added new languages since a document was translated, this + will fill those in as well. type: select required: true options: @@ -139,16 +146,24 @@ params: events: - type: firebase.extensions.firestore-translate-text.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. + 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-translate-text.v1.onSuccess - description: Occurs when image resizing completes successfully. The event will contain further details about specific formats and sizes. + description: + Occurs when image resizing completes successfully. The event will contain + further details about specific formats and sizes. - type: firebase.extensions.firestore-translate-text.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. - + 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-translate-text.v1.onCompletion - description: Occurs when the function is settled. Provides no customized data other than the context. + description: + Occurs when the function is settled. Provides no customized data other + than the context. lifecycleEvents: onInstall: diff --git a/rtdb-limit-child-nodes/extension.yaml b/rtdb-limit-child-nodes/extension.yaml index 02c60aef0..8be612e21 100644 --- a/rtdb-limit-child-nodes/extension.yaml +++ b/rtdb-limit-child-nodes/extension.yaml @@ -18,7 +18,8 @@ specVersion: v1beta displayName: Limit Child Nodes description: - Limits the number of nodes to a specified maximum count in a specified Realtime Database path. + Limits the number of nodes to a specified maximum count in a specified + Realtime Database path. license: Apache-2.0 @@ -41,15 +42,16 @@ billingRequired: true roles: - role: firebasedatabase.admin - reason: Allows the extension to delete nodes from your Realtime Database instance. + reason: + Allows the extension to delete nodes from your Realtime Database instance. resources: - name: rtdblimit type: firebaseextensions.v1beta.function description: Listens for new child nodes in your specified Realtime Database path, - checks if the max count has been exceeded, - then deletes the oldest nodes first, as needed to maintain the max count. + checks if the max count has been exceeded, then deletes the oldest nodes + first, as needed to maintain the max count. properties: runtime: nodejs18 eventTrigger: @@ -60,7 +62,8 @@ params: - param: NODE_PATH label: Realtime Database path description: >- - What is the Realtime Database path for which you want to limit the number of child nodes? + What is the Realtime Database path for which you want to limit the number + of child nodes? type: string example: path/to/limit validationRegex: ^\S+$ @@ -70,7 +73,7 @@ params: - param: SELECTED_DATABASE_INSTANCE label: Realtime Database description: > - From which Realtime Database instance do you want to limit child nodes? + From which Realtime Database instance do you want to limit child nodes? type: string example: my-instance validationRegex: ^([0-9a-z_.-]*)$ @@ -78,12 +81,11 @@ params: default: ${DATABASE_INSTANCE} required: true - - param: MAX_COUNT label: Maximum count of nodes to keep description: >- - What is the maximum count of nodes to keep in your specified database path? - The oldest nodes will be deleted first to maintain this max count. + What is the maximum count of nodes to keep in your specified database + path? The oldest nodes will be deleted first to maintain this max count. type: string example: 10 validationRegex: ^\d+$ diff --git a/samples/rtdb-uppercase-messages/extension.yaml b/samples/rtdb-uppercase-messages/extension.yaml index e0c6e8547..064e6855b 100644 --- a/samples/rtdb-uppercase-messages/extension.yaml +++ b/samples/rtdb-uppercase-messages/extension.yaml @@ -1,6 +1,6 @@ name: rtdb-uppercase-messages version: 0.0.1 -specVersion: v1beta # Firebase Extensions specification version; don’t change +specVersion: v1beta # Firebase Extensions specification version; don’t change # Friendly display name for your extension (~3-5 words) displayName: Convert messages to upper case @@ -13,7 +13,7 @@ author: authorName: Your Name url: https://your-site.example.com -license: Apache-2.0 # https://spdx.org/licenses/ +license: Apache-2.0 # https://spdx.org/licenses/ # Public URL for the source code of your extension sourceUrl: https://github.com/firebase/extensions/tree/master/samples/rtdb-uppercase-messages @@ -27,14 +27,14 @@ resources: # DATABASE_INSTANCE (project's default instance) is an auto-populated # parameter value. You can also specify an instance. resource: projects/_/instances/${DATABASE_INSTANCE}/refs/${param:MESSAGE_PATH} - runtime: "nodejs18" + runtime: "nodejs18" - name: backfilldata type: firebaseextensions.v1beta.function - description: >- + description: >- Backfill existing messages with uppercase versions properties: taskQueueTrigger: {} - runtime: "nodejs18" + runtime: "nodejs18" roles: - role: firebasedatabase.admin @@ -69,5 +69,5 @@ events: lifecycleEvents: onInstall: - function: backfilldata + function: backfilldata processingMessage: Uppercasing existing messages diff --git a/storage-resize-images/README.md b/storage-resize-images/README.md index 59574f9a2..2974cc20f 100644 --- a/storage-resize-images/README.md +++ b/storage-resize-images/README.md @@ -81,7 +81,7 @@ If you prefer not to explicitly restrict to certain directories of your Storage * List of absolute paths not included for resized images: Ensure storage-resize-images does *not* resize images in _specific locations_ in your Storage bucket by supplying a comma-separated list of absolute paths. For example, to *exclude* the images stored in the `/foo/alpha` and its subdirectories and `/bar/beta` and its subdirectories, specify the paths `/foo/alpha,/bar/beta`. You may also use wildcard notation for directories in the path. For example, `/users/*/pictures` would exclude any images in any subdirectories of `/users/foo/pictures` as well as any images in subdirectories of `/users/bar/pictures`, but also any images in subdirectories of `/users/any/level/of/subdirectories/pictures`. -If you prefer to resize every image uploaded to your Storage bucket, leave this field empty. +If you prefer to resize every image uploaded to your Storage bucket, leave this field empty. * Cloud Storage path for failed images: A relative path in which to store failed images. For example, if you specify a path here of `failed` and you upload an image to `/images/original.jpg`, then resizing failed, the image will be stored at `/images/failed/original.jpg`. diff --git a/storage-resize-images/extension.yaml b/storage-resize-images/extension.yaml index fbba4a2c8..f8aca0987 100644 --- a/storage-resize-images/extension.yaml +++ b/storage-resize-images/extension.yaml @@ -18,7 +18,8 @@ specVersion: v1beta displayName: Resize Images description: - Resizes images uploaded to Cloud Storage to a specified size, and optionally keeps or deletes the original image. + Resizes images uploaded to Cloud Storage to a specified size, and optionally + keeps or deletes the original image. license: Apache-2.0 @@ -53,8 +54,9 @@ resources: - name: generateResizedImage type: firebaseextensions.v1beta.function description: >- - Listens for new images uploaded to your specified Cloud Storage bucket, resizes the images, - then stores the resized images in the same bucket. Optionally keeps or deletes the original images. + Listens for new images uploaded to your specified Cloud Storage bucket, + resizes the images, then stores the resized images in the same bucket. + Optionally keeps or deletes the original images. properties: runtime: nodejs18 availableMemoryMb: ${param:FUNCTION_MEMORY} @@ -74,11 +76,12 @@ params: - param: IMG_BUCKET label: Cloud Storage bucket for images description: > - To which Cloud Storage bucket will you upload images that you want to resize? - Resized images will be stored in this bucket. Depending on your extension configuration, - original images are either kept or deleted. - It is recommended to create a separate bucket for this extension. For more information, - refer to the [pre-installation guide](https://firebase.google.com/products/extensions/storage-resize-images). + To which Cloud Storage bucket will you upload images that you want to + resize? Resized images will be stored in this bucket. Depending on your + extension configuration, original images are either kept or deleted. It is + recommended to create a separate bucket for this extension. For more + information, refer to the [pre-installation + guide](https://firebase.google.com/products/extensions/storage-resize-images). type: selectResource resourceType: storage.googleapis.com/Bucket example: my-project-12345.appspot.com @@ -91,8 +94,9 @@ params: label: Sizes of resized images description: > What sizes of images would you like (in pixels)? Enter the sizes as a - comma-separated list of WIDTHxHEIGHT values. Learn more about - [how this parameter works](https://firebase.google.com/products/extensions/storage-resize-images). + comma-separated list of WIDTHxHEIGHT values. Learn more about [how this + parameter + works](https://firebase.google.com/products/extensions/storage-resize-images). type: string example: "200x200" validationRegex: ^\d+x(\d+,\d+x)*\d+$ @@ -104,9 +108,10 @@ params: - param: DELETE_ORIGINAL_FILE label: Deletion of original file description: >- - Do you want to automatically delete the original file from the Cloud Storage - bucket? Warning: these deletions cannot be undone, and if you reconfigure this - instance to use different image dimensions, you won't be able to backfill deleted images. + Do you want to automatically delete the original file from the Cloud + Storage bucket? Warning: these deletions cannot be undone, and if you + reconfigure this instance to use different image dimensions, you won't be + able to backfill deleted images. type: select options: - label: Don't delete @@ -121,8 +126,9 @@ params: - param: MAKE_PUBLIC label: Make resized images public description: >- - Do you want to make the resized images public automatically? So you can access them by URL. - For example: https://storage.googleapis.com/{bucket}/{path} + Do you want to make the resized images public automatically? So you can + access them by URL. For example: + https://storage.googleapis.com/{bucket}/{path} type: select options: - label: Yes @@ -134,8 +140,8 @@ params: - param: RESIZED_IMAGES_PATH label: Cloud Storage path for resized images description: > - A relative path in which to store resized images. For example, - if you specify a path here of `thumbs` and you upload an image to + A relative path in which to store resized images. For example, if you + specify a path here of `thumbs` and you upload an image to `/images/original.jpg`, then the resized image is stored at `/images/thumbs/original_200x200.jpg`. If you prefer to store resized images at the root of your bucket, leave this field empty. @@ -145,15 +151,20 @@ params: - param: INCLUDE_PATH_LIST label: Paths that contain images you want to resize description: > - Restrict storage-resize-images to only resize images in specific locations in your Storage bucket by - supplying a comma-separated list of absolute paths. For example, specifying the paths `/users/pictures,/restaurants/menuItems` - will resize any images found in any subdirectories of `/users/pictures` and `/restaurants/menuItems`. - - You may also use wildcard notation for directories in the path. For example, `/users/*/pictures` - would include any images in any subdirectories of `/users/foo/pictures` as well as any images in - subdirectories of `/users/bar/pictures`, but also any images in subdirectories of `/users/any/level/of/subdirectories/pictures`. - - If you prefer not to explicitly restrict to certain directories of your Storage bucket, leave this field empty. + Restrict storage-resize-images to only resize images in specific locations + in your Storage bucket by supplying a comma-separated list of absolute + paths. For example, specifying the paths + `/users/pictures,/restaurants/menuItems` will resize any images found in + any subdirectories of `/users/pictures` and `/restaurants/menuItems`. + + You may also use wildcard notation for directories in the path. For + example, `/users/*/pictures` would include any images in any + subdirectories of `/users/foo/pictures` as well as any images in + subdirectories of `/users/bar/pictures`, but also any images in + subdirectories of `/users/any/level/of/subdirectories/pictures`. + + If you prefer not to explicitly restrict to certain directories of your + Storage bucket, leave this field empty. type: string example: "/users/avatars,/design/pictures" validationRegex: ^(\/[^\s\/\,]+)+(\,(\/[^\s\/\,]+)+)*$ @@ -164,17 +175,20 @@ params: - param: EXCLUDE_PATH_LIST label: List of absolute paths not included for resized images description: > - Ensure storage-resize-images does *not* resize images in _specific locations_ in your Storage bucket by - supplying a comma-separated list of absolute paths. For example, to *exclude* the images - stored in the `/foo/alpha` and its subdirectories and `/bar/beta` and its subdirectories, specify the - paths `/foo/alpha,/bar/beta`. - - You may also use wildcard notation for directories in the path. For example, `/users/*/pictures` would - exclude any images in any subdirectories of `/users/foo/pictures` as well as any images in subdirectories of - `/users/bar/pictures`, but also any images in subdirectories of `/users/any/level/of/subdirectories/pictures`. - - If you prefer to resize every image uploaded to your Storage bucket, - leave this field empty. + Ensure storage-resize-images does *not* resize images in _specific + locations_ in your Storage bucket by supplying a comma-separated list of + absolute paths. For example, to *exclude* the images stored in the + `/foo/alpha` and its subdirectories and `/bar/beta` and its + subdirectories, specify the paths `/foo/alpha,/bar/beta`. + + You may also use wildcard notation for directories in the path. For + example, `/users/*/pictures` would exclude any images in any + subdirectories of `/users/foo/pictures` as well as any images in + subdirectories of `/users/bar/pictures`, but also any images in + subdirectories of `/users/any/level/of/subdirectories/pictures`. + + If you prefer to resize every image uploaded to your Storage bucket, leave + this field empty. type: string example: "/users/avatars/thumbs,/design/pictures/thumbs" validationRegex: ^(\/[^\s\/\,]+)+(\,(\/[^\s\/\,]+)+)*$ @@ -185,36 +199,38 @@ params: - param: FAILED_IMAGES_PATH label: Cloud Storage path for failed images description: > - A relative path in which to store failed images. For example, - if you specify a path here of `failed` and you upload an image to - `/images/original.jpg`, then resizing failed, the image will be - stored at `/images/failed/original.jpg`. - - Leave this field empty if you do not want to store failed images - in a separate directory. + A relative path in which to store failed images. For example, if you + specify a path here of `failed` and you upload an image to + `/images/original.jpg`, then resizing failed, the image will be stored at + `/images/failed/original.jpg`. + + Leave this field empty if you do not want to store failed images in a + separate directory. example: failed validationRegex: ^([^\/.]*|)$ - validationErrorMessage: - Values cannot include "/", ".". + validationErrorMessage: Values cannot include "/", ".". required: false - param: CACHE_CONTROL_HEADER label: Cache-Control header for resized images description: > - This extension automatically copies any `Cache-Control` metadata from the original image - to the resized images. For the resized images, do you want to overwrite this copied - `Cache-Control` metadata or add `Cache-Control` metadata? Learn more about - [`Cache-Control` headers](https://developer.mozilla.org/docs/Web/HTTP/Headers/Cache-Control). - If you prefer not to overwrite or add `Cache-Control` metadata, leave this field empty. + This extension automatically copies any `Cache-Control` metadata from the + original image to the resized images. For the resized images, do you want + to overwrite this copied `Cache-Control` metadata or add `Cache-Control` + metadata? Learn more about [`Cache-Control` + headers](https://developer.mozilla.org/docs/Web/HTTP/Headers/Cache-Control). + If you prefer not to overwrite or add `Cache-Control` metadata, leave this + field empty. example: max-age=86400 required: false - param: IMAGE_TYPE label: Convert image to preferred types description: > - The image types you'd like your source image to convert to. - The default for this option will be to keep the original file type as the destination file type. + The image types you'd like your source image to convert to. The default + for this option will be to keep the original file type as the destination + file type. type: multiSelect options: - label: jpeg @@ -237,8 +253,9 @@ params: - param: OUTPUT_OPTIONS label: Output options for selected formats description: > - Provide a optional output option stringified object containing Sharp Output Options for selected image types conversion. - eg. `{"jpeg": { "quality": 5, "chromaSubsampling": "4:4:4" }, "png": { "pallete": true }}` + Provide a optional output option stringified object containing Sharp + Output Options for selected image types conversion. eg. `{"jpeg": { + "quality": 5, "chromaSubsampling": "4:4:4" }, "png": { "pallete": true }}` type: string validationRegex: ^({(.*?)})$ validationErrorMessage: Please provide a valid json object. @@ -247,8 +264,9 @@ params: - param: SHARP_OPTIONS label: Sharp constructor options for resizing images description: > - Provide a optional output option stringified object containing Sharp Output Options for selected image types conversion. - eg. `{ failOnError: false, limitInputPixels: true }` + Provide a optional output option stringified object containing Sharp + Output Options for selected image types conversion. eg. `{ failOnError: + false, limitInputPixels: true }` type: string validationRegex: ^({(.*?)})$ validationErrorMessage: Please provide a valid json object. @@ -270,8 +288,9 @@ params: - param: FUNCTION_MEMORY label: Cloud Function memory description: >- - Memory of the function responsible of resizing images. - Choose how much memory to give to the function that resize images. (For animated GIF => GIF we recommend using a minimum of 2GB). + Memory of the function responsible of resizing images. Choose how much + memory to give to the function that resize images. (For animated GIF => + GIF we recommend using a minimum of 2GB). type: select options: - label: 512 MB @@ -291,7 +310,8 @@ params: - param: DO_BACKFILL label: Backfill existing images description: > - Should existing, unresized images in the Storage bucket be resized as well? + Should existing, unresized images in the Storage bucket be resized as + well? type: select required: true options: @@ -302,16 +322,24 @@ params: events: - type: firebase.extensions.storage-resize-images.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. + 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.storage-resize-images.v1.onSuccess - description: Occurs when image resizing completes successfully. The event will contain further details about specific formats and sizes. + description: + Occurs when image resizing completes successfully. The event will contain + further details about specific formats and sizes. - type: firebase.extensions.storage-resize-images.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. - + 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.storage-resize-images.v1.onCompletion - description: Occurs when the function is settled. Provides no customized data other than the context. + description: + Occurs when the function is settled. Provides no customized data other + than the context. lifecycleEvents: onInstall: