Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add Stream Deck 6.9 and SDKVersion 3 #19

Merged
merged 2 commits into from
Mar 3, 2025
Merged
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
64 changes: 48 additions & 16 deletions src/streamdeck/plugins/manifest/__tests__/all.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/Actions/0/Icon",
keyword: "pattern",
pattern: patterns.IMAGE_PATH
params: {
pattern: patterns.IMAGE_PATH
}
});
});

Expand All @@ -34,7 +36,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/Actions/0/PropertyInspectorPath",
keyword: "pattern",
pattern: patterns.HTML_PATH
params: {
pattern: patterns.HTML_PATH
}
});
});

Expand All @@ -47,7 +51,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/Actions/0/UUID",
keyword: "pattern",
pattern: patterns.UUID
params: {
pattern: patterns.UUID
}
});
});

Expand All @@ -64,7 +70,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/Actions/0/Encoder/Icon",
keyword: "pattern",
pattern: patterns.IMAGE_PATH
params: {
pattern: patterns.IMAGE_PATH
}
});
});

Expand All @@ -77,7 +85,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/Actions/0/Encoder/background",
keyword: "pattern",
pattern: patterns.ENCODER_BACKGROUND_PATH
params: {
pattern: patterns.ENCODER_BACKGROUND_PATH
}
});
});

Expand All @@ -90,7 +100,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/Actions/0/Encoder/layout",
keyword: "pattern",
pattern: patterns.LAYOUT
params: {
pattern: patterns.LAYOUT
}
});
});
});
Expand All @@ -108,7 +120,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/Actions/0/States/0/Image",
keyword: "pattern",
pattern: patterns.IMAGE_PATH_WITH_GIF_SUPPORT
params: {
pattern: patterns.IMAGE_PATH_WITH_GIF_SUPPORT
}
});
});

Expand All @@ -121,7 +135,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/Actions/0/States/0/MultiActionImage",
keyword: "pattern",
pattern: patterns.IMAGE_PATH
params: {
pattern: patterns.IMAGE_PATH
}
});
});
});
Expand All @@ -136,7 +152,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/CategoryIcon",
keyword: "pattern",
pattern: patterns.IMAGE_PATH
params: {
pattern: patterns.IMAGE_PATH
}
});
});

Expand All @@ -149,7 +167,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/CodePath",
keyword: "pattern",
pattern: patterns.FILE_PATH
params: {
pattern: patterns.FILE_PATH
}
});
});

Expand All @@ -162,7 +182,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/CodePathMac",
keyword: "pattern",
pattern: patterns.FILE_PATH
params: {
pattern: patterns.FILE_PATH
}
});
});

Expand All @@ -175,7 +197,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/CodePathWin",
keyword: "pattern",
pattern: patterns.FILE_PATH
params: {
pattern: patterns.FILE_PATH
}
});
});

Expand All @@ -188,7 +212,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/Icon",
keyword: "pattern",
pattern: patterns.ICON_PATH
params: {
pattern: patterns.ICON_PATH
}
});
});

Expand All @@ -206,7 +232,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/Profiles/0/Name",
keyword: "pattern",
pattern: patterns.PROFILE_PATH
params: {
pattern: patterns.PROFILE_PATH
}
});
});
});
Expand All @@ -225,7 +253,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/PropertyInspectorPath",
keyword: "pattern",
pattern: patterns.HTML_PATH
params: {
pattern: patterns.HTML_PATH
}
});
});

Expand All @@ -238,7 +268,9 @@ describe.each(["v6.4", "v6.5", "v6.6", "v6.7", "v6.8"])("%s", (version) => {
expect(errors).toHaveError({
instancePath: "/UUID",
keyword: "pattern",
pattern: patterns.UUID
params: {
pattern: patterns.UUID
}
});
});
});
Expand Down
91 changes: 91 additions & 0 deletions src/streamdeck/plugins/manifest/__tests__/files/v6.9.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"$schema": "../../../../../../streamdeck/plugins/manifest.json",
"Actions": [
{
"Controllers": ["Encoder", "Keypad"],
"DisableAutomaticStates": true,
"DisableCaching": false,
"Encoder": {
"background": "background",
"Icon": "icon",
"layout": "$A0",
"StackColor": "#000000",
"TriggerDescription": {
"LongTouch": "Long touch",
"Push": "Push",
"Rotate": "Rotate",
"Touch": "Touch"
}
},
"Icon": "action-icon",
"Name": "Action One",
"OS": ["mac", "windows"],
"PropertyInspectorPath": "action.html",
"States": [
{
"FontFamily": "Arial",
"FontSize": 12,
"FontStyle": "Bold",
"FontUnderline": true,
"Image": "action-state-image",
"MultiActionImage": "action-state-multi-action-image",
"Name": "Action State One",
"ShowTitle": true,
"Title": "State One",
"TitleAlignment": "bottom",
"TitleColor": "#000000"
}
],
"SupportedInMultiActions": true,
"Tooltip": "This is the tooltip",
"UserTitleEnabled": true,
"UUID": "com.elgato.test.one",
"VisibleInActionsList": true
}
],
"ApplicationsToMonitor": {
"mac": ["finder"],
"windows": ["explorer.exe"]
},
"Author": "Elgato",
"Category": "Testing",
"CategoryIcon": "category-icon",
"CodePath": "main.js",
"CodePathMac": "main-darwin.js",
"CodePathWin": "main-windows.js",
"DefaultWindowSize": [500, 650],
"Description": "Manifest version 6.4",
"Icon": "icon",
"Name": "Test Manifest",
"Nodejs": {
"Debug": "break",
"GenerateProfilerOutput": false,
"Version": "20"
},
"OS": [
{
"MinimumVersion": "13",
"Platform": "mac"
},
{
"MinimumVersion": "10",
"Platform": "windows"
}
],
"Profiles": [
{
"DeviceType": 7,
"DontAutoSwitchWhenInstalled": true,
"Name": "Test Profile",
"Readonly": true
}
],
"PropertyInspectorPath": "pi.html",
"SDKVersion": 3,
"Software": {
"MinimumVersion": "6.9"
},
"URL": "https://www.elgato.com",
"UUID": "com.elgato.test",
"Version": "1.0.0.0"
}
8 changes: 6 additions & 2 deletions src/streamdeck/plugins/manifest/__tests__/v6.4.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ describe("v6.4", () => {
expect(errors).toHaveError({
instancePath: "/Actions/0",
keyword: "additionalProperties",
property: "OS"
params: {
additionalProperty: "OS"
}
});
});

Expand All @@ -35,7 +37,9 @@ describe("v6.4", () => {
expect(errors).toHaveError({
instancePath: "/Profiles/0",
keyword: "additionalProperties",
property: "AutoInstall"
params: {
additionalProperty: "AutoInstall"
}
});
});
});
Expand Down
8 changes: 6 additions & 2 deletions src/streamdeck/plugins/manifest/__tests__/v6.5.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ describe("v6.5", () => {
expect(errors).toHaveError({
instancePath: "/Actions/0",
keyword: "additionalProperties",
property: "OS"
params: {
additionalProperty: "OS"
}
});
});

Expand All @@ -35,7 +37,9 @@ describe("v6.5", () => {
expect(errors).toHaveError({
instancePath: "/Profiles/0",
keyword: "additionalProperties",
property: "AutoInstall"
params: {
additionalProperty: "AutoInstall"
}
});
});
});
Expand Down
81 changes: 81 additions & 0 deletions src/streamdeck/plugins/manifest/__tests__/v6.9.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { validateStreamDeckPluginManifest } from "@tests";

describe("6.9", () => {
/**
* Asserts the full manifest.
*/
test("full manifest", () => {
// Arrange, act, assert.
const errors = validateStreamDeckPluginManifest(`v6.9.json`);
expect(errors).toHaveLength(0);
});

describe("SDKVersion", () => {
describe("in Stream Deck 6.9", () => {
/**
* Asserts the `SDKVersion` can be `2` in Stream Deck `6.9`.
*/
test("can be 2", () => {
const errors = validateStreamDeckPluginManifest("v6.9.json", (m) => (m.SDKVersion = 2));
expect(errors).toHaveLength(0);
});

/**
* Asserts the `SDKVersion` can be `3` in Stream Deck `6.9`.
*/
test("can be 3", () => {
const errors = validateStreamDeckPluginManifest("v6.9.json", (m) => (m.SDKVersion = 3));
expect(errors).toHaveLength(0);
});

/**
* Asserts the `SDKVersion` is within scope in Stream Deck `6.9`.
*/
test("cannot be 4 in 6.9", () => {
const errors = validateStreamDeckPluginManifest("v6.9.json", (m) => {
// @ts-expect-error: To test invalid values for 6.9
m.SDKVersion = 4;
});

expect(errors).toHaveError({
keyword: "enum",
instancePath: "/SDKVersion",
params: {
allowedValues: [2, 3]
}
});
});
});

describe("in Stream Deck 6.8", () => {
/**
* Asserts the `SDKVersion` can be `2` in Stream Deck `6.8`.
*/
it("can be 2", () => {
const errors = validateStreamDeckPluginManifest("v6.8.json", (m) => {
m.SDKVersion = 2;
});

expect(errors).toHaveLength(0);
});

/**
* Asserts the `SDKVersion` cannot be `3` in Stream Deck `6.8`.
*/
it("cannot be 3", () => {
const errors = validateStreamDeckPluginManifest("v6.9.json", (m) => {
m.Software.MinimumVersion = "6.8";
m.SDKVersion = 3;
});

expect(errors).toHaveError({
keyword: "const",
instancePath: "/SDKVersion",
params: {
allowedValue: 2
}
});
});
});
});
});
Loading