├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── SECURITY.md ├── src ├── HeatMap │ ├── .vscode │ │ ├── launch.json │ │ └── tasks.json │ ├── App.razor │ ├── Assignee.cs │ ├── Chore.cs │ ├── ChoreListData.cs │ ├── ConnectionInfo.cs │ ├── HeatMap.csproj │ ├── HeatMap.sln │ ├── Pages │ │ ├── Admin-Chores.razor │ │ ├── Admin-People.razor │ │ ├── Index.razor │ │ └── Widget.razor │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Shared │ │ ├── MainLayout.razor │ │ ├── NavMenu.razor │ │ └── WidgetLayout.razor │ ├── _Imports.razor │ ├── nuget.config │ └── wwwroot │ │ ├── appsettings.json │ │ ├── css │ │ ├── app.css │ │ ├── bootstrap │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ └── open-iconic │ │ │ ├── FONT-LICENSE │ │ │ ├── ICON-LICENSE │ │ │ ├── README.md │ │ │ └── font │ │ │ ├── css │ │ │ └── open-iconic-bootstrap.min.css │ │ │ └── fonts │ │ │ ├── open-iconic.eot │ │ │ ├── open-iconic.otf │ │ │ ├── open-iconic.svg │ │ │ ├── open-iconic.ttf │ │ │ └── open-iconic.woff │ │ ├── favicon.ico │ │ ├── img │ │ ├── empty.png │ │ ├── full.png │ │ ├── high.png │ │ ├── home.png │ │ └── low.png │ │ └── index.html ├── NotifyFunction │ ├── .gitignore │ ├── Assignee.cs │ ├── AzureCommunicationService.cs │ ├── ChoreListData.cs │ ├── ChoreService.cs │ ├── Chores.cs │ ├── Functions.cs │ ├── NotifyFunction.csproj │ ├── NotifyFunction.sln │ ├── Startup.cs │ └── host.json ├── choresFunction │ ├── .funcignore │ ├── .gitignore │ ├── getChores │ │ ├── function.json │ │ └── index.ts │ ├── host.json │ ├── package-lock.json │ ├── package.json │ ├── proxies.json │ ├── tsconfig.json │ ├── updateChores │ │ ├── function.json │ │ └── index.ts │ └── utils.ts └── choresUpdater │ └── updateChoresFromSensor.py └── static ├── Diagram.png ├── Heatmap.png ├── Icons.png ├── acs-create.png ├── acs-events.png ├── acs-logic-app.png ├── acs-number-1.png ├── acs-number-2.png ├── acs-number-3.png ├── acs-number-4.png ├── acs-setup.png ├── c-sharp-publish-1.png ├── c-sharp-publish-2.png ├── c-sharp-publish-3.png ├── function-app-publish-project.png └── function-create-notifications.png /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | *.vspscc 90 | *.vssscc 91 | .builds 92 | *.pidb 93 | *.svclog 94 | *.scc 95 | 96 | # Chutzpah Test files 97 | _Chutzpah* 98 | 99 | # Visual C++ cache files 100 | ipch/ 101 | *.aps 102 | *.ncb 103 | *.opendb 104 | *.opensdf 105 | *.sdf 106 | *.cachefile 107 | *.VC.db 108 | *.VC.VC.opendb 109 | 110 | # Visual Studio profiler 111 | *.psess 112 | *.vsp 113 | *.vspx 114 | *.sap 115 | 116 | # Visual Studio Trace Files 117 | *.e2e 118 | 119 | # TFS 2012 Local Workspace 120 | $tf/ 121 | 122 | # Guidance Automation Toolkit 123 | *.gpState 124 | 125 | # ReSharper is a .NET coding add-in 126 | _ReSharper*/ 127 | *.[Rr]e[Ss]harper 128 | *.DotSettings.user 129 | 130 | # TeamCity is a build add-in 131 | _TeamCity* 132 | 133 | # DotCover is a Code Coverage Tool 134 | *.dotCover 135 | 136 | # AxoCover is a Code Coverage Tool 137 | .axoCover/* 138 | !.axoCover/settings.json 139 | 140 | # Visual Studio code coverage results 141 | *.coverage 142 | *.coveragexml 143 | 144 | # NCrunch 145 | _NCrunch_* 146 | .*crunch*.local.xml 147 | nCrunchTemp_* 148 | 149 | # MightyMoose 150 | *.mm.* 151 | AutoTest.Net/ 152 | 153 | # Web workbench (sass) 154 | .sass-cache/ 155 | 156 | # Installshield output folder 157 | [Ee]xpress/ 158 | 159 | # DocProject is a documentation generator add-in 160 | DocProject/buildhelp/ 161 | DocProject/Help/*.HxT 162 | DocProject/Help/*.HxC 163 | DocProject/Help/*.hhc 164 | DocProject/Help/*.hhk 165 | DocProject/Help/*.hhp 166 | DocProject/Help/Html2 167 | DocProject/Help/html 168 | 169 | # Click-Once directory 170 | publish/ 171 | 172 | # Publish Web Output 173 | *.[Pp]ublish.xml 174 | *.azurePubxml 175 | # Note: Comment the next line if you want to checkin your web deploy settings, 176 | # but database connection strings (with potential passwords) will be unencrypted 177 | *.pubxml 178 | *.publishproj 179 | 180 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 181 | # checkin your Azure Web App publish settings, but sensitive information contained 182 | # in these scripts will be unencrypted 183 | PublishScripts/ 184 | 185 | # NuGet Packages 186 | *.nupkg 187 | # NuGet Symbol Packages 188 | *.snupkg 189 | # The packages folder can be ignored because of Package Restore 190 | **/[Pp]ackages/* 191 | # except build/, which is used as an MSBuild target. 192 | !**/[Pp]ackages/build/ 193 | # Uncomment if necessary however generally it will be regenerated when needed 194 | #!**/[Pp]ackages/repositories.config 195 | # NuGet v3's project.json files produces more ignorable files 196 | *.nuget.props 197 | *.nuget.targets 198 | 199 | # Microsoft Azure Build Output 200 | csx/ 201 | *.build.csdef 202 | 203 | # Microsoft Azure Emulator 204 | ecf/ 205 | rcf/ 206 | 207 | # Windows Store app package directories and files 208 | AppPackages/ 209 | BundleArtifacts/ 210 | Package.StoreAssociation.xml 211 | _pkginfo.txt 212 | *.appx 213 | *.appxbundle 214 | *.appxupload 215 | 216 | # Visual Studio cache files 217 | # files ending in .cache can be ignored 218 | *.[Cc]ache 219 | # but keep track of directories ending in .cache 220 | !?*.[Cc]ache/ 221 | 222 | # Others 223 | ClientBin/ 224 | ~$* 225 | *~ 226 | *.dbmdl 227 | *.dbproj.schemaview 228 | *.jfm 229 | *.pfx 230 | *.publishsettings 231 | orleans.codegen.cs 232 | 233 | # Including strong name files can present a security risk 234 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 235 | #*.snk 236 | 237 | # Since there are multiple workflows, uncomment next line to ignore bower_components 238 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 239 | #bower_components/ 240 | 241 | # RIA/Silverlight projects 242 | Generated_Code/ 243 | 244 | # Backup & report files from converting an old project file 245 | # to a newer Visual Studio version. Backup files are not needed, 246 | # because we have git ;-) 247 | _UpgradeReport_Files/ 248 | Backup*/ 249 | UpgradeLog*.XML 250 | UpgradeLog*.htm 251 | ServiceFabricBackup/ 252 | *.rptproj.bak 253 | 254 | # SQL Server files 255 | *.mdf 256 | *.ldf 257 | *.ndf 258 | 259 | # Business Intelligence projects 260 | *.rdl.data 261 | *.bim.layout 262 | *.bim_*.settings 263 | *.rptproj.rsuser 264 | *- [Bb]ackup.rdl 265 | *- [Bb]ackup ([0-9]).rdl 266 | *- [Bb]ackup ([0-9][0-9]).rdl 267 | 268 | # Microsoft Fakes 269 | FakesAssemblies/ 270 | 271 | # GhostDoc plugin setting file 272 | *.GhostDoc.xml 273 | 274 | # Node.js Tools for Visual Studio 275 | .ntvs_analysis.dat 276 | node_modules/ 277 | 278 | # Visual Studio 6 build log 279 | *.plg 280 | 281 | # Visual Studio 6 workspace options file 282 | *.opt 283 | 284 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 285 | *.vbw 286 | 287 | # Visual Studio LightSwitch build output 288 | **/*.HTMLClient/GeneratedArtifacts 289 | **/*.DesktopClient/GeneratedArtifacts 290 | **/*.DesktopClient/ModelManifest.xml 291 | **/*.Server/GeneratedArtifacts 292 | **/*.Server/ModelManifest.xml 293 | _Pvt_Extensions 294 | 295 | # Paket dependency manager 296 | .paket/paket.exe 297 | paket-files/ 298 | 299 | # FAKE - F# Make 300 | .fake/ 301 | 302 | # CodeRush personal settings 303 | .cr/personal 304 | 305 | # Python Tools for Visual Studio (PTVS) 306 | __pycache__/ 307 | *.pyc 308 | 309 | # Cake - Uncomment if you are using it 310 | # tools/** 311 | # !tools/packages.config 312 | 313 | # Tabs Studio 314 | *.tss 315 | 316 | # Telerik's JustMock configuration file 317 | *.jmconfig 318 | 319 | # BizTalk build output 320 | *.btp.cs 321 | *.btm.cs 322 | *.odx.cs 323 | *.xsd.cs 324 | 325 | # OpenCover UI analysis results 326 | OpenCover/ 327 | 328 | # Azure Stream Analytics local run output 329 | ASALocalRun/ 330 | 331 | # MSBuild Binary and Structured Log 332 | *.binlog 333 | 334 | # NVidia Nsight GPU debugger configuration file 335 | *.nvuser 336 | 337 | # MFractors (Xamarin productivity tool) working folder 338 | .mfractor/ 339 | 340 | # Local History for Visual Studio 341 | .localhistory/ 342 | 343 | # BeatPulse healthcheck temp database 344 | healthchecksdb 345 | 346 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 347 | MigrationBackup/ 348 | 349 | # Ionide (cross platform F# VS Code tools) working folder 350 | .ionide/ 351 | /src/choresFunction/.vscode 352 | /src/NotifyFunction/.vscode 353 | /src/NotifyFunction/Properties 354 | /src/choresFunction/getChores/sample.dat 355 | /src/choresFunction/updateChores/sample.dat 356 | /src/NotifyFunction/nuget.config 357 | /src/choresUpdater/config.py 358 | .vscode/settings.json 359 | src/HeatMap/Properties/ServiceDependencies/choresiot - Web Deploy/profile.arm.json 360 | 361 | /.github/workflows/* 362 | 363 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Chores IOT 2 | 3 | Sample application for Scott Hanselman's Developer Keynote at Microsoft Ignite 2020. 4 | 5 | ## **[Blog Post](https://techcommunity.microsoft.com/t5/azure-developer-community-blog/using-iot-and-azure-to-help-with-family-chores/ba-p/1809444)** 6 | 7 | # Table of contents 8 | 9 | - [Application Screens](#screens) 10 | - [Application Diagram](#diagram) 11 | - [Getting Started](#getting-started) 12 | - [Deploy to Azure](#deployment-scenarios) 13 | - [Contributing](#contributing) 14 | 15 | # Application Screens 16 | 17 | ![](static/Heatmap.png) 18 | ![](static/Icons.png) 19 | 20 | # Application Diagram 21 | 22 | ![](static/Diagram.png) 23 | 24 | 25 | # Getting Started 26 | 27 | ## Pre-Requisites 28 | 29 | 1. You will need [Visual Studio 2019](https://visualstudio.microsoft.com/vs/) Version 16.8.0 Preview 3.1 on Windows 10. 30 | 1. You will need [Docker Desktop](https://www.docker.com/products/docker-desktop). 31 | 32 | If you want to deploy this solution in Azure: 33 | 34 | 1. You will need and Azure Subscription in order to deploy this. 35 | 1. Azure CLI. 36 | 1. Download and install helm. 37 | 38 | ## New to Microsoft Azure? 39 | 40 | You will need an Azure subscription to work with this demo code. You can: 41 | 42 | - Open an account for free [Azure subscription](https://azure.microsoft.com/free/). You get credits that can be used to try out paid Azure services. Even after the credits are used up, you can keep the account and use free Azure services and features, such as the Web Apps feature in Azure App Service. 43 | - [Activate Visual Studio subscriber benefits](https://azure.microsoft.com/pricing/member-offers/credit-for-visual-studio-subscribers/). Your Visual Studio subscription gives you credits every month that you can use for paid Azure services. 44 | - Create an [Azure Student Account](https://azure.microsoft.com/free/students/) and get free credit when you create your account. 45 | 46 | Learn more about it with [Microsoft Learn - Introduction to Azure](https://docs.microsoft.com/learn/azure). 47 | 48 | # Deploy to Azure 49 | 50 | Chores IOT takes advantage of the following services in Azure 51 | 52 | - [Azure Communication Services](https://azure.microsoft.com/services/communication-services/) 53 | - [Azure Functions](https://docs.microsoft.com/azure/azure-functions/) 54 | - [Azure Static Web Apps](https://docs.microsoft.com/azure/static-web-apps/) 55 | - [Azure Logic Apps](https://azure.microsoft.com/services/logic-apps/) 56 | - [Azure Event Grid](https://azure.microsoft.com/services/event-grid/) 57 | 58 | Referencing the Architecture Diagram above, the application consists of 3 seperate Azure Functions (2 written in Node.js, the other in C#), an ASP.NET Web-Assembly based Blazor website hosted in Azure Static Web Apps and a script deployed to a Raspberry Pi (in this case, [Pi-Top](https://www.pi-top.com/)) written in Python. Finally, to configure the SMS Communication, as well as Azure Logic Apps and Azure Event Grid. 59 | 60 | ## Setting up ACS 61 | 62 | Setting up Azure Communication Services is done in the Azure Portal, by searching for the service, entering resource information and creating. 63 | 64 | ![](static/acs-create.png) 65 | ![](static/acs-setup.png) 66 | 67 | Once the resource is created, you will need to Add a Phone Number 68 | 69 | ![](static/acs-number-1.png) 70 | 71 | ![](static/acs-number-2.png) 72 | 73 | ![](static/acs-number-3.png) 74 | 75 | ![](static/acs-number-4.png) 76 | 77 | And create an Azure Event Grid Subscription for Delivery Reports with Logic Apps 78 | 79 | ![](static/acs-events.png) 80 | 81 | ![](static/acs-logic-app.png) 82 | 83 | ## Deploying Azure Functions 84 | 85 | ### Chore Function (Typescript) 86 | 87 | You can seamlessly deploy a Node.js-based Azure Function using Visual Studio Code and the Azure Functions Extension. 88 | 89 | 1. Choose the Azure icon in the Activity bar, then in the Azure: Functions area, choose the Deploy to function app... button. 90 | 91 | ![](static/function-app-publish-project.png) 92 | 93 | 2. Provide the following information at the prompts: 94 | 95 | - Select folder: Choose a folder from your workspace or browse to one that contains your function app. You won't see this if you already have a valid function app opened. 96 | 97 | - Select subscription: Choose the subscription to use. You won't see this if you only have one subscription. 98 | 99 | - Select Function App in Azure: Choose - Create new Function App. (Don't choose the Advanced option, which isn't covered in this article.) 100 | 101 | - Enter a globally unique name for the function app: Type a name that is valid in a URL path. The name you type is validated to make sure that it's unique in Azure Functions. 102 | 103 | - Select a runtime: Choose the version of Node.js you've been running on locally. You can use the node --version command to check your version. 104 | Select a location for new resources: For better performance, choose a region near you. 105 | 106 | 3. When completed, the following Azure resources are created in your subscription, using names based on your function app name: 107 | 108 | - A resource group, which is a logical container for related resources. 109 | - A standard Azure Storage account, which maintains state and other information about your projects. 110 | - A consumption plan, which defines the underlying host for your serverless function app. 111 | - A function app, which provides the environment for executing your function code. A function app lets you group functions as a logical unit for easier management, deployment, and sharing of resources within the same hosting plan. 112 | - An Application Insights instance connected to the function app, which tracks usage of your serverless function. 113 | A notification is displayed after your function app is created and the deployment package is applied. 114 | 115 | 4. Select View Output in this notification to view the creation and deployment results, including the Azure resources that you created. If you miss the notification, select the bell icon in the lower right corner to see it again. 116 | 117 | ![](static/function-create-notifications.png) 118 | 119 | ### Notification Function (C#) 120 | 121 | The preferred way to deploy the Notification Azure Function is to configure CI/CD for it. With Visual Studio 2019 16.8 Preview 3 and later, you can now generate a GitHub Action directly from Visual Studio, which configures CI/CD for your applicaitons on commit. To do this, simply right-click on the project and publish. 122 | 123 | ![](static/c-sharp-publish-1.png) 124 | 125 | 126 | Follow the wizard to deploy the Azure Function, and the last step you will be given the option to generate a publishing profile (think traditional right-click publish) or a generate a workflow file, which will create a github action that will be commited to your repo. 127 | 128 | ![](static/c-sharp-publish-2.png) 129 | 130 | After clicking finish you will be able to review the new GitHub Action workflow file that was generated, whcih will look similar to 131 | 132 | ```yaml 133 | name: Deploy Function App (.NET Core) to acs-notify 134 | on: 135 | push: 136 | branches: 137 | - main 138 | env: 139 | AZURE_FUNCTIONAPP_NAME: acs-notify 140 | AZURE_FUNCTIONAPP_PACKAGE_PATH: . 141 | AZURE_FUNCTIONAPP_PUBLISH_PROFILE: ${{ secrets.ACS_NOTIFY_PUBLISH_PROFILE }} 142 | CONFIGURATION: Release 143 | DOTNET_CORE_VERSION: 3.1.x 144 | PROJECT_PATH: . 145 | jobs: 146 | build-and-deploy: 147 | runs-on: windows-latest 148 | steps: 149 | - name: Checkout GitHub Action 150 | uses: actions/checkout@master 151 | - name: Setup .NET Core SDK ${{ env.DOTNET_CORE_VERSION }} 152 | uses: actions/setup-dotnet@v1 153 | with: 154 | dotnet-version: ${{ env.DOTNET_CORE_VERSION }} 155 | - name: Resolve Project Dependencies Using Dotnet 156 | run: > 157 | pushd "./${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}" 158 | 159 | dotnet build "{{ env.PROJECT_PATH }}" --configuration ${{ env.CONFIGURATION }} --output "./output" 160 | 161 | popd 162 | shell: pwsh 163 | - name: Run Azure Functions Action 164 | uses: Azure/functions-action@v1 165 | with: 166 | app-name: ${{ env.AZURE_FUNCTIONAPP_NAME }} 167 | publish-profile: ${{ env.AZURE_FUNCTIONAPP_PUBLISH_PROFILE }} 168 | package: ${{ env.AZURE_FUNCTIONAPP_PACKAGE_PATH }}/output 169 | ``` 170 | 171 | There will also be a environment file created alongside. It will be your responsibility to add any additional GitHub secrets to your repo if needed. 172 | 173 | ### Loading Script on Raspberry Pi 174 | 175 | **Note: This script will only work using a Pi-Top, you will need to update to run with a regular Pi with a GPIO array. 176 | 177 | Using SSH/SCP or Visual Studio Code, copy the `updateChoresFromSensor.py` and `config.py` files to your Raspberry Pi. After that, you will need to update `config.py` to match your configuration 178 | 179 | ```python 180 | get_url = '' 181 | post_url = '' 182 | sensor_port = '' 183 | greenlight_port = '' 184 | redlight_port = '' 185 | distance_threshold = 0 186 | over_threshold_status = 0 187 | under_threshold_status = 0 188 | ``` 189 | 190 | After that, you should be able to run the script and see the Chores data get updated. You can start the script from bash with 191 | 192 | ```bash 193 | python updateChoresFromSensor.py 194 | ``` 195 | 196 | ### Deploying HeatMap 197 | 198 | Finally, we will deploy the .NET Core Blazor Web-Assembly based UI to see the heatmap in action. You can deploy the app to one of the following hosting options in Azure 199 | 200 | - App Service (any option, including container) 201 | - Static Site hosted in Azure Blob Storage 202 | - Azure Static Web Apps 203 | 204 | For the Ignite Keynote, we took advantage of new support of .NET Core Blazor in Azure Static Web Apps. When we create an Azure Static Web App, we point it at a GitHub repo and it automatically configures a GitHub Action that will link your repo to the instance of SWA. After you connect the SWA to your repo, it will generate a GitHub Action Workflow. For instance, here is the one that was used for the Ignite Keynote 205 | 206 | ```yaml 207 | name: Azure Static Web Apps CI/CD 208 | 209 | on: 210 | push: 211 | branches: 212 | - main 213 | pull_request: 214 | types: [opened, synchronize, reopened, closed] 215 | branches: 216 | - main 217 | 218 | jobs: 219 | build_and_deploy_job: 220 | if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') 221 | runs-on: ubuntu-latest 222 | name: Build and Deploy Job 223 | steps: 224 | - uses: actions/checkout@v2 225 | with: 226 | submodules: true 227 | 228 | 229 | - name: Setup .NET Core SDK 230 | uses: actions/setup-dotnet@v1.6.0 231 | with: 232 | # SDK version to use. Examples: 2.2.104, 3.1, 3.1.x 233 | dotnet-version: '5.0.100-rc.1.20452.10' 234 | 235 | - name: Build App 236 | run: dotnet publish -c Release -o src/HeatMap/published src/HeatMap/HeatMap.csproj 237 | 238 | 239 | - name: Build And Deploy 240 | id: builddeploy 241 | uses: Azure/static-web-apps-deploy@v0.0.1-preview 242 | with: 243 | azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_VICTORIOUS_MOSS_031B5941E }} 244 | repo_token: ${{ secrets.GITHUB_TOKEN }} 245 | app_location: "src/HeatMap/published/wwwroot" 246 | api_location: "" 247 | app_artifact_location: "" 248 | close_pull_request_job: 249 | if: github.event_name == 'pull_request' && github.event.action == 'closed' 250 | runs-on: ubuntu-latest 251 | name: Close Pull Request Job 252 | steps: 253 | - name: Close Pull Request 254 | id: closepullrequest 255 | uses: Azure/static-web-apps-deploy@v0.0.1-preview 256 | with: 257 | azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_VICTORIOUS_MOSS_031B5941E }} 258 | action: "close" 259 | ``` 260 | 261 | As mentioned previously, you will need to add GitHub secrets to your repo. 262 | 263 | # Contributing 264 | 265 | This project welcomes contributions and suggestions. Most contributions require you to agree to a 266 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us 267 | the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. 268 | 269 | When you submit a pull request, a CLA bot will automatically determine whether you need to provide 270 | a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions 271 | provided by the bot. You will only need to do this once across all repos using our CLA. 272 | 273 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 274 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 275 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 276 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)), please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). 40 | 41 | -------------------------------------------------------------------------------- /src/HeatMap/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Launch and Debug Standalone Blazor WebAssembly App", 9 | "type": "blazorwasm", 10 | "request": "launch", 11 | "cwd": "${workspaceFolder}" 12 | } 13 | ] 14 | } -------------------------------------------------------------------------------- /src/HeatMap/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/HeatMap.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/HeatMap.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/HeatMap.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /src/HeatMap/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

Sorry, there's nothing at this address.

8 |
9 |
10 |
11 | -------------------------------------------------------------------------------- /src/HeatMap/Assignee.cs: -------------------------------------------------------------------------------- 1 | namespace HeatMap 2 | { 3 | public class Assignee 4 | { 5 | public string Name { get; set; } 6 | public string Phone { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /src/HeatMap/Chore.cs: -------------------------------------------------------------------------------- 1 | namespace HeatMap 2 | { 3 | public class Chore 4 | { 5 | public string ZoneId { get; set; } 6 | public string ChoreId { get; set; } 7 | public string Message { get; set; } 8 | public string AssignedTo { get; set; } 9 | public int Status { get; set; } 10 | public int Threshold { get; set; } 11 | public string SmsStatus { get; set; } 12 | public string MessageId { get; set; } 13 | } 14 | 15 | public static class ChoreExtensions 16 | { 17 | public static string WidgetIcon(this Chore chore) 18 | { 19 | if(chore.Status >= chore.Threshold) return "/img/full.png"; 20 | else return "/img/empty.png"; 21 | } 22 | 23 | public static string HeatMapIcon(this Chore chore) 24 | { 25 | if(chore.Status >= chore.Threshold) return "/img/high.png"; 26 | else return "/img/low.png"; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /src/HeatMap/ChoreListData.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace HeatMap 4 | { 5 | public class ChoreListData 6 | { 7 | public List Chores { get; set; } = new List(); 8 | public List Assignees { get; set; } = new List(); 9 | } 10 | } -------------------------------------------------------------------------------- /src/HeatMap/ConnectionInfo.cs: -------------------------------------------------------------------------------- 1 | namespace HeatMap 2 | { 3 | public class ConnectionInfo 4 | { 5 | public string AccessToken { get; set; } 6 | public string Url { get; set; } 7 | } 8 | } -------------------------------------------------------------------------------- /src/HeatMap/HeatMap.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net5.0 4 | false 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/HeatMap/HeatMap.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30428.66 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HeatMap", "HeatMap.csproj", "{DEF0D1CD-47AD-4670-8045-1871E933DBFB}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DEF0D1CD-47AD-4670-8045-1871E933DBFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {DEF0D1CD-47AD-4670-8045-1871E933DBFB}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {DEF0D1CD-47AD-4670-8045-1871E933DBFB}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {DEF0D1CD-47AD-4670-8045-1871E933DBFB}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {C07B7946-B5A5-4216-BB64-2477FD7B2865} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /src/HeatMap/Pages/Admin-Chores.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.SignalR.Client 2 | @using System.Threading.Tasks 3 | @using System.Net.Http 4 | @page "/Admin/Chores" 5 | @inject HttpClient Http 6 | @using Microsoft.Extensions.Configuration 7 | @inject IConfiguration Configuration 8 |

Chore Administration

9 | 10 |

11 | This is the chore list, where you'll be able to edit and assign chores. 12 |

13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @foreach (var chore in Chores) 26 | { 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | } 35 | 36 |
Assigned ToChoreStatusThresholdZone
@chore.AssignedTo@chore.Message@chore.Status@chore.Threshold@chore.ZoneId
37 | 38 | 39 | @code { 40 | 41 | public List Chores { get; set; } = new List(); 42 | 43 | protected override async Task OnInitializedAsync() 44 | { 45 | var result = await Http.GetFromJsonAsync(Configuration["ChoreFunctionUrl"]); 46 | 47 | Chores = result.Chores; 48 | 49 | StateHasChanged(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/HeatMap/Pages/Admin-People.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.SignalR.Client 2 | @using System.Threading.Tasks 3 | @using System.Net.Http 4 | @page "/Admin/People" 5 | @inject HttpClient Http 6 | @using Microsoft.Extensions.Configuration 7 | @inject IConfiguration Configuration 8 |

People Administration

9 | 10 |

11 | This is the pepole list, where you'll maintain the people who do chores. 12 |

13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | @foreach (var person in People) 23 | { 24 | 25 | 26 | 27 | 28 | } 29 | 30 |
NamePhone
@person.Name@person.Phone
31 | 32 | 33 | @code { 34 | 35 | public List People { get; set; } = new List(); 36 | 37 | protected override async Task OnInitializedAsync() 38 | { 39 | var result = await Http.GetFromJsonAsync(Configuration["ChoreFunctionUrl"]); 40 | 41 | People = result.Assignees; 42 | 43 | StateHasChanged(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/HeatMap/Pages/Index.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.SignalR.Client 2 | @using System.Threading.Tasks 3 | @using System.Net.Http; 4 | @using System.Net.Http.Headers; 5 | @using Microsoft.Extensions.DependencyInjection 6 | @using Microsoft.AspNetCore.Connections 7 | @using System.Net 8 | @page "/" 9 | @layout WidgetLayout 10 | @inject HttpClient Http 11 | @inject NavigationManager NavigationManager 12 | @using Microsoft.Extensions.Configuration 13 | @inject IConfiguration Configuration 14 | 15 |
16 | @foreach (var chore in Chores) 17 | { 18 | 19 | } 20 |
21 | 22 | 23 | @code { 24 | 25 | public List Chores { get; set; } = new List(); 26 | 27 | private void RemoveExistingChoreFromList(string choreId) 28 | { 29 | if (Chores.Any(x => x.ChoreId == choreId)) 30 | { 31 | Chores.RemoveAll(x => x.ChoreId == choreId); 32 | } 33 | } 34 | private async Task Preload() 35 | { 36 | var result = await Http.GetFromJsonAsync(Configuration["ChoreFunctionUrl"]); 37 | Chores = result.Chores; 38 | StateHasChanged(); 39 | } 40 | private void Reload(Chore chore) 41 | { 42 | RemoveExistingChoreFromList(choreId: chore.ChoreId); 43 | Chores.Add(chore); 44 | Chores = Chores.OrderBy(x => x.AssignedTo).ThenBy(x => x.Message).ToList(); 45 | StateHasChanged(); 46 | } 47 | protected override async Task OnInitializedAsync() 48 | { 49 | await Preload(); 50 | 51 | var connection = new HubConnectionBuilder() 52 | .WithUrl(Configuration["HubUrl"]) 53 | .WithAutomaticReconnect() 54 | .Build(); 55 | 56 | connection.On("choreStatusUpdated", (chore) => 57 | { 58 | Reload(chore); 59 | }); 60 | 61 | connection.On("textingChoreAssignee", (chore) => 62 | { 63 | chore.SmsStatus = $"Texting {chore.AssignedTo} a reminder"; 64 | Reload(chore); 65 | }); 66 | 67 | connection.On("choreAssigneeTexted", (chore) => 68 | { 69 | chore.SmsStatus = $"Reminder sent at {DateTime.Now.ToShortTimeString()}"; 70 | Reload(chore); 71 | }); 72 | 73 | connection.On("smsMessageReceived", (messageId) => 74 | { 75 | var chore = Chores.First(x => x.MessageId == messageId); 76 | chore.SmsStatus = $"Reminder received at {DateTime.Now.ToShortTimeString()}"; 77 | Reload(chore); 78 | }); 79 | 80 | await connection.StartAsync(); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/HeatMap/Pages/Widget.razor: -------------------------------------------------------------------------------- 1 | @using Microsoft.AspNetCore.SignalR.Client 2 | @using System.Threading.Tasks 3 | @using System.Net.Http; 4 | @using System.Net.Http.Headers; 5 | @page "/widget" 6 | @layout WidgetLayout 7 | @inject HttpClient Http 8 | @using Microsoft.Extensions.Configuration 9 | @inject IConfiguration Configuration 10 |
11 | @foreach (var chore in Chores) 12 | { 13 |
14 |
15 |
16 | Status 17 |
18 |
19 |
20 |
21 |

@chore.ZoneId

22 |
23 |
24 |
25 |
@chore.SmsStatus
26 |
27 |
28 | } 29 |
30 | 31 | @code { 32 | 33 | public List Chores { get; set; } = new List(); 34 | 35 | private void RemoveExistingChoreFromList(string choreId) 36 | { 37 | if (Chores.Any(x => x.ChoreId == choreId)) 38 | { 39 | Chores.RemoveAll(x => x.ChoreId == choreId); 40 | } 41 | } 42 | 43 | private async Task Preload() 44 | { 45 | var result = await Http.GetFromJsonAsync(Configuration["ChoreFunctionUrl"]); 46 | Chores = result.Chores; 47 | StateHasChanged(); 48 | } 49 | 50 | private void Reload(Chore chore) 51 | { 52 | RemoveExistingChoreFromList(choreId: chore.ChoreId); 53 | Chores.Add(chore); 54 | Chores = Chores.OrderBy(x => x.AssignedTo).ThenBy(x => x.Message).ToList(); 55 | StateHasChanged(); 56 | } 57 | 58 | protected override async Task OnInitializedAsync() 59 | { 60 | await Preload(); 61 | 62 | var connection = new HubConnectionBuilder() 63 | .WithUrl(Configuration["HubUrl"]) 64 | .WithAutomaticReconnect() 65 | .Build(); 66 | 67 | connection.On("choreStatusUpdated", (chore) => 68 | { 69 | Reload(chore); 70 | }); 71 | 72 | connection.On("textingChoreAssignee", (chore) => 73 | { 74 | chore.SmsStatus = $"Texting {chore.AssignedTo} a reminder"; 75 | Reload(chore); 76 | }); 77 | 78 | connection.On("choreAssigneeTexted", (chore) => 79 | { 80 | chore.SmsStatus = $"Reminder sent at {DateTime.Now.ToShortTimeString()}"; 81 | Reload(chore); 82 | }); 83 | 84 | connection.On("smsMessageReceived", (messageId) => 85 | { 86 | var chore = Chores.First(x => x.MessageId == messageId); 87 | chore.SmsStatus = $"Reminder received at {DateTime.Now.ToShortTimeString()}"; 88 | Reload(chore); 89 | }); 90 | 91 | await connection.StartAsync(); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/HeatMap/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Components.WebAssembly.Hosting; 2 | using Microsoft.Extensions.Configuration; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using System; 5 | using System.Net.Http; 6 | using System.Reflection; 7 | using System.Threading.Tasks; 8 | 9 | namespace HeatMap 10 | { 11 | public class Program 12 | { 13 | public static async Task Main(string[] args) 14 | { 15 | 16 | var builder = WebAssemblyHostBuilder.CreateDefault(args); 17 | builder.RootComponents.Add("app"); 18 | 19 | 20 | builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); 21 | 22 | var client = new HttpClient() 23 | { 24 | BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) 25 | }; 26 | 27 | using var response = await client.GetAsync("appsettings.json"); 28 | using var stream = await response.Content.ReadAsStreamAsync(); 29 | 30 | builder.Configuration.AddJsonStream(stream); 31 | 32 | await builder.Build().RunAsync(); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/HeatMap/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:33542", 7 | "sslPort": 44391 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "HeatMap": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", 23 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 24 | "environmentVariables": { 25 | "ASPNETCORE_ENVIRONMENT": "Development" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/HeatMap/Shared/MainLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 | 6 | 7 |
8 |
9 | About 10 |
11 | 12 |
13 | @Body 14 |
15 |
16 | -------------------------------------------------------------------------------- /src/HeatMap/Shared/NavMenu.razor: -------------------------------------------------------------------------------- 1 |  7 | 8 |
9 | 26 |
27 | 28 | @code { 29 | private bool collapseNavMenu = true; 30 | 31 | private string NavMenuCssClass => collapseNavMenu ? "collapse" : null; 32 | 33 | private void ToggleNavMenu() 34 | { 35 | collapseNavMenu = !collapseNavMenu; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/HeatMap/Shared/WidgetLayout.razor: -------------------------------------------------------------------------------- 1 | @inherits LayoutComponentBase 2 | 3 |
4 | @Body 5 |
6 | -------------------------------------------------------------------------------- /src/HeatMap/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using Microsoft.AspNetCore.Components.WebAssembly.Http 7 | @using Microsoft.JSInterop 8 | @using HeatMap 9 | @using HeatMap.Shared 10 | -------------------------------------------------------------------------------- /src/HeatMap/nuget.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "HubUrl": "https://acs-notify.azurewebsites.net/api", 3 | "ChoreFunctionUrl": "https://chores-iot.azurewebsites.net/api/getChores" 4 | } -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/css/app.css: -------------------------------------------------------------------------------- 1 | @import url('open-iconic/font/css/open-iconic-bootstrap.min.css'); 2 | 3 | /* custom stuff */ 4 | 5 | .home { 6 | width: 908px; 7 | height: 579px; 8 | background-image: url('/img/home.png'); 9 | } 10 | 11 | .Playroom { 12 | position: relative; 13 | left: 0px; 14 | top: 70px; 15 | width: 64px; 16 | height: 64px; 17 | } 18 | 19 | .Kitchen { 20 | position: relative; 21 | left: 350px; 22 | top: 370px; 23 | width: 64px; 24 | height: 64px; 25 | } 26 | 27 | /* end custom stuff */ 28 | 29 | html, body { 30 | font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; 31 | background-color: #000000; 32 | color: white; 33 | overflow: hidden; 34 | } 35 | 36 | a, .btn-link { 37 | color: #0366d6; 38 | } 39 | 40 | .btn-primary { 41 | color: #fff; 42 | background-color: #1b6ec2; 43 | border-color: #1861ac; 44 | } 45 | 46 | app { 47 | position: relative; 48 | display: flex; 49 | flex-direction: column; 50 | } 51 | 52 | .top-row { 53 | height: 3.5rem; 54 | display: flex; 55 | align-items: center; 56 | } 57 | 58 | .main { 59 | flex: 1; 60 | } 61 | 62 | .main .top-row { 63 | background-color: #f7f7f7; 64 | border-bottom: 1px solid #d6d5d5; 65 | justify-content: flex-end; 66 | } 67 | 68 | .main .top-row > a, .main .top-row .btn-link { 69 | white-space: nowrap; 70 | margin-left: 1.5rem; 71 | } 72 | 73 | .main .top-row a:first-child { 74 | overflow: hidden; 75 | text-overflow: ellipsis; 76 | } 77 | 78 | .sidebar { 79 | background-image: linear-gradient(180deg, rgb(5, 39, 103) 0%, #3a0647 70%); 80 | } 81 | 82 | .sidebar .top-row { 83 | background-color: rgba(0,0,0,0.4); 84 | } 85 | 86 | .sidebar .navbar-brand { 87 | font-size: 1.1rem; 88 | } 89 | 90 | .sidebar .oi { 91 | width: 2rem; 92 | font-size: 1.1rem; 93 | vertical-align: text-top; 94 | top: -2px; 95 | } 96 | 97 | .sidebar .nav-item { 98 | font-size: 0.9rem; 99 | padding-bottom: 0.5rem; 100 | } 101 | 102 | .sidebar .nav-item:first-of-type { 103 | padding-top: 1rem; 104 | } 105 | 106 | .sidebar .nav-item:last-of-type { 107 | padding-bottom: 1rem; 108 | } 109 | 110 | .sidebar .nav-item a { 111 | color: #d7d7d7; 112 | border-radius: 4px; 113 | height: 3rem; 114 | display: flex; 115 | align-items: center; 116 | line-height: 3rem; 117 | } 118 | 119 | .sidebar .nav-item a.active { 120 | background-color: rgba(255,255,255,0.25); 121 | color: white; 122 | } 123 | 124 | .sidebar .nav-item a:hover { 125 | background-color: rgba(255,255,255,0.1); 126 | color: white; 127 | } 128 | 129 | .content { 130 | padding-top: 1.1rem; 131 | } 132 | 133 | .navbar-toggler { 134 | background-color: rgba(255, 255, 255, 0.1); 135 | } 136 | 137 | .valid.modified:not([type=checkbox]) { 138 | outline: 1px solid #26b050; 139 | } 140 | 141 | .invalid { 142 | outline: 1px solid red; 143 | } 144 | 145 | .validation-message { 146 | color: red; 147 | } 148 | 149 | #blazor-error-ui { 150 | background: lightyellow; 151 | bottom: 0; 152 | box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2); 153 | display: none; 154 | left: 0; 155 | padding: 0.6rem 1.25rem 0.7rem 1.25rem; 156 | position: fixed; 157 | width: 100%; 158 | z-index: 1000; 159 | } 160 | 161 | #blazor-error-ui .dismiss { 162 | cursor: pointer; 163 | position: absolute; 164 | right: 0.75rem; 165 | top: 0.5rem; 166 | } 167 | 168 | @media (max-width: 767.98px) { 169 | .main .top-row:not(.auth) { 170 | display: none; 171 | } 172 | 173 | .main .top-row.auth { 174 | justify-content: space-between; 175 | } 176 | 177 | .main .top-row a, .main .top-row .btn-link { 178 | margin-left: 0; 179 | } 180 | } 181 | 182 | @media (min-width: 768px) { 183 | app { 184 | flex-direction: row; 185 | } 186 | 187 | .sidebar { 188 | width: 250px; 189 | height: 100vh; 190 | position: sticky; 191 | top: 0; 192 | } 193 | 194 | .main .top-row { 195 | position: sticky; 196 | top: 0; 197 | } 198 | 199 | .main > div { 200 | padding-left: 2rem !important; 201 | padding-right: 1.5rem !important; 202 | } 203 | 204 | .navbar-toggler { 205 | display: none; 206 | } 207 | 208 | .sidebar .collapse { 209 | /* Never collapse the sidebar for wide screens */ 210 | display: block; 211 | } 212 | } 213 | -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/css/open-iconic/FONT-LICENSE: -------------------------------------------------------------------------------- 1 | SIL OPEN FONT LICENSE Version 1.1 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | PREAMBLE 6 | The goals of the Open Font License (OFL) are to stimulate worldwide 7 | development of collaborative font projects, to support the font creation 8 | efforts of academic and linguistic communities, and to provide a free and 9 | open framework in which fonts may be shared and improved in partnership 10 | with others. 11 | 12 | The OFL allows the licensed fonts to be used, studied, modified and 13 | redistributed freely as long as they are not sold by themselves. The 14 | fonts, including any derivative works, can be bundled, embedded, 15 | redistributed and/or sold with any software provided that any reserved 16 | names are not used by derivative works. The fonts and derivatives, 17 | however, cannot be released under any other type of license. The 18 | requirement for fonts to remain under this license does not apply 19 | to any document created using the fonts or their derivatives. 20 | 21 | DEFINITIONS 22 | "Font Software" refers to the set of files released by the Copyright 23 | Holder(s) under this license and clearly marked as such. This may 24 | include source files, build scripts and documentation. 25 | 26 | "Reserved Font Name" refers to any names specified as such after the 27 | copyright statement(s). 28 | 29 | "Original Version" refers to the collection of Font Software components as 30 | distributed by the Copyright Holder(s). 31 | 32 | "Modified Version" refers to any derivative made by adding to, deleting, 33 | or substituting -- in part or in whole -- any of the components of the 34 | Original Version, by changing formats or by porting the Font Software to a 35 | new environment. 36 | 37 | "Author" refers to any designer, engineer, programmer, technical 38 | writer or other person who contributed to the Font Software. 39 | 40 | PERMISSION & CONDITIONS 41 | Permission is hereby granted, free of charge, to any person obtaining 42 | a copy of the Font Software, to use, study, copy, merge, embed, modify, 43 | redistribute, and sell modified and unmodified copies of the Font 44 | Software, subject to the following conditions: 45 | 46 | 1) Neither the Font Software nor any of its individual components, 47 | in Original or Modified Versions, may be sold by itself. 48 | 49 | 2) Original or Modified Versions of the Font Software may be bundled, 50 | redistributed and/or sold with any software, provided that each copy 51 | contains the above copyright notice and this license. These can be 52 | included either as stand-alone text files, human-readable headers or 53 | in the appropriate machine-readable metadata fields within text or 54 | binary files as long as those fields can be easily viewed by the user. 55 | 56 | 3) No Modified Version of the Font Software may use the Reserved Font 57 | Name(s) unless explicit written permission is granted by the corresponding 58 | Copyright Holder. This restriction only applies to the primary font name as 59 | presented to the users. 60 | 61 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font 62 | Software shall not be used to promote, endorse or advertise any 63 | Modified Version, except to acknowledge the contribution(s) of the 64 | Copyright Holder(s) and the Author(s) or with their explicit written 65 | permission. 66 | 67 | 5) The Font Software, modified or unmodified, in part or in whole, 68 | must be distributed entirely under this license, and must not be 69 | distributed under any other license. The requirement for fonts to 70 | remain under this license does not apply to any document created 71 | using the Font Software. 72 | 73 | TERMINATION 74 | This license becomes null and void if any of the above conditions are 75 | not met. 76 | 77 | DISCLAIMER 78 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 79 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF 80 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 81 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE 82 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 83 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL 84 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 85 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM 86 | OTHER DEALINGS IN THE FONT SOFTWARE. 87 | -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/css/open-iconic/ICON-LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Waybury 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/css/open-iconic/README.md: -------------------------------------------------------------------------------- 1 | [Open Iconic v1.1.1](http://useiconic.com/open) 2 | =========== 3 | 4 | ### Open Iconic is the open source sibling of [Iconic](http://useiconic.com). It is a hyper-legible collection of 223 icons with a tiny footprint—ready to use with Bootstrap and Foundation. [View the collection](http://useiconic.com/open#icons) 5 | 6 | 7 | 8 | ## What's in Open Iconic? 9 | 10 | * 223 icons designed to be legible down to 8 pixels 11 | * Super-light SVG files - 61.8 for the entire set 12 | * SVG sprite—the modern replacement for icon fonts 13 | * Webfont (EOT, OTF, SVG, TTF, WOFF), PNG and WebP formats 14 | * Webfont stylesheets (including versions for Bootstrap and Foundation) in CSS, LESS, SCSS and Stylus formats 15 | * PNG and WebP raster images in 8px, 16px, 24px, 32px, 48px and 64px. 16 | 17 | 18 | ## Getting Started 19 | 20 | #### For code samples and everything else you need to get started with Open Iconic, check out our [Icons](http://useiconic.com/open#icons) and [Reference](http://useiconic.com/open#reference) sections. 21 | 22 | ### General Usage 23 | 24 | #### Using Open Iconic's SVGs 25 | 26 | We like SVGs and we think they're the way to display icons on the web. Since Open Iconic are just basic SVGs, we suggest you display them like you would any other image (don't forget the `alt` attribute). 27 | 28 | ``` 29 | icon name 30 | ``` 31 | 32 | #### Using Open Iconic's SVG Sprite 33 | 34 | Open Iconic also comes in a SVG sprite which allows you to display all the icons in the set with a single request. It's like an icon font, without being a hack. 35 | 36 | Adding an icon from an SVG sprite is a little different than what you're used to, but it's still a piece of cake. *Tip: To make your icons easily style able, we suggest adding a general class to the* `` *tag and a unique class name for each different icon in the* `` *tag.* 37 | 38 | ``` 39 | 40 | 41 | 42 | ``` 43 | 44 | Sizing icons only needs basic CSS. All the icons are in a square format, so just set the `` tag with equal width and height dimensions. 45 | 46 | ``` 47 | .icon { 48 | width: 16px; 49 | height: 16px; 50 | } 51 | ``` 52 | 53 | Coloring icons is even easier. All you need to do is set the `fill` rule on the `` tag. 54 | 55 | ``` 56 | .icon-account-login { 57 | fill: #f00; 58 | } 59 | ``` 60 | 61 | To learn more about SVG Sprites, read [Chris Coyier's guide](http://css-tricks.com/svg-sprites-use-better-icon-fonts/). 62 | 63 | #### Using Open Iconic's Icon Font... 64 | 65 | 66 | ##### …with Bootstrap 67 | 68 | You can find our Bootstrap stylesheets in `font/css/open-iconic-bootstrap.{css, less, scss, styl}` 69 | 70 | 71 | ``` 72 | 73 | ``` 74 | 75 | 76 | ``` 77 | 78 | ``` 79 | 80 | ##### …with Foundation 81 | 82 | You can find our Foundation stylesheets in `font/css/open-iconic-foundation.{css, less, scss, styl}` 83 | 84 | ``` 85 | 86 | ``` 87 | 88 | 89 | ``` 90 | 91 | ``` 92 | 93 | ##### …on its own 94 | 95 | You can find our default stylesheets in `font/css/open-iconic.{css, less, scss, styl}` 96 | 97 | ``` 98 | 99 | ``` 100 | 101 | ``` 102 | 103 | ``` 104 | 105 | 106 | ## License 107 | 108 | ### Icons 109 | 110 | All code (including SVG markup) is under the [MIT License](http://opensource.org/licenses/MIT). 111 | 112 | ### Fonts 113 | 114 | All fonts are under the [SIL Licensed](http://scripts.sil.org/cms/scripts/page.php?item_id=OFL_web). 115 | -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/css/open-iconic/font/css/open-iconic-bootstrap.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:Icons;src:url(../fonts/open-iconic.eot);src:url(../fonts/open-iconic.eot?#iconic-sm) format('embedded-opentype'),url(../fonts/open-iconic.woff) format('woff'),url(../fonts/open-iconic.ttf) format('truetype'),url(../fonts/open-iconic.otf) format('opentype'),url(../fonts/open-iconic.svg#iconic-sm) format('svg');font-weight:400;font-style:normal}.oi{position:relative;top:1px;display:inline-block;speak:none;font-family:Icons;font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.oi:empty:before{width:1em;text-align:center;box-sizing:content-box}.oi.oi-align-center:before{text-align:center}.oi.oi-align-left:before{text-align:left}.oi.oi-align-right:before{text-align:right}.oi.oi-flip-horizontal:before{-webkit-transform:scale(-1,1);-ms-transform:scale(-1,1);transform:scale(-1,1)}.oi.oi-flip-vertical:before{-webkit-transform:scale(1,-1);-ms-transform:scale(-1,1);transform:scale(1,-1)}.oi.oi-flip-horizontal-vertical:before{-webkit-transform:scale(-1,-1);-ms-transform:scale(-1,1);transform:scale(-1,-1)}.oi-account-login:before{content:'\e000'}.oi-account-logout:before{content:'\e001'}.oi-action-redo:before{content:'\e002'}.oi-action-undo:before{content:'\e003'}.oi-align-center:before{content:'\e004'}.oi-align-left:before{content:'\e005'}.oi-align-right:before{content:'\e006'}.oi-aperture:before{content:'\e007'}.oi-arrow-bottom:before{content:'\e008'}.oi-arrow-circle-bottom:before{content:'\e009'}.oi-arrow-circle-left:before{content:'\e00a'}.oi-arrow-circle-right:before{content:'\e00b'}.oi-arrow-circle-top:before{content:'\e00c'}.oi-arrow-left:before{content:'\e00d'}.oi-arrow-right:before{content:'\e00e'}.oi-arrow-thick-bottom:before{content:'\e00f'}.oi-arrow-thick-left:before{content:'\e010'}.oi-arrow-thick-right:before{content:'\e011'}.oi-arrow-thick-top:before{content:'\e012'}.oi-arrow-top:before{content:'\e013'}.oi-audio-spectrum:before{content:'\e014'}.oi-audio:before{content:'\e015'}.oi-badge:before{content:'\e016'}.oi-ban:before{content:'\e017'}.oi-bar-chart:before{content:'\e018'}.oi-basket:before{content:'\e019'}.oi-battery-empty:before{content:'\e01a'}.oi-battery-full:before{content:'\e01b'}.oi-beaker:before{content:'\e01c'}.oi-bell:before{content:'\e01d'}.oi-bluetooth:before{content:'\e01e'}.oi-bold:before{content:'\e01f'}.oi-bolt:before{content:'\e020'}.oi-book:before{content:'\e021'}.oi-bookmark:before{content:'\e022'}.oi-box:before{content:'\e023'}.oi-briefcase:before{content:'\e024'}.oi-british-pound:before{content:'\e025'}.oi-browser:before{content:'\e026'}.oi-brush:before{content:'\e027'}.oi-bug:before{content:'\e028'}.oi-bullhorn:before{content:'\e029'}.oi-calculator:before{content:'\e02a'}.oi-calendar:before{content:'\e02b'}.oi-camera-slr:before{content:'\e02c'}.oi-caret-bottom:before{content:'\e02d'}.oi-caret-left:before{content:'\e02e'}.oi-caret-right:before{content:'\e02f'}.oi-caret-top:before{content:'\e030'}.oi-cart:before{content:'\e031'}.oi-chat:before{content:'\e032'}.oi-check:before{content:'\e033'}.oi-chevron-bottom:before{content:'\e034'}.oi-chevron-left:before{content:'\e035'}.oi-chevron-right:before{content:'\e036'}.oi-chevron-top:before{content:'\e037'}.oi-circle-check:before{content:'\e038'}.oi-circle-x:before{content:'\e039'}.oi-clipboard:before{content:'\e03a'}.oi-clock:before{content:'\e03b'}.oi-cloud-download:before{content:'\e03c'}.oi-cloud-upload:before{content:'\e03d'}.oi-cloud:before{content:'\e03e'}.oi-cloudy:before{content:'\e03f'}.oi-code:before{content:'\e040'}.oi-cog:before{content:'\e041'}.oi-collapse-down:before{content:'\e042'}.oi-collapse-left:before{content:'\e043'}.oi-collapse-right:before{content:'\e044'}.oi-collapse-up:before{content:'\e045'}.oi-command:before{content:'\e046'}.oi-comment-square:before{content:'\e047'}.oi-compass:before{content:'\e048'}.oi-contrast:before{content:'\e049'}.oi-copywriting:before{content:'\e04a'}.oi-credit-card:before{content:'\e04b'}.oi-crop:before{content:'\e04c'}.oi-dashboard:before{content:'\e04d'}.oi-data-transfer-download:before{content:'\e04e'}.oi-data-transfer-upload:before{content:'\e04f'}.oi-delete:before{content:'\e050'}.oi-dial:before{content:'\e051'}.oi-document:before{content:'\e052'}.oi-dollar:before{content:'\e053'}.oi-double-quote-sans-left:before{content:'\e054'}.oi-double-quote-sans-right:before{content:'\e055'}.oi-double-quote-serif-left:before{content:'\e056'}.oi-double-quote-serif-right:before{content:'\e057'}.oi-droplet:before{content:'\e058'}.oi-eject:before{content:'\e059'}.oi-elevator:before{content:'\e05a'}.oi-ellipses:before{content:'\e05b'}.oi-envelope-closed:before{content:'\e05c'}.oi-envelope-open:before{content:'\e05d'}.oi-euro:before{content:'\e05e'}.oi-excerpt:before{content:'\e05f'}.oi-expand-down:before{content:'\e060'}.oi-expand-left:before{content:'\e061'}.oi-expand-right:before{content:'\e062'}.oi-expand-up:before{content:'\e063'}.oi-external-link:before{content:'\e064'}.oi-eye:before{content:'\e065'}.oi-eyedropper:before{content:'\e066'}.oi-file:before{content:'\e067'}.oi-fire:before{content:'\e068'}.oi-flag:before{content:'\e069'}.oi-flash:before{content:'\e06a'}.oi-folder:before{content:'\e06b'}.oi-fork:before{content:'\e06c'}.oi-fullscreen-enter:before{content:'\e06d'}.oi-fullscreen-exit:before{content:'\e06e'}.oi-globe:before{content:'\e06f'}.oi-graph:before{content:'\e070'}.oi-grid-four-up:before{content:'\e071'}.oi-grid-three-up:before{content:'\e072'}.oi-grid-two-up:before{content:'\e073'}.oi-hard-drive:before{content:'\e074'}.oi-header:before{content:'\e075'}.oi-headphones:before{content:'\e076'}.oi-heart:before{content:'\e077'}.oi-home:before{content:'\e078'}.oi-image:before{content:'\e079'}.oi-inbox:before{content:'\e07a'}.oi-infinity:before{content:'\e07b'}.oi-info:before{content:'\e07c'}.oi-italic:before{content:'\e07d'}.oi-justify-center:before{content:'\e07e'}.oi-justify-left:before{content:'\e07f'}.oi-justify-right:before{content:'\e080'}.oi-key:before{content:'\e081'}.oi-laptop:before{content:'\e082'}.oi-layers:before{content:'\e083'}.oi-lightbulb:before{content:'\e084'}.oi-link-broken:before{content:'\e085'}.oi-link-intact:before{content:'\e086'}.oi-list-rich:before{content:'\e087'}.oi-list:before{content:'\e088'}.oi-location:before{content:'\e089'}.oi-lock-locked:before{content:'\e08a'}.oi-lock-unlocked:before{content:'\e08b'}.oi-loop-circular:before{content:'\e08c'}.oi-loop-square:before{content:'\e08d'}.oi-loop:before{content:'\e08e'}.oi-magnifying-glass:before{content:'\e08f'}.oi-map-marker:before{content:'\e090'}.oi-map:before{content:'\e091'}.oi-media-pause:before{content:'\e092'}.oi-media-play:before{content:'\e093'}.oi-media-record:before{content:'\e094'}.oi-media-skip-backward:before{content:'\e095'}.oi-media-skip-forward:before{content:'\e096'}.oi-media-step-backward:before{content:'\e097'}.oi-media-step-forward:before{content:'\e098'}.oi-media-stop:before{content:'\e099'}.oi-medical-cross:before{content:'\e09a'}.oi-menu:before{content:'\e09b'}.oi-microphone:before{content:'\e09c'}.oi-minus:before{content:'\e09d'}.oi-monitor:before{content:'\e09e'}.oi-moon:before{content:'\e09f'}.oi-move:before{content:'\e0a0'}.oi-musical-note:before{content:'\e0a1'}.oi-paperclip:before{content:'\e0a2'}.oi-pencil:before{content:'\e0a3'}.oi-people:before{content:'\e0a4'}.oi-person:before{content:'\e0a5'}.oi-phone:before{content:'\e0a6'}.oi-pie-chart:before{content:'\e0a7'}.oi-pin:before{content:'\e0a8'}.oi-play-circle:before{content:'\e0a9'}.oi-plus:before{content:'\e0aa'}.oi-power-standby:before{content:'\e0ab'}.oi-print:before{content:'\e0ac'}.oi-project:before{content:'\e0ad'}.oi-pulse:before{content:'\e0ae'}.oi-puzzle-piece:before{content:'\e0af'}.oi-question-mark:before{content:'\e0b0'}.oi-rain:before{content:'\e0b1'}.oi-random:before{content:'\e0b2'}.oi-reload:before{content:'\e0b3'}.oi-resize-both:before{content:'\e0b4'}.oi-resize-height:before{content:'\e0b5'}.oi-resize-width:before{content:'\e0b6'}.oi-rss-alt:before{content:'\e0b7'}.oi-rss:before{content:'\e0b8'}.oi-script:before{content:'\e0b9'}.oi-share-boxed:before{content:'\e0ba'}.oi-share:before{content:'\e0bb'}.oi-shield:before{content:'\e0bc'}.oi-signal:before{content:'\e0bd'}.oi-signpost:before{content:'\e0be'}.oi-sort-ascending:before{content:'\e0bf'}.oi-sort-descending:before{content:'\e0c0'}.oi-spreadsheet:before{content:'\e0c1'}.oi-star:before{content:'\e0c2'}.oi-sun:before{content:'\e0c3'}.oi-tablet:before{content:'\e0c4'}.oi-tag:before{content:'\e0c5'}.oi-tags:before{content:'\e0c6'}.oi-target:before{content:'\e0c7'}.oi-task:before{content:'\e0c8'}.oi-terminal:before{content:'\e0c9'}.oi-text:before{content:'\e0ca'}.oi-thumb-down:before{content:'\e0cb'}.oi-thumb-up:before{content:'\e0cc'}.oi-timer:before{content:'\e0cd'}.oi-transfer:before{content:'\e0ce'}.oi-trash:before{content:'\e0cf'}.oi-underline:before{content:'\e0d0'}.oi-vertical-align-bottom:before{content:'\e0d1'}.oi-vertical-align-center:before{content:'\e0d2'}.oi-vertical-align-top:before{content:'\e0d3'}.oi-video:before{content:'\e0d4'}.oi-volume-high:before{content:'\e0d5'}.oi-volume-low:before{content:'\e0d6'}.oi-volume-off:before{content:'\e0d7'}.oi-warning:before{content:'\e0d8'}.oi-wifi:before{content:'\e0d9'}.oi-wrench:before{content:'\e0da'}.oi-x:before{content:'\e0db'}.oi-yen:before{content:'\e0dc'}.oi-zoom-in:before{content:'\e0dd'}.oi-zoom-out:before{content:'\e0de'} -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/css/open-iconic/font/fonts/open-iconic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/src/HeatMap/wwwroot/css/open-iconic/font/fonts/open-iconic.eot -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/css/open-iconic/font/fonts/open-iconic.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/src/HeatMap/wwwroot/css/open-iconic/font/fonts/open-iconic.otf -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/css/open-iconic/font/fonts/open-iconic.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | Created by FontForge 20120731 at Tue Jul 1 20:39:22 2014 9 | By P.J. Onori 10 | Created by P.J. Onori with FontForge 2.0 (http://fontforge.sf.net) 11 | 12 | 13 | 14 | 27 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 45 | 47 | 49 | 51 | 53 | 55 | 57 | 59 | 61 | 63 | 65 | 67 | 69 | 71 | 74 | 76 | 79 | 81 | 84 | 86 | 88 | 91 | 93 | 95 | 98 | 100 | 102 | 104 | 106 | 109 | 112 | 115 | 117 | 121 | 123 | 125 | 127 | 130 | 132 | 134 | 136 | 138 | 141 | 143 | 145 | 147 | 149 | 151 | 153 | 155 | 157 | 159 | 162 | 165 | 167 | 169 | 172 | 174 | 177 | 179 | 181 | 183 | 185 | 189 | 191 | 194 | 196 | 198 | 200 | 202 | 205 | 207 | 209 | 211 | 213 | 215 | 218 | 220 | 222 | 224 | 226 | 228 | 230 | 232 | 234 | 236 | 238 | 241 | 243 | 245 | 247 | 249 | 251 | 253 | 256 | 259 | 261 | 263 | 265 | 267 | 269 | 272 | 274 | 276 | 280 | 282 | 285 | 287 | 289 | 292 | 295 | 298 | 300 | 302 | 304 | 306 | 309 | 312 | 314 | 316 | 318 | 320 | 322 | 324 | 326 | 330 | 334 | 338 | 340 | 343 | 345 | 347 | 349 | 351 | 353 | 355 | 358 | 360 | 363 | 365 | 367 | 369 | 371 | 373 | 375 | 377 | 379 | 381 | 383 | 386 | 388 | 390 | 392 | 394 | 396 | 399 | 401 | 404 | 406 | 408 | 410 | 412 | 414 | 416 | 419 | 421 | 423 | 425 | 428 | 431 | 435 | 438 | 440 | 442 | 444 | 446 | 448 | 451 | 453 | 455 | 457 | 460 | 462 | 464 | 466 | 468 | 471 | 473 | 477 | 479 | 481 | 483 | 486 | 488 | 490 | 492 | 494 | 496 | 499 | 501 | 504 | 506 | 509 | 512 | 515 | 517 | 520 | 522 | 524 | 526 | 529 | 532 | 534 | 536 | 539 | 542 | 543 | 544 | -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/src/HeatMap/wwwroot/css/open-iconic/font/fonts/open-iconic.ttf -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/css/open-iconic/font/fonts/open-iconic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/src/HeatMap/wwwroot/css/open-iconic/font/fonts/open-iconic.woff -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/src/HeatMap/wwwroot/favicon.ico -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/img/empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/src/HeatMap/wwwroot/img/empty.png -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/img/full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/src/HeatMap/wwwroot/img/full.png -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/img/high.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/src/HeatMap/wwwroot/img/high.png -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/img/home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/src/HeatMap/wwwroot/img/home.png -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/img/low.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/src/HeatMap/wwwroot/img/low.png -------------------------------------------------------------------------------- /src/HeatMap/wwwroot/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | HeatMap 8 | 9 | 10 | 11 | 12 | 13 | 14 | Loading... 15 | 16 |
17 | An unhandled error has occurred. 18 | Reload 19 | 🗙 20 |
21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/NotifyFunction/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # Azure Functions localsettings file 5 | local.settings.json 6 | 7 | # User-specific files 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | bld/ 24 | [Bb]in/ 25 | [Oo]bj/ 26 | [Ll]og/ 27 | 28 | # Visual Studio 2015 cache/options directory 29 | .vs/ 30 | # Uncomment if you have tasks that create the project's static files in wwwroot 31 | #wwwroot/ 32 | 33 | # MSTest test Results 34 | [Tt]est[Rr]esult*/ 35 | [Bb]uild[Ll]og.* 36 | 37 | # NUNIT 38 | *.VisualState.xml 39 | TestResult.xml 40 | 41 | # Build Results of an ATL Project 42 | [Dd]ebugPS/ 43 | [Rr]eleasePS/ 44 | dlldata.c 45 | 46 | # DNX 47 | project.lock.json 48 | project.fragment.lock.json 49 | artifacts/ 50 | 51 | *_i.c 52 | *_p.c 53 | *_i.h 54 | *.ilk 55 | *.meta 56 | *.obj 57 | *.pch 58 | *.pdb 59 | *.pgc 60 | *.pgd 61 | *.rsp 62 | *.sbr 63 | *.tlb 64 | *.tli 65 | *.tlh 66 | *.tmp 67 | *.tmp_proj 68 | *.log 69 | *.vspscc 70 | *.vssscc 71 | .builds 72 | *.pidb 73 | *.svclog 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | *.VC.db 88 | *.VC.VC.opendb 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | *.sap 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding add-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # NCrunch 117 | _NCrunch_* 118 | .*crunch*.local.xml 119 | nCrunchTemp_* 120 | 121 | # MightyMoose 122 | *.mm.* 123 | AutoTest.Net/ 124 | 125 | # Web workbench (sass) 126 | .sass-cache/ 127 | 128 | # Installshield output folder 129 | [Ee]xpress/ 130 | 131 | # DocProject is a documentation generator add-in 132 | DocProject/buildhelp/ 133 | DocProject/Help/*.HxT 134 | DocProject/Help/*.HxC 135 | DocProject/Help/*.hhc 136 | DocProject/Help/*.hhk 137 | DocProject/Help/*.hhp 138 | DocProject/Help/Html2 139 | DocProject/Help/html 140 | 141 | # Click-Once directory 142 | publish/ 143 | 144 | # Publish Web Output 145 | *.[Pp]ublish.xml 146 | *.azurePubxml 147 | # TODO: Comment the next line if you want to checkin your web deploy settings 148 | # but database connection strings (with potential passwords) will be unencrypted 149 | #*.pubxml 150 | *.publishproj 151 | 152 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 153 | # checkin your Azure Web App publish settings, but sensitive information contained 154 | # in these scripts will be unencrypted 155 | PublishScripts/ 156 | 157 | # NuGet Packages 158 | *.nupkg 159 | # The packages folder can be ignored because of Package Restore 160 | **/packages/* 161 | # except build/, which is used as an MSBuild target. 162 | !**/packages/build/ 163 | # Uncomment if necessary however generally it will be regenerated when needed 164 | #!**/packages/repositories.config 165 | # NuGet v3's project.json files produces more ignoreable files 166 | *.nuget.props 167 | *.nuget.targets 168 | 169 | # Microsoft Azure Build Output 170 | csx/ 171 | *.build.csdef 172 | 173 | # Microsoft Azure Emulator 174 | ecf/ 175 | rcf/ 176 | 177 | # Windows Store app package directories and files 178 | AppPackages/ 179 | BundleArtifacts/ 180 | Package.StoreAssociation.xml 181 | _pkginfo.txt 182 | 183 | # Visual Studio cache files 184 | # files ending in .cache can be ignored 185 | *.[Cc]ache 186 | # but keep track of directories ending in .cache 187 | !*.[Cc]ache/ 188 | 189 | # Others 190 | ClientBin/ 191 | ~$* 192 | *~ 193 | *.dbmdl 194 | *.dbproj.schemaview 195 | *.jfm 196 | *.pfx 197 | *.publishsettings 198 | node_modules/ 199 | orleans.codegen.cs 200 | 201 | # Since there are multiple workflows, uncomment next line to ignore bower_components 202 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 203 | #bower_components/ 204 | 205 | # RIA/Silverlight projects 206 | Generated_Code/ 207 | 208 | # Backup & report files from converting an old project file 209 | # to a newer Visual Studio version. Backup files are not needed, 210 | # because we have git ;-) 211 | _UpgradeReport_Files/ 212 | Backup*/ 213 | UpgradeLog*.XML 214 | UpgradeLog*.htm 215 | 216 | # SQL Server files 217 | *.mdf 218 | *.ldf 219 | 220 | # Business Intelligence projects 221 | *.rdl.data 222 | *.bim.layout 223 | *.bim_*.settings 224 | 225 | # Microsoft Fakes 226 | FakesAssemblies/ 227 | 228 | # GhostDoc plugin setting file 229 | *.GhostDoc.xml 230 | 231 | # Node.js Tools for Visual Studio 232 | .ntvs_analysis.dat 233 | 234 | # Visual Studio 6 build log 235 | *.plg 236 | 237 | # Visual Studio 6 workspace options file 238 | *.opt 239 | 240 | # Visual Studio LightSwitch build output 241 | **/*.HTMLClient/GeneratedArtifacts 242 | **/*.DesktopClient/GeneratedArtifacts 243 | **/*.DesktopClient/ModelManifest.xml 244 | **/*.Server/GeneratedArtifacts 245 | **/*.Server/ModelManifest.xml 246 | _Pvt_Extensions 247 | 248 | # Paket dependency manager 249 | .paket/paket.exe 250 | paket-files/ 251 | 252 | # FAKE - F# Make 253 | .fake/ 254 | 255 | # JetBrains Rider 256 | .idea/ 257 | *.sln.iml 258 | 259 | # CodeRush 260 | .cr/ 261 | 262 | # Python Tools for Visual Studio (PTVS) 263 | __pycache__/ 264 | *.pyc -------------------------------------------------------------------------------- /src/NotifyFunction/Assignee.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json.Serialization; 2 | 3 | namespace ChoreIot 4 | { 5 | public class Assignee 6 | { 7 | [JsonPropertyName("name")] 8 | public string Name { get; set; } 9 | [JsonPropertyName("phone")] 10 | public string Phone { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/NotifyFunction/AzureCommunicationService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Azure.Communication.Sms; 4 | 5 | namespace ChoreIot 6 | { 7 | internal class AzureCommunicationService 8 | { 9 | internal static async Task SendSmsMessage(Chore chore, Assignee assignee) 10 | { 11 | SmsClient smsclient = new SmsClient(Environment.GetEnvironmentVariable("ACSConnectionString")); 12 | 13 | string source = Environment.GetEnvironmentVariable("FromNumber"); 14 | 15 | string destination = assignee.Phone; 16 | 17 | var response = await smsclient.SendAsync( 18 | from: source, 19 | to: destination, 20 | message: chore.Message, 21 | options: new SmsSendOptions(enableDeliveryReport: true)); 22 | 23 | return response.Value.MessageId; 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /src/NotifyFunction/ChoreListData.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System.Collections.Generic; 3 | using System.Text.Json.Serialization; 4 | 5 | namespace ChoreIot 6 | { 7 | public class ChoreListData 8 | { 9 | [JsonPropertyName("chores")] 10 | public List Chores { get; set; } = new List(); 11 | [JsonPropertyName("assignees")] 12 | public List Assignees { get; set; } = new List(); 13 | } 14 | } -------------------------------------------------------------------------------- /src/NotifyFunction/ChoreService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Net.Http; 4 | using System.Text.Json; 5 | using System.Threading.Tasks; 6 | 7 | namespace ChoreIot 8 | { 9 | public class ChoreService 10 | { 11 | private readonly IHttpClientFactory _httpClientFactory; 12 | 13 | public ChoreService(IHttpClientFactory httpClientFactory) 14 | { 15 | _httpClientFactory = httpClientFactory; 16 | } 17 | 18 | public ChoreService() 19 | { 20 | 21 | } 22 | 23 | public async Task GetChores() 24 | { 25 | var client = new HttpClient(); 26 | HttpResponseMessage response = await client.GetAsync(Environment.GetEnvironmentVariable("ChoresApi")); 27 | response.EnsureSuccessStatusCode(); 28 | 29 | var options = new JsonSerializerOptions 30 | { 31 | PropertyNameCaseInsensitive = true, 32 | }; 33 | 34 | string responseBody = await response.Content.ReadAsStringAsync(); 35 | return JsonSerializer.Deserialize(responseBody, options); 36 | } 37 | 38 | public async Task ProcessChores(ChoreListData choreData, Action choreUpdated = null, 39 | Action beforeSendSms = null, 40 | Action afterSendSms = null) 41 | { 42 | if (Convert.ToBoolean(Environment.GetEnvironmentVariable("Run"))) 43 | { 44 | foreach (var chore in choreData.Chores) 45 | { 46 | choreUpdated?.Invoke(chore); 47 | 48 | // if the status is greater than the threshold, sound an alarm 49 | if (chore.Status >= chore.Threshold) 50 | { 51 | beforeSendSms?.Invoke(chore); 52 | 53 | var assignedTo = choreData.Assignees.First(x => x.Name == chore.AssignedTo); 54 | var messageId = await AzureCommunicationService.SendSmsMessage(chore, assignedTo); 55 | 56 | chore.MessageId = messageId; 57 | 58 | afterSendSms?.Invoke(chore); 59 | } 60 | } 61 | } 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /src/NotifyFunction/Chores.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 | using System.Text.Json.Serialization; 4 | 5 | namespace ChoreIot 6 | { 7 | public class Chore 8 | { 9 | [JsonPropertyName("zoneId")] 10 | public string ZoneId { get; set; } 11 | [JsonPropertyName("choreId")] 12 | public string ChoreId { get; set; } 13 | [JsonPropertyName("message")] 14 | public string Message { get; set; } 15 | [JsonPropertyName("assignedTo")] 16 | public string AssignedTo { get; set; } 17 | [JsonPropertyName("status")] 18 | public int Status { get; set; } 19 | [JsonPropertyName("threshold")] 20 | public int Threshold { get; set; } 21 | [JsonPropertyName("messageId")] 22 | public string MessageId { get; set; } 23 | } 24 | } -------------------------------------------------------------------------------- /src/NotifyFunction/Functions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Azure.WebJobs.Extensions.SignalRService; 6 | using Microsoft.Extensions.Logging; 7 | using System.IO; 8 | using System.Threading.Tasks; 9 | 10 | namespace ChoreIot 11 | { 12 | public class Functions 13 | { 14 | private readonly ChoreService _choreService; 15 | public Functions() 16 | { 17 | _choreService = new ChoreService(); 18 | } 19 | 20 | [FunctionName(nameof(negotiate))] 21 | public SignalRConnectionInfo negotiate( 22 | [HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequest req, 23 | [SignalRConnectionInfo(HubName = "heatmap")] SignalRConnectionInfo connectionInfo, 24 | ILogger log) 25 | { 26 | req.HttpContext.Response.Headers.Add("Content-Type", "application/json"); 27 | return connectionInfo; 28 | } 29 | 30 | [FunctionName(nameof(Notify))] 31 | public async Task Notify( 32 | [BlobTrigger("chores/chores.json", Connection = "AzureWebJobsStorage")] Stream myBlob, 33 | [SignalR(HubName = "heatmap")] IAsyncCollector heatmap, 34 | ILogger log) 35 | { 36 | log.LogInformation("C# HTTP trigger function processed a request."); 37 | 38 | StreamReader reader = new StreamReader(myBlob); 39 | string choresJson = reader.ReadToEnd(); 40 | var chores = System.Text.Json.JsonSerializer.Deserialize(choresJson); 41 | 42 | await _choreService.ProcessChores(chores, 43 | choreUpdated: async (chore) => 44 | { 45 | await heatmap.AddAsync(new SignalRMessage 46 | { 47 | Target = "choreStatusUpdated", 48 | Arguments = new[] { chore } 49 | }); 50 | }, 51 | beforeSendSms: async (chore) => 52 | { 53 | await heatmap.AddAsync(new SignalRMessage 54 | { 55 | Target = "textingChoreAssignee", 56 | Arguments = new[] { chore } 57 | }); 58 | }, 59 | afterSendSms: async (chore) => 60 | { 61 | await heatmap.AddAsync(new SignalRMessage 62 | { 63 | Target = "choreAssigneeTexted", 64 | Arguments = new[] { chore } 65 | }); 66 | }); 67 | } 68 | 69 | [FunctionName(nameof(HandleSmsTextDeliveredEvent))] 70 | public async Task HandleSmsTextDeliveredEvent( 71 | [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req, 72 | [SignalR(HubName = "heatmap")] IAsyncCollector heatmap, 73 | ILogger log) 74 | { 75 | string messageId = req.Query["messageId"]; 76 | 77 | await heatmap.AddAsync(new SignalRMessage 78 | { 79 | Target = "smsMessageReceived", 80 | Arguments = new[] { messageId } 81 | }); 82 | 83 | return new OkObjectResult(""); 84 | } 85 | } 86 | } -------------------------------------------------------------------------------- /src/NotifyFunction/NotifyFunction.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | netcoreapp3.1 4 | v3 5 | true 6 | true 7 | <_FunctionsSkipCleanOutput>false 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | PreserveNewest 27 | 28 | 29 | PreserveNewest 30 | Never 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/NotifyFunction/NotifyFunction.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30404.54 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NotifyFunction", "NotifyFunction.csproj", "{62399595-3783-4BFC-ADA3-C33CACF307E2}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {62399595-3783-4BFC-ADA3-C33CACF307E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {62399595-3783-4BFC-ADA3-C33CACF307E2}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {62399595-3783-4BFC-ADA3-C33CACF307E2}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {62399595-3783-4BFC-ADA3-C33CACF307E2}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {DDDB8BF6-8439-4414-9FA1-7815CE0EA379} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /src/NotifyFunction/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Azure.Functions.Extensions.DependencyInjection; 3 | using Microsoft.Extensions.Configuration; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using Microsoft.Extensions.Logging; 6 | using ChoreIot; 7 | using Microsoft.AspNetCore.Http; 8 | [assembly: FunctionsStartup(typeof(ChoreIoT.Startup))] 9 | 10 | namespace ChoreIoT 11 | { 12 | public class Startup : FunctionsStartup 13 | { 14 | public override void Configure(IFunctionsHostBuilder builder) 15 | { 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/NotifyFunction/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/choresFunction/.funcignore: -------------------------------------------------------------------------------- 1 | *.js.map 2 | *.ts 3 | .git* 4 | .vscode 5 | local.settings.json 6 | test 7 | tsconfig.json -------------------------------------------------------------------------------- /src/choresFunction/.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | 24 | # nyc test coverage 25 | .nyc_output 26 | 27 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 28 | .grunt 29 | 30 | # Bower dependency directory (https://bower.io/) 31 | bower_components 32 | 33 | # node-waf configuration 34 | .lock-wscript 35 | 36 | # Compiled binary addons (https://nodejs.org/api/addons.html) 37 | build/Release 38 | 39 | # Dependency directories 40 | node_modules/ 41 | jspm_packages/ 42 | 43 | # TypeScript v1 declaration files 44 | typings/ 45 | 46 | # Optional npm cache directory 47 | .npm 48 | 49 | # Optional eslint cache 50 | .eslintcache 51 | 52 | # Optional REPL history 53 | .node_repl_history 54 | 55 | # Output of 'npm pack' 56 | *.tgz 57 | 58 | # Yarn Integrity file 59 | .yarn-integrity 60 | 61 | # dotenv environment variables file 62 | .env 63 | .env.test 64 | 65 | # parcel-bundler cache (https://parceljs.org/) 66 | .cache 67 | 68 | # next.js build output 69 | .next 70 | 71 | # nuxt.js build output 72 | .nuxt 73 | 74 | # vuepress build output 75 | .vuepress/dist 76 | 77 | # Serverless directories 78 | .serverless/ 79 | 80 | # FuseBox cache 81 | .fusebox/ 82 | 83 | # DynamoDB Local files 84 | .dynamodb/ 85 | 86 | # TypeScript output 87 | dist 88 | out 89 | 90 | # Azure Functions artifacts 91 | bin 92 | obj 93 | appsettings.json 94 | local.settings.json -------------------------------------------------------------------------------- /src/choresFunction/getChores/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "authLevel": "anonymous", 5 | "type": "httpTrigger", 6 | "direction": "in", 7 | "name": "req", 8 | "methods": [ 9 | "get" 10 | ] 11 | }, 12 | { 13 | "type": "http", 14 | "direction": "out", 15 | "name": "res" 16 | } 17 | ], 18 | "scriptFile": "../dist/getChores/index.js" 19 | } 20 | -------------------------------------------------------------------------------- /src/choresFunction/getChores/index.ts: -------------------------------------------------------------------------------- 1 | import { AzureFunction, Context, HttpRequest } from "@azure/functions"; 2 | import { 3 | BlobServiceClient, 4 | StorageSharedKeyCredential, 5 | BlobDownloadResponseModel, 6 | } from "@azure/storage-blob"; 7 | import { getBlob } from "../utils"; 8 | import * as dotenv from "dotenv"; 9 | 10 | dotenv.config(); 11 | 12 | const httpTrigger: AzureFunction = async function ( 13 | context: Context, 14 | req: HttpRequest 15 | ): Promise { 16 | let blockBlobClient = getBlob(); 17 | 18 | const downloadBlockBlobResponse: BlobDownloadResponseModel = await blockBlobClient.download( 19 | 0 20 | ); 21 | 22 | let blobBody = await streamToString( 23 | downloadBlockBlobResponse.readableStreamBody! 24 | ); 25 | 26 | context.res = { 27 | body: blobBody, 28 | headers: { 29 | 'Content-Type': 'application/json' 30 | } 31 | }; 32 | }; 33 | 34 | // A helper method used to read a Node.js readable stream into string 35 | async function streamToString(readableStream: NodeJS.ReadableStream) { 36 | return new Promise((resolve, reject) => { 37 | const chunks: string[] = []; 38 | readableStream.on("data", (data) => { 39 | chunks.push(data.toString()); 40 | }); 41 | readableStream.on("end", () => { 42 | resolve(chunks.join("")); 43 | }); 44 | readableStream.on("error", reject); 45 | }); 46 | } 47 | 48 | export default httpTrigger; 49 | -------------------------------------------------------------------------------- /src/choresFunction/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0", 3 | "logging": { 4 | "applicationInsights": { 5 | "samplingSettings": { 6 | "isEnabled": true, 7 | "excludedTypes": "Request" 8 | } 9 | } 10 | }, 11 | "extensionBundle": { 12 | "id": "Microsoft.Azure.Functions.ExtensionBundle", 13 | "version": "[1.*, 2.0.0)" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/choresFunction/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "choresfunction", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@azure/abort-controller": { 8 | "version": "1.0.1", 9 | "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.0.1.tgz", 10 | "integrity": "sha512-wP2Jw6uPp8DEDy0n4KNidvwzDjyVV2xnycEIq7nPzj1rHyb/r+t3OPeNT1INZePP2wy5ZqlwyuyOMTi0ePyY1A==", 11 | "requires": { 12 | "tslib": "^1.9.3" 13 | } 14 | }, 15 | "@azure/core-asynciterator-polyfill": { 16 | "version": "1.0.0", 17 | "resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.0.tgz", 18 | "integrity": "sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg==" 19 | }, 20 | "@azure/core-auth": { 21 | "version": "1.1.3", 22 | "resolved": "https://registry.npmjs.org/@azure/core-auth/-/core-auth-1.1.3.tgz", 23 | "integrity": "sha512-A4xigW0YZZpkj1zK7dKuzbBpGwnhEcRk6WWuIshdHC32raR3EQ1j6VA9XZqE+RFsUgH6OAmIK5BWIz+mZjnd6Q==", 24 | "requires": { 25 | "@azure/abort-controller": "^1.0.0", 26 | "@azure/core-tracing": "1.0.0-preview.8", 27 | "@opentelemetry/api": "^0.6.1", 28 | "tslib": "^2.0.0" 29 | }, 30 | "dependencies": { 31 | "@azure/core-tracing": { 32 | "version": "1.0.0-preview.8", 33 | "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.8.tgz", 34 | "integrity": "sha512-ZKUpCd7Dlyfn7bdc+/zC/sf0aRIaNQMDuSj2RhYRFe3p70hVAnYGp3TX4cnG2yoEALp/LTj/XnZGQ8Xzf6Ja/Q==", 35 | "requires": { 36 | "@opencensus/web-types": "0.0.7", 37 | "@opentelemetry/api": "^0.6.1", 38 | "tslib": "^1.10.0" 39 | }, 40 | "dependencies": { 41 | "tslib": { 42 | "version": "1.13.0", 43 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", 44 | "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==" 45 | } 46 | } 47 | }, 48 | "@opentelemetry/api": { 49 | "version": "0.6.1", 50 | "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-0.6.1.tgz", 51 | "integrity": "sha512-wpufGZa7tTxw7eAsjXJtiyIQ42IWQdX9iUQp7ACJcKo1hCtuhLU+K2Nv1U6oRwT1oAlZTE6m4CgWKZBhOiau3Q==", 52 | "requires": { 53 | "@opentelemetry/context-base": "^0.6.1" 54 | } 55 | }, 56 | "tslib": { 57 | "version": "2.0.1", 58 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz", 59 | "integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==" 60 | } 61 | } 62 | }, 63 | "@azure/core-http": { 64 | "version": "1.1.8", 65 | "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-1.1.8.tgz", 66 | "integrity": "sha512-hJ9ZblU99sY2dTD6U5EqZ5zjd0QmwwvSp8RYp2zS9s5mhsNobLQFI09bIE6yo891bOySCEepNCE5tL15dLYhIA==", 67 | "requires": { 68 | "@azure/abort-controller": "^1.0.0", 69 | "@azure/core-auth": "^1.1.3", 70 | "@azure/core-tracing": "1.0.0-preview.9", 71 | "@azure/logger": "^1.0.0", 72 | "@opentelemetry/api": "^0.10.2", 73 | "@types/node-fetch": "^2.5.0", 74 | "@types/tunnel": "^0.0.1", 75 | "form-data": "^3.0.0", 76 | "node-fetch": "^2.6.0", 77 | "process": "^0.11.10", 78 | "tough-cookie": "^4.0.0", 79 | "tslib": "^2.0.0", 80 | "tunnel": "^0.0.6", 81 | "uuid": "^8.1.0", 82 | "xml2js": "^0.4.19" 83 | }, 84 | "dependencies": { 85 | "tslib": { 86 | "version": "2.0.1", 87 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz", 88 | "integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==" 89 | } 90 | } 91 | }, 92 | "@azure/core-lro": { 93 | "version": "1.0.2", 94 | "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-1.0.2.tgz", 95 | "integrity": "sha512-Yr0JD7GKryOmbcb5wHCQoQ4KCcH5QJWRNorofid+UvudLaxnbCfvKh/cUfQsGUqRjO9L/Bw4X7FP824DcHdMxw==", 96 | "requires": { 97 | "@azure/abort-controller": "^1.0.0", 98 | "@azure/core-http": "^1.1.1", 99 | "events": "^3.0.0", 100 | "tslib": "^1.10.0" 101 | } 102 | }, 103 | "@azure/core-paging": { 104 | "version": "1.1.2", 105 | "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.1.2.tgz", 106 | "integrity": "sha512-6wZ+LrF8zwAuukvYsiff+uMNkVu9HZt8gRs/1o5377Cz9354y23QI7eZM0iwTfO38c8LZUSvzLJSqdM4T1QXxA==", 107 | "requires": { 108 | "@azure/core-asynciterator-polyfill": "^1.0.0" 109 | } 110 | }, 111 | "@azure/core-tracing": { 112 | "version": "1.0.0-preview.9", 113 | "resolved": "https://registry.npmjs.org/@azure/core-tracing/-/core-tracing-1.0.0-preview.9.tgz", 114 | "integrity": "sha512-zczolCLJ5QG42AEPQ+Qg9SRYNUyB+yZ5dzof4YEc+dyWczO9G2sBqbAjLB7IqrsdHN2apkiB2oXeDKCsq48jug==", 115 | "requires": { 116 | "@opencensus/web-types": "0.0.7", 117 | "@opentelemetry/api": "^0.10.2", 118 | "tslib": "^2.0.0" 119 | }, 120 | "dependencies": { 121 | "tslib": { 122 | "version": "2.0.1", 123 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz", 124 | "integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==" 125 | } 126 | } 127 | }, 128 | "@azure/functions": { 129 | "version": "1.2.2", 130 | "resolved": "https://registry.npmjs.org/@azure/functions/-/functions-1.2.2.tgz", 131 | "integrity": "sha512-p/dDHq1sG/iAib+eDY4NxskWHoHW1WFzD85s0SfWxc2wVjJbxB0xz/zBF4s7ymjVgTu+0ceipeBk+tmpnt98oA==", 132 | "dev": true 133 | }, 134 | "@azure/identity": { 135 | "version": "1.1.0", 136 | "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-1.1.0.tgz", 137 | "integrity": "sha512-S4jYqegLWXIwVnkiArFlcTA7KOZmv+LMhQeQJhnmYy/CxrJHyIAEQyJ7qsrSt58bSyDZI2NkmKUBKaYGZU3/5g==", 138 | "requires": { 139 | "@azure/core-http": "^1.1.6", 140 | "@azure/core-tracing": "1.0.0-preview.9", 141 | "@azure/logger": "^1.0.0", 142 | "@opentelemetry/api": "^0.10.2", 143 | "events": "^3.0.0", 144 | "jws": "^4.0.0", 145 | "keytar": "^5.4.0", 146 | "msal": "^1.0.2", 147 | "qs": "^6.7.0", 148 | "tslib": "^2.0.0", 149 | "uuid": "^8.1.0" 150 | }, 151 | "dependencies": { 152 | "tslib": { 153 | "version": "2.0.1", 154 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz", 155 | "integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==" 156 | } 157 | } 158 | }, 159 | "@azure/logger": { 160 | "version": "1.0.0", 161 | "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.0.0.tgz", 162 | "integrity": "sha512-g2qLDgvmhyIxR3JVS8N67CyIOeFRKQlX/llxYJQr1OSGQqM3HTpVP8MjmjcEKbL/OIt2N9C9UFaNQuKOw1laOA==", 163 | "requires": { 164 | "tslib": "^1.9.3" 165 | } 166 | }, 167 | "@azure/storage-blob": { 168 | "version": "12.2.1", 169 | "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.2.1.tgz", 170 | "integrity": "sha512-erqCSmDL8b/AHZi94nq+nCE+2whQmvBDkAv4N9uic0MRac/gRyZqnsqkfrun/gr2rZo+qVtnMenwkkE3roXn8Q==", 171 | "requires": { 172 | "@azure/abort-controller": "^1.0.0", 173 | "@azure/core-http": "^1.1.6", 174 | "@azure/core-lro": "^1.0.2", 175 | "@azure/core-paging": "^1.1.1", 176 | "@azure/core-tracing": "1.0.0-preview.9", 177 | "@azure/logger": "^1.0.0", 178 | "@opentelemetry/api": "^0.10.2", 179 | "events": "^3.0.0", 180 | "tslib": "^2.0.0" 181 | }, 182 | "dependencies": { 183 | "tslib": { 184 | "version": "2.0.1", 185 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz", 186 | "integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==" 187 | } 188 | } 189 | }, 190 | "@opencensus/web-types": { 191 | "version": "0.0.7", 192 | "resolved": "https://registry.npmjs.org/@opencensus/web-types/-/web-types-0.0.7.tgz", 193 | "integrity": "sha512-xB+w7ZDAu3YBzqH44rCmG9/RlrOmFuDPt/bpf17eJr8eZSrLt7nc7LnWdxM9Mmoj/YKMHpxRg28txu3TcpiL+g==" 194 | }, 195 | "@opentelemetry/api": { 196 | "version": "0.10.2", 197 | "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-0.10.2.tgz", 198 | "integrity": "sha512-GtpMGd6vkzDMYcpu2t9LlhEgMy/SzBwRnz48EejlRArYqZzqSzAsKmegUK7zHgl+EOIaK9mKHhnRaQu3qw20cA==", 199 | "requires": { 200 | "@opentelemetry/context-base": "^0.10.2" 201 | }, 202 | "dependencies": { 203 | "@opentelemetry/context-base": { 204 | "version": "0.10.2", 205 | "resolved": "https://registry.npmjs.org/@opentelemetry/context-base/-/context-base-0.10.2.tgz", 206 | "integrity": "sha512-hZNKjKOYsckoOEgBziGMnBcX0M7EtstnCmwz5jZUOUYwlZ+/xxX6z3jPu1XVO2Jivk0eLfuP9GP+vFD49CMetw==" 207 | } 208 | } 209 | }, 210 | "@opentelemetry/context-base": { 211 | "version": "0.6.1", 212 | "resolved": "https://registry.npmjs.org/@opentelemetry/context-base/-/context-base-0.6.1.tgz", 213 | "integrity": "sha512-5bHhlTBBq82ti3qPT15TRxkYTFPPQWbnkkQkmHPtqiS1XcTB69cEKd3Jm7Cfi/vkPoyxapmePE9tyA7EzLt8SQ==" 214 | }, 215 | "@types/node": { 216 | "version": "8.10.62", 217 | "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.62.tgz", 218 | "integrity": "sha512-76fupxOYVxk36kb7O/6KtrAPZ9jnSK3+qisAX4tQMEuGNdlvl7ycwatlHqjoE6jHfVtXFM3pCrCixZOidc5cuw==" 219 | }, 220 | "@types/node-fetch": { 221 | "version": "2.5.7", 222 | "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.7.tgz", 223 | "integrity": "sha512-o2WVNf5UhWRkxlf6eq+jMZDu7kjgpgJfl4xVNlvryc95O/6F2ld8ztKX+qu+Rjyet93WAWm5LjeX9H5FGkODvw==", 224 | "requires": { 225 | "@types/node": "*", 226 | "form-data": "^3.0.0" 227 | } 228 | }, 229 | "@types/tunnel": { 230 | "version": "0.0.1", 231 | "resolved": "https://registry.npmjs.org/@types/tunnel/-/tunnel-0.0.1.tgz", 232 | "integrity": "sha512-AOqu6bQu5MSWwYvehMXLukFHnupHrpZ8nvgae5Ggie9UwzDR1CCwoXgSSWNZJuyOlCdfdsWMA5F2LlmvyoTv8A==", 233 | "requires": { 234 | "@types/node": "*" 235 | } 236 | }, 237 | "ansi-regex": { 238 | "version": "2.1.1", 239 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", 240 | "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", 241 | "optional": true 242 | }, 243 | "aproba": { 244 | "version": "1.2.0", 245 | "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", 246 | "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", 247 | "optional": true 248 | }, 249 | "are-we-there-yet": { 250 | "version": "1.1.5", 251 | "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", 252 | "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", 253 | "optional": true, 254 | "requires": { 255 | "delegates": "^1.0.0", 256 | "readable-stream": "^2.0.6" 257 | } 258 | }, 259 | "asynckit": { 260 | "version": "0.4.0", 261 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 262 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 263 | }, 264 | "balanced-match": { 265 | "version": "1.0.0", 266 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 267 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 268 | "dev": true 269 | }, 270 | "base64-js": { 271 | "version": "1.3.1", 272 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", 273 | "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", 274 | "optional": true 275 | }, 276 | "bl": { 277 | "version": "4.0.3", 278 | "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.3.tgz", 279 | "integrity": "sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==", 280 | "optional": true, 281 | "requires": { 282 | "buffer": "^5.5.0", 283 | "inherits": "^2.0.4", 284 | "readable-stream": "^3.4.0" 285 | }, 286 | "dependencies": { 287 | "readable-stream": { 288 | "version": "3.6.0", 289 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", 290 | "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", 291 | "optional": true, 292 | "requires": { 293 | "inherits": "^2.0.3", 294 | "string_decoder": "^1.1.1", 295 | "util-deprecate": "^1.0.1" 296 | } 297 | } 298 | } 299 | }, 300 | "brace-expansion": { 301 | "version": "1.1.11", 302 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 303 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 304 | "dev": true, 305 | "requires": { 306 | "balanced-match": "^1.0.0", 307 | "concat-map": "0.0.1" 308 | } 309 | }, 310 | "buffer": { 311 | "version": "5.6.0", 312 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", 313 | "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", 314 | "optional": true, 315 | "requires": { 316 | "base64-js": "^1.0.2", 317 | "ieee754": "^1.1.4" 318 | } 319 | }, 320 | "buffer-equal-constant-time": { 321 | "version": "1.0.1", 322 | "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", 323 | "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" 324 | }, 325 | "case": { 326 | "version": "1.6.3", 327 | "resolved": "https://registry.npmjs.org/case/-/case-1.6.3.tgz", 328 | "integrity": "sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ==" 329 | }, 330 | "chownr": { 331 | "version": "1.1.4", 332 | "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", 333 | "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", 334 | "optional": true 335 | }, 336 | "code-point-at": { 337 | "version": "1.1.0", 338 | "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", 339 | "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", 340 | "optional": true 341 | }, 342 | "combined-stream": { 343 | "version": "1.0.8", 344 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 345 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 346 | "requires": { 347 | "delayed-stream": "~1.0.0" 348 | } 349 | }, 350 | "concat-map": { 351 | "version": "0.0.1", 352 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 353 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 354 | "dev": true 355 | }, 356 | "console-control-strings": { 357 | "version": "1.1.0", 358 | "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", 359 | "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", 360 | "optional": true 361 | }, 362 | "core-util-is": { 363 | "version": "1.0.2", 364 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 365 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", 366 | "optional": true 367 | }, 368 | "decompress-response": { 369 | "version": "4.2.1", 370 | "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", 371 | "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", 372 | "optional": true, 373 | "requires": { 374 | "mimic-response": "^2.0.0" 375 | } 376 | }, 377 | "deep-extend": { 378 | "version": "0.6.0", 379 | "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", 380 | "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", 381 | "optional": true 382 | }, 383 | "delayed-stream": { 384 | "version": "1.0.0", 385 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 386 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 387 | }, 388 | "delegates": { 389 | "version": "1.0.0", 390 | "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", 391 | "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", 392 | "optional": true 393 | }, 394 | "detect-libc": { 395 | "version": "1.0.3", 396 | "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", 397 | "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", 398 | "optional": true 399 | }, 400 | "dotenv": { 401 | "version": "8.2.0", 402 | "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-8.2.0.tgz", 403 | "integrity": "sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==" 404 | }, 405 | "ecdsa-sig-formatter": { 406 | "version": "1.0.11", 407 | "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", 408 | "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", 409 | "requires": { 410 | "safe-buffer": "^5.0.1" 411 | } 412 | }, 413 | "end-of-stream": { 414 | "version": "1.4.4", 415 | "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", 416 | "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", 417 | "optional": true, 418 | "requires": { 419 | "once": "^1.4.0" 420 | } 421 | }, 422 | "events": { 423 | "version": "3.2.0", 424 | "resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz", 425 | "integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg==" 426 | }, 427 | "expand-template": { 428 | "version": "2.0.3", 429 | "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", 430 | "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", 431 | "optional": true 432 | }, 433 | "form-data": { 434 | "version": "3.0.0", 435 | "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", 436 | "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", 437 | "requires": { 438 | "asynckit": "^0.4.0", 439 | "combined-stream": "^1.0.8", 440 | "mime-types": "^2.1.12" 441 | } 442 | }, 443 | "fs-constants": { 444 | "version": "1.0.0", 445 | "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", 446 | "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", 447 | "optional": true 448 | }, 449 | "fs.realpath": { 450 | "version": "1.0.0", 451 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 452 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 453 | "dev": true 454 | }, 455 | "gauge": { 456 | "version": "2.7.4", 457 | "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", 458 | "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", 459 | "optional": true, 460 | "requires": { 461 | "aproba": "^1.0.3", 462 | "console-control-strings": "^1.0.0", 463 | "has-unicode": "^2.0.0", 464 | "object-assign": "^4.1.0", 465 | "signal-exit": "^3.0.0", 466 | "string-width": "^1.0.1", 467 | "strip-ansi": "^3.0.1", 468 | "wide-align": "^1.1.0" 469 | } 470 | }, 471 | "github-from-package": { 472 | "version": "0.0.0", 473 | "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", 474 | "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=", 475 | "optional": true 476 | }, 477 | "glob": { 478 | "version": "7.1.6", 479 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", 480 | "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", 481 | "dev": true, 482 | "requires": { 483 | "fs.realpath": "^1.0.0", 484 | "inflight": "^1.0.4", 485 | "inherits": "2", 486 | "minimatch": "^3.0.4", 487 | "once": "^1.3.0", 488 | "path-is-absolute": "^1.0.0" 489 | } 490 | }, 491 | "has-unicode": { 492 | "version": "2.0.1", 493 | "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", 494 | "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", 495 | "optional": true 496 | }, 497 | "ieee754": { 498 | "version": "1.1.13", 499 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", 500 | "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==", 501 | "optional": true 502 | }, 503 | "inflight": { 504 | "version": "1.0.6", 505 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 506 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 507 | "dev": true, 508 | "requires": { 509 | "once": "^1.3.0", 510 | "wrappy": "1" 511 | } 512 | }, 513 | "inherits": { 514 | "version": "2.0.4", 515 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 516 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 517 | }, 518 | "ini": { 519 | "version": "1.3.5", 520 | "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", 521 | "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", 522 | "optional": true 523 | }, 524 | "is-fullwidth-code-point": { 525 | "version": "1.0.0", 526 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", 527 | "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", 528 | "optional": true, 529 | "requires": { 530 | "number-is-nan": "^1.0.0" 531 | } 532 | }, 533 | "isarray": { 534 | "version": "1.0.0", 535 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 536 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", 537 | "optional": true 538 | }, 539 | "jwa": { 540 | "version": "2.0.0", 541 | "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", 542 | "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", 543 | "requires": { 544 | "buffer-equal-constant-time": "1.0.1", 545 | "ecdsa-sig-formatter": "1.0.11", 546 | "safe-buffer": "^5.0.1" 547 | } 548 | }, 549 | "jws": { 550 | "version": "4.0.0", 551 | "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", 552 | "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", 553 | "requires": { 554 | "jwa": "^2.0.0", 555 | "safe-buffer": "^5.0.1" 556 | } 557 | }, 558 | "keytar": { 559 | "version": "5.6.0", 560 | "resolved": "https://registry.npmjs.org/keytar/-/keytar-5.6.0.tgz", 561 | "integrity": "sha512-ueulhshHSGoryfRXaIvTj0BV1yB0KddBGhGoqCxSN9LR1Ks1GKuuCdVhF+2/YOs5fMl6MlTI9On1a4DHDXoTow==", 562 | "optional": true, 563 | "requires": { 564 | "nan": "2.14.1", 565 | "prebuild-install": "5.3.3" 566 | } 567 | }, 568 | "mime-db": { 569 | "version": "1.44.0", 570 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", 571 | "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" 572 | }, 573 | "mime-types": { 574 | "version": "2.1.27", 575 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", 576 | "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", 577 | "requires": { 578 | "mime-db": "1.44.0" 579 | } 580 | }, 581 | "mimic-response": { 582 | "version": "2.1.0", 583 | "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", 584 | "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", 585 | "optional": true 586 | }, 587 | "minimatch": { 588 | "version": "3.0.4", 589 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 590 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 591 | "dev": true, 592 | "requires": { 593 | "brace-expansion": "^1.1.7" 594 | } 595 | }, 596 | "minimist": { 597 | "version": "1.2.5", 598 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", 599 | "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", 600 | "optional": true 601 | }, 602 | "mkdirp": { 603 | "version": "0.5.5", 604 | "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", 605 | "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", 606 | "optional": true, 607 | "requires": { 608 | "minimist": "^1.2.5" 609 | } 610 | }, 611 | "mkdirp-classic": { 612 | "version": "0.5.3", 613 | "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", 614 | "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", 615 | "optional": true 616 | }, 617 | "msal": { 618 | "version": "1.4.0", 619 | "resolved": "https://registry.npmjs.org/msal/-/msal-1.4.0.tgz", 620 | "integrity": "sha512-NTxMFQh6t5g2QWMlvZTWTxL1bmcqiCv0cs2lxTHhUbWEuxWCfvaVRZfjxN8i+T0VltVVGaVIdML8QEoBnlbaSw==", 621 | "requires": { 622 | "tslib": "^1.9.3" 623 | } 624 | }, 625 | "nan": { 626 | "version": "2.14.1", 627 | "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", 628 | "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", 629 | "optional": true 630 | }, 631 | "napi-build-utils": { 632 | "version": "1.0.2", 633 | "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", 634 | "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", 635 | "optional": true 636 | }, 637 | "node-abi": { 638 | "version": "2.19.1", 639 | "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.19.1.tgz", 640 | "integrity": "sha512-HbtmIuByq44yhAzK7b9j/FelKlHYISKQn0mtvcBrU5QBkhoCMp5bu8Hv5AI34DcKfOAcJBcOEMwLlwO62FFu9A==", 641 | "optional": true, 642 | "requires": { 643 | "semver": "^5.4.1" 644 | } 645 | }, 646 | "node-fetch": { 647 | "version": "2.6.1", 648 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", 649 | "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" 650 | }, 651 | "noop-logger": { 652 | "version": "0.1.1", 653 | "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", 654 | "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=", 655 | "optional": true 656 | }, 657 | "npmlog": { 658 | "version": "4.1.2", 659 | "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", 660 | "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", 661 | "optional": true, 662 | "requires": { 663 | "are-we-there-yet": "~1.1.2", 664 | "console-control-strings": "~1.1.0", 665 | "gauge": "~2.7.3", 666 | "set-blocking": "~2.0.0" 667 | } 668 | }, 669 | "number-is-nan": { 670 | "version": "1.0.1", 671 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", 672 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", 673 | "optional": true 674 | }, 675 | "object-assign": { 676 | "version": "4.1.1", 677 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 678 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", 679 | "optional": true 680 | }, 681 | "once": { 682 | "version": "1.4.0", 683 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 684 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 685 | "requires": { 686 | "wrappy": "1" 687 | } 688 | }, 689 | "path-is-absolute": { 690 | "version": "1.0.1", 691 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 692 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 693 | "dev": true 694 | }, 695 | "prebuild-install": { 696 | "version": "5.3.3", 697 | "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.3.tgz", 698 | "integrity": "sha512-GV+nsUXuPW2p8Zy7SarF/2W/oiK8bFQgJcncoJ0d7kRpekEA0ftChjfEaF9/Y+QJEc/wFR7RAEa8lYByuUIe2g==", 699 | "optional": true, 700 | "requires": { 701 | "detect-libc": "^1.0.3", 702 | "expand-template": "^2.0.3", 703 | "github-from-package": "0.0.0", 704 | "minimist": "^1.2.0", 705 | "mkdirp": "^0.5.1", 706 | "napi-build-utils": "^1.0.1", 707 | "node-abi": "^2.7.0", 708 | "noop-logger": "^0.1.1", 709 | "npmlog": "^4.0.1", 710 | "pump": "^3.0.0", 711 | "rc": "^1.2.7", 712 | "simple-get": "^3.0.3", 713 | "tar-fs": "^2.0.0", 714 | "tunnel-agent": "^0.6.0", 715 | "which-pm-runs": "^1.0.0" 716 | } 717 | }, 718 | "process": { 719 | "version": "0.11.10", 720 | "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", 721 | "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" 722 | }, 723 | "process-nextick-args": { 724 | "version": "2.0.1", 725 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 726 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", 727 | "optional": true 728 | }, 729 | "psl": { 730 | "version": "1.8.0", 731 | "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", 732 | "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" 733 | }, 734 | "pump": { 735 | "version": "3.0.0", 736 | "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", 737 | "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", 738 | "optional": true, 739 | "requires": { 740 | "end-of-stream": "^1.1.0", 741 | "once": "^1.3.1" 742 | } 743 | }, 744 | "punycode": { 745 | "version": "2.1.1", 746 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 747 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" 748 | }, 749 | "qs": { 750 | "version": "6.9.4", 751 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", 752 | "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==" 753 | }, 754 | "rc": { 755 | "version": "1.2.8", 756 | "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", 757 | "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", 758 | "optional": true, 759 | "requires": { 760 | "deep-extend": "^0.6.0", 761 | "ini": "~1.3.0", 762 | "minimist": "^1.2.0", 763 | "strip-json-comments": "~2.0.1" 764 | } 765 | }, 766 | "readable-stream": { 767 | "version": "2.3.7", 768 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", 769 | "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", 770 | "optional": true, 771 | "requires": { 772 | "core-util-is": "~1.0.0", 773 | "inherits": "~2.0.3", 774 | "isarray": "~1.0.0", 775 | "process-nextick-args": "~2.0.0", 776 | "safe-buffer": "~5.1.1", 777 | "string_decoder": "~1.1.1", 778 | "util-deprecate": "~1.0.1" 779 | }, 780 | "dependencies": { 781 | "safe-buffer": { 782 | "version": "5.1.2", 783 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 784 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", 785 | "optional": true 786 | } 787 | } 788 | }, 789 | "rimraf": { 790 | "version": "3.0.2", 791 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", 792 | "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", 793 | "dev": true, 794 | "requires": { 795 | "glob": "^7.1.3" 796 | } 797 | }, 798 | "safe-buffer": { 799 | "version": "5.2.1", 800 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 801 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" 802 | }, 803 | "sax": { 804 | "version": "1.2.4", 805 | "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", 806 | "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" 807 | }, 808 | "semver": { 809 | "version": "5.7.1", 810 | "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", 811 | "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", 812 | "optional": true 813 | }, 814 | "set-blocking": { 815 | "version": "2.0.0", 816 | "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", 817 | "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", 818 | "optional": true 819 | }, 820 | "signal-exit": { 821 | "version": "3.0.3", 822 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", 823 | "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", 824 | "optional": true 825 | }, 826 | "simple-concat": { 827 | "version": "1.0.1", 828 | "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", 829 | "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", 830 | "optional": true 831 | }, 832 | "simple-get": { 833 | "version": "3.1.0", 834 | "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", 835 | "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", 836 | "optional": true, 837 | "requires": { 838 | "decompress-response": "^4.2.0", 839 | "once": "^1.3.1", 840 | "simple-concat": "^1.0.0" 841 | } 842 | }, 843 | "string-width": { 844 | "version": "1.0.2", 845 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", 846 | "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", 847 | "optional": true, 848 | "requires": { 849 | "code-point-at": "^1.0.0", 850 | "is-fullwidth-code-point": "^1.0.0", 851 | "strip-ansi": "^3.0.0" 852 | } 853 | }, 854 | "string_decoder": { 855 | "version": "1.1.1", 856 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 857 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 858 | "optional": true, 859 | "requires": { 860 | "safe-buffer": "~5.1.0" 861 | }, 862 | "dependencies": { 863 | "safe-buffer": { 864 | "version": "5.1.2", 865 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 866 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", 867 | "optional": true 868 | } 869 | } 870 | }, 871 | "strip-ansi": { 872 | "version": "3.0.1", 873 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", 874 | "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", 875 | "optional": true, 876 | "requires": { 877 | "ansi-regex": "^2.0.0" 878 | } 879 | }, 880 | "strip-json-comments": { 881 | "version": "2.0.1", 882 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", 883 | "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", 884 | "optional": true 885 | }, 886 | "tar-fs": { 887 | "version": "2.1.0", 888 | "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.0.tgz", 889 | "integrity": "sha512-9uW5iDvrIMCVpvasdFHW0wJPez0K4JnMZtsuIeDI7HyMGJNxmDZDOCQROr7lXyS+iL/QMpj07qcjGYTSdRFXUg==", 890 | "optional": true, 891 | "requires": { 892 | "chownr": "^1.1.1", 893 | "mkdirp-classic": "^0.5.2", 894 | "pump": "^3.0.0", 895 | "tar-stream": "^2.0.0" 896 | } 897 | }, 898 | "tar-stream": { 899 | "version": "2.1.4", 900 | "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.4.tgz", 901 | "integrity": "sha512-o3pS2zlG4gxr67GmFYBLlq+dM8gyRGUOvsrHclSkvtVtQbjV0s/+ZE8OpICbaj8clrX3tjeHngYGP7rweaBnuw==", 902 | "optional": true, 903 | "requires": { 904 | "bl": "^4.0.3", 905 | "end-of-stream": "^1.4.1", 906 | "fs-constants": "^1.0.0", 907 | "inherits": "^2.0.3", 908 | "readable-stream": "^3.1.1" 909 | }, 910 | "dependencies": { 911 | "readable-stream": { 912 | "version": "3.6.0", 913 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", 914 | "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", 915 | "optional": true, 916 | "requires": { 917 | "inherits": "^2.0.3", 918 | "string_decoder": "^1.1.1", 919 | "util-deprecate": "^1.0.1" 920 | } 921 | } 922 | } 923 | }, 924 | "tough-cookie": { 925 | "version": "4.0.0", 926 | "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", 927 | "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", 928 | "requires": { 929 | "psl": "^1.1.33", 930 | "punycode": "^2.1.1", 931 | "universalify": "^0.1.2" 932 | } 933 | }, 934 | "tslib": { 935 | "version": "1.13.0", 936 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", 937 | "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==" 938 | }, 939 | "tunnel": { 940 | "version": "0.0.6", 941 | "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", 942 | "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" 943 | }, 944 | "tunnel-agent": { 945 | "version": "0.6.0", 946 | "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", 947 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 948 | "optional": true, 949 | "requires": { 950 | "safe-buffer": "^5.0.1" 951 | } 952 | }, 953 | "typescript": { 954 | "version": "3.6.5", 955 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.5.tgz", 956 | "integrity": "sha512-BEjlc0Z06ORZKbtcxGrIvvwYs5hAnuo6TKdNFL55frVDlB+na3z5bsLhFaIxmT+dPWgBIjMo6aNnTOgHHmHgiQ==", 957 | "dev": true 958 | }, 959 | "universalify": { 960 | "version": "0.1.2", 961 | "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", 962 | "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==" 963 | }, 964 | "util-deprecate": { 965 | "version": "1.0.2", 966 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 967 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", 968 | "optional": true 969 | }, 970 | "uuid": { 971 | "version": "8.3.0", 972 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.0.tgz", 973 | "integrity": "sha512-fX6Z5o4m6XsXBdli9g7DtWgAx+osMsRRZFKma1mIUsLCz6vRvv+pz5VNbyu9UEDzpMWulZfvpgb/cmDXVulYFQ==" 974 | }, 975 | "which-pm-runs": { 976 | "version": "1.0.0", 977 | "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", 978 | "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", 979 | "optional": true 980 | }, 981 | "wide-align": { 982 | "version": "1.1.3", 983 | "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", 984 | "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", 985 | "optional": true, 986 | "requires": { 987 | "string-width": "^1.0.2 || 2" 988 | } 989 | }, 990 | "wrappy": { 991 | "version": "1.0.2", 992 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 993 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" 994 | }, 995 | "xml2js": { 996 | "version": "0.4.23", 997 | "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", 998 | "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", 999 | "requires": { 1000 | "sax": ">=0.6.0", 1001 | "xmlbuilder": "~11.0.0" 1002 | } 1003 | }, 1004 | "xmlbuilder": { 1005 | "version": "11.0.1", 1006 | "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", 1007 | "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" 1008 | } 1009 | } 1010 | } 1011 | -------------------------------------------------------------------------------- /src/choresFunction/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "choresfunction", 3 | "version": "1.0.0", 4 | "description": "", 5 | "scripts": { 6 | "build": "tsc", 7 | "prebuild": "rimraf dist/", 8 | "watch": "tsc -w", 9 | "prestart": "npm run build && func extensions install", 10 | "start:host": "func start", 11 | "start": "npm run start:host & npm run watch", 12 | "build:production": "npm install && npm run prestart && npm prune --production", 13 | "test": "echo \"No tests yet...\"" 14 | }, 15 | "dependencies": { 16 | "case": "^1.6.1", 17 | "@azure/abort-controller": "latest", 18 | "@azure/identity": "latest", 19 | "@azure/storage-blob": "latest", 20 | "dotenv": "^8.2.0" 21 | }, 22 | "devDependencies": { 23 | "@azure/functions": "^1.0.1-beta2", 24 | "@types/node": "^8.0.0", 25 | "rimraf": "^3.0.0", 26 | "typescript": "~3.6.4" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/choresFunction/proxies.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/proxies", 3 | "proxies": {} 4 | } 5 | -------------------------------------------------------------------------------- /src/choresFunction/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "lib": ["dom", "dom.iterable", "esnext.asynciterable"], 5 | "target": "es6", 6 | "outDir": "dist", 7 | "rootDir": ".", 8 | "sourceMap": true, 9 | "strict": false 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/choresFunction/updateChores/function.json: -------------------------------------------------------------------------------- 1 | { 2 | "bindings": [ 3 | { 4 | "authLevel": "anonymous", 5 | "type": "httpTrigger", 6 | "direction": "in", 7 | "name": "req", 8 | "methods": [ 9 | "post" 10 | ] 11 | }, 12 | { 13 | "type": "http", 14 | "direction": "out", 15 | "name": "res" 16 | } 17 | ], 18 | "scriptFile": "../dist/updateChores/index.js" 19 | } 20 | -------------------------------------------------------------------------------- /src/choresFunction/updateChores/index.ts: -------------------------------------------------------------------------------- 1 | import { AzureFunction, Context, HttpRequest } from "@azure/functions"; 2 | import { 3 | BlobServiceClient, 4 | StorageSharedKeyCredential, 5 | } from "@azure/storage-blob"; 6 | import { getBlob } from "../utils"; 7 | import * as dotenv from "dotenv"; 8 | dotenv.config(); 9 | const httpTrigger: AzureFunction = async function ( 10 | context: Context, 11 | req: HttpRequest 12 | ): Promise { 13 | const chores = JSON.stringify(req.body); 14 | 15 | let blockBlobClient = getBlob(); 16 | 17 | const uploadBlobResponse = await blockBlobClient.upload( 18 | chores, 19 | Buffer.byteLength(chores) 20 | ); 21 | 22 | context.res = { 23 | body: "Chores Updated", 24 | }; 25 | }; 26 | 27 | export default httpTrigger; 28 | -------------------------------------------------------------------------------- /src/choresFunction/utils.ts: -------------------------------------------------------------------------------- 1 | import { 2 | BlobServiceClient, 3 | BlockBlobClient, 4 | StorageSharedKeyCredential, 5 | BlobDownloadResponseModel, 6 | } from "@azure/storage-blob"; 7 | 8 | import * as dotenv from "dotenv"; 9 | dotenv.config(); 10 | 11 | export function getBlob(): BlockBlobClient { 12 | const account = process.env.ACCOUNT_NAME || ""; 13 | const accountKey = process.env.ACCOUNT_KEY || ""; 14 | const containerName = process.env.CONTAINER_NAME || ""; 15 | const blobName = process.env.BLOB_NAME || ""; 16 | 17 | const sharedKeyCredential = new StorageSharedKeyCredential( 18 | account, 19 | accountKey 20 | ); 21 | 22 | const blobServiceClient = new BlobServiceClient( 23 | `https://${account}.blob.core.windows.net`, 24 | sharedKeyCredential 25 | ); 26 | 27 | const containerClient = blobServiceClient.getContainerClient(containerName); 28 | return containerClient.getBlockBlobClient(blobName); 29 | } 30 | -------------------------------------------------------------------------------- /src/choresUpdater/updateChoresFromSensor.py: -------------------------------------------------------------------------------- 1 | from ptpma.components import PMAUltrasonicSensor, PMALed 2 | from time import sleep 3 | import requests 4 | import json 5 | import config as config 6 | from munch import * 7 | 8 | # Assign Inputs to Objects 9 | red_led = PMALed(config.redlight_port) 10 | green_led = PMALed(config.greenlight_port) 11 | ultrasonic_sensor = PMAUltrasonicSensor(config.sensor_port) 12 | prevDistance = 0 13 | 14 | while True: 15 | distance = round(ultrasonic_sensor.distance * 100, 2) 16 | print(distance) 17 | # Check previous distance to see if sensor changed enough to process 18 | if (abs(distance) - abs(prevDistance) > 10) or (abs(distance) - abs(prevDistance) < -10): 19 | # Get Chore data and build object 20 | jsonData = requests.get(config.get_url) 21 | chores = jsonData.json()['chores'] 22 | newChores = {} 23 | newChores['assignees'] = jsonData.json()['assignees'] 24 | newChores["chores"] = [] 25 | for x in chores: 26 | chore = munchify(x) 27 | newChore = munchify(x) 28 | # Check distance against configured threshold 29 | if distance < config.distance_threshold: 30 | red_led.on() 31 | green_led.off() 32 | newChore.status = config.over_threshold_status 33 | else: 34 | red_led.off() 35 | green_led.on() 36 | newChore.status = config.under_threshold_status 37 | newChores["chores"].append(newChore) 38 | data = json.dumps(newChores) 39 | # Post updated chores to Azure and save previous version 40 | r = requests.post(config.post_url, data= data ) 41 | prevDistance = distance 42 | sleep(5) -------------------------------------------------------------------------------- /static/Diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/Diagram.png -------------------------------------------------------------------------------- /static/Heatmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/Heatmap.png -------------------------------------------------------------------------------- /static/Icons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/Icons.png -------------------------------------------------------------------------------- /static/acs-create.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/acs-create.png -------------------------------------------------------------------------------- /static/acs-events.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/acs-events.png -------------------------------------------------------------------------------- /static/acs-logic-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/acs-logic-app.png -------------------------------------------------------------------------------- /static/acs-number-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/acs-number-1.png -------------------------------------------------------------------------------- /static/acs-number-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/acs-number-2.png -------------------------------------------------------------------------------- /static/acs-number-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/acs-number-3.png -------------------------------------------------------------------------------- /static/acs-number-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/acs-number-4.png -------------------------------------------------------------------------------- /static/acs-setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/acs-setup.png -------------------------------------------------------------------------------- /static/c-sharp-publish-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/c-sharp-publish-1.png -------------------------------------------------------------------------------- /static/c-sharp-publish-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/c-sharp-publish-2.png -------------------------------------------------------------------------------- /static/c-sharp-publish-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/c-sharp-publish-3.png -------------------------------------------------------------------------------- /static/function-app-publish-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/function-app-publish-project.png -------------------------------------------------------------------------------- /static/function-create-notifications.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/microsoft/ChoresIoT/508ef02d5110ec4077d006ebeba6dfb71b8be48f/static/function-create-notifications.png --------------------------------------------------------------------------------