Git Product home page Git Product logo

experimental-extensions's Introduction

Experimental extensions

This repository contains the source for experimental extensions. Created by Firebase, these experimental extensions may be useful in your project, but don't have the same level of testing and support as the official extensions.

New to Extensions? You can learn more at the Firebase Extensions product page. You can find all official extensions on the Extensions Marketplace.

Each directory in this repo contains the source code for an extension and a README to explain how the extension works, including information about the APIs enabled, resources created, and the access granted to the extension.

List of experimental extensions

Want to install one of these? Visit each extension's linked README for installation instructions.

Set custom claims for Firebase Auth users from values set in Firestore.

Use this extension to get toxicity scores from Perspective API for comments written to a Cloud Firestore collection.

Write documents to Firestore at an arbitrary time in the future.

Determines the sentiment magnitude and score for given text values in Firestore.

Shortens URLs written to a specified Cloud Firestore collection using Firebase Dynamic Links.

Serves Firestore Data Bundles based on specs defined as Firestore Documents, with the ability to use Hosting and Storage as cache.

Extracts text from images uploaded to a Cloud Storage bucket and writes extracted text to Firestore.

Extracts labels from your videos uploaded to Storage and writes the extracted labels to Storage as a JSON file.

Extension to store links to Google Cloud Storage objects in a Firestore collection.

Transcode video files into formats suitable for consumer distribution.

Status

Status: Experimental

This repository is maintained by Googlers but is not a supported Firebase product. Issues here are answered by maintainers and other community members on GitHub on a best-effort basis.

experimental-extensions's People

Contributors

cabljac avatar cynthiajoan avatar dackers86 avatar ehesp avatar elvisun avatar gaetschwartz avatar huangjeff5 avatar i14h avatar jarrodonlo avatar jhuleatt avatar mbleigh avatar paultr avatar pavelgj avatar russellwheatley avatar salakar avatar wu-hui avatar yamankatby avatar yannicel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

experimental-extensions's Issues

Installation Audit

Ext name Valid Source Files Prs
firestore-auth-claims โœ“
firestore-bundle-server โœ“ #63
firestore-perspective-toxicity n/a
firestore-scheduld-writes โœ“
firestore-sentiment-analysis โœ“
firestore-shorten-urls-dynamic-links โœ“
storage-extract-image-text โœ“
storage-image-labeling โœ“
storage-label-videos n/a
storage-mirror-firestore โœ“
storage-transcode-videos n/a

Can we use this extension to check if a video has inappropriate content like nudity or violence

I want to do this on the device not on the cloud.
Our users record and chooses videos from their camera or internal storage.
I want to process these videos and check if they are safe before uploading them to Firebase storage.
By using ffmpeg I can convert the video in to many images so I can feed them to this plugin.
Do I need a seperate model for the inappropriate filtering?

Could you please direct me to the right path?

EDIT: I have seen a product called SafeSearch in Google Cloud Vision
https://cloud.google.com/blog/products/ai-machine-learning/filtering-inappropriate-content-with-the-cloud-vision-api
Does this help with Flutter and doing it in the client?
It gives results very suitable for my case:

"safeSearchAnnotation" : {
      "spoof" : "VERY_UNLIKELY",
      "medical" : "UNLIKELY",
      "adult" : "VERY_UNLIKELY",
      "violence" : "VERY_UNLIKELY"
   }

[firestore-sentiment-analysis] Reconfiguring collection path causes Error deploying extension

Expected Behavior

It is possible to create a Firestore collection with spaces and punctuation.

I would expect reconfiguring COLLECTION_PATH for firestore-stentiment-analysis to either support spaces and punctuation as firestore does OR the reconfigure action fails the regex validation.

Actual Behavior

Reconfiguring firestore-sentiment-analysis doesn't stop me from configuring COLLECTION_PATH with spaces and punctuation, but it results in "error deploying Extension" with the following error output:

Error saving configuration:

; RESOURCE_ERROR at /deployments/firebase-ext-firestore-sentiment-analysis/resources/fssentiment: {"ResourceType":"gcp-types/cloudfunctions-v1:projects.locations.functions","ResourceErrorCode":"500","ResourceErrorMessage":"Failed to configure trigger providers/cloud.firestore/eventTypes/[email protected] (__gcf__.europe-west2.ext-firestore-sentiment-analysis-fssentiment)"}

Steps to Reproduce the Problem

Install firestore-sentiment-analysis, setting the collection path to something including spaces and punctuation. In my case, this is a collection!.

Specifications

  • Extension name: firestore-sentiment-analysis
  • Version: 0.0.1

why is experimental extensions

Hey! Your extension is very useful.
I was wondering why it's labeled as experimental.
Are there any known issues with it?

[firestore-sentiment-analysis] Postinstall magnitude value seems incorrect

Expected Behavior

Score can be a positive or negative float, between -1 and 1, and magnitude is the absolute value of that. Magnitude is always positive and should not exceed 1.

Actual Behavior

The example provided in the POSTINSTALL:

{
  to_analyze: 'Firebase is absolutely amazing. 10/10, would recommend it to everyone I know.',
  sentiment: {
    magnitude: 1.899999976158142,
    score: 0.8999999761581421,
  },
}

Question: How can I sign up to Firebase Extensions Alpha Program?

Hello,

I'm watching Firebase Summit 2021 video and I hear that joining this program would allow me to learn how to build custom cloud functions from the ground up.

I've been a GCP customer for about 3 years so I would love to learn more on this amazing topic.

Regards

[storage-extract-image-text] Invalid link appears on extension details

Expected Behavior

Extension details link should link to a valid page showing the extensions details.

Actual Behavior

It directs to an invalid link similar to https://console.firebase.google.com/project/extensions-testing/extensions/instances/null.

Steps to Reproduce the Problem

  1. Install the latest storage-extract-image-text extension.
  2. Select the extensions from your list of extensions.
  3. Click Extension Details as shown below...

๏ฟผ
image

Specifications

  • Extension name: storage-extract-image-text
  • Version: 0.0.1

[firestore-shorten-urls-dynamic-links] Note that created links won't show up in Firebase console

We should add a note to POSTINSTALL.md to explain that dynamic links created by this extension won't show up in the console.

Expected Behavior

Dynamic links created by the extension would show up in the FDL console

Actual Behavior

They don't, but it turns out this is expected per the Firebase docs

Short Dynamic Links created with the API and client (Android/iOS) SDK do not show up in the Firebase console.

[storage-extract-image-text] Error logs appear with duplicate images

Expected Behaviour

The extension should gracefully handle multiple images of the same name.

Actual Behaviour

Multiple error logs appear showing an issue. The extensions still works as expected, however.

Steps to Reproduce the Problem

  1. Install the extension.
  2. Ensure the resize image extensions is also installed.
  3. Attempt to extract image text by running the extract image text extension.
  4. Examine the logs.

What happened? How can we make the problem occur?

image

Specifications

  • Extension name: 0.0.1
  • Version: storage-extract-image-text

[firestore-shorten-urls-dynamic-links] Regex validation on DYNAMIC_LINKS_URL_PREFIX

Expected Behavior

There should be some validationRegex for this parameter, since we know it should look likehttps://*.page.link

Actual Behavior

There isn't any validation. If you try to install with something invalid, the extension deploys correctly but sets shortUrl to undefined every time it triggers.

Specifications

  • Extension name: firestore-shorten-urls-dynamic-links
  • Version: 0.1.1

[firestore-shorten-urls-dynamic-links] Links won't open in Safari (iOS)

Expected Behavior

Short links should open and redirect to full URL in Safari (iOS) like in any Chrome

Actual Behavior

White screen appears. Clicking anywhere starts redirection

Steps to Reproduce the Problem

Create a web project (no apps). Configure extension firestore-shorten-urls-dynamic-links or just use REST API to create short links.

I already tried creating an iOS app in console, using efr=1 param, generating the short link manually skipping the app preview, using enableForcedRedirect...

If you open the short url in Chrome, you get a 200 response and then the browser calls same URL with ?_imcp=1 param, and it resolves as a 302 with location the full url.

chrome

If you open the short url in Safari, you get a 200 OK response and a white page, that's it. If you open short url with ?_imcp=1 param, you get a 200 instead of 302.

safari

Merging Sentiment Analysis extension with firestore-nlp-extension

The sentiment analysis extension is very similar to the Firestore NLP extension, which is written by an intern on the Firebase ML team last summer. Both extensions uses the Cloud NLP API and are very similar in the way they are built, so I'm proposing that we merge them into one.

In terms of the delta between the two extensions:

  • The current Sentiment Analysis Extension have a small amount of installs.
  • The Firestore NLP Extension has a richer feature set - it gives users ability to choose which of the following tasks to perform: sentiment analysis, entity extraction, content classification. Also it might be easier for us to maintain, since it's written in TS and has good unit test coverage.

Collaboration

Anyone intersted on building extensions, plug ins, games and apps let me know.

[email protected]

Or hmu on GitHub as I need these ideas turned into a reality for everyone. I will pay and and have registered a company on the behalf of myself and whomever replies to this ad

I look forward to engineering some breakthrough technology and forever becing greatful for learning the process as I am a cplete noob lol.

But I will say I have some good ideas that will need to be immediately consoder by some top notch players.

We need avatar specialists such as bitmoji

We need drafters for objects

We need expert script readers and writers in any form for I can explain the idea and I would love one to create it

Would be cool to know someone in these fields as well meet someone who can develop something new yet refresh something old or In yes.

Like copy paste and change / add

Who's in?

[firestore-schedule-writes] Strange error appears in log after successful write

Expected Behavior

There should be no logs after a successful write (or just something indicating success).

Actual Behavior

After a write has been successfully delivered, this error appears in the logs. The functionality is still working as expected, but the logs look as if there is an issue: https://screencast.googleplex.com/cast/NDkzODU0MTQ1OTA0NjQwMHxjNzNmY2E2Mi1mYg

Steps to Reproduce the Problem

What happened? How can we make the problem occur?
Set up the extension and create a new queued_write object. After it has been delivered, check the logs to see the error.

Specifications

  • Extension name: firestore-schedule-writes
  • Version: 0.0.1

[firestore-auth-claims] Specifying "Claims Field" field in the configuration results in error

Expected Behavior

With "claims field" specified in the extension configuration, only the data in that field is synced with the custom claim for the user.

Actual Behavior

Nothing happens - error message from CF3:

Error: CustomUserClaims argument must be an object or null.
  at FirebaseAuthError.FirebaseError [as constructor] (/workspace/node_modules/firebase-admin/lib/utils/error.js:42:28)
  at FirebaseAuthError.PrefixedFirebaseError [as constructor] (/workspace/node_modules/firebase-admin/lib/utils/error.js:88:28)
  at new FirebaseAuthError (/workspace/node_modules/firebase-admin/lib/utils/error.js:147:16)
  at AuthRequestHandler.AbstractAuthRequestHandler.setCustomUserClaims (/workspace/node_modules/firebase-admin/lib/auth/auth-api-request.js:999:35)
  at Auth.BaseAuth.setCustomUserClaims (/workspace/node_modules/firebase-admin/lib/auth/auth.js:342:40)
  at /workspace/lib/index.js:38:16 at processTicksAndRejections (internal/process/task_queues.js:97:5)

Steps to Reproduce the Problem

  1. While installing/updating the firestore-auth-claims extension, specify a claims field, e.g. "role".
  2. Trigger an extension by manually modifying the content of the document in the collection configured in the extension, e.g. in the user_claims collection, set { "role": "admin" }.
  3. Auth claims of the user is updated w/ the value of the "role" field in the document.

Specifications

  • Extension name: firestore-auth-claims
  • Version: 0.1.0

[firestore-scheduled-writes] Error logs appear even with successful writes

Expected Behavior

Logging should be successful and not contain error logs when a successful rite has been made.

Actual Behavior

An error log appears, stating the document cannot be found. The extensions appear to have worked as expected.

Steps to Reproduce the Problem

  • Follow standard directions for installation in README.
  • Run the example code snippet
const TEN_MINUTES_MS = 10 * 60 * 1000;

firebase
  .firestore()
  .collection("queued_writes")
  .add({
    state: "PENDING",
    data: { message: "Hello from the future!" },
    deliverTime: firebase.firestore.Timestamp.fromMillis(
      Date.now() + TEN_MINUTES_MS
    )
  });

What happened? How can we make the problem occur?

๏ฟผ
image

Specifications

  • Extension name: firestore-schedule-writes
  • Version: 0.0.1

[storage-mirror-firestore] Generated image links result in an error

Expected Behavior

The user should be successfully redirected to the storage object.

Actual Behavior

A http error will occur, an error message should will resemble...

{
  "error": {
    "code": 401,
    "message": "Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object.",
    "errors": [
      {
        "message": "Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object.",
        "domain": "global",
        "reason": "required",
        "locationType": "header",
        "location": "Authorization"
      }
    ]
  }
}

Steps to Reproduce the Problem

  1. Upload an example to generate a mirrored storage object.
  2. Inspect the Firestore database and located either a media or selfLink url.
  3. Click to follow the link

Specifications

  • Extension name: storage-mirror-firestore
  • Version: 0.1.0

Image Text Extraction does not allow the storage path to be further specified

Expected Behavior

Being able to choose a sub path to look for the added files.

Actual Behavior

Only the home directory is allowed, slashes are forbidden

Steps to Reproduce the Problem

  1. Install the experimental Image Text Extraction extension
  2. Enter a "/subdir"
  3. Look at the error saying invalid.

Specifications

  • Extension name: Image Text Extraction
  • Version: 0.0.1

[firestore-sentiment-analysis] Reconfiguring sentiment output field name

Expected Behavior

Reconfiguring the sentiment output field name to a non-default value, and writing to Firestore should cause the Extension to write the sentiment scores into the newly specified output field name.

Actual Behavior

The extension writes to both the new field name and the old field name:

Screenshot 2021-01-14 at 2 13 30 PM

Steps to Reproduce the Problem

  1. Install firestore-sentiment-analysis
  2. Reconfigure the output field name param to something other than sentiment
  3. Write to the collection a document with key:value to_analyze: some example text
  4. See the output sentiment created twice, once for the default key value and once for the newly specified key.

Specifications

  • Extension name: firestore-sentiment-analysis
  • Version: 0.0.1

Create link to 'How to install extensions' in READMEs

Expected Behavior

Have a link to 'what is an extension' or 'how to install an extension' for new developers who land on any of these extensions.

Actual Behavior

New users might not understand what these extensions are.

Steps to Reproduce the Problem

What happened? How can we make the problem occur?
This could be a description, log/console output, etc.

Specifications

  • Extension name: ALL
  • Version:

firebase-auth-claims extension does not run against the emulator

Expected Behavior

The firebase-auth-claims sets custom claims using the authentication emulator.

Actual Behavior

The firestore user_claims document is created in the emulator. I can see the user_claims object and add attributes.

The extension attempts to update claims in the cloud instance, not the local auth emulator. I can validate this by using a uid from the cloud. When the local firestore emulator user_claims is written with a cloud uid, it updates the cloud ok - no error.

When I attempt to use a local auth emulator id, I get " error: FirebaseAuthError: There is no user record corresponding to the provided identifier". This uid does not exist in the cloud. I understand the error - but not how to get the extension to use the auth emulator.

My other functions work fine in the emulator, and clearly the extension is being triggered by a write to the firestore emulator instance. It's just not going against the local auth emulator.

I also get a "'firebase-admin' dependency is below version 9.3.0," It looks like the extension needs to be updated?

Steps to Reproduce the Problem

What happened? How can we make the problem occur?

Install the extension using the cli
Add a doc to user_claims with the id of an existing user in the authentication emulator.

Specifications

  • Extension name: firebase-auth-claims
  • Version: 0.1.1

Image Text Extraction function not working, index.js seems to be missing

Expected Behavior

After installing the experimental extension Image Text Extraction, I would have expected the Cloud Function to be installed properly as well.

Actual Behavior

Cloud Function is failing because "index.js" is missing.

{
  "protoPayload": {
    "@type": "type.googleapis.com/google.cloud.audit.AuditLog",
    "status": {
      "code": 3,
      "message": "Build failed: lib/index.js does not exist; Error ID: bc73f5cd"
    },
    "authenticationInfo": {
      "principalEmail": "[email protected]"
    },
    "serviceName": "cloudfunctions.googleapis.com",
    "methodName": "google.cloud.functions.v1.CloudFunctionsService.UpdateFunction",
    "resourceName": "projects/MyProjectName/locations/europe-west3/functions/ext-storage-extract-image-text-extractText"
  },
  "insertId": "-6dcq53bdy",
  "resource": {
    "type": "cloud_function",
    "labels": {
      "project_id": "jpabiggmbh-001",
      "region": "europe-west3",
      "function_name": "ext-storage-extract-image-text-extractText"
    }
  },
  "timestamp": "2021-02-16T10:59:36.945647Z",
  "severity": "ERROR",
  "logName": "projects/MyProjectName/logs/cloudaudit.googleapis.com%2Factivity",
  "operation": {
    "id": "operations/anBhYmlnZ21iaC0wMDEvZXVyb3BlLXdlc3QzL2V4dC1zdG9yYWdlLWV4dHJhY3QtaW1hZ2UtdGV4dC1leHRyYWN0VGV4dC9TV0diZURmWHFONA",
    "producer": "cloudfunctions.googleapis.com",
    "last": true
  },
  "receiveTimestamp": "2021-02-16T10:59:37.161659787Z"
}

Steps to Reproduce the Problem

  1. Go to the extensions tab in Firebase
  2. Choose the experimental extension
  3. Choose Image Text Extraction
  4. Enter all the details, in my case Europe-West-3 (Frankfurt)

Specifications

  • Extension name: Image Text Extraction
  • Version: 0.0.1

[firestore-bundle-server] Deployment failed

Expected Behavior

Installing via the Firebase console or CLI should deploy correctly.
The last deployment of the extension in GCP should not say "Version 1, deployment failed at ..."

Actual Behavior

Installing via CLI or UI fails. The extension installs correctly, but when I check the GCP deployment it says "failed".

The actual error message is:

Deployment failure:
Build failed: lib/index.js does not exist; Error ID: bc73f5cd

When I download the .zip with the source code, there is no lib folder, there's just src/ and test/ (same as in this Github repo).

Steps to Reproduce the Problem

Install the extension.

Specifications

  • Extension name: firestore-bundle-server
  • Version: v0.1.1

[storage-mirror-firestore] Documentation does not format as expected

Expected Behavior

Documentation on how this extension works should display correctly within it's container.

Actual Behavior

image

Steps to Reproduce the Problem

  1. Install the latest version of the extension.
  2. Click to view the installed extension.
  3. Select how this extension works

Specifications

  • Extension name: storage-mirror-firestore
  • Version: 0.1.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.