diff --git a/.vscode/.editorconfig b/.editorconfig similarity index 100% rename from .vscode/.editorconfig rename to .editorconfig diff --git a/.github/workflows/mobile.yml b/.github/workflows/mobile.yml index 1508c38b..8b796406 100644 --- a/.github/workflows/mobile.yml +++ b/.github/workflows/mobile.yml @@ -19,13 +19,13 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-java@v1 with: - java-version: "12.x" + java-version: "8.x" - uses: subosito/flutter-action@v1 - uses: abelfodil/protoc-action@v1 with: enable-dart: true - - run: protoc --proto_path=protos protos/* --dart_out=mobile/lib/protos + - run: protoc --proto_path=protos protos/* --dart_out=grpc:mobile/lib/protos working-directory: . - run: flutter pub get diff --git a/.github/workflows/web.yml b/.github/workflows/web.yml index b23aadff..fa8a16a6 100644 --- a/.github/workflows/web.yml +++ b/.github/workflows/web.yml @@ -15,7 +15,9 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 - uses: abelfodil/protoc-action@v1 - - run: protoc --proto_path=protos protos/* --js_out=web/src/protos + with: + enable-grpc-web: true + - run: protoc protos/* --js_out=import_style=commonjs:web/src --grpc-web_out=import_style=commonjs,mode=grpcwebtext:web/src - run: yarn --cwd web install - run: yarn --cwd web build - uses: actions/upload-artifact@v2 diff --git a/.vscode/.prettierrc.yaml b/.prettierrc.yaml similarity index 72% rename from .vscode/.prettierrc.yaml rename to .prettierrc.yaml index f51d99fc..3c7da0b7 100644 --- a/.vscode/.prettierrc.yaml +++ b/.prettierrc.yaml @@ -1,4 +1,4 @@ -trailingComma: 'all' +trailingComma: "all" tabWidth: 2 semi: true singleQuote: true diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 39f95aac..00000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "recommendations": [ - "christian-kohler.path-intellisense", - "ms-python.python", - "2gua.rainbow-brackets", - "esbenp.prettier-vscode", - "eamodio.gitlens", - "editorconfig.editorconfig", - "dbaeumer.vscode-eslint", - "dart-code.flutter", - "zxh404.vscode-proto3" - ] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 1701392a..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "prettier.configPath": ".vscode/.prettierrc.yaml", - "editor.defaultFormatter": "esbenp.prettier-vscode", - "eslint.packageManager": "yarn", - "editor.codeActionsOnSave": { - "source.fixAll.eslint": true - }, - "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[jsonc]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[json]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "protoc": { - "compile_on_save": true, - "options": ["--proto_path=protos", "--dart_out=mobile/lib/protos", "--python_out=backend/protos", "--js_out=web/src/protos"] - } -} diff --git a/README.md b/README.md index b7cc91bb..d15d745f 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This projects aims to offer a comprehensive guide to **record polysomnographic E - Install `gRPC` package from your distribution's package manager - Install `protoc` compiler -### Yarn +### Web - Install Yarn package manager - `yarn global add protoc-gen-grpc-web` @@ -18,7 +18,9 @@ This projects aims to offer a comprehensive guide to **record polysomnographic E ### Python - Install Python 3 and pip -- Run `pip install -r requirements.txt` +- Consider using `venv` to create a virtual environment +- Install gRPC using a package manager or by compiling the [source code](https://github.com/grpc/grpc) +- Create a simlink named `protoc-gen-grpc_python` to `grpc_python_plugin` using `ln -nsf $(which grpc_python_plugin) /some/where/in/your/path/protoc-gen-grpc_python` ### Flutter @@ -33,7 +35,13 @@ This projects aims to offer a comprehensive guide to **record polysomnographic E ## Dev workflow -- Open root folder on VS Code +- Open workspace `polydodo.code-workspace` - Install node modules by running `yarn install --cwd web` - Fetch Flutter dependencies through the `Flutter` extension - Compile all protos through `proto3` extension + +## Running the server locally + +- [Login](https://docs.github.com/en/free-pro-team@latest/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages#authenticating-with-a-personal-access-token) to Github Docker registry +- `docker pull docker.pkg.github.com/polycortex/polydodo/backend:latest` +- `docker run -p 8080:8080 docker.pkg.github.com/polycortex/polydodo/backend:latest` diff --git a/backend/.gitignore b/backend/.gitignore index 0cafc1cd..93163afa 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -1 +1,3 @@ -.venv/ \ No newline at end of file +.venv/ +.vscode/ +__pycache__/ diff --git a/backend/Dockerfile b/backend/Dockerfile index 97c0b228..cb6e7293 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -2,10 +2,17 @@ FROM namely/protoc-all as generator WORKDIR / COPY protos protos COPY backend backend -RUN protoc --proto_path=protos protos/* --python_out=backend/protos +RUN ln $(which grpc_python_plugin) /usr/bin/protoc-gen-grpc_python +RUN protoc protos/* --python_out=backend --grpc_python_out=backend -FROM python +FROM envoyproxy/envoy:v1.15-latest +RUN apt-get update \ + && apt-get -y install python3-pip \ + && apt-get autoremove -y \ + && apt-get clean \ + && rm -rf /tmp/* /var/tmp/* \ + && rm -rf /var/lib/apt/lists/* COPY --from=generator /backend /backend WORKDIR /backend -RUN pip install -r requirements.txt --no-cache-dir -ENTRYPOINT ["python", "app.py"] +RUN pip3 install -r requirements.txt --no-cache-dir +CMD "./start.sh" diff --git a/backend/app.py b/backend/app.py index 1ad464e1..508486f9 100644 --- a/backend/app.py +++ b/backend/app.py @@ -1,46 +1,40 @@ -from flask import Flask, render_template, url_for, request, redirect -import os -from resampling import convert_csv_to_raw -from werkzeug.utils import secure_filename - -ALLOWED_EXTENSIONS = {'csv'} - -def allowed_filename(filename): - if not '.' in filename: - print('No extension in filename') - return False - - ext = filename.rsplit('.', 1)[1] - if ext.lower() in ALLOWED_EXTENSIONS: - return True - else: - print('That file extension is not allowed') - return False - - -app = Flask(__name__) - -@app.route('/') -def index(): - return render_template('index.html') - -@app.route('/upload-csv', methods =['GET','POST']) -def upload_csv(): - if request.method == 'POST': - if request.files: - csv = request.files['csv'] - - if csv.filename =='': - print('No filename or no selected file') - return redirect(request.url) - - if allowed_filename(csv.filename): - filename = secure_filename(csv.filename) #useless si on save pas le fichier je crois - print(csv) - convert_csv_to_raw(csv) - return redirect(request.url) - - return render_template('upload_csv.html') +# Copyright 2015 gRPC authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"""The Python implementation of the GRPC helloworld.Greeter server.""" + +from concurrent import futures +import logging + +import grpc + +from protos import helloworld_pb2 +from protos import helloworld_pb2_grpc + + +class Greeter(helloworld_pb2_grpc.GreeterServicer): + def SayHello(self, request, context): + return helloworld_pb2.HelloReply(message='Hello, %s!' % request.name) + + +def serve(): + server = grpc.server(futures.ThreadPoolExecutor(max_workers=10)) + helloworld_pb2_grpc.add_GreeterServicer_to_server(Greeter(), server) + server.add_insecure_port('[::]:9090') + server.start() + server.wait_for_termination() + if __name__ == '__main__': - app.run(host='0.0.0.0', debug=True) \ No newline at end of file + logging.basicConfig() + serve() diff --git a/backend/envoy.yaml b/backend/envoy.yaml new file mode 100644 index 00000000..181806ef --- /dev/null +++ b/backend/envoy.yaml @@ -0,0 +1,40 @@ +# Taken from https://github.com/grpc/grpc-web/tree/master/net/grpc/gateway/examples/helloworld +static_resources: + listeners: + - name: listener_0 + address: + socket_address: { address: 0.0.0.0, port_value: 8080 } + filter_chains: + - filters: + - name: envoy.http_connection_manager + config: + codec_type: auto + stat_prefix: ingress_http + route_config: + name: local_route + virtual_hosts: + - name: local_service + domains: ["*"] + routes: + - match: { prefix: "/" } + route: + cluster: greeter_service + max_grpc_timeout: 0s + cors: + allow_origin_string_match: + - prefix: "*" + allow_methods: GET, PUT, DELETE, POST, OPTIONS + allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,custom-header-1,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout + max_age: "1728000" + expose_headers: custom-header-1,grpc-status,grpc-message + http_filters: + - name: envoy.grpc_web + - name: envoy.cors + - name: envoy.router + clusters: + - name: greeter_service + connect_timeout: 0.25s + type: logical_dns + http2_protocol_options: {} + lb_policy: round_robin + hosts: [{ socket_address: { address: 0.0.0.0, port_value: 9090 } }] diff --git a/backend/erreur_test.csv b/backend/erreur_test.csv deleted file mode 100644 index 7d01c400..00000000 --- a/backend/erreur_test.csv +++ /dev/null @@ -1,97 +0,0 @@ -%OBCI SD Convert - 2020-02-23_12-09-13,,,,,,,,,,, -%,,,,,,,,,,, -%Sample Rate = 250.0 Hz,,,,,,,,,,, -%First Column = SampleIndex,,,,,,,,,,, -%Last Column = Timestamp,,,,,,,,,,, -%Other Columns = EEG data in microvolts followed by Accel Data (in G) interleaved with Aux Data,,,,,,,,,,, -81436,,,,,,,,,,, -0,-11104.548,205.0996,183.9325,1208.6259,0,0,0,0,-0.026,0.28800002,0.358 -1,-11065.186,191.77795,117.45841,1185.9388,0,0,0,0,,, -2,-11017.264,180.24446,157.98212,1174.6064,0,0,0,0,,, -3,-11041.448,194.37076,150.40488,1194.6783,0,0,0,0,,, -4,-11036.777,194.03549,158.80914,1194.1195,0,0,0,0,,, -5,-11030.071,188.69342,190.191,1179.0768,0,0,0,0,,, -6,-11043.885,190.05687,167.39221,1185.0671,0,0,0,0,-0.042000003,0.45200002,0.568 -7,-11042.298,184.91597,169.8956,1178.5181,0,0,0,0,,, -8,-11060.56,186.97234,167.77219,1177.2664,0,0,0,0,,, -9,-11052.803,186.6147,172.80133,1181.759,0,0,0,0,,, -10,-11049.629,187.06174,182.18906,1170.0244,0,0,0,0,,, -11,-11065.32,189.00635,163.5924,1168.4597,0,0,0,0,,, -12,-11058.704,191.08505,169.7168,1174.83,0,0,0,0,,, -13,-11048.221,204.20554,173.1813,1184.9106,0,0,0,0,,, -14,-11061.968,204.80902,162.45247,1184.2401,0,0,0,0,,, -15,-11058.771,201.2104,179.66331,1177.8922,0,0,0,0,,, -16,-11059.777,202.0821,171.1026,1174.2041,0,0,0,0,-0.048,0.52000004,0.708 -17,-11059.777,208.11708,165.08998,1172.796,0,0,0,0,-0.074,0.53000003,0.772 -18,-11031.077,202.97618,169.60503,1175.277,0,0,0,0,,, -19,-11052.356,198.77406,178.61278,1171.8795,0,0,0,0,,, -20,-11073.657,212.45332,170.25323,1175.143,0,0,0,0,,, -21,-11060.917,209.34644,159.94908,1178.0262,0,0,0,0,,, -22,-11040.309,200.36102,186.5253,1170.695,0,0,0,0,,, -23,-11039.012,203.80319,184.04425,1168.1915,0,0,0,0,-0.108,0.51600003,0.76600003 -24,-11040.465,203.80319,183.68663,1164.4587,0,0,0,0,,, -25,-11055.553,208.49707,170.54381,1171.1643,0,0,0,0,,, -26,-11063.465,208.65353,172.91309,1179.4121,0,0,0,0,,, -27,-11054.167,201.03159,173.76245,1178.7416,0,0,0,0,,, -28,-11059.866,199.3552,175.41649,1168.7727,0,0,0,0,,, -29,-11064.046,204.49611,160.10555,1173.3771,0,0,0,0,,, -30,-11059.308,204.49611,166.09581,1170.8514,0,0,0,0,,, -31,-11062.303,200.67395,163.81593,1178.4509,0,0,0,0,,, -32,-11062.303,196.89651,171.81786,1179.7921,0,0,0,0,-0.148,0.56,0.78000003 -33,-11062.705,197.94704,163.48065,1172.9972,0,0,0,0,,, -34,-11066.103,203.1997,171.39317,1169.3986,0,0,0,0,,, -35,-11063.845,204.65256,161.02196,1167.0516,0,0,0,0,,, -36,-11057.497,206.95479,163.81593,1170.3596,0,0,0,0,,, -37,-11055.553,197.96939,165.42525,1173.6677,0,0,0,0,,, -38,-11056.826,197.54471,162.296,1166.9622,0,0,0,0,,, -39,-11057.296,204.27258,161.9831,1168.5715,0,0,0,0,,, -40,-11055.105,201.79153,169.8956,1166.9622,0,0,0,0,,, -41,-11060.805,196.44948,164.68765,1172.6842,0,0,0,0,,, -42,-11065.834,198.30467,152.7071,1178.9427,0,0,0,0,-0.14400001,0.60400003,0.81200004 -43,-11059.174,200.22691,164.41943,1174.6959,0,0,0,0,,, -44,-11060.738,198.41643,169.31445,1171.4996,0,0,0,0,,, -45,-11070.394,202.05977,163.90533,1173.3324,0,0,0,0,,, -46,-11068.069,200.07045,154.98698,1175.7911,0,0,0,0,,, -47,-11060.492,197.34355,154.33879,1169.9573,0,0,0,0,,, -48,-11052.133,192.8732,156.05988,1163.4753,0,0,0,0,,, -49,-11056.871,195.44365,164.28531,1161.4636,0,0,0,0,,, -50,-11058.369,200.6069,165.31349,1167.5657,0,0,0,0,,, -51,-11062.258,202.14917,162.92186,1170.695,0,0,0,0,,, -52,-11067.778,206.70892,149.95786,1171.2313,0,0,0,0,-0.104,0.568,0.8 -53,-11052.759,208.78764,174.09773,1168.795,0,0,0,0,,, -54,-11065.253,210.844,168.44273,1185.4918,0,0,0,0,,, -55,-11062.638,208.00533,144.36992,1183.6143,0,0,0,0,,, -56,-11059.375,209.77112,160.73138,1166.8728,0,0,0,0,,, -57,-11058.994,208.76529,154.51761,1170.0914,0,0,0,0,,, -58,-11052.825,206.82068,155.32227,1173.7347,0,0,0,0,,, -59,-11065.343,212.81096,159.32323,1172.3042,0,0,0,0,,, -60,-11068.047,214.1297,155.88106,1167.7892,0,0,0,0,,, -61,-11060.85,214.75555,159.68086,1167.1857,0,0,0,0,,, -62,-11051.037,217.4154,159.81497,1164.6152,0,0,0,0,-0.106000006,0.578,0.818 -63,-11058.324,217.7954,157.26686,1169.9796,0,0,0,0,,, -64,-11063.867,215.4261,158.60797,1176.3947,0,0,0,0,,, -65,-11065.432,210.8887,160.9102,1180.0826,0,0,0,0,,, -66,-11066.058,215.20259,163.3689,1166.8057,0,0,0,0,,, -67,-11067.913,213.52621,152.97533,1167.2303,0,0,0,0,,, -68,-11073.546,208.40765,153.89175,1177.6016,0,0,0,0,,, -69,-11073.523,214.0403,155.88106,1170.4043,0,0,0,0,,, -70,-11056.715,d,153.1765,1166.3363,0,0,0,0,,, -71,-11060.671,207.42418,147.70032,1168.2139,0,0,0,0,-0.142,0.59000003,0.84400004 -72,-11060.671,211.31339,141.79947,1176.1711,0,0,0,0,,, -73,-11058.458,208.45236,158.98795,1177.1099,0,0,0,0,,, -74,-11065.588,207.89357,148.54968,1178.3616,0,0,0,0,,, -75,-11050.702,209.07822,147.14153,1165.5988,0,0,0,0,,, -76,A,210.08405,152.46124,1162.1118,0,0,0,0,,, -77,-11055.82,203.80319,154.58466,1173.2207,0,0,0,0,,, -78,-11054.368,205.0549,150.20372,1169.5103,0,0,0,0,,, -79,c,207.6477,143.22998,1166.7386,0,0,0,0,,, -80,-11055.91,206.84303,147.4768,1160.6589,0,0,0,0,,, -81,-11054.748,2f,155.70224,1178.4734,0,0,0,0,-0.14400001,0.6,0.84200007 -82,-11056.647,207.84886,141.35243,1177.1545,0,0,0,0,,, -83,-11053.966,210.50873,140.92775,1176.0146,0,0,0,0,,, -84,-11055.038,214.7332,138.93845,1175.6123,0,0,0,0,,, -85,-11054.368,210.53107,146.35922,1169.4656,0,0,0,0,,, -86,-11057.229,209.34644,138.89374,1169.3986,0,0,0,0,,, -87,-11064.091,216.87897,132.90347,1172.416,0,0,0,0,,, -88,-11061.788,220.00821,138.33495,1175.3218,0,0,0,0,,, -89,-11048.221,218.13066,139.8325,1180.6638,0,0,0,0,,, diff --git a/backend/readme.md b/backend/readme.md new file mode 100644 index 00000000..4cac8e6f --- /dev/null +++ b/backend/readme.md @@ -0,0 +1,20 @@ +# Backend + +This backend holds a GRPC server that classify OpenBCI raw EEG data into sleep stages. + +## How to run + +I you are running the front-end, you'll need to build the dockerfile to get the Envoy proxy. + +> docker build -t polydodo-web . + +> docker run -d -p 8080:8080 -p 9090:9090 --network=host polydodo-web + +To start the server: + +> python backend/app.py + +## Get requirements: + +> python -m venv .venv +> python -m pip install -r requirements.txt diff --git a/backend/requirements.txt b/backend/requirements.txt index 4bb82bc4..b229498b 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -1,17 +1,2 @@ -click==7.1.1 -Flask==1.1.1 -Flask-SQLAlchemy==2.4.1 -itsdangerous==1.1.0 -Jinja2==2.11.1 -MarkupSafe==1.1.1 -mne==0.19.2 -numpy==1.18.2 -pandas==1.0.3 -pandas-schema==0.3.5 -python-dateutil==2.8.1 -pytz==2019.3 -scipy==1.4.1 -six==1.14.0 -SQLAlchemy==1.3.15 -Werkzeug==1.0.0 +grpcio==1.32.0 protobuf==3.13.0 diff --git a/backend/resampling.py b/backend/resampling.py deleted file mode 100644 index d87c6702..00000000 --- a/backend/resampling.py +++ /dev/null @@ -1,140 +0,0 @@ -import numpy as np -import scipy -from scipy import signal -from scipy.interpolate import griddata -import copy -import pandas as pd -import math -import mne -from fractions import Fraction -import pandas_schema -from pandas_schema import Column -from pandas_schema.validation import CustomElementValidation -from decimal import Decimal, InvalidOperation - -SAMPLING_RATE = 100 - -def check_decimal(dec): - try: - Decimal(dec) - except InvalidOperation: - return False - return True - -def do_validation(data): - # define validation elements - decimal_validation = [CustomElementValidation(lambda d: check_decimal(d), 'is not decimal')] - null_validation = [CustomElementValidation(lambda d: d is not np.nan, 'this field cannot be null')] - - # define validation schema - schema = pandas_schema.Schema([ - Column('ch1', decimal_validation + null_validation), - Column('ch2', decimal_validation+ null_validation)]) - - # apply validation - errors = schema.validate(data) - errors_index_rows = [e.row for e in errors] - if len(errors)==0: - return True - else: - for e in range(0,len(errors_index_rows)): - print("Error on line ", errors[e].row, " for ",errors[e].column, " : ",errors[e].value, " ", errors[e].message) - return False - -def upsampling(ch_1, ch_2, up_factor, starting_s_rate): - npts = len(ch_1) #equal to len(ch_2) also - time = np.arange(0,npts)/starting_s_rate - - #Upsample by a factor - new_npts = npts * up_factor - - #New time vector after upsampling - new_up_time = np.arange(0,new_npts)/(up_factor*starting_s_rate) - new_up_time = new_up_time[new_up_time - - - - - - {% block head %}{% endblock %} - - - {% block body %}{% endblock %} - - \ No newline at end of file diff --git a/backend/templates/index.html b/backend/templates/index.html deleted file mode 100644 index 0d2af4c4..00000000 --- a/backend/templates/index.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends 'base.html' %} - -{% block head %} - -{% endblock %} - -{% block body %} -

Template

-{% endblock %} \ No newline at end of file diff --git a/backend/templates/upload_csv.html b/backend/templates/upload_csv.html deleted file mode 100644 index 737f10ca..00000000 --- a/backend/templates/upload_csv.html +++ /dev/null @@ -1,34 +0,0 @@ -{% extends 'base.html' %} - -{% block head %} -Upload CSV -{% endblock %} - -{% block body %} - -
-
-
- -

Upload CSV

-
- -
- -
- -
- - -
-
- - - -
- -
-
-
- -{% endblock %} \ No newline at end of file diff --git a/mobile/.vscode/launch.json b/mobile/.vscode/launch.json new file mode 100644 index 00000000..95b36429 --- /dev/null +++ b/mobile/.vscode/launch.json @@ -0,0 +1,18 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "mobile", + "program": "lib/main.dart", + "request": "launch", + "type": "dart", + "args": [ + "--dart-define", + "HOST=10.0.2.2" + ] + } + ] +} diff --git a/mobile/lib/main.dart b/mobile/lib/main.dart index ad72d679..11699fb8 100644 --- a/mobile/lib/main.dart +++ b/mobile/lib/main.dart @@ -1,7 +1,26 @@ +import 'package:polydodo/protos/helloworld.pbgrpc.dart'; +import 'package:grpc/grpc.dart'; import 'package:flutter/material.dart'; +import 'protos/helloworld.pb.dart'; import 'src/app.dart'; -void main() { +void main() async { + // GRPC TEST + final channel = ClientChannel( + const String.fromEnvironment('HOST'), + port: 9090, + options: const ChannelOptions(credentials: ChannelCredentials.insecure()), + ); + final stub = GreeterClient(channel); + + try { + final response = await stub.sayHello(HelloRequest()..name = 'world'); + print('Greeter client received: ${response.message}'); + } catch (e) { + print('Caught error: $e'); + } + await channel.shutdown(); + // END OF TEST runApp(App()); } diff --git a/mobile/pubspec.lock b/mobile/pubspec.lock index cf28699b..7d50ad9c 100644 --- a/mobile/pubspec.lock +++ b/mobile/pubspec.lock @@ -151,6 +151,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.0.4" + googleapis_auth: + dependency: transitive + description: + name: googleapis_auth + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.12" + grpc: + dependency: "direct main" + description: + name: grpc + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" hive: dependency: "direct main" description: @@ -158,6 +172,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.4.4" + http: + dependency: transitive + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.2" + http2: + dependency: transitive + description: + name: http2 + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.4" matcher: dependency: transitive description: @@ -193,6 +228,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0-nullsafety" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.2" plugin_platform_interface: dependency: transitive description: @@ -227,7 +269,7 @@ packages: name: share url: "https://pub.dartlang.org" source: hosted - version: "0.6.5" + version: "0.6.5+1" sky_engine: dependency: transitive description: flutter diff --git a/mobile/pubspec.yaml b/mobile/pubspec.yaml index c7f7dd29..7f6c150e 100644 --- a/mobile/pubspec.yaml +++ b/mobile/pubspec.yaml @@ -34,6 +34,7 @@ dependencies: flutter_bloc: ^6.0.5 flutter_blue: ^0.7.2 get_it: ^4.0.4 + grpc: ^2.3.0 hive: ^1.4.4 meta: ^1.1.8 protobuf: ^1.0.1 diff --git a/polydodo.code-workspace b/polydodo.code-workspace new file mode 100644 index 00000000..2f0d9cfd --- /dev/null +++ b/polydodo.code-workspace @@ -0,0 +1,73 @@ +{ + "folders": [ + { + "name": "Polydodo", + "path": "." + }, + { + "name": "AI", + "path": "ai" + }, + { + "name": "Server", + "path": "backend" + }, + { + "name": "Mobile client", + "path": "mobile" + }, + { + "name": "Web client", + "path": "web" + }, + { + "name": "Protos", + "path": "protos" + } + ], + "settings": { + "prettier.configPath": "../.prettierrc.yaml", + "editor.defaultFormatter": "esbenp.prettier-vscode", + "eslint.packageManager": "yarn", + "editor.codeActionsOnSave": { + "source.fixAll.eslint": true + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "[json]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" + }, + "protoc": { + "compile_on_save": true, + "compile_all_path": "protos", + "options": [ + "--dart_out=grpc:mobile/lib", + "--python_out=backend", + "--grpc_python_out=backend", + "--js_out=import_style=commonjs:web/src", + "--grpc-web_out=import_style=commonjs,mode=grpcwebtext:web/src" + ] + }, + "python.linting.enabled": true, + "python.linting.flake8Enabled": true, + "python.formatting.provider": "autopep8", + "python.pythonPath": "/usr/bin/python" + }, + "extensions": { + "recommendations": [ + "christian-kohler.path-intellisense", + "ms-python.python", + "2gua.rainbow-brackets", + "esbenp.prettier-vscode", + "eamodio.gitlens", + "editorconfig.editorconfig", + "dbaeumer.vscode-eslint", + "dart-code.flutter", + "zxh404.vscode-proto3" + ] + } +} diff --git a/web/.env b/web/.env new file mode 100644 index 00000000..3ccb8fff --- /dev/null +++ b/web/.env @@ -0,0 +1 @@ +EXTEND_ESLINT=true \ No newline at end of file diff --git a/web/Dockerfile b/web/Dockerfile deleted file mode 100644 index e4008934..00000000 --- a/web/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM namely/protoc-all as generator -WORKDIR / -COPY protos protos -COPY web web -RUN protoc --proto_path=protos protos/* --js_out=web/src/protos - -FROM node:14 as builder -COPY --from=generator /web /web -WORKDIR /web -RUN yarn install -RUN yarn build - -FROM nginx:alpine -COPY --from=builder /web/build/ /usr/share/nginx/html diff --git a/web/package.json b/web/package.json index f17a4f56..72f65ee9 100644 --- a/web/package.json +++ b/web/package.json @@ -14,7 +14,10 @@ "format": "yarn prettier --config ../.vscode/.prettierrc.yaml --write \"./**/*.{js,jsx,css,scss,json}\"" }, "eslintConfig": { - "extends": "react-app" + "extends": "react-app", + "ignorePatterns": [ + "src/protos/" + ] }, "browserslist": [ ">0.2%", @@ -23,17 +26,20 @@ "not op_mini all" ], "dependencies": { + "@grpc/grpc-js": "^1.1.7", + "@grpc/proto-loader": "^0.5.5", "argon-design-system-react": "^1.1.0", "bootstrap": "^4.5.0", "classnames": "2.2.6", "d3": "^5.16.0", "d3-tip": "^0.9.1", + "google-protobuf": "^3.13.0", + "grpc-web": "^1.2.1", "headroom.js": "^0.11.0", "moment": "^2.27.0", "node-sass": "4.14.1", "nouislider": "14.1.1", "prop-types": "^15.7.2", - "protobufjs": "^6.10.1", "react": "16.12.0", "react-datetime": "2.16.3", "react-dom": "16.12.0", diff --git a/web/src/index.js b/web/src/index.js index 960a5894..54955242 100644 --- a/web/src/index.js +++ b/web/src/index.js @@ -17,6 +17,18 @@ import AnalyzeSleep from 'views/analyze-sleep'; import ScrollToTop from 'components/scroll_to_top'; import Emoji from 'components/emoji'; +// GRPC TEST +import { HelloRequest } from 'protos/helloworld_pb'; +import { GreeterClient } from 'protos/helloworld_grpc_web_pb'; + +const client = new GreeterClient('http://localhost:8080'); +const request = new HelloRequest(); +request.setName('World'); +client.sayHello(request, {}, (err, response) => { + err ? console.log(err) : console.log(response.getMessage()); +}); +// END OF TEST + const underConstruction = () => { const text = { header_title: 'Under', diff --git a/web/yarn.lock b/web/yarn.lock index d7169dd3..265c4524 100644 --- a/web/yarn.lock +++ b/web/yarn.lock @@ -1179,6 +1179,35 @@ resolved "https://registry.yarnpkg.com/@csstools/normalize.css/-/normalize.css-10.1.0.tgz#f0950bba18819512d42f7197e56c518aa491cf18" integrity sha512-ij4wRiunFfaJxjB0BdrYHIH8FxBJpOwNPhhAcunlmPdXudL1WQV1qoP9un6JsEBAgQH+7UXyyjh0g7jTxXK6tg== +"@grpc/grpc-js@^1.1.7": + version "1.1.7" + resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.1.7.tgz#d3d71c6da95397e2d63895ccc4a05e7572f7b7e6" + integrity sha512-EuxMstI0u778dp0nk6Fe3gHXYPeV6FYsWOe0/QFwxv1NQ6bc5Wl/0Yxa4xl9uBlKElL6AIxuASmSfu7KEJhqiw== + dependencies: + "@grpc/proto-loader" "^0.6.0-pre14" + "@types/node" "^12.12.47" + google-auth-library "^6.0.0" + semver "^6.2.0" + +"@grpc/proto-loader@^0.5.5": + version "0.5.5" + resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.5.5.tgz#6725e7a1827bdf8e92e29fbf4e9ef0203c0906a9" + integrity sha512-WwN9jVNdHRQoOBo9FDH7qU+mgfjPc8GygPYms3M+y3fbQLfnCe/Kv/E01t7JRgnrsOHH8euvSbed3mIalXhwqQ== + dependencies: + lodash.camelcase "^4.3.0" + protobufjs "^6.8.6" + +"@grpc/proto-loader@^0.6.0-pre14": + version "0.6.0-pre9" + resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.6.0-pre9.tgz#0c6fe42f6c5ef9ce1b3cef7be64d5b09d6fe4d6d" + integrity sha512-oM+LjpEjNzW5pNJjt4/hq1HYayNeQT+eGrOPABJnYHv7TyNPDNzkQ76rDYZF86X5swJOa4EujEMzQ9iiTdPgww== + dependencies: + "@types/long" "^4.0.1" + lodash.camelcase "^4.3.0" + long "^4.0.0" + protobufjs "^6.9.0" + yargs "^15.3.1" + "@hapi/address@2.x.x": version "2.1.4" resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5" @@ -1643,10 +1672,15 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.6.3.tgz#cc4f979548ca4d8e7b90bc0180052ab99ee64224" integrity sha512-pC/hkcREG6YfDfui1FBmj8e20jFU5Exjw4NYDm8kEdrW+mOh0T1Zve8DWKnS7ZIZvgncrctcNCXF4Q2I+loyww== +"@types/node@^12.12.47": + version "12.12.62" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.62.tgz#733923d73669188d35950253dd18a21570085d2b" + integrity sha512-qAfo81CsD7yQIM9mVyh6B/U47li5g7cfpVQEDMfQeF8pSZVwzbhwU3crc0qG4DmpsebpJPR49AKOExQyJ05Cpg== + "@types/node@^13.7.0": - version "13.13.16" - resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.16.tgz#66f2177047b61131eaac18c47eb25d6f1317070a" - integrity sha512-dJ9vXxJ8MEwzNn4GkoAGauejhXoKuJyYKegsA6Af25ZpEDXomeVXt5HUWUNVHk5UN7+U0f6ghC6otwt+7PdSDg== + version "13.13.21" + resolved "https://registry.yarnpkg.com/@types/node/-/node-13.13.21.tgz#e48d3c2e266253405cf404c8654d1bcf0d333e5c" + integrity sha512-tlFWakSzBITITJSxHV4hg4KvrhR/7h3xbJdSFbYJBVzKubrASbnnIFuSgolUh7qKGo/ZeJPKUfbZ0WS6Jp14DQ== "@types/parse-json@^4.0.0": version "4.0.0" @@ -1897,6 +1931,13 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== +abort-controller@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/abort-controller/-/abort-controller-3.0.0.tgz#eaf54d53b62bae4138e809ca225c8439a6efb392" + integrity sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg== + dependencies: + event-target-shim "^5.0.0" + accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7: version "1.3.7" resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" @@ -1954,6 +1995,13 @@ adjust-sourcemap-loader@2.0.0: object-path "0.11.4" regex-parser "2.2.10" +agent-base@6: + version "6.0.1" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.1.tgz#808007e4e5867decb0ab6ab2f928fbdb5a596db4" + integrity sha512-01q25QQDwLSsyfhrKbn8yuur+JNw0H+0Y4JiGIKd3z9aYk/w/2kxD/Upc+t2ZBBSUNff50VjPsSW2YxM8QYKVg== + dependencies: + debug "4" + aggregate-error@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-3.1.0.tgz#92670ff50f5359bdb7a3e0d40d0ec30c5737687a" @@ -2060,7 +2108,7 @@ ansi-styles@^3.2.0, ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" -ansi-styles@^4.1.0: +ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359" integrity sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA== @@ -2275,6 +2323,11 @@ arrify@^1.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= +arrify@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" + integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== + asap@~2.0.3, asap@~2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" @@ -2578,7 +2631,7 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= -base64-js@^1.0.2: +base64-js@^1.0.2, base64-js@^1.3.0: version "1.3.1" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1" integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g== @@ -2613,6 +2666,11 @@ big.js@^5.2.2: resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" integrity sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ== +bignumber.js@^9.0.0: + version "9.0.0" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.0.0.tgz#805880f84a329b5eac6e7cb6f8274b6d82bdf075" + integrity sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A== + binary-extensions@^1.0.0: version "1.13.1" resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" @@ -2831,6 +2889,11 @@ bser@2.1.1: dependencies: node-int64 "^0.4.0" +buffer-equal-constant-time@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz#f8e71132f7ffe6e01a5c9697a4c6f3e48d5cc819" + integrity sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk= + buffer-equal@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/buffer-equal/-/buffer-equal-1.0.0.tgz#59616b498304d556abd466966b22eeda3eca5fbe" @@ -3195,6 +3258,15 @@ cliui@^5.0.0: strip-ansi "^5.2.0" wrap-ansi "^5.1.0" +cliui@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1" + integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.0" + wrap-ansi "^6.2.0" + clone-buffer@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/clone-buffer/-/clone-buffer-1.0.0.tgz#e3e25b207ac4e701af721e2cb5a16792cac3dc58" @@ -4160,6 +4232,13 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3, debug@^2.6.0, debug@^2.6.9: dependencies: ms "2.0.0" +debug@4: + version "4.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1" + integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== + dependencies: + ms "2.1.2" + debug@^3.1.1, debug@^3.2.5: version "3.2.6" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.6.tgz#e83d17de16d8a7efb7717edbe5fb10135eee629b" @@ -4501,6 +4580,13 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" +ecdsa-sig-formatter@1.0.11, ecdsa-sig-formatter@^1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz#ae0f0fa2d85045ef14a817daa3ce9acd0489e5bf" + integrity sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ== + dependencies: + safe-buffer "^5.0.1" + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -4917,6 +5003,11 @@ etag@~1.8.1: resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= +event-target-shim@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789" + integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ== + eventemitter3@^4.0.0: version "4.0.7" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f" @@ -5055,7 +5146,7 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@^3.0.0, extend@~3.0.2: +extend@^3.0.0, extend@^3.0.2, extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== @@ -5135,6 +5226,11 @@ fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fast-text-encoding@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz#ec02ac8e01ab8a319af182dae2681213cfe9ce53" + integrity sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig== + faye-websocket@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" @@ -5263,7 +5359,7 @@ find-cache-dir@^3.2.0: make-dir "^3.0.2" pkg-dir "^4.1.0" -find-up@4.1.0, find-up@^4.0.0: +find-up@4.1.0, find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -5547,6 +5643,17 @@ gauge@~2.7.3: strip-ansi "^3.0.1" wide-align "^1.1.0" +gaxios@^3.0.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/gaxios/-/gaxios-3.2.0.tgz#11b6f0e8fb08d94a10d4d58b044ad3bec6dd486a" + integrity sha512-+6WPeVzPvOshftpxJwRi2Ozez80tn/hdtOUag7+gajDHRJvAblKxTFSSMPtr2hmnLy7p0mvYz0rMXLBl8pSO7Q== + dependencies: + abort-controller "^3.0.0" + extend "^3.0.2" + https-proxy-agent "^5.0.0" + is-stream "^2.0.0" + node-fetch "^2.3.0" + gaze@^1.0.0: version "1.1.3" resolved "https://registry.yarnpkg.com/gaze/-/gaze-1.1.3.tgz#c441733e13b927ac8c0ff0b4c3b033f28812924a" @@ -5554,6 +5661,14 @@ gaze@^1.0.0: dependencies: globule "^1.0.0" +gcp-metadata@^4.1.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/gcp-metadata/-/gcp-metadata-4.2.0.tgz#3b424355ccdc240ee07c5791e2fd6a60a283d89a" + integrity sha512-vQZD57cQkqIA6YPGXM/zc+PIZfNRFdukWGsGZ5+LcJzesi5xp6Gn7a02wRJi4eXPyArNMIYpPET4QMxGqtlk6Q== + dependencies: + gaxios "^3.0.0" + json-bigint "^1.0.0" + gensync@^1.0.0-beta.1: version "1.0.0-beta.1" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269" @@ -5747,6 +5862,33 @@ glogg@^1.0.0: dependencies: sparkles "^1.0.0" +google-auth-library@^6.0.0: + version "6.0.6" + resolved "https://registry.yarnpkg.com/google-auth-library/-/google-auth-library-6.0.6.tgz#5102e5c643baab45b4c16e9752cd56b8861f3a82" + integrity sha512-fWYdRdg55HSJoRq9k568jJA1lrhg9i2xgfhVIMJbskUmbDpJGHsbv9l41DGhCDXM21F9Kn4kUwdysgxSYBYJUw== + dependencies: + arrify "^2.0.0" + base64-js "^1.3.0" + ecdsa-sig-formatter "^1.0.11" + fast-text-encoding "^1.0.0" + gaxios "^3.0.0" + gcp-metadata "^4.1.0" + gtoken "^5.0.0" + jws "^4.0.0" + lru-cache "^6.0.0" + +google-p12-pem@^3.0.0: + version "3.0.3" + resolved "https://registry.yarnpkg.com/google-p12-pem/-/google-p12-pem-3.0.3.tgz#673ac3a75d3903a87f05878f3c75e06fc151669e" + integrity sha512-wS0ek4ZtFx/ACKYF3JhyGe5kzH7pgiQ7J5otlumqR9psmWMYc+U9cErKlCYVYHoUaidXHdZ2xbo34kB+S+24hA== + dependencies: + node-forge "^0.10.0" + +google-protobuf@^3.13.0: + version "3.13.0" + resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.13.0.tgz#909c5983d75dd6101ed57c79e0528d000cdc3251" + integrity sha512-ZIf3qfLFayVrPvAjeKKxO5FRF1/NwRxt6Dko+fWEMuHwHbZx8/fcaAao9b0wCM6kr8qeg2te8XTpyuvKuD9aKw== + graceful-fs@^4.0.0, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.2: version "4.2.4" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" @@ -5757,6 +5899,21 @@ growly@^1.3.0: resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081" integrity sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE= +grpc-web@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/grpc-web/-/grpc-web-1.2.1.tgz#860051d705bf5baa7b81fcbd14030060bf16b7b9" + integrity sha512-ibBaJPzfMVuLPgaST9w0kZl60s+SnkPBQp6QKdpEr85tpc1gXW2QDqSne9xiyiym0logDfdUSm4aX5h9YBA2mw== + +gtoken@^5.0.0: + version "5.0.3" + resolved "https://registry.yarnpkg.com/gtoken/-/gtoken-5.0.3.tgz#b76ef8e9a2fed6fef165e47f7d05b60c498e4d05" + integrity sha512-Nyd1wZCMRc2dj/mAD0LlfQLcAO06uKdpKJXvK85SGrF5+5+Bpfil9u/2aw35ltvEHjvl0h5FMKN5knEU+9JrOg== + dependencies: + gaxios "^3.0.0" + google-p12-pem "^3.0.0" + jws "^4.0.0" + mime "^2.2.0" + gud@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0" @@ -6134,6 +6291,14 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= +https-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" + integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== + dependencies: + agent-base "6" + debug "4" + iconv-lite@0.4, iconv-lite@0.4.24, iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" @@ -6660,6 +6825,11 @@ is-stream@^1.0.1, is-stream@^1.1.0: resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" integrity sha1-EtSj3U5o4Lec6428hBc66A2RykQ= +is-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" + integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + is-string@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.5.tgz#40493ed198ef3ff477b8c7f92f644ec82a5cd3a6" @@ -7292,6 +7462,13 @@ jsesc@~0.5.0: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" integrity sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0= +json-bigint@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-bigint/-/json-bigint-1.0.0.tgz#ae547823ac0cad8398667f8cd9ef4730f5b01ff1" + integrity sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ== + dependencies: + bignumber.js "^9.0.0" + json-parse-better-errors@^1.0.1, json-parse-better-errors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -7383,6 +7560,23 @@ just-debounce@^1.0.0: resolved "https://registry.yarnpkg.com/just-debounce/-/just-debounce-1.0.0.tgz#87fccfaeffc0b68cd19d55f6722943f929ea35ea" integrity sha1-h/zPrv/AtozRnVX2cilD+SnqNeo= +jwa@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/jwa/-/jwa-2.0.0.tgz#a7e9c3f29dae94027ebcaf49975c9345593410fc" + integrity sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA== + dependencies: + buffer-equal-constant-time "1.0.1" + ecdsa-sig-formatter "1.0.11" + safe-buffer "^5.0.1" + +jws@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/jws/-/jws-4.0.0.tgz#2d4e8cf6a318ffaa12615e9dec7e86e6c97310f4" + integrity sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg== + dependencies: + jwa "^2.0.0" + safe-buffer "^5.0.1" + killable@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/killable/-/killable-1.0.1.tgz#4c8ce441187a061c7474fb87ca08e2a638194892" @@ -7612,6 +7806,11 @@ lodash._reinterpolate@^3.0.0: resolved "https://registry.yarnpkg.com/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d" integrity sha1-DM8tiRZq8Ds2Y8eWU4t1rG4RTZ0= +lodash.camelcase@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + integrity sha1-soqmKIorn8ZRA1x3EfZathkDMaY= + lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" @@ -7694,6 +7893,13 @@ lru-cache@^5.1.1: dependencies: yallist "^3.0.2" +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + make-dir@^2.0.0, make-dir@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-2.1.0.tgz#5f0310e18b8be898cc07009295a30ae41e91e6f5" @@ -7905,7 +8111,7 @@ mime@1.6.0: resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== -mime@^2.4.4: +mime@^2.2.0, mime@^2.4.4: version "2.4.6" resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.6.tgz#e5b407c90db442f2beb5b162373d07b69affa4d1" integrity sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA== @@ -8055,7 +8261,7 @@ ms@2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== -ms@^2.1.1: +ms@2.1.2, ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== @@ -8146,11 +8352,21 @@ node-fetch@^1.0.1: encoding "^0.1.11" is-stream "^1.0.1" +node-fetch@^2.3.0: + version "2.6.1" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052" + integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw== + node-forge@0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.9.0.tgz#d624050edbb44874adca12bb9a52ec63cb782579" integrity sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ== +node-forge@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3" + integrity sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA== + node-gyp@^3.8.0: version "3.8.0" resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.8.0.tgz#540304261c330e80d0d5edce253a68cb3964218c" @@ -9821,7 +10037,7 @@ prop-types@^15.0.0, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.6.1, object-assign "^4.1.1" react-is "^16.8.1" -protobufjs@^6.10.1: +protobufjs@^6.8.6, protobufjs@^6.9.0: version "6.10.1" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.10.1.tgz#e6a484dd8f04b29629e9053344e3970cccf13cd2" integrity sha512-pb8kTchL+1Ceg4lFd5XUpK8PdWacbvV5SK2ULH2ebrYtl4GjJmS24m6CKME67jzV53tbJxHlnNOSqQHbTsR9JQ== @@ -11456,7 +11672,7 @@ string-width@^3.0.0, string-width@^3.1.0: is-fullwidth-code-point "^2.0.0" strip-ansi "^5.1.0" -string-width@^4.1.0: +string-width@^4.1.0, string-width@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5" integrity sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg== @@ -12758,6 +12974,15 @@ wrap-ansi@^5.1.0: string-width "^3.0.0" strip-ansi "^5.0.0" +wrap-ansi@^6.2.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" + integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" @@ -12862,6 +13087,14 @@ yargs-parser@^13.1.2: camelcase "^5.0.0" decamelize "^1.2.0" +yargs-parser@^18.1.2: + version "18.1.3" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" + integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + yargs@12.0.5: version "12.0.5" resolved "https://registry.yarnpkg.com/yargs/-/yargs-12.0.5.tgz#05f5997b609647b64f66b81e3b4b10a368e7ad13" @@ -12896,6 +13129,23 @@ yargs@^13.3.0, yargs@^13.3.2: y18n "^4.0.0" yargs-parser "^13.1.2" +yargs@^15.3.1: + version "15.4.1" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" + integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A== + dependencies: + cliui "^6.0.0" + decamelize "^1.2.0" + find-up "^4.1.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^4.2.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^18.1.2" + yargs@^7.0.0, yargs@^7.1.0: version "7.1.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.1.tgz#67f0ef52e228d4ee0d6311acede8850f53464df6"