Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions .nuget/AlexaSkillsKit.Lib.nuspec

This file was deleted.

2 changes: 0 additions & 2 deletions .nuget/pack.cmd

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.1</TargetFramework>
<Product>AlexaSkillsKit</Product>
<Copyright>Copyright © 2018 Stefan Negritoiu (FreeBusy) and contributors</Copyright>
<Company />
<Authors>Stefan Negritoiu (FreeBusy)</Authors>
<Owners>Stefan Negritoiu (FreeBusy)</Owners>
<Version>2.0.0</Version>
<RepositoryUrl>https://github.com/AreYouFreeBusy/AlexaSkillsKit.NET.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseUrl>http://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageTags>Amazon Alexa Skill Echo Show Speechlet .Net AudioPlayer PlaybackController</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIconUrl>https://developer.amazon.com/public/binaries/content/gallery/developerportalpublic/solutions/alexa/dp_image_kit_02.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/AreYouFreeBusy/AlexaSkillsKit.NET</PackageProjectUrl>
<Description>AudioPlayer and PlaybackController interfaces support for AlexaSkillsKit</Description>
<PackageReleaseNotes>
2.0.0: Extract AudioPlayer and PlaybackController interfaces to separate library
</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AlexaSkillsKit" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AlexaSkillsKit.Lib\AlexaSkillsKit.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ namespace AlexaSkillsKit.Interfaces.AudioPlayer
/// </summary>
public class AudioPlayerRequest : ExtendedSpeechletRequest
{
public static readonly string TypeName = "AudioPlayer";

public AudioPlayerRequest(string subtype, JObject json) : base(TypeName, subtype, json) {
public AudioPlayerRequest(string subtype, JObject json) : base(subtype, json) {
Token = json.Value<string>("token");
OffsetInMilliseconds = json.Value<long?>("offsetInMilliseconds");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
// Copyright 2015 Stefan Negritoiu (FreeBusy). See LICENSE file for more information.

using AlexaSkillsKit.Interfaces.AudioPlayer.Directives;
using AlexaSkillsKit.Interfaces.AudioPlayer.Directives;
using AlexaSkillsKit.Speechlet;
using System.Collections.Generic;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using AlexaSkillsKit.Speechlet;
using System.Threading.Tasks;

namespace AlexaSkillsKit.Interfaces.AudioPlayer
{
public class AudioPlayerSpeechletAsyncWrapper : IAudioPlayerSpeechletAsync
{
private readonly IAudioPlayerSpeechlet speechlet;

public AudioPlayerSpeechletAsyncWrapper(IAudioPlayerSpeechlet speechlet) {
this.speechlet = speechlet;
}

public async Task<AudioPlayerResponse> OnAudioPlayerAsync(AudioPlayerRequest audioRequest, Context context) {
return speechlet.OnAudioPlayer(audioRequest, context);
}

public async Task<AudioPlayerResponse> OnPlaybackControllerAsync(PlaybackControllerRequest playbackRequest, Context context) {
return speechlet.OnPlaybackController(playbackRequest, context);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using AlexaSkillsKit.Json;
using AlexaSkillsKit.Speechlet;

namespace AlexaSkillsKit.Interfaces.AudioPlayer
{
public static class AudioPlayerSpeechletServiceExtensions
{
public static void AddAudioPlayer(this SpeechletService service, IAudioPlayerSpeechlet speechlet) {
service.AddAudioPlayer(new AudioPlayerSpeechletAsyncWrapper(speechlet));
}

public static void AddAudioPlayer(this SpeechletService service, IAudioPlayerSpeechletAsync speechlet) {
Deserializer<ISpeechletInterface>.RegisterDeserializer("AudioPlayer", AudioPlayerInterface.FromJson);

SpeechletRequestEnvelope.RequestParser.AddInterface("AudioPlayer", (subtype, json) => {
switch (subtype) {
case "PlaybackFailed":
return new AudioPlayerPlaybackFailedRequest(subtype, json);
default:
return new AudioPlayerRequest(subtype, json);
}
});

service.AddHandler<AudioPlayerRequest>(
async (request, context) => await speechlet.OnAudioPlayerAsync(request, context));

SpeechletRequestEnvelope.RequestParser.AddInterface("PlaybackController", (subtype, json) => new PlaybackControllerRequest(subtype, json));

service.AddHandler<PlaybackControllerRequest>(
async (request, context) => await speechlet.OnPlaybackControllerAsync(request, context));
}
}
}
10 changes: 10 additions & 0 deletions AlexaSkillsKit.Interfaces.AudioPlayer/IAudioPlayerSpeechlet.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using AlexaSkillsKit.Speechlet;

namespace AlexaSkillsKit.Interfaces.AudioPlayer
{
public interface IAudioPlayerSpeechlet
{
AudioPlayerResponse OnAudioPlayer(AudioPlayerRequest audioRequest, Context context);
AudioPlayerResponse OnPlaybackController(PlaybackControllerRequest playbackRequest, Context context);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using AlexaSkillsKit.Speechlet;
using System.Threading.Tasks;

namespace AlexaSkillsKit.Interfaces.AudioPlayer
{
public interface IAudioPlayerSpeechletAsync
{
Task<AudioPlayerResponse> OnAudioPlayerAsync(AudioPlayerRequest audioRequest, Context context);
Task<AudioPlayerResponse> OnPlaybackControllerAsync(PlaybackControllerRequest playbackRequest, Context context);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ namespace AlexaSkillsKit.Interfaces.AudioPlayer
/// </summary>
public class PlaybackControllerRequest : ExtendedSpeechletRequest
{
public static readonly string TypeName = "PlaybackController";

public PlaybackControllerRequest(string subtype, JObject json) : base(TypeName, subtype, json) {
public PlaybackControllerRequest(string subtype, JObject json) : base(subtype, json) {
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.1</TargetFramework>
<Product>AlexaSkillsKit</Product>
<Copyright>Copyright © 2018 Stefan Negritoiu (FreeBusy) and contributors</Copyright>
<Company />
<Authors>Stefan Negritoiu (FreeBusy)</Authors>
<Owners>Stefan Negritoiu (FreeBusy)</Owners>
<Version>2.0.0</Version>
<RepositoryUrl>https://github.com/AreYouFreeBusy/AlexaSkillsKit.NET.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseUrl>http://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageTags>Amazon Alexa Skill Echo Show Speechlet .Net Dialog interface</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIconUrl>https://developer.amazon.com/public/binaries/content/gallery/developerportalpublic/solutions/alexa/dp_image_kit_02.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/AreYouFreeBusy/AlexaSkillsKit.NET</PackageProjectUrl>
<Description>Dialog interface support for AlexaSkillsKit</Description>
<PackageReleaseNotes>
2.0.0: Extract Dialog interface to separate library
</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AlexaSkillsKit" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AlexaSkillsKit.Lib\AlexaSkillsKit.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.1</TargetFramework>
<Product>AlexaSkillsKit</Product>
<Copyright>Copyright © 2018 Stefan Negritoiu (FreeBusy) and contributors</Copyright>
<Company />
<Authors>Stefan Negritoiu (FreeBusy)</Authors>
<Owners>Stefan Negritoiu (FreeBusy)</Owners>
<Version>2.0.0</Version>
<RepositoryUrl>https://github.com/AreYouFreeBusy/AlexaSkillsKit.NET.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseUrl>http://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageTags>Amazon Alexa Skill Echo Show Speechlet .Net Display interface</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIconUrl>https://developer.amazon.com/public/binaries/content/gallery/developerportalpublic/solutions/alexa/dp_image_kit_02.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/AreYouFreeBusy/AlexaSkillsKit.NET</PackageProjectUrl>
<Description>Display interface support for AlexaSkillsKit</Description>
<PackageReleaseNotes>
2.0.0: Extract Display interface to separate library
</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AlexaSkillsKit" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AlexaSkillsKit.Lib\AlexaSkillsKit.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ namespace AlexaSkillsKit.Interfaces.Display
/// </summary>
public class DisplayRequest : ExtendedSpeechletRequest
{
public static readonly string TypeName = "Display";

public DisplayRequest(string subtype, JObject json) : base(TypeName, subtype, json) {
public DisplayRequest(string subtype, JObject json) : base(subtype, json) {
Token = json.Value<string>("token");
}

Expand Down
18 changes: 18 additions & 0 deletions AlexaSkillsKit.Interfaces.Display/DisplaySpeechletAsyncWrapper.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using AlexaSkillsKit.Speechlet;
using System.Threading.Tasks;

namespace AlexaSkillsKit.Interfaces.Display
{
public class DisplaySpeechletAsyncWrapper : IDisplaySpeechletAsync
{
private readonly IDisplaySpeechlet speechlet;

public DisplaySpeechletAsyncWrapper(IDisplaySpeechlet speechlet) {
this.speechlet = speechlet;
}

public async Task<SpeechletResponse> OnDisplayAsync(DisplayRequest displayRequest, Context context) {
return speechlet.OnDisplay(displayRequest, context);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using AlexaSkillsKit.Json;
using AlexaSkillsKit.Speechlet;

namespace AlexaSkillsKit.Interfaces.Display
{
public static class DisplaySpeechletServiceExtensions
{
public static void AddDisplay(this SpeechletService service, IDisplaySpeechlet speechlet) {
service.AddDisplay(new DisplaySpeechletAsyncWrapper(speechlet));
}

public static void AddDisplay(this SpeechletService service, IDisplaySpeechletAsync speechlet) {
Deserializer<ISpeechletInterface>.RegisterDeserializer("Display", DisplayInterface.FromJson);

SpeechletRequestEnvelope.RequestParser.AddInterface("Display", (subtype, json) => new DisplayRequest(subtype, json));

service.AddHandler<DisplayRequest>(async (request, context) => await speechlet.OnDisplayAsync(request, context));
}
}
}
9 changes: 9 additions & 0 deletions AlexaSkillsKit.Interfaces.Display/IDisplaySpeechlet.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using AlexaSkillsKit.Speechlet;

namespace AlexaSkillsKit.Interfaces.Display
{
public interface IDisplaySpeechlet
{
SpeechletResponse OnDisplay(DisplayRequest displayRequest, Context context);
}
}
10 changes: 10 additions & 0 deletions AlexaSkillsKit.Interfaces.Display/IDisplaySpeechletAsync.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using AlexaSkillsKit.Speechlet;
using System.Threading.Tasks;

namespace AlexaSkillsKit.Interfaces.Display
{
public interface IDisplaySpeechletAsync
{
Task<SpeechletResponse> OnDisplayAsync(DisplayRequest displayRequest, Context context);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard1.1</TargetFramework>
<Product>AlexaSkillsKit</Product>
<Copyright>Copyright © 2018 Stefan Negritoiu (FreeBusy) and contributors</Copyright>
<Company />
<Authors>Stefan Negritoiu (FreeBusy)</Authors>
<Owners>Stefan Negritoiu (FreeBusy)</Owners>
<Version>2.0.0</Version>
<RepositoryUrl>https://github.com/AreYouFreeBusy/AlexaSkillsKit.NET.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageLicenseUrl>http://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageTags>Amazon Alexa Skill Echo Show Speechlet .Net VideoApp interface</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIconUrl>https://developer.amazon.com/public/binaries/content/gallery/developerportalpublic/solutions/alexa/dp_image_kit_02.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/AreYouFreeBusy/AlexaSkillsKit.NET</PackageProjectUrl>
<Description>VideoApp interface support for AlexaSkillsKit</Description>
<PackageReleaseNotes>
2.0.0: Extract VideoApp interface to separate library
</PackageReleaseNotes>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AlexaSkillsKit" Version="2.0.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\AlexaSkillsKit.Lib\AlexaSkillsKit.csproj" />
</ItemGroup>

</Project>
Loading