From 4ec7cf665bd678dd894e9cd063fa7831c0a693d6 Mon Sep 17 00:00:00 2001 From: Tim Heuer Date: Thu, 2 Feb 2023 21:30:03 +0000 Subject: [PATCH 1/8] bump to net7 on test project [skip ci] --- Alexa.NET.Tests/Alexa.NET.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Alexa.NET.Tests/Alexa.NET.Tests.csproj b/Alexa.NET.Tests/Alexa.NET.Tests.csproj index 0602a0b..eddbe7d 100644 --- a/Alexa.NET.Tests/Alexa.NET.Tests.csproj +++ b/Alexa.NET.Tests/Alexa.NET.Tests.csproj @@ -1,7 +1,7 @@  - net6.0 + net7.0 CS0612,CS0618 From 0e6f78fa60e8ec81a805a1db6e61db46591e7192 Mon Sep 17 00:00:00 2001 From: Tim Heuer Date: Tue, 14 Mar 2023 08:53:29 -0700 Subject: [PATCH 2/8] Update devcontainer.json --- .devcontainer/devcontainer.json | 70 +++++++++------------------------ 1 file changed, 19 insertions(+), 51 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 43b4ac6..18a2ab8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,62 +1,30 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.231.6/containers/dotnet +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet { "name": "C# (.NET)", - "build": { - "dockerfile": "Dockerfile", - "args": { - // Update 'VARIANT' to pick a .NET Core version: 3.1, 5.0, 6.0 - // Append -bullseye or -focal to pin to an OS version. - "VARIANT": "7.0-bullseye", - // Options - "NODE_VERSION": "none" - } - }, - - // Set *default* container specific settings.json values on container create. - "settings": { - "testExplorer.useNativeTesting": true - }, + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/dotnet:0-7.0", + "features": { + "ghcr.io/devcontainers/features/powershell:1": {} + } - // Add the IDs of extensions you want installed when the container is created. - // "extensions": [ - // "ms-dotnettools.csharp", - // "samirat.csharp-test-adapter", - // "ms-vscode.test-adapter-converter" - // ], + // Features to add to the dev container. More info: https://containers.dev/features. + // "features": {}, // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [5000, 5001], - - // [Optional] To reuse of your local HTTPS dev cert: - // - // 1. Export it locally using this command: - // * Windows PowerShell: - // dotnet dev-certs https --trust; dotnet dev-certs https -ep "$env:USERPROFILE/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere" - // * macOS/Linux terminal: - // dotnet dev-certs https --trust; dotnet dev-certs https -ep "${HOME}/.aspnet/https/aspnetapp.pfx" -p "SecurePwdGoesHere" - // - // 2. Uncomment these 'remoteEnv' lines: - // "remoteEnv": { - // "ASPNETCORE_Kestrel__Certificates__Default__Password": "SecurePwdGoesHere", - // "ASPNETCORE_Kestrel__Certificates__Default__Path": "/home/vscode/.aspnet/https/aspnetapp.pfx", - // }, - // - // 3. Do one of the following depending on your scenario: - // * When using GitHub Codespaces and/or Remote - Containers: - // 1. Start the container - // 2. Drag ~/.aspnet/https/aspnetapp.pfx into the root of the file explorer - // 3. Open a terminal in VS Code and run "mkdir -p /home/vscode/.aspnet/https && mv aspnetapp.pfx /home/vscode/.aspnet/https" - // - // * If only using Remote - Containers with a local container, uncomment this line instead: - // "mounts": [ "source=${env:HOME}${env:USERPROFILE}/.aspnet/https,target=/home/vscode/.aspnet/https,type=bind" ], + // "portsAttributes": { + // "5001": { + // "protocol": "https" + // } + // } // Use 'postCreateCommand' to run commands after the container is created. // "postCreateCommand": "dotnet restore", - // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. - "remoteUser": "vscode", - "features": { - "powershell": "latest" - } + // Configure tool-specific properties. + // "customizations": {}, + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. + // "remoteUser": "root" } From 30032af74ae3efbe7ed4673b22fffa32a53edf94 Mon Sep 17 00:00:00 2001 From: Tim Heuer Date: Tue, 14 Mar 2023 08:55:07 -0700 Subject: [PATCH 3/8] Update build.yml [skip ci] Added exclusion for devcontainer changes --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33597d7..050d1d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,7 @@ on: - '**/*.gitignore' - '**/*.gitattributes' - '**/*.all-contributorsrc' + - '**/devcontainer.json' workflow_dispatch: branches: - master @@ -17,6 +18,7 @@ on: - '**/*.gitignore' - '**/*.gitattributes' - '**/*.all-contributorsrc' + - '**/devcontainer.json' jobs: build: From 32d181c434453026a0431c7f9d419c1ca58adb01 Mon Sep 17 00:00:00 2001 From: Tim Heuer Date: Tue, 14 Mar 2023 18:55:19 +0000 Subject: [PATCH 4/8] Adding more error types fixing #259 --- Alexa.NET/Request/Type/ErrorType.cs | 52 ++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/Alexa.NET/Request/Type/ErrorType.cs b/Alexa.NET/Request/Type/ErrorType.cs index 2bcfe01..e7d0bfe 100644 --- a/Alexa.NET/Request/Type/ErrorType.cs +++ b/Alexa.NET/Request/Type/ErrorType.cs @@ -23,6 +23,56 @@ public enum ErrorType [EnumMember(Value = "MEDIA_ERROR_INTERNAL_SERVER_ERROR")] InternalServerError, [EnumMember(Value = "MEDIA_ERROR_INTERNAL_DEVICE_ERROR")] - InternalDeviceError + InternalDeviceError, + [EnumMember(Value = "ALREADY_IN_OPERATION")] + AlreadyInOperationError, + [EnumMember(Value = "BRIDGE_UNREACHABLE")] + BridgeUnreachableError, + [EnumMember(Value = "ENDPOINT_BUSY")] + EndpointBusyError, + [EnumMember(Value = "ENDPOINT_LOW_POWER")] + EndpointLowPowerError, + [EnumMember(Value = "ENDPOINT_UNREACHABLE")] + EndpointUnreachableError, + [EnumMember(Value = "ENDPOINT_CONTROL_UNAVAILABLE")] + EndpointControlUnavailableError, + [EnumMember(Value = "EXPIRED_AUTHORIZATION_CREDENTIAL")] + ExpiredAuthorizationCredentialError, + [EnumMember(Value = "FIRMWARE_OUT_OF_DATE")] + FirmwareOutOfDateError, + [EnumMember(Value = "HARDWARE_MALFUNCTION")] + HardwareMalfunctionError, + [EnumMember(Value = "INSUFFICIENT_PERMISSIONS")] + InsufficientPermissionsError, + [EnumMember(Value = "INTERNAL_SERVICE_ERROR")] + InternalServiceError, + [EnumMember(Value = "INVALID_AUTHORIZATION_CREDENTIAL")] + InvalidAuthorizationCredentialError, + [EnumMember(Value = "INVALID_DIRECTIVE")] + InvalidDirectiveError, + [EnumMember(Value = "INVALID_VALUE")] + InvalidValueError, + [EnumMember(Value = "NO_SUCH_ENDPOINT")] + NoSuchEndpointError, + [EnumMember(Value = "NOT_CALIBRATED")] + NotCalibratedError, + [EnumMember(Value = "NOT_IN_OPERATION")] + NotInOperationError, + [EnumMember(Value = "NOT_SUPPORTED_IN_CURRENT_MODE")] + NotSupportedInCurrentModeError, + [EnumMember(Value = "NOT_SUPPORTED_WITH_CURRENT_BATTERY_CHARGE_STATE")] + NotSupportedWithCurrentBatteryChargeError, + [EnumMember(Value = "PARTNER_APPLICATION_REDIRECTION")] + PartnerApplicationRedirectionError, + [EnumMember(Value = "POWER_LEVEL_NOT_SUPPORTED")] + PowerLevelNotSupportedError, + [EnumMember(Value = "RATE_LIMIT_EXCEEDED")] + RateLimitExceededError, + [EnumMember(Value = "TEMPERATURE_VALUE_OUT_OF_RANGE")] + TemperatureValueOutOfRangeError, + [EnumMember(Value = "TOO_MANY_FAILED_ATTEMPTS")] + TooManyFailedAttemptsError, + [EnumMember(Value = "VALUE_OUT_OF_RANGE")] + ValueOutOfRangeError } } From 83bc0ec2ebd23837582586508bbf36a3e5d3e14e Mon Sep 17 00:00:00 2001 From: Tim Heuer Date: Tue, 14 Mar 2023 23:17:30 +0000 Subject: [PATCH 5/8] Fixing error naming per code review --- .vscode/settings.json | 3 +- Alexa.NET/Request/Type/ErrorType.cs | 48 ++++++++++++++--------------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 7ffb618..590c534 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "dotnet-test-explorer.testProjectPath":"**//Alexa.NET.Tests.csproj" + "dotnet-test-explorer.testProjectPath": "**//Alexa.NET.Tests.csproj", + "dotnet.defaultSolution": "Alexa.NET.sln" } \ No newline at end of file diff --git a/Alexa.NET/Request/Type/ErrorType.cs b/Alexa.NET/Request/Type/ErrorType.cs index e7d0bfe..abd6b88 100644 --- a/Alexa.NET/Request/Type/ErrorType.cs +++ b/Alexa.NET/Request/Type/ErrorType.cs @@ -25,54 +25,54 @@ public enum ErrorType [EnumMember(Value = "MEDIA_ERROR_INTERNAL_DEVICE_ERROR")] InternalDeviceError, [EnumMember(Value = "ALREADY_IN_OPERATION")] - AlreadyInOperationError, + AlreadyInOperation, [EnumMember(Value = "BRIDGE_UNREACHABLE")] - BridgeUnreachableError, + BridgeUnreachable, [EnumMember(Value = "ENDPOINT_BUSY")] - EndpointBusyError, + EndpointBusy, [EnumMember(Value = "ENDPOINT_LOW_POWER")] - EndpointLowPowerError, + EndpointLowPower, [EnumMember(Value = "ENDPOINT_UNREACHABLE")] - EndpointUnreachableError, + EndpointUnreachable, [EnumMember(Value = "ENDPOINT_CONTROL_UNAVAILABLE")] - EndpointControlUnavailableError, + EndpointControlUnavailable, [EnumMember(Value = "EXPIRED_AUTHORIZATION_CREDENTIAL")] - ExpiredAuthorizationCredentialError, + ExpiredAuthorizationCredential, [EnumMember(Value = "FIRMWARE_OUT_OF_DATE")] - FirmwareOutOfDateError, + FirmwareOutOfDate, [EnumMember(Value = "HARDWARE_MALFUNCTION")] - HardwareMalfunctionError, + HardwareMalfunction, [EnumMember(Value = "INSUFFICIENT_PERMISSIONS")] - InsufficientPermissionsError, + InsufficientPermissions, [EnumMember(Value = "INTERNAL_SERVICE_ERROR")] InternalServiceError, [EnumMember(Value = "INVALID_AUTHORIZATION_CREDENTIAL")] - InvalidAuthorizationCredentialError, + InvalidAuthorizationCredential, [EnumMember(Value = "INVALID_DIRECTIVE")] - InvalidDirectiveError, + InvalidDirective, [EnumMember(Value = "INVALID_VALUE")] - InvalidValueError, + InvalidValue, [EnumMember(Value = "NO_SUCH_ENDPOINT")] - NoSuchEndpointError, + NoSuchEndpoint, [EnumMember(Value = "NOT_CALIBRATED")] - NotCalibratedError, + NotCalibrated, [EnumMember(Value = "NOT_IN_OPERATION")] - NotInOperationError, + NotInOperation, [EnumMember(Value = "NOT_SUPPORTED_IN_CURRENT_MODE")] - NotSupportedInCurrentModeError, + NotSupportedInCurrentMode, [EnumMember(Value = "NOT_SUPPORTED_WITH_CURRENT_BATTERY_CHARGE_STATE")] - NotSupportedWithCurrentBatteryChargeError, + NotSupportedWithCurrentBatteryChargeState, [EnumMember(Value = "PARTNER_APPLICATION_REDIRECTION")] - PartnerApplicationRedirectionError, + PartnerApplicationRedirection, [EnumMember(Value = "POWER_LEVEL_NOT_SUPPORTED")] - PowerLevelNotSupportedError, + PowerLevelNotSupported, [EnumMember(Value = "RATE_LIMIT_EXCEEDED")] - RateLimitExceededError, + RateLimitExceeded, [EnumMember(Value = "TEMPERATURE_VALUE_OUT_OF_RANGE")] - TemperatureValueOutOfRangeError, + TemperatureValueOutOfRange, [EnumMember(Value = "TOO_MANY_FAILED_ATTEMPTS")] - TooManyFailedAttemptsError, + TooManyFailedAttempts, [EnumMember(Value = "VALUE_OUT_OF_RANGE")] - ValueOutOfRangeError + ValueOutOfRange } } From bf4d303354974b009b80b359b122e3ced6ca107c Mon Sep 17 00:00:00 2001 From: Tim Heuer Date: Tue, 14 Mar 2023 23:32:40 +0000 Subject: [PATCH 6/8] Version bump for release --- Alexa.NET/Alexa.NET.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Alexa.NET/Alexa.NET.csproj b/Alexa.NET/Alexa.NET.csproj index 844c023..4b67439 100644 --- a/Alexa.NET/Alexa.NET.csproj +++ b/Alexa.NET/Alexa.NET.csproj @@ -3,13 +3,13 @@ A simple .NET Core library for handling Alexa Skill request/responses. Alexa.NET - 1.21.0 + 1.22.0 Tim Heuer, Steven Pears netstandard2.0 Alexa.NET Alexa.NET amazon;alexa;echo;dot;echo dot;skills - Fixes bug in EmphasisLevel. Thanks @stoiveyp, @FelipeBergmann + Adding more support for known error types https://github.com/timheuer/alexa-skills-dotnet MIT https://github.com/timheuer/alexa-skills-dotnet From 7927f5baec3819eb46990a5540b2fe5b0cdc84de Mon Sep 17 00:00:00 2001 From: Tim Heuer Date: Tue, 14 Mar 2023 16:35:15 -0700 Subject: [PATCH 7/8] Update build.yml Fixing base64 version action --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 050d1d9..8a256c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -97,7 +97,7 @@ jobs: - name: Get certificate id: cert_file - uses: timheuer/base64-to-file@master + uses: timheuer/base64-to-file@v1 with: fileName: 'certfile.pfx' encodedString: ${{ secrets.SIGNING_CERT }} From 431dc833f92dd6751b0eb9e6425acabe52b4d5b9 Mon Sep 17 00:00:00 2001 From: Tim Heuer Date: Tue, 14 Mar 2023 16:56:07 -0700 Subject: [PATCH 8/8] Update build.yml [skip ci] Removed announce since Twitter hates developers --- .github/workflows/build.yml | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8a256c7..f64096c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,7 @@ on: - '**/*.gitattributes' - '**/*.all-contributorsrc' - '**/devcontainer.json' + - '**/build.yml' workflow_dispatch: branches: - master @@ -132,22 +133,3 @@ jobs: with: name: signednupkg path: . - - announce: - needs: [build,deploy] - environment: - name: announcement - url: ${{ steps.send_tweet.outputs.tweeturl }} - if: ${{ contains(toJson(github.event.commits),'[skip announce]') == false }} - name: Tweet release - runs-on: ubuntu-latest - steps: - - name: Tweet release detail - id: send_tweet - uses: timheuer/send-tweet-action@master - with: - status: "Alexa.NET ${{ needs.build.outputs.version }} was just released! https://github.com/timheuer/alexa-skills-dotnet/ Thanks to all the contributors!" - consumer-key: ${{ secrets.TWITTER_API_KEY }} - consumer-secret: ${{ secrets.TWITTER_API_SECRET }} - access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }} - access-token-secret: ${{ secrets.TWITTER_ACCESS_SECRET }}