@vestra-player/sdk 1.8.0 → 1.10.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.
- package/CHANGELOG.md +64 -2
- package/README.md +2 -2
- package/bin/vestra-plugin.mjs +98 -106
- package/capability-scan.json +21 -1
- package/dist/api-requests.d.ts +15 -39
- package/dist/api-requests.js +28 -50
- package/dist/capability-scan.d.ts +1 -1
- package/dist/capability-scan.js +8 -9
- package/dist/condition-table.d.ts +1889 -0
- package/dist/condition-table.js +562 -0
- package/dist/docs-tree.json.gz +0 -0
- package/dist/docs.d.ts +1 -1
- package/dist/docs.js +1 -1
- package/dist/i18n-tools.d.ts +7 -0
- package/dist/i18n-tools.js +66 -3
- package/dist/index.d.ts +4 -5
- package/dist/manifest.d.ts +5 -0
- package/dist/manifest.js +9 -24
- package/dist/member-uses.d.ts +61 -0
- package/dist/member-uses.js +160 -0
- package/dist/player-runtime.d.ts +4 -2
- package/dist/player-runtime.js +4 -2
- package/dist/plugin/appearance.d.ts +1 -1
- package/dist/plugin/appearance.js +2 -2
- package/dist/plugin/bindings.d.ts +1 -1
- package/dist/plugin/bindings.js +2 -2
- package/dist/plugin/commands.js +1 -12
- package/dist/plugin/connection.d.ts +38 -8
- package/dist/plugin/connection.js +126 -37
- package/dist/plugin/drops.js +1 -1
- package/dist/plugin/index.d.ts +7 -0
- package/dist/plugin/index.js +22 -15
- package/dist/plugin/media.js +0 -12
- package/dist/plugin/mpv.js +39 -12
- package/dist/plugin/packages.js +1 -2
- package/dist/plugin/player/events.d.ts +17 -7
- package/dist/plugin/player/events.js +26 -9
- package/dist/plugin/player.d.ts +37 -13
- package/dist/plugin/player.js +133 -22
- package/dist/plugin/scope.d.ts +4 -1
- package/dist/plugin/scope.js +8 -0
- package/dist/plugin/services.d.ts +4 -4
- package/dist/plugin/services.js +7 -29
- package/dist/plugin/settings.js +1 -1
- package/dist/plugin/shaders.js +0 -2
- package/dist/plugin/stream.d.ts +2 -1
- package/dist/plugin/stream.js +2 -2
- package/dist/plugin/testing/commands.d.ts +3 -10
- package/dist/plugin/testing/commands.js +24 -37
- package/dist/plugin/testing/index.d.ts +133 -116
- package/dist/plugin/testing/index.js +198 -125
- package/dist/plugin/testing/media.d.ts +6 -0
- package/dist/plugin/testing/media.js +15 -2
- package/dist/plugin/testing/processing.js +1 -1
- package/dist/plugin/testing/services.js +0 -1
- package/dist/plugin/testing/source-events.d.ts +28 -0
- package/dist/plugin/testing/source-events.js +66 -0
- package/dist/plugin/testing/transport.js +5 -0
- package/dist/plugin/testing/triggers.d.ts +82 -0
- package/dist/plugin/testing/triggers.js +448 -0
- package/dist/plugin/timeline.d.ts +5 -6
- package/dist/plugin/timeline.js +7 -11
- package/dist/plugin/triggers.d.ts +55 -0
- package/dist/plugin/triggers.js +233 -0
- package/dist/plugin/types/base.d.ts +77 -87
- package/dist/plugin/types/commands.d.ts +384 -68
- package/dist/plugin/types/packages.d.ts +17 -55
- package/dist/plugin/types/playback.d.ts +382 -152
- package/dist/plugin/types/plugin-wire.d.ts +6 -36
- package/dist/plugin/types/processing.d.ts +10 -49
- package/dist/plugin/types/services.d.ts +11 -70
- package/dist/plugin/types/snapshots.d.ts +7 -60
- package/dist/plugin/types/sources.d.ts +2 -11
- package/dist/plugin/types/subtitles.d.ts +5 -26
- package/dist/plugin/types/ui-content.d.ts +1 -16
- package/dist/plugin/types/ui-layout.d.ts +53 -79
- package/dist/plugin/types/ui-locale.d.ts +5 -23
- package/dist/plugin/types/ui-shell.d.ts +13 -59
- package/dist/plugin/view/layout.js +1 -1
- package/dist/plugin/view.js +0 -2
- package/dist/plugin/when.d.ts +78 -4
- package/dist/plugin/when.js +182 -14
- package/dist/plugin/window.d.ts +1 -1
- package/dist/plugin/window.js +1 -1
- package/dist/plugin/wire-facade.js +1 -2
- package/dist/processing.d.ts +2 -3
- package/dist/protocol.d.ts +14 -0
- package/dist/protocol.js +14 -0
- package/dist/request-queue.js +1 -1
- package/dist/slint-version.d.ts +7 -0
- package/dist/slint-version.js +7 -0
- package/dist/subtitles.d.ts +1 -1
- package/dist/ts-plugin.d.ts +8 -15
- package/dist/ts-plugin.js +3 -141
- package/dist/wire.d.ts +22 -12
- package/dist/wire.js +17 -8
- package/llms.txt +6 -6
- package/package.json +1 -2
- package/dist/capabilities.d.ts +0 -107
- package/dist/capabilities.js +0 -69
- package/dist/capability-check.d.ts +0 -176
- package/dist/capability-check.js +0 -461
- package/dist/capability-rules.d.ts +0 -125
- package/dist/capability-rules.js +0 -192
- package/dist/host-capabilities.d.ts +0 -10
- package/dist/host-capabilities.js +0 -492
package/dist/api-requests.js
CHANGED
|
@@ -1,33 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Which player requests each member of the plugin API sends
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* Which player requests each member of the plugin API sends, written
|
|
3
|
+
* `Interface.member`; members declared on `Scope` are written `Plugin.…`.
|
|
4
|
+
* The generated reference pages read it: the Stability column of the
|
|
5
|
+
* message table (docs/reference/messages.md) and the members of each event
|
|
6
|
+
* (docs/reference/events.md). For a listener the row is the
|
|
7
|
+
* `events.subscribe` with its event name.
|
|
6
8
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* capability the member needs on top of its own (documented at the member,
|
|
12
|
-
* not listed in its capability's `CAPABILITY_INFO.apis`).
|
|
13
|
-
*
|
|
14
|
-
* Members that need no capability are left out, apart from a few that show
|
|
15
|
-
* a rule's "none" case. Members of objects that another listed member
|
|
16
|
-
* returns (a `Window` from `Windows.create`, a `Panel` from `Panels.mount`)
|
|
17
|
-
* are left out too: the call that created the object already needs the
|
|
18
|
-
* capability.
|
|
19
|
-
*
|
|
20
|
-
* Order matters for `CAPABILITY_INFO`: each capability lists its members in
|
|
21
|
-
* this table's order. test/capability-rules.test.ts checks every method and
|
|
22
|
-
* parameter against the player's table.
|
|
9
|
+
* A row lists the request the member sends to do its work. Members whose
|
|
10
|
+
* requests come from a handle another member returned (a `Window` from
|
|
11
|
+
* `Windows.create`) are listed in the message table's `WRAPPED_BY`
|
|
12
|
+
* (scripts/doc-tables/messages.mjs) instead.
|
|
23
13
|
*
|
|
24
14
|
* @internal
|
|
25
15
|
*/
|
|
26
16
|
const submit = [{ method: "source.submit" }, { method: "source.operation" }];
|
|
27
|
-
const readsSubtitles = { method: "subtitles.state"
|
|
28
|
-
const listen = (event
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
const readsSubtitles = { method: "subtitles.state" };
|
|
18
|
+
const listen = (event) => ({
|
|
19
|
+
method: "events.subscribe",
|
|
20
|
+
params: { event },
|
|
21
|
+
});
|
|
31
22
|
/** @internal */
|
|
32
23
|
export const API_REQUESTS = Object.freeze({
|
|
33
24
|
"Player.state": [{ method: "source.state" }],
|
|
@@ -39,7 +30,7 @@ export const API_REQUESTS = Object.freeze({
|
|
|
39
30
|
"Player.open": submit,
|
|
40
31
|
"Player.openStream": [
|
|
41
32
|
{ method: "producer.prepare" },
|
|
42
|
-
{ method: "source.submit"
|
|
33
|
+
{ method: "source.submit" },
|
|
43
34
|
],
|
|
44
35
|
"Player.setPaused": submit,
|
|
45
36
|
"Player.seek": submit,
|
|
@@ -70,6 +61,9 @@ export const API_REQUESTS = Object.freeze({
|
|
|
70
61
|
"Subtitles.load": [{ method: "subtitles.upload.begin" }, readsSubtitles],
|
|
71
62
|
"Subtitles.remove": [{ method: "subtitles.remove" }, readsSubtitles],
|
|
72
63
|
"Subtitles.setStyle": [{ method: "subtitles.style" }, readsSubtitles],
|
|
64
|
+
"Plugin.trigger": [{ method: "triggers.declare" }],
|
|
65
|
+
"Trigger.firesOn": [{ method: "triggers.set" }],
|
|
66
|
+
"Trigger.off": [{ method: "triggers.off" }],
|
|
73
67
|
"Timeline.marks": [{ method: "timeline.marks" }],
|
|
74
68
|
"Timeline.ranges": [{ method: "timeline.marks" }],
|
|
75
69
|
"Timeline.layer": [
|
|
@@ -119,7 +113,7 @@ export const API_REQUESTS = Object.freeze({
|
|
|
119
113
|
"Packages.uninstall": [{ method: "packages.uninstall" }],
|
|
120
114
|
"Plugin.video.filter": [
|
|
121
115
|
{ method: "processing.replace", params: { stage: "video" } },
|
|
122
|
-
listen("source.state"
|
|
116
|
+
listen("source.state"),
|
|
123
117
|
],
|
|
124
118
|
"Plugin.video.view": [{ method: "video.view.set" }],
|
|
125
119
|
"Plugin.video.render": [{ method: "video.render.set" }],
|
|
@@ -132,8 +126,6 @@ export const API_REQUESTS = Object.freeze({
|
|
|
132
126
|
{ method: "snapshot.capture" },
|
|
133
127
|
],
|
|
134
128
|
"Snapshot.export": [{ method: "jobs.state" }, { method: "jobs.start" }],
|
|
135
|
-
// Parts of remembered files: also media.sources (documented at the
|
|
136
|
-
// members; the player checks it for jobs.start with parts and jobs.check).
|
|
137
129
|
"MediaCapture.export": [{ method: "jobs.state" }, { method: "jobs.start" }],
|
|
138
130
|
"MediaCapture.exportCheck": [{ method: "jobs.check" }],
|
|
139
131
|
"MediaSources.remember": [{ method: "media.sources.remember" }],
|
|
@@ -141,8 +133,7 @@ export const API_REQUESTS = Object.freeze({
|
|
|
141
133
|
"MediaSources.locate": [{ method: "media.sources.locate" }],
|
|
142
134
|
"MediaSources.forget": [{ method: "media.sources.forget" }],
|
|
143
135
|
"MediaSources.list": [{ method: "media.sources.list" }],
|
|
144
|
-
// An open like Player.open
|
|
145
|
-
// media.sources.open), with which source.operation needs it too.
|
|
136
|
+
// An open like Player.open, followed with source.operation.
|
|
146
137
|
"MediaSources.open": [
|
|
147
138
|
{ method: "media.sources.open" },
|
|
148
139
|
{ method: "source.operation" },
|
|
@@ -178,9 +169,10 @@ export const API_REQUESTS = Object.freeze({
|
|
|
178
169
|
});
|
|
179
170
|
/**
|
|
180
171
|
* The events whose listener subscribes (`events.subscribe` with the event
|
|
181
|
-
* name): the plugin API's `HostEvent`. Other names a
|
|
182
|
-
* (`commands.execute`, `ui.callback`) arrive unasked and
|
|
183
|
-
*
|
|
172
|
+
* name): the plugin API's `HostEvent` and `SourceEvent`. Other names a
|
|
173
|
+
* plugin listens to (`commands.execute`, `ui.callback`) arrive unasked and
|
|
174
|
+
* need nothing.
|
|
175
|
+
* test/wire-facade.test.ts keeps it equal to `EVENT_NEEDS`.
|
|
184
176
|
*
|
|
185
177
|
* @internal
|
|
186
178
|
*/
|
|
@@ -196,21 +188,7 @@ export const SUBSCRIBED_EVENTS = Object.freeze([
|
|
|
196
188
|
"resolvers.fileTypes",
|
|
197
189
|
"video.upscaling.changed",
|
|
198
190
|
"video.motion.changed",
|
|
191
|
+
"source.opening",
|
|
192
|
+
"source.ready",
|
|
193
|
+
"source.ended",
|
|
199
194
|
]);
|
|
200
|
-
/**
|
|
201
|
-
* Members whose requests depend on an argument, which `API_REQUESTS` cannot
|
|
202
|
-
* list: the event name of a listener (`event`: a subscribed event's
|
|
203
|
-
* `events.subscribe`, nothing for the others) or the method name of a request
|
|
204
|
-
* (`method`: that method, with the string fields of the second argument as its
|
|
205
|
-
* parameters). The capability check reads the argument when its type is one
|
|
206
|
-
* string (a literal, a constant), and reports the call as unchecked otherwise
|
|
207
|
-
* (a computed name, a union of several, the member taken by destructuring or as
|
|
208
|
-
* a value).
|
|
209
|
-
*
|
|
210
|
-
* @internal
|
|
211
|
-
*/
|
|
212
|
-
export const ARGUMENT_APIS = Object.freeze({
|
|
213
|
-
"Player.on": "event",
|
|
214
|
-
"Wire.on": "event",
|
|
215
|
-
"Wire.request": "method",
|
|
216
|
-
});
|
|
@@ -10,7 +10,7 @@ export interface ScanList {
|
|
|
10
10
|
readonly about: string;
|
|
11
11
|
/** API members, `Interface.member` (`Clipboard.readText`, `Scope.video.filter`). */
|
|
12
12
|
readonly members: readonly string[];
|
|
13
|
-
/** Methods of the player's protocol,
|
|
13
|
+
/** Methods of the player's protocol, by name or prefix (`packages.*`). */
|
|
14
14
|
readonly requests: readonly string[];
|
|
15
15
|
}
|
|
16
16
|
/** @internal `capability-scan.json`. */
|
package/dist/capability-scan.js
CHANGED
|
@@ -5,24 +5,23 @@
|
|
|
5
5
|
* prints the result; the plugin repository's index and the store show it.
|
|
6
6
|
*
|
|
7
7
|
* The table is `capability-scan.json` at the package's root, maintained by
|
|
8
|
-
* hand: every method of the public API
|
|
9
|
-
*
|
|
10
|
-
* (test/capability-scan.test.ts). Nothing here is read at run time
|
|
11
|
-
*
|
|
8
|
+
* hand: every method of the public API is in one category's list or in
|
|
9
|
+
* `none`'s, and every request the SDK sends has a category by name or
|
|
10
|
+
* prefix (test/capability-scan.test.ts). Nothing here is read at run time;
|
|
11
|
+
* since 1.9.0 the scan is the only disclosure (manifests declare nothing).
|
|
12
12
|
*
|
|
13
|
-
* TypeScript files are scanned by type
|
|
14
|
-
* resolution (`findMemberUses`, capability-check.ts): a member counts
|
|
13
|
+
* TypeScript files are scanned by type (`findMemberUses`, member-uses.ts): a member counts
|
|
15
14
|
* however its object was reached. JavaScript files have no types and are
|
|
16
15
|
* scanned by name, best effort (`scanNamesInto`); the result says which
|
|
17
16
|
* way each file was read.
|
|
18
17
|
*
|
|
19
18
|
* The TypeScript module is passed in, never imported (as in
|
|
20
|
-
*
|
|
19
|
+
* member-uses.ts). Node only: it reads the table from disk.
|
|
21
20
|
*
|
|
22
21
|
* @internal
|
|
23
22
|
*/
|
|
24
23
|
import { readFileSync } from "node:fs";
|
|
25
|
-
import { findMemberUses } from "./
|
|
24
|
+
import { findMemberUses } from "./member-uses.js";
|
|
26
25
|
/** @internal The scan's categories, in the order results list them. */
|
|
27
26
|
export const SCAN_CATEGORIES = [
|
|
28
27
|
"player",
|
|
@@ -107,7 +106,7 @@ class Findings {
|
|
|
107
106
|
this.unchecked.push({
|
|
108
107
|
file: this.#relative(file),
|
|
109
108
|
line,
|
|
110
|
-
message: `a request of ${JSON.stringify(method)}, which
|
|
109
|
+
message: `a request of ${JSON.stringify(method)}, which capability-scan.json does not list`,
|
|
111
110
|
});
|
|
112
111
|
else if (category !== null)
|
|
113
112
|
this.add(category, { request: method, file, line, by });
|