@jdg-keyforge/protocol 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +69 -0
  3. package/dist/common.d.ts +171 -0
  4. package/dist/common.js +7 -0
  5. package/dist/envelope.d.ts +91 -0
  6. package/dist/envelope.js +7 -0
  7. package/dist/events/active_profile_changed.d.ts +16 -0
  8. package/dist/events/active_profile_changed.js +7 -0
  9. package/dist/events/input.d.ts +39 -0
  10. package/dist/events/input.js +7 -0
  11. package/dist/index.d.ts +17 -0
  12. package/dist/index.js +3 -0
  13. package/dist/methods/create_profile.d.ts +68 -0
  14. package/dist/methods/create_profile.js +7 -0
  15. package/dist/methods/delete_profile.d.ts +22 -0
  16. package/dist/methods/delete_profile.js +7 -0
  17. package/dist/methods/duplicate_profile.d.ts +72 -0
  18. package/dist/methods/duplicate_profile.js +7 -0
  19. package/dist/methods/get_auto_switch.d.ts +37 -0
  20. package/dist/methods/get_auto_switch.js +7 -0
  21. package/dist/methods/hello.d.ts +40 -0
  22. package/dist/methods/hello.js +7 -0
  23. package/dist/methods/list_actions.d.ts +69 -0
  24. package/dist/methods/list_actions.js +7 -0
  25. package/dist/methods/list_bindings.d.ts +52 -0
  26. package/dist/methods/list_bindings.js +7 -0
  27. package/dist/methods/list_devices.d.ts +76 -0
  28. package/dist/methods/list_devices.js +7 -0
  29. package/dist/methods/list_profiles.d.ts +73 -0
  30. package/dist/methods/list_profiles.js +7 -0
  31. package/dist/methods/rename_profile.d.ts +24 -0
  32. package/dist/methods/rename_profile.js +7 -0
  33. package/dist/methods/set_active_profile.d.ts +22 -0
  34. package/dist/methods/set_active_profile.js +7 -0
  35. package/dist/methods/set_auto_switch.d.ts +43 -0
  36. package/dist/methods/set_auto_switch.js +7 -0
  37. package/dist/methods/set_binding.d.ts +49 -0
  38. package/dist/methods/set_binding.js +7 -0
  39. package/package.json +48 -0
  40. package/src/common.ts +174 -0
  41. package/src/envelope.ts +94 -0
  42. package/src/events/active_profile_changed.ts +18 -0
  43. package/src/events/input.ts +42 -0
  44. package/src/index.ts +21 -0
  45. package/src/methods/create_profile.ts +71 -0
  46. package/src/methods/delete_profile.ts +24 -0
  47. package/src/methods/duplicate_profile.ts +75 -0
  48. package/src/methods/get_auto_switch.ts +39 -0
  49. package/src/methods/hello.ts +42 -0
  50. package/src/methods/list_actions.ts +71 -0
  51. package/src/methods/list_bindings.ts +55 -0
  52. package/src/methods/list_devices.ts +79 -0
  53. package/src/methods/list_profiles.ts +76 -0
  54. package/src/methods/rename_profile.ts +26 -0
  55. package/src/methods/set_active_profile.ts +24 -0
  56. package/src/methods/set_auto_switch.ts +45 -0
  57. package/src/methods/set_binding.ts +52 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ Copyright (c) 2026 Jonathan Daniel Gomez <jonathan.d.gomez98@gmail.com>
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ http://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+
19
+ ---
20
+
21
+ Full license text: https://www.apache.org/licenses/LICENSE-2.0.txt
package/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # @jdg-keyforge/protocol
2
+
3
+ > TypeScript types for the [KeyForge](https://github.com/JoniDG/keyforge) WebSocket protocol, generated from the canonical JSON Schema contracts in this repository.
4
+
5
+ This package contains only type declarations — there is no runtime code. It mirrors the Go submodule published at `github.com/JoniDG/keyforge-protocol/go/protocol`.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @jdg-keyforge/protocol
11
+ ```
12
+
13
+ While the package is unpublished, consumers in the KeyForge workspace can install it directly from the source tree:
14
+
15
+ ```bash
16
+ npm install file:../keyforge-protocol/ts
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ```ts
22
+ import type {
23
+ Envelope,
24
+ Request,
25
+ Response,
26
+ Event,
27
+ Device,
28
+ InputEvent,
29
+ MethodHello,
30
+ MethodListDevices,
31
+ EventInput,
32
+ } from '@jdg-keyforge/protocol';
33
+ ```
34
+
35
+ The root `index` re-exports shared types from [`common`](./src/common.ts) and [`envelope`](./src/envelope.ts) plus the top-level `Method*` / `Event*` types for each method and event. Inner payload shapes (e.g. `MethodListDevices['result']`) are reachable through the parent type.
36
+
37
+ For schema definitions and the wire-protocol overview, see the [repository root README](../README.md).
38
+
39
+ ## Versioning
40
+
41
+ This package is versioned independently from the schema's `/v1/` path and from the Go submodule:
42
+
43
+ | Artifact | Source of truth | Tag |
44
+ |---|---|---|
45
+ | Schema major | `$id` path (`.../v1/...`) | — |
46
+ | Go submodule | [`go/protocol/`](../go/protocol) | `go/vX.Y.Z` |
47
+ | TS package | [`ts/`](.) | `ts/vX.Y.Z` |
48
+
49
+ A breaking schema change bumps `/v1/` to `/v2/` *and* the major version of both packages. Non-breaking schema additions bump only the minor/patch of each package.
50
+
51
+ ## Local regeneration
52
+
53
+ The contents of `src/` are auto-generated from the JSON Schemas. To regenerate after editing a schema, run from the repository root:
54
+
55
+ ```bash
56
+ make generate-ts
57
+ ```
58
+
59
+ Then build the package:
60
+
61
+ ```bash
62
+ cd ts && npm install && npm run build
63
+ ```
64
+
65
+ CI fails the build if `git diff --exit-code ts/src/` is dirty — i.e. someone changed a schema without committing the regenerated types.
66
+
67
+ ## License
68
+
69
+ [Apache 2.0](./LICENSE) — Copyright (c) 2026 Jonathan Daniel Gomez.
@@ -0,0 +1,171 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * Stable identifier for a HID device. Format: VID_<hex>_PID_<hex>[_<serial>].
8
+ *
9
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
10
+ * via the `definition` "DeviceID".
11
+ */
12
+ export type DeviceID = string;
13
+ /**
14
+ * Kind of physical input.
15
+ *
16
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
17
+ * via the `definition` "InputKind".
18
+ */
19
+ export type InputKind = "key" | "encoder";
20
+ /**
21
+ * What happened on the input.
22
+ *
23
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
24
+ * via the `definition` "InputAction".
25
+ */
26
+ export type InputAction = "press" | "release" | "rotate_cw" | "rotate_ccw" | "click";
27
+ /**
28
+ * Shared type definitions referenced by message schemas.
29
+ */
30
+ export interface CommonTypes {
31
+ [k: string]: unknown;
32
+ }
33
+ /**
34
+ * A single hardware event coming from a HID device.
35
+ *
36
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
37
+ * via the `definition` "InputEvent".
38
+ */
39
+ export interface InputEvent {
40
+ device_id: DeviceID;
41
+ kind: InputKind;
42
+ /**
43
+ * Logical identifier of the input within the device (e.g. 'key_0x04', 'encoder_0'). Matches Device.inputs[].id.
44
+ */
45
+ input_id: string;
46
+ action: InputAction;
47
+ /**
48
+ * Unix epoch in milliseconds when the event was captured by the daemon.
49
+ */
50
+ timestamp_ms: number;
51
+ }
52
+ /**
53
+ * An executable action bound to an input.
54
+ *
55
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
56
+ * via the `definition` "Action".
57
+ */
58
+ export interface Action {
59
+ /**
60
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
61
+ */
62
+ type: string;
63
+ /**
64
+ * Action-specific parameters. Schema depends on 'type'.
65
+ */
66
+ params?: {
67
+ [k: string]: unknown;
68
+ };
69
+ }
70
+ /**
71
+ * Maps an input on a specific device to an action.
72
+ *
73
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
74
+ * via the `definition` "Binding".
75
+ */
76
+ export interface Binding {
77
+ device_id: DeviceID;
78
+ input_id: string;
79
+ trigger: InputAction;
80
+ action: Action;
81
+ }
82
+ /**
83
+ * A named set of bindings. The daemon keeps exactly one profile active at a time; switching profiles swaps the active binding set.
84
+ *
85
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
86
+ * via the `definition` "Profile".
87
+ */
88
+ export interface Profile {
89
+ /**
90
+ * Stable server-generated identifier for the profile.
91
+ */
92
+ id: string;
93
+ /**
94
+ * Human-friendly profile name.
95
+ */
96
+ name: string;
97
+ /**
98
+ * Bindings that belong to this profile.
99
+ */
100
+ bindings: Binding[];
101
+ }
102
+ /**
103
+ * A single physical input exposed by a device (a key or an encoder).
104
+ *
105
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
106
+ * via the `definition` "Input".
107
+ */
108
+ export interface Input {
109
+ /**
110
+ * Logical identifier of the input within the device (e.g. 'key_0x04', 'encoder_0'). Matches InputEvent.input_id and Binding.input_id.
111
+ */
112
+ id: string;
113
+ kind: InputKind;
114
+ /**
115
+ * Human-friendly label for the input (e.g. 'Key 1', 'Encoder'). Optional; clients fall back to id.
116
+ */
117
+ label?: string;
118
+ }
119
+ /**
120
+ * A HID device known to the daemon. Returned by list_devices.
121
+ *
122
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
123
+ * via the `definition` "Device".
124
+ */
125
+ export interface Device {
126
+ id: DeviceID;
127
+ /**
128
+ * USB Vendor ID as a 4-digit hexadecimal string (lowercase or uppercase, no '0x' prefix).
129
+ */
130
+ vendor_id: string;
131
+ /**
132
+ * USB Product ID as a 4-digit hexadecimal string (lowercase or uppercase, no '0x' prefix).
133
+ */
134
+ product_id: string;
135
+ /**
136
+ * Manufacturer string from the HID descriptor. May be missing on cheap/clone devices.
137
+ */
138
+ manufacturer?: string;
139
+ /**
140
+ * Product name string from the HID descriptor.
141
+ */
142
+ product?: string;
143
+ /**
144
+ * Serial number string from the HID descriptor. Not all HID devices expose one.
145
+ */
146
+ serial_number?: string;
147
+ /**
148
+ * OS-opaque path used by the HID library to (re)open the device. Format varies per OS; clients should treat it as an opaque token.
149
+ */
150
+ path: string;
151
+ /**
152
+ * Inputs (keys/encoders) the daemon knows this device exposes. Empty for unrecognized devices the daemon can't map.
153
+ */
154
+ inputs: Input[];
155
+ }
156
+ /**
157
+ * Maps a foreground application to the profile that should become active while that app is frontmost. When the frontmost app matches no rule, the active profile is left unchanged (sticky behavior); there is no fallback profile.
158
+ *
159
+ * This interface was referenced by `CommonTypes`'s JSON-Schema
160
+ * via the `definition` "AutoSwitchRule".
161
+ */
162
+ export interface AutoSwitchRule {
163
+ /**
164
+ * OS-native application identifier: bundle id on macOS, executable name on Linux/Windows. Opaque string, not portable across OSes; the daemon matches it verbatim against the frontmost app.
165
+ */
166
+ app: string;
167
+ /**
168
+ * Identifier of the profile to activate when this app is frontmost.
169
+ */
170
+ profile_id: string;
171
+ }
package/dist/common.js ADDED
@@ -0,0 +1,7 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};
@@ -0,0 +1,91 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * Wire-level frame exchanged over the WebSocket transport. Every frame is one of three shapes discriminated by the 'type' field. Inner 'params'/'data'/'error' are intentionally generic here; method- and event-specific schemas refine them in a second validation pass.
8
+ */
9
+ export type Envelope = Request | Response | Event;
10
+ /**
11
+ * Server -> client. Discriminated by 'ok'.
12
+ */
13
+ export type Response = ResponseOk | ResponseErr;
14
+ /**
15
+ * Client -> server. Expects a correlated Response with the same id.
16
+ */
17
+ export interface Request {
18
+ type: "request";
19
+ /**
20
+ * Client-generated correlation id (UUID v4 or nanoid).
21
+ */
22
+ id: string;
23
+ /**
24
+ * Method name in snake_case.
25
+ */
26
+ method: string;
27
+ /**
28
+ * Method-specific arguments. Refined by the schema in schemas/methods/<method>.schema.json.
29
+ */
30
+ params: {
31
+ [k: string]: unknown;
32
+ };
33
+ }
34
+ export interface ResponseOk {
35
+ type: "response";
36
+ /**
37
+ * Echo of the original Request.id.
38
+ */
39
+ id: string;
40
+ ok: true;
41
+ /**
42
+ * Method-specific result. Refined by the schema in schemas/methods/<method>.schema.json.
43
+ */
44
+ data: {
45
+ [k: string]: unknown;
46
+ };
47
+ }
48
+ export interface ResponseErr {
49
+ type: "response";
50
+ /**
51
+ * Echo of the original Request.id.
52
+ */
53
+ id: string;
54
+ ok: false;
55
+ error: Error;
56
+ }
57
+ /**
58
+ * Failure payload returned in a Response with ok=false.
59
+ */
60
+ export interface Error {
61
+ /**
62
+ * Stable, machine-readable error code in SCREAMING_SNAKE_CASE.
63
+ */
64
+ code: string;
65
+ /**
66
+ * Human-readable error message. Free form, may be localized in future versions.
67
+ */
68
+ message: string;
69
+ /**
70
+ * Optional structured context for debugging.
71
+ */
72
+ details?: {
73
+ [k: string]: unknown;
74
+ };
75
+ }
76
+ /**
77
+ * Server -> client, no correlation. Stream of hardware events or daemon notifications.
78
+ */
79
+ export interface Event {
80
+ type: "event";
81
+ /**
82
+ * Event name in snake_case.
83
+ */
84
+ name: string;
85
+ /**
86
+ * Event-specific payload. Refined by the schema in schemas/events/<name>.schema.json.
87
+ */
88
+ data: {
89
+ [k: string]: unknown;
90
+ };
91
+ }
@@ -0,0 +1,7 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * Pushed by the daemon whenever the active profile changes on the server's own initiative (today: auto-switch by foreground app). Lets clients stay in sync without polling. Not emitted in response to a client's set_active_profile request, which already returns the new id.
8
+ */
9
+ export interface EventActiveProfileChanged {
10
+ data: {
11
+ /**
12
+ * Identifier of the now-active profile.
13
+ */
14
+ active_profile_id: string;
15
+ };
16
+ }
@@ -0,0 +1,7 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};
@@ -0,0 +1,39 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * Stable identifier for a HID device. Format: VID_<hex>_PID_<hex>[_<serial>].
8
+ */
9
+ export type DeviceID = string;
10
+ /**
11
+ * Kind of physical input.
12
+ */
13
+ export type InputKind = "key" | "encoder";
14
+ /**
15
+ * What happened on the input.
16
+ */
17
+ export type InputAction = "press" | "release" | "rotate_cw" | "rotate_ccw" | "click";
18
+ /**
19
+ * Pushed by the daemon for every hardware event captured on a connected HID device. High-frequency: encoders may emit many per second.
20
+ */
21
+ export interface EventInput {
22
+ data: InputEvent;
23
+ }
24
+ /**
25
+ * A single hardware event coming from a HID device.
26
+ */
27
+ export interface InputEvent {
28
+ device_id: DeviceID;
29
+ kind: InputKind;
30
+ /**
31
+ * Logical identifier of the input within the device (e.g. 'key_0x04', 'encoder_0'). Matches Device.inputs[].id.
32
+ */
33
+ input_id: string;
34
+ action: InputAction;
35
+ /**
36
+ * Unix epoch in milliseconds when the event was captured by the daemon.
37
+ */
38
+ timestamp_ms: number;
39
+ }
@@ -0,0 +1,7 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};
@@ -0,0 +1,17 @@
1
+ export * from './common.js';
2
+ export * from './envelope.js';
3
+ export type { MethodCreateProfile } from './methods/create_profile.js';
4
+ export type { MethodDeleteProfile } from './methods/delete_profile.js';
5
+ export type { MethodDuplicateProfile } from './methods/duplicate_profile.js';
6
+ export type { MethodGetAutoSwitch } from './methods/get_auto_switch.js';
7
+ export type { MethodHello } from './methods/hello.js';
8
+ export type { MethodListActions } from './methods/list_actions.js';
9
+ export type { MethodListBindings } from './methods/list_bindings.js';
10
+ export type { MethodListDevices } from './methods/list_devices.js';
11
+ export type { MethodListProfiles } from './methods/list_profiles.js';
12
+ export type { MethodRenameProfile } from './methods/rename_profile.js';
13
+ export type { MethodSetActiveProfile } from './methods/set_active_profile.js';
14
+ export type { MethodSetAutoSwitch } from './methods/set_auto_switch.js';
15
+ export type { MethodSetBinding } from './methods/set_binding.js';
16
+ export type { EventActiveProfileChanged } from './events/active_profile_changed.js';
17
+ export type { EventInput } from './events/input.js';
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ // AUTO-GENERATED by 'make generate-ts'. DO NOT EDIT BY HAND.
2
+ export * from './common.js';
3
+ export * from './envelope.js';
@@ -0,0 +1,68 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * Stable identifier for a HID device. Format: VID_<hex>_PID_<hex>[_<serial>].
8
+ */
9
+ export type DeviceID = string;
10
+ /**
11
+ * What happened on the input.
12
+ */
13
+ export type InputAction = "press" | "release" | "rotate_cw" | "rotate_ccw" | "click";
14
+ /**
15
+ * Creates a new profile. The server generates the id and returns the profile with an empty bindings array.
16
+ */
17
+ export interface MethodCreateProfile {
18
+ params: {
19
+ /**
20
+ * Human-friendly name for the new profile.
21
+ */
22
+ name: string;
23
+ };
24
+ result: {
25
+ profile: Profile;
26
+ };
27
+ }
28
+ /**
29
+ * A named set of bindings. The daemon keeps exactly one profile active at a time; switching profiles swaps the active binding set.
30
+ */
31
+ export interface Profile {
32
+ /**
33
+ * Stable server-generated identifier for the profile.
34
+ */
35
+ id: string;
36
+ /**
37
+ * Human-friendly profile name.
38
+ */
39
+ name: string;
40
+ /**
41
+ * Bindings that belong to this profile.
42
+ */
43
+ bindings: Binding[];
44
+ }
45
+ /**
46
+ * Maps an input on a specific device to an action.
47
+ */
48
+ export interface Binding {
49
+ device_id: DeviceID;
50
+ input_id: string;
51
+ trigger: InputAction;
52
+ action: Action;
53
+ }
54
+ /**
55
+ * An executable action bound to an input.
56
+ */
57
+ export interface Action {
58
+ /**
59
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
60
+ */
61
+ type: string;
62
+ /**
63
+ * Action-specific parameters. Schema depends on 'type'.
64
+ */
65
+ params?: {
66
+ [k: string]: unknown;
67
+ };
68
+ }
@@ -0,0 +1,7 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};
@@ -0,0 +1,22 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * Deletes a profile. The daemon never deletes the last remaining profile. Deleting the active profile reassigns the active one, so the resulting active profile id is always returned.
8
+ */
9
+ export interface MethodDeleteProfile {
10
+ params: {
11
+ /**
12
+ * Identifier of the profile to delete.
13
+ */
14
+ id: string;
15
+ };
16
+ result: {
17
+ /**
18
+ * Identifier of the profile that is active after the deletion. Unchanged unless the deleted profile was the active one.
19
+ */
20
+ active_profile_id: string;
21
+ };
22
+ }
@@ -0,0 +1,7 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};
@@ -0,0 +1,72 @@
1
+ /**
2
+ * This file was automatically generated by json-schema-to-typescript.
3
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
4
+ * and run json-schema-to-typescript to regenerate this file.
5
+ */
6
+ /**
7
+ * Stable identifier for a HID device. Format: VID_<hex>_PID_<hex>[_<serial>].
8
+ */
9
+ export type DeviceID = string;
10
+ /**
11
+ * What happened on the input.
12
+ */
13
+ export type InputAction = "press" | "release" | "rotate_cw" | "rotate_ccw" | "click";
14
+ /**
15
+ * Creates a copy of an existing profile under a new name. The server generates a new id and copies the source profile's bindings. Does not change the active profile.
16
+ */
17
+ export interface MethodDuplicateProfile {
18
+ params: {
19
+ /**
20
+ * Identifier of the source profile to copy bindings from.
21
+ */
22
+ id: string;
23
+ /**
24
+ * Human-friendly name for the new (duplicated) profile.
25
+ */
26
+ name: string;
27
+ };
28
+ result: {
29
+ profile: Profile;
30
+ };
31
+ }
32
+ /**
33
+ * A named set of bindings. The daemon keeps exactly one profile active at a time; switching profiles swaps the active binding set.
34
+ */
35
+ export interface Profile {
36
+ /**
37
+ * Stable server-generated identifier for the profile.
38
+ */
39
+ id: string;
40
+ /**
41
+ * Human-friendly profile name.
42
+ */
43
+ name: string;
44
+ /**
45
+ * Bindings that belong to this profile.
46
+ */
47
+ bindings: Binding[];
48
+ }
49
+ /**
50
+ * Maps an input on a specific device to an action.
51
+ */
52
+ export interface Binding {
53
+ device_id: DeviceID;
54
+ input_id: string;
55
+ trigger: InputAction;
56
+ action: Action;
57
+ }
58
+ /**
59
+ * An executable action bound to an input.
60
+ */
61
+ export interface Action {
62
+ /**
63
+ * Action type. Built-ins are well-known; plugin actions use 'plugin.<plugin_id>.<action_id>'.
64
+ */
65
+ type: string;
66
+ /**
67
+ * Action-specific parameters. Schema depends on 'type'.
68
+ */
69
+ params?: {
70
+ [k: string]: unknown;
71
+ };
72
+ }
@@ -0,0 +1,7 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+ export {};