Skip to content

Commit 952b4f2

Browse files
authored
feat: add SupportURL to manifest (#20)
Co-authored-by: Richard Herman <[email protected]>
1 parent e7cc8ff commit 952b4f2

File tree

5 files changed

+69
-1
lines changed

5 files changed

+69
-1
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111

1212
# Change Log
1313

14+
## 0.4.4
15+
16+
### ✨ New
17+
18+
- Add `SupportURL` and `Actions[].SupportURL`.
19+
1420
## 0.4.3
1521

1622
### ✨ New

src/streamdeck/plugins/manifest/__tests__/files/v6.9.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"TitleColor": "#000000"
3737
}
3838
],
39+
"SupportURL": "https://help.elgato.com",
3940
"SupportedInMultiActions": true,
4041
"Tooltip": "This is the tooltip",
4142
"UserTitleEnabled": true,
@@ -85,6 +86,7 @@
8586
"Software": {
8687
"MinimumVersion": "6.9"
8788
},
89+
"SupportURL": "https://help.elgato.com",
8890
"URL": "https://www.elgato.com",
8991
"UUID": "com.elgato.test",
9092
"Version": "1.0.0.0"

src/streamdeck/plugins/manifest/__tests__/v6.9.test.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,4 +78,39 @@ describe("6.9", () => {
7878
});
7979
});
8080
});
81+
82+
describe("SupportURL", () => {
83+
it("is optional", () => {
84+
// Arrange, act.
85+
const errors = validateStreamDeckPluginManifest("v6.9.json", (m) => {
86+
m.Actions[0].SupportURL = undefined;
87+
m.SupportURL = undefined;
88+
});
89+
90+
// Assert.
91+
expect(errors).toHaveLength(0);
92+
});
93+
94+
it("cannot be in lower than 6.9", () => {
95+
// Arrange, act.
96+
const errors = validateStreamDeckPluginManifest("v6.9.json", (m) => (m.Software.MinimumVersion = "6.8"));
97+
98+
// Assert.
99+
expect(errors).toHaveError({
100+
keyword: "additionalProperties",
101+
instancePath: "/Actions/0",
102+
params: {
103+
additionalProperty: "SupportURL"
104+
}
105+
});
106+
107+
expect(errors).toHaveError({
108+
keyword: "additionalProperties",
109+
instancePath: "",
110+
params: {
111+
additionalProperty: "SupportURL"
112+
}
113+
});
114+
});
115+
});
81116
});

src/streamdeck/plugins/manifest/latest.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,15 @@ export type Manifest = {
183183
*/
184184
Software: Software;
185185

186+
/**
187+
* Link to the plugin's support website.
188+
*
189+
* **Examples**:
190+
* - https://help.corsair.com/
191+
* - https://help.elgato.com/
192+
*/
193+
SupportURL?: string;
194+
186195
/**
187196
* Link to the plugin's website.
188197
*
@@ -318,6 +327,15 @@ export type Action = {
318327
*/
319328
SupportedInMultiActions?: boolean;
320329

330+
/**
331+
* Link to the actions's support website.
332+
*
333+
* **Examples**:
334+
* - https://help.corsair.com/
335+
* - https://help.elgato.com/
336+
*/
337+
SupportURL?: string;
338+
321339
/**
322340
* Tooltip shown to the user when they hover over the action within the actions list in the Stream Deck application.
323341
*/

src/streamdeck/plugins/manifest/v6.6.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
import type { ElementOf } from "../../../utils";
12
import type { Manifest_6_9 } from "./v6.9";
23

34
/**
45
* Defines the plugin and available actions, and all information associated with them, including the plugin's entry point, all iconography, action default behavior, etc.
56
*/
6-
export type Manifest_6_6 = Omit<Manifest_6_9, "SDKVersion" | "Software"> & {
7+
export type Manifest_6_6 = Omit<Manifest_6_9, "Actions" | "SDKVersion" | "Software" | "SupportURL"> & {
8+
/**
9+
* Collection of actions provided by the plugin, and all of their information; this can include actions that are available to user's via the actions list, and actions that are
10+
* hidden to the user but available to pre-defined profiles distributed with the plugin (`Manifest.Actions.VisibleInActionsList`).
11+
*/
12+
Actions: Omit<ElementOf<Manifest_6_9["Actions"]>, "SupportURL">[];
13+
714
/**
815
* Determines the Stream Deck software requirements for this plugin.
916
*/

0 commit comments

Comments
 (0)