@companion-module/base 1.14.0-0-nightly-main-20251113-203236-30c5c0c → 1.99.0-0-nightly-feat-split-api-20251221-153951-fa12995
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 +20 -0
- package/README.md +12 -11
- package/dist/__mocks__/net.d.ts +30 -0
- package/dist/__mocks__/net.js +108 -0
- package/dist/__mocks__/net.js.map +1 -0
- package/dist/__mocks__/util.d.ts +8 -0
- package/dist/__mocks__/util.js +44 -0
- package/dist/__mocks__/util.js.map +1 -0
- package/dist/common/json-value.d.ts +0 -1
- package/dist/common/osc.d.ts +0 -1
- package/dist/entrypoint.d.ts +9 -1
- package/dist/entrypoint.js +4 -122
- package/dist/entrypoint.js.map +1 -1
- package/dist/helpers/__tests__/tcp.spec.d.ts +1 -0
- package/dist/helpers/__tests__/tcp.spec.js +210 -0
- package/dist/helpers/__tests__/tcp.spec.js.map +1 -0
- package/dist/helpers/__tests__/udp.spec.d.ts +1 -0
- package/dist/helpers/__tests__/udp.spec.js +200 -0
- package/dist/helpers/__tests__/udp.spec.js.map +1 -0
- package/dist/helpers/index.d.ts +3 -4
- package/dist/helpers/index.js +4 -7
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/tcp.d.ts +1 -3
- package/dist/helpers/telnet.d.ts +0 -1
- package/dist/helpers/udp.d.ts +1 -3
- package/dist/host-api/context.d.ts +59 -0
- package/dist/host-api/{api.js → context.js} +6 -1
- package/dist/host-api/context.js.map +1 -0
- package/dist/instance-base.d.ts +0 -1
- package/dist/logging.d.ts +20 -0
- package/dist/logging.js +25 -0
- package/dist/logging.js.map +1 -0
- package/dist/main.d.ts +8 -0
- package/dist/main.js +14 -0
- package/dist/main.js.map +1 -0
- package/dist/manifest.d.ts +2 -3
- package/dist/manifest.js.map +1 -1
- package/dist/module-api/__tests__/shared-udp-socket.spec.d.ts +1 -0
- package/dist/module-api/__tests__/shared-udp-socket.spec.js +272 -0
- package/dist/module-api/__tests__/shared-udp-socket.spec.js.map +1 -0
- package/dist/module-api/action.d.ts +0 -1
- package/dist/module-api/base.d.ts +3 -17
- package/dist/module-api/base.js +47 -320
- package/dist/module-api/base.js.map +1 -1
- package/dist/module-api/common.d.ts +0 -1
- package/dist/module-api/config.d.ts +0 -1
- package/dist/module-api/enums.d.ts +0 -2
- package/dist/module-api/enums.js.map +1 -1
- package/dist/module-api/feedback.d.ts +0 -1
- package/dist/module-api/http.d.ts +0 -1
- package/dist/module-api/index.d.ts +2 -2
- package/dist/module-api/index.js +1 -0
- package/dist/module-api/index.js.map +1 -1
- package/dist/module-api/input.d.ts +0 -1
- package/dist/module-api/preset.d.ts +0 -1
- package/dist/module-api/shared-udp-socket.d.ts +3 -5
- package/dist/module-api/shared-udp-socket.js +13 -15
- package/dist/module-api/shared-udp-socket.js.map +1 -1
- package/dist/module-api/style.d.ts +0 -1
- package/dist/module-api/upgrade.d.ts +0 -1
- package/dist/module-api/variable.d.ts +0 -1
- package/dist/util.d.ts +0 -1
- package/package.json +7 -36
- package/dist/common/json-value.d.ts.map +0 -1
- package/dist/common/osc.d.ts.map +0 -1
- package/dist/entrypoint.d.ts.map +0 -1
- package/dist/helpers/index.d.ts.map +0 -1
- package/dist/helpers/tcp.d.ts.map +0 -1
- package/dist/helpers/telnet.d.ts.map +0 -1
- package/dist/helpers/udp.d.ts.map +0 -1
- package/dist/host-api/api.d.ts +0 -389
- package/dist/host-api/api.d.ts.map +0 -1
- package/dist/host-api/api.js.map +0 -1
- package/dist/host-api/ipc-wrapper.d.ts +0 -37
- package/dist/host-api/ipc-wrapper.d.ts.map +0 -1
- package/dist/host-api/ipc-wrapper.js +0 -129
- package/dist/host-api/ipc-wrapper.js.map +0 -1
- package/dist/host-api/versions.d.ts +0 -12
- package/dist/host-api/versions.d.ts.map +0 -1
- package/dist/host-api/versions.js +0 -5
- package/dist/host-api/versions.js.map +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -22
- package/dist/index.js.map +0 -1
- package/dist/instance-base.d.ts.map +0 -1
- package/dist/internal/actions.d.ts +0 -16
- package/dist/internal/actions.d.ts.map +0 -1
- package/dist/internal/actions.js +0 -223
- package/dist/internal/actions.js.map +0 -1
- package/dist/internal/base.d.ts +0 -11
- package/dist/internal/base.d.ts.map +0 -1
- package/dist/internal/base.js +0 -39
- package/dist/internal/base.js.map +0 -1
- package/dist/internal/feedback.d.ts +0 -20
- package/dist/internal/feedback.d.ts.map +0 -1
- package/dist/internal/feedback.js +0 -307
- package/dist/internal/feedback.js.map +0 -1
- package/dist/internal/upgrade.d.ts +0 -15
- package/dist/internal/upgrade.d.ts.map +0 -1
- package/dist/internal/upgrade.js +0 -174
- package/dist/internal/upgrade.js.map +0 -1
- package/dist/manifest.d.ts.map +0 -1
- package/dist/module-api/action.d.ts.map +0 -1
- package/dist/module-api/base.d.ts.map +0 -1
- package/dist/module-api/common.d.ts.map +0 -1
- package/dist/module-api/config.d.ts.map +0 -1
- package/dist/module-api/enums.d.ts.map +0 -1
- package/dist/module-api/feedback.d.ts.map +0 -1
- package/dist/module-api/http.d.ts.map +0 -1
- package/dist/module-api/index.d.ts.map +0 -1
- package/dist/module-api/input.d.ts.map +0 -1
- package/dist/module-api/preset.d.ts.map +0 -1
- package/dist/module-api/shared-udp-socket.d.ts.map +0 -1
- package/dist/module-api/style.d.ts.map +0 -1
- package/dist/module-api/upgrade.d.ts.map +0 -1
- package/dist/module-api/variable.d.ts.map +0 -1
- package/dist/util.d.ts.map +0 -1
- package/lib/debounce-fn/index.d.ts +0 -83
- package/lib/debounce-fn/index.js +0 -78
- package/lib/debounce-fn/license +0 -9
- package/lib/debounce-fn/readme.md +0 -64
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { RemoteInfo } from 'dgram';
|
|
2
|
-
import type { SharedUdpSocketMessage, ModuleToHostEventsV0SharedSocket, HostToModuleEventsV0SharedSocket } from '../host-api/api.js';
|
|
3
|
-
import type { IpcWrapper } from '../host-api/ipc-wrapper.js';
|
|
4
2
|
import EventEmitter from 'eventemitter3';
|
|
3
|
+
import type { InstanceSharedUdpSocketContext, SharedUdpSocketMessage } from '../host-api/context.js';
|
|
5
4
|
export interface SharedUdpSocketEvents {
|
|
6
5
|
error: [err: Error];
|
|
7
6
|
listening: [];
|
|
@@ -31,7 +30,7 @@ export interface SharedUdpSocket extends EventEmitter<SharedUdpSocketEvents> {
|
|
|
31
30
|
send(bufferOrList: Buffer | DataView | string | Array<number>, port: number, address: string, callback?: () => void): void;
|
|
32
31
|
/**
|
|
33
32
|
* Send a message from the shared socket
|
|
34
|
-
* @param
|
|
33
|
+
* @param buffer Data to send
|
|
35
34
|
* @param offset Offset in the buffer to start sending from
|
|
36
35
|
* @param length Length of the data to send. Limited to the length of the bufer
|
|
37
36
|
* @param port Target port number
|
|
@@ -49,7 +48,7 @@ export declare class SharedUdpSocketImpl extends EventEmitter<SharedUdpSocketEve
|
|
|
49
48
|
get handleId(): string | undefined;
|
|
50
49
|
get portNumber(): number | undefined;
|
|
51
50
|
private get boundState();
|
|
52
|
-
constructor(
|
|
51
|
+
constructor(context: InstanceSharedUdpSocketContext, options: SharedUdpSocketOptions);
|
|
53
52
|
bind(port: number, _address?: string, callback?: () => void): void;
|
|
54
53
|
close(callback?: () => void): void;
|
|
55
54
|
send(bufferOrList: string | Buffer | DataView | number[], port: number, address: string, callback?: () => void): void;
|
|
@@ -57,4 +56,3 @@ export declare class SharedUdpSocketImpl extends EventEmitter<SharedUdpSocketEve
|
|
|
57
56
|
receiveSocketMessage(message: SharedUdpSocketMessage): void;
|
|
58
57
|
receiveSocketError(error: Error): void;
|
|
59
58
|
}
|
|
60
|
-
//# sourceMappingURL=shared-udp-socket.d.ts.map
|
|
@@ -5,8 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const eventemitter3_1 = tslib_1.__importDefault(require("eventemitter3"));
|
|
6
6
|
const util_js_1 = require("../util.js");
|
|
7
7
|
class SharedUdpSocketImpl extends eventemitter3_1.default {
|
|
8
|
-
#
|
|
9
|
-
#moduleUdpSockets;
|
|
8
|
+
#context;
|
|
10
9
|
#options;
|
|
11
10
|
get handleId() {
|
|
12
11
|
return this.boundState?.handleId;
|
|
@@ -23,10 +22,9 @@ class SharedUdpSocketImpl extends eventemitter3_1.default {
|
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
#state = 'pending';
|
|
26
|
-
constructor(
|
|
25
|
+
constructor(context, options) {
|
|
27
26
|
super();
|
|
28
|
-
this.#
|
|
29
|
-
this.#moduleUdpSockets = moduleUdpSockets;
|
|
27
|
+
this.#context = context;
|
|
30
28
|
this.#options = { ...options };
|
|
31
29
|
}
|
|
32
30
|
bind(port, _address, callback) {
|
|
@@ -48,15 +46,15 @@ class SharedUdpSocketImpl extends eventemitter3_1.default {
|
|
|
48
46
|
this.#state = 'binding';
|
|
49
47
|
if (callback)
|
|
50
48
|
this.on('listening', callback);
|
|
51
|
-
this.#
|
|
52
|
-
.
|
|
49
|
+
this.#context
|
|
50
|
+
.sharedUdpSocketJoin({
|
|
53
51
|
family: this.#options.type,
|
|
54
52
|
portNumber: port,
|
|
55
53
|
// Future: use address?
|
|
56
54
|
})
|
|
57
55
|
.then((handleId) => {
|
|
58
56
|
this.#state = { portNumber: port, handleId };
|
|
59
|
-
this.#
|
|
57
|
+
this.#context.sharedUdpSocketHandlers.set(handleId, this);
|
|
60
58
|
this.emit('listening');
|
|
61
59
|
}, (err) => {
|
|
62
60
|
this.#state = 'closed';
|
|
@@ -85,15 +83,15 @@ class SharedUdpSocketImpl extends eventemitter3_1.default {
|
|
|
85
83
|
this.#state = 'closed';
|
|
86
84
|
if (callback)
|
|
87
85
|
this.on('close', callback);
|
|
88
|
-
this.#
|
|
89
|
-
.
|
|
86
|
+
this.#context
|
|
87
|
+
.sharedUdpSocketLeave({
|
|
90
88
|
handleId: handleId,
|
|
91
89
|
})
|
|
92
90
|
.then(() => {
|
|
93
|
-
this.#
|
|
91
|
+
this.#context.sharedUdpSocketHandlers.delete(handleId);
|
|
94
92
|
this.emit('close');
|
|
95
93
|
}, (err) => {
|
|
96
|
-
this.#
|
|
94
|
+
this.#context.sharedUdpSocketHandlers.delete(handleId);
|
|
97
95
|
this.emit('error', err instanceof Error ? err : new Error(err));
|
|
98
96
|
})
|
|
99
97
|
.catch(() => null); // Make sure any errors in user code don't cause a crash
|
|
@@ -139,8 +137,8 @@ class SharedUdpSocketImpl extends eventemitter3_1.default {
|
|
|
139
137
|
#sendInner(buffer, port, address, callback) {
|
|
140
138
|
if (!this.#state || typeof this.#state !== 'object')
|
|
141
139
|
throw new Error('Socket is not open');
|
|
142
|
-
this.#
|
|
143
|
-
.
|
|
140
|
+
this.#context
|
|
141
|
+
.sharedUdpSocketSend({
|
|
144
142
|
handleId: this.#state.handleId,
|
|
145
143
|
message: buffer,
|
|
146
144
|
address: address,
|
|
@@ -165,7 +163,7 @@ class SharedUdpSocketImpl extends eventemitter3_1.default {
|
|
|
165
163
|
this.#state = 'fatalError';
|
|
166
164
|
const boundState = this.boundState;
|
|
167
165
|
if (boundState)
|
|
168
|
-
this.#
|
|
166
|
+
this.#context.sharedUdpSocketHandlers.delete(boundState.handleId);
|
|
169
167
|
try {
|
|
170
168
|
this.emit('error', error);
|
|
171
169
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-udp-socket.js","sourceRoot":"","sources":["../../src/module-api/shared-udp-socket.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"shared-udp-socket.js","sourceRoot":"","sources":["../../src/module-api/shared-udp-socket.ts"],"names":[],"mappings":";;;;AACA,0EAAwC;AACxC,wCAAwC;AA0ExC,MAAa,mBAAoB,SAAQ,uBAAmC;IAClE,QAAQ,CAAgC;IACxC,QAAQ,CAAwB;IAEzC,IAAW,QAAQ;QAClB,OAAO,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAA;IACjC,CAAC;IACD,IAAW,UAAU;Q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CAAC,UAAU,CAAC,QAAQ,CAAC,CAAA;QAEjF,IAAI,CAAC;YACJ,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QAC1B,CAAC;QAAC,OAAO,EAAE,EAAE,CAAC;YACb,SAAS;QACV,CAAC;IACF,CAAC;CACD;AA1MD,kDA0MC"}
|
|
@@ -115,4 +115,3 @@ export declare function CreateConvertToBooleanFeedbackUpgradeScript<TConfig = un
|
|
|
115
115
|
* @param upgradeMap The feedbacks to upgrade and the id of the option to convert
|
|
116
116
|
*/
|
|
117
117
|
export declare function CreateUseBuiltinInvertForFeedbacksUpgradeScript<TConfig = unknown>(upgradeMap: Record<string, string>): CompanionStaticUpgradeScript<TConfig>;
|
|
118
|
-
//# sourceMappingURL=upgrade.d.ts.map
|
package/dist/util.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@companion-module/base",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.99.0-0-nightly-feat-split-api-20251221-153951-fa12995",
|
|
4
4
|
"type": "commonjs",
|
|
5
|
-
"main": "dist/
|
|
6
|
-
"typings": "dist/
|
|
5
|
+
"main": "dist/main.js",
|
|
6
|
+
"typings": "dist/main.d.ts",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"repository": "https://github.com/bitfocus/companion-module-base",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"
|
|
11
|
-
"build": "yarn build:json-schema && yarn build:ajv-validator && yarn build:ts",
|
|
12
|
-
"build:ts": "tsc -p tsconfig.build.json",
|
|
13
|
-
"build:json-schema": "json2ts --input assets/manifest.schema.json --output generated/manifest.d.ts --additionalProperties=false",
|
|
14
|
-
"build:ajv-validator": "node tools/schema-compile.mjs",
|
|
15
|
-
"docs:html": "typedoc --tsconfig tsconfig.build.json --entryPoints src/index.ts --excludePrivate --theme default --out docs",
|
|
16
|
-
"lint:raw": "eslint",
|
|
17
|
-
"lint": "yarn lint:raw .",
|
|
18
|
-
"unit": "vitest"
|
|
10
|
+
"docs:html": "run -BT typedoc --tsconfig tsconfig.build.json --entryPoints src/main.ts --excludePrivate --theme default --out docs"
|
|
19
11
|
},
|
|
20
12
|
"engines": {
|
|
21
|
-
"node": "^18.
|
|
13
|
+
"node": "^18.20 || ^22.21"
|
|
22
14
|
},
|
|
23
15
|
"files": [
|
|
24
16
|
"README.md",
|
|
@@ -31,30 +23,9 @@
|
|
|
31
23
|
"dependencies": {
|
|
32
24
|
"ajv": "^8.17.1",
|
|
33
25
|
"colord": "^2.9.3",
|
|
34
|
-
"ejson": "^2.2.3",
|
|
35
26
|
"eventemitter3": "^5.0.1",
|
|
36
|
-
"mimic-fn": "^3.1.0",
|
|
37
|
-
"nanoid": "^3.3.11",
|
|
38
|
-
"p-queue": "^6.6.2",
|
|
39
|
-
"p-timeout": "^4.1.0",
|
|
40
27
|
"tslib": "^2.8.1"
|
|
41
28
|
},
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
"@tsconfig/node18": "^18.2.4",
|
|
45
|
-
"@types/ejson": "^2.2.2",
|
|
46
|
-
"@types/lodash-es": "^4.17.12",
|
|
47
|
-
"@types/node": "^18.19.123",
|
|
48
|
-
"eslint": "^9.34.0",
|
|
49
|
-
"json-schema-to-typescript": "^15.0.4",
|
|
50
|
-
"lodash-es": "^4.17.21",
|
|
51
|
-
"prettier": "^3.6.2",
|
|
52
|
-
"typedoc": "^0.27.9",
|
|
53
|
-
"typescript": "~5.7.3",
|
|
54
|
-
"typescript-eslint": "^8.42.0",
|
|
55
|
-
"vitest": "^3.2.4",
|
|
56
|
-
"vitest-mock-extended": "^3.1.0"
|
|
57
|
-
},
|
|
58
|
-
"packageManager": "yarn@4.10.3",
|
|
59
|
-
"stableVersion": "1.14.0-0"
|
|
29
|
+
"packageManager": "yarn@4.12.0",
|
|
30
|
+
"stableVersion": "1.99.0-0"
|
|
60
31
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"json-value.d.ts","sourceRoot":"","sources":["../../src/common/json-value.ts"],"names":[],"mappings":"AAGA;;;;;;EAME;AACF,MAAM,MAAM,UAAU,GAAG;KAAG,GAAG,IAAI,MAAM,GAAG,SAAS;CAAE,GAAG;KAAG,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS;CAAE,CAAA;AAErG;;;;EAIE;AACF,MAAM,MAAM,SAAS,GAAG,SAAS,EAAE,GAAG,SAAS,SAAS,EAAE,CAAA;AAE1D;;;;EAIE;AACF,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;AAE5D;;;;;;EAME;AACF,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAA"}
|
package/dist/common/osc.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"osc.d.ts","sourceRoot":"","sources":["../../src/common/osc.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;AACtD,MAAM,MAAM,eAAe,GACxB;IAAE,IAAI,EAAE,GAAG,GAAG,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,CAAA;AACnC,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,eAAe,GAAG,KAAK,CAAC,eAAe,CAAC,CAAA"}
|
package/dist/entrypoint.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entrypoint.d.ts","sourceRoot":"","sources":["../src/entrypoint.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAUxD,MAAM,MAAM,mBAAmB,CAAC,OAAO,EAAE,QAAQ,IAAI,KAAK,QAAQ,EAAE,OAAO,KAAK,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;AAe/G;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,QAAQ,EAC9C,OAAO,EAAE,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAC/C,cAAc,EAAE,4BAA4B,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE,GAC/D,IAAI,CAuHN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AACvE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACnF,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tcp.d.ts","sourceRoot":"","sources":["../../src/helpers/tcp.ts"],"names":[],"mappings":"AAiBA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,KAAK,WAAW,GACb,cAAc,CAAC,EAAE,GACjB,cAAc,CAAC,UAAU,GACzB,cAAc,CAAC,YAAY,GAC3B,cAAc,CAAC,YAAY,CAAA;AAE9B,MAAM,WAAW,eAAe;IAE/B,KAAK,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;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,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB,wBAAwB;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED,qBAAa,SAAU,SAAQ,YAAY,CAAC,eAAe,CAAC;;IAU3D,IAAI,WAAW,IAAI,OAAO,CAEzB;gBAEW,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB;IAkE5D,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBnD,OAAO,IAAI,IAAI;CAoBf"}
|
package/dist/host-api/api.d.ts
DELETED
|
@@ -1,389 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Warning: these types are intentionally semi-isolated from the module-api folder.
|
|
3
|
-
* While it causes a lot of duplicate typings and requires us to do translation of types,
|
|
4
|
-
* it allows for us to be selective as to whether a change impacts the module api or the host api.
|
|
5
|
-
* This will allow for cleaner and more stable apis which can both evolve at different rates
|
|
6
|
-
*/
|
|
7
|
-
import type { CompanionFeedbackButtonStyleResult, SomeCompanionFeedbackInputField } from '../module-api/feedback.js';
|
|
8
|
-
import type { OSCSomeArguments } from '../common/osc.js';
|
|
9
|
-
import type { SomeCompanionConfigField } from '../module-api/config.js';
|
|
10
|
-
import type { LogLevel, InstanceStatus } from '../module-api/enums.js';
|
|
11
|
-
import type { CompanionOptionValues, CompanionInputFieldBase } from '../module-api/input.js';
|
|
12
|
-
import type { CompanionButtonPresetDefinition, CompanionTextPresetDefinition } from '../module-api/preset.js';
|
|
13
|
-
import type { CompanionHTTPRequest, CompanionHTTPResponse } from '../module-api/http.js';
|
|
14
|
-
import type { SomeCompanionActionInputField } from '../module-api/action.js';
|
|
15
|
-
import type { CompanionVariableValue } from '../module-api/variable.js';
|
|
16
|
-
import type { RemoteInfo } from 'dgram';
|
|
17
|
-
import type { OptionsObject } from '../util.js';
|
|
18
|
-
import type { JsonValue } from '../common/json-value.js';
|
|
19
|
-
export interface ModuleToHostEventsV0 extends ModuleToHostEventsV0SharedSocket {
|
|
20
|
-
/** The connection has a message for the Companion log */
|
|
21
|
-
'log-message': (msg: LogMessageMessage) => never;
|
|
22
|
-
/** The connection status has changed */
|
|
23
|
-
'set-status': (msg: SetStatusMessage) => never;
|
|
24
|
-
/** The actions available in the connection have changed */
|
|
25
|
-
setActionDefinitions: (msg: SetActionDefinitionsMessage) => never;
|
|
26
|
-
/** The feedbacks available in the connection have changed */
|
|
27
|
-
setFeedbackDefinitions: (msg: SetFeedbackDefinitionsMessage) => never;
|
|
28
|
-
/** The varaibles available in the connection have changed */
|
|
29
|
-
setVariableDefinitions: (msg: SetVariableDefinitionsMessage) => never;
|
|
30
|
-
/** The presets provided by the connection have changed */
|
|
31
|
-
setPresetDefinitions: (msg: SetPresetDefinitionsMessage) => never;
|
|
32
|
-
/** The connection has some new values for variables */
|
|
33
|
-
setVariableValues: (msg: SetVariableValuesMessage) => never;
|
|
34
|
-
/** The connection has some new values for feedbacks it is running */
|
|
35
|
-
updateFeedbackValues: (msg: UpdateFeedbackValuesMessage) => never;
|
|
36
|
-
/** The connection has updated its config, which should be persisted */
|
|
37
|
-
saveConfig: (msg: SaveConfigMessage) => never;
|
|
38
|
-
/** Send an OSC message from the default osc listener in companion */
|
|
39
|
-
'send-osc': (msg: SendOscMessage) => never;
|
|
40
|
-
/**
|
|
41
|
-
* Parse the variables in a string of text.
|
|
42
|
-
* This has been semi depricated in favor of the companion parsing the options before the module.
|
|
43
|
-
*/
|
|
44
|
-
parseVariablesInString: (msg: ParseVariablesInStringMessage) => ParseVariablesInStringResponseMessage;
|
|
45
|
-
/**
|
|
46
|
-
* @deprecated Replaced with explicit upgrade call in 1.13.0
|
|
47
|
-
* The connection has upgraded some actions/feedbacks it has been informed about to a new version of its definitions
|
|
48
|
-
*/
|
|
49
|
-
upgradedItems: (msg: UpgradedDataResponseMessage) => void;
|
|
50
|
-
/** When the action-recorder is running, the module has recorded an action to add to the recorded stack */
|
|
51
|
-
recordAction: (msg: RecordActionMessage) => never;
|
|
52
|
-
/**
|
|
53
|
-
* The connection has a new value for a custom variable
|
|
54
|
-
* Note: This should only be used by a few internal modules, it is not intended for general use
|
|
55
|
-
*/
|
|
56
|
-
setCustomVariable: (msg: SetCustomVariableMessage) => never;
|
|
57
|
-
}
|
|
58
|
-
export interface ModuleToHostEventsV0SharedSocket {
|
|
59
|
-
sharedUdpSocketJoin: (msg: SharedUdpSocketMessageJoin) => string;
|
|
60
|
-
sharedUdpSocketLeave: (msg: SharedUdpSocketMessageLeave) => void;
|
|
61
|
-
sharedUdpSocketSend: (msg: SharedUdpSocketMessageSend) => void;
|
|
62
|
-
}
|
|
63
|
-
export interface HostToModuleEventsV0 extends HostToModuleEventsV0SharedSocket {
|
|
64
|
-
/** Initialise the connection with the given config and label */
|
|
65
|
-
init: (msg: InitMessage) => InitResponseMessage;
|
|
66
|
-
/** Cleanup the connection in preparation for the thread/process to be terminated */
|
|
67
|
-
destroy: (msg: Record<string, never>) => void;
|
|
68
|
-
/**
|
|
69
|
-
* @deprecated Replaced with updateConfigAndLabel in 1.2.0
|
|
70
|
-
* This is the same as `updateConfigAndLabel` but without the label
|
|
71
|
-
*/
|
|
72
|
-
updateConfig: (config: unknown) => void;
|
|
73
|
-
/** The connection config or label has been updated by the user */
|
|
74
|
-
updateConfigAndLabel: (msg: UpdateConfigAndLabelMessage) => void;
|
|
75
|
-
/**
|
|
76
|
-
* Some feedbacks for this connection have been created/updated/removed. This will start them being executed, watching for state changes in the connection and any referenced variables
|
|
77
|
-
* Since 1.13.0, the options will have variables pre-parsed. Subscribe/unsubscribe would be called as needed, and the feedbacks would start to be executed
|
|
78
|
-
* Prior to 1.13.0, this would also run upgrade scripts on the feedbacks
|
|
79
|
-
*/
|
|
80
|
-
updateFeedbacks: (msg: UpdateFeedbackInstancesMessage) => void;
|
|
81
|
-
/**
|
|
82
|
-
* Some actions for this connection have been created/updated/removed
|
|
83
|
-
* Since 1.13.0, the options will have variables pre-parsed. Subscribe/unsubscribe would be called as needed
|
|
84
|
-
* Prior to 1.13.0, this would also run upgrade scripts on the actions
|
|
85
|
-
*/
|
|
86
|
-
updateActions: (msg: UpdateActionInstancesMessage) => void;
|
|
87
|
-
/**
|
|
88
|
-
* Run the upgrade scripts for the provided actions and feedbacks
|
|
89
|
-
* Available since 1.13.0. Prior to this, the upgrade scripts would be run as part of the `updateActions` and `updateFeedbacks` calls
|
|
90
|
-
* The options objects provided here are in their 'raw' form, and can contain expressions
|
|
91
|
-
*/
|
|
92
|
-
upgradeActionsAndFeedbacks: (msg: UpgradeActionAndFeedbackInstancesMessage) => UpgradeActionAndFeedbackInstancesResponse;
|
|
93
|
-
/** Execute an action */
|
|
94
|
-
executeAction: (msg: ExecuteActionMessage) => ExecuteActionResponseMessage | undefined;
|
|
95
|
-
/** Get the config fields for this connection */
|
|
96
|
-
getConfigFields: (msg: GetConfigFieldsMessage) => GetConfigFieldsResponseMessage;
|
|
97
|
-
/** Handle an incoming HTTP request */
|
|
98
|
-
handleHttpRequest: (msg: HandleHttpRequestMessage) => HandleHttpRequestResponseMessage;
|
|
99
|
-
/**
|
|
100
|
-
* Learn the options for an action
|
|
101
|
-
* This allows the module to update the options for an action based on the current state of the device
|
|
102
|
-
*/
|
|
103
|
-
learnAction: (msg: LearnActionMessage) => LearnActionResponseMessage;
|
|
104
|
-
/**
|
|
105
|
-
* Learn the options for an feedback
|
|
106
|
-
* This allows the module to update the options for an feedback based on the current state of the device
|
|
107
|
-
*/
|
|
108
|
-
learnFeedback: (msg: LearnFeedbackMessage) => LearnFeedbackResponseMessage;
|
|
109
|
-
/**
|
|
110
|
-
* Start or stop the action-recorder.
|
|
111
|
-
* When running, this lets the connection emit `recordAction` events when the state of the device changes.
|
|
112
|
-
* This allows users to record macros of actions for their device by changing properties on the device itself.
|
|
113
|
-
*/
|
|
114
|
-
startStopRecordActions: (msg: StartStopRecordActionsMessage) => void;
|
|
115
|
-
/**
|
|
116
|
-
* @deprecated Replaced by companion parsing the options before the module in 1.13.0
|
|
117
|
-
* Prior to 1.13.0, this would notify the module that a variable it had parsed during a feedback had changed and let it re-run the feedback
|
|
118
|
-
*/
|
|
119
|
-
variablesChanged: (msg: VariablesChangedMessage) => never;
|
|
120
|
-
}
|
|
121
|
-
export interface HostToModuleEventsV0SharedSocket {
|
|
122
|
-
sharedUdpSocketMessage: (msg: SharedUdpSocketMessage) => never;
|
|
123
|
-
sharedUdpSocketError: (msg: SharedUdpSocketError) => never;
|
|
124
|
-
}
|
|
125
|
-
export type EncodeIsVisible<T extends CompanionInputFieldBase> = Omit<T, 'isVisible' | 'isVisibleExpression'> & {
|
|
126
|
-
isVisibleFn?: string;
|
|
127
|
-
isVisibleFnType?: 'function' | 'expression';
|
|
128
|
-
};
|
|
129
|
-
export interface InitMessage {
|
|
130
|
-
label: string;
|
|
131
|
-
isFirstInit: boolean;
|
|
132
|
-
config: unknown;
|
|
133
|
-
secrets: unknown;
|
|
134
|
-
lastUpgradeIndex: number;
|
|
135
|
-
/** @deprecated not populated/used since 1.13.0 */
|
|
136
|
-
feedbacks: {
|
|
137
|
-
[id: string]: FeedbackInstance | undefined;
|
|
138
|
-
};
|
|
139
|
-
/** @deprecated not populated/used since 1.13.0 */
|
|
140
|
-
actions: {
|
|
141
|
-
[id: string]: ActionInstance | undefined;
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
export interface InitResponseMessage {
|
|
145
|
-
hasHttpHandler: boolean;
|
|
146
|
-
hasRecordActionsHandler: boolean;
|
|
147
|
-
newUpgradeIndex: number;
|
|
148
|
-
disableNewConfigLayout: boolean;
|
|
149
|
-
updatedConfig: unknown | undefined;
|
|
150
|
-
updatedSecrets: unknown | undefined;
|
|
151
|
-
}
|
|
152
|
-
export interface UpgradedDataResponseMessage {
|
|
153
|
-
updatedFeedbacks: {
|
|
154
|
-
[id: string]: (FeedbackInstanceBase & {
|
|
155
|
-
controlId: string;
|
|
156
|
-
style?: Partial<CompanionFeedbackButtonStyleResult>;
|
|
157
|
-
isInverted: boolean;
|
|
158
|
-
}) | undefined;
|
|
159
|
-
};
|
|
160
|
-
updatedActions: {
|
|
161
|
-
[id: string]: (ActionInstanceBase & {
|
|
162
|
-
controlId: string;
|
|
163
|
-
}) | undefined;
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
export type GetConfigFieldsMessage = Record<string, never>;
|
|
167
|
-
export type SomeEncodedCompanionConfigField = EncodeIsVisible<SomeCompanionConfigField>;
|
|
168
|
-
export interface GetConfigFieldsResponseMessage {
|
|
169
|
-
fields: SomeEncodedCompanionConfigField[];
|
|
170
|
-
}
|
|
171
|
-
export interface LogMessageMessage {
|
|
172
|
-
level: LogLevel;
|
|
173
|
-
message: string;
|
|
174
|
-
}
|
|
175
|
-
export interface SetStatusMessage {
|
|
176
|
-
status: InstanceStatus;
|
|
177
|
-
message: string | null;
|
|
178
|
-
}
|
|
179
|
-
export interface SetActionDefinitionsMessage {
|
|
180
|
-
actions: Array<{
|
|
181
|
-
id: string;
|
|
182
|
-
name: string;
|
|
183
|
-
description: string | undefined;
|
|
184
|
-
options: EncodeIsVisible<SomeCompanionActionInputField>[];
|
|
185
|
-
optionsToIgnoreForSubscribe: string[] | undefined;
|
|
186
|
-
hasLearn: boolean;
|
|
187
|
-
learnTimeout: number | undefined;
|
|
188
|
-
hasLifecycleFunctions: boolean;
|
|
189
|
-
}>;
|
|
190
|
-
}
|
|
191
|
-
export interface SetFeedbackDefinitionsMessage {
|
|
192
|
-
feedbacks: Array<{
|
|
193
|
-
id: string;
|
|
194
|
-
name: string;
|
|
195
|
-
description: string | undefined;
|
|
196
|
-
options: EncodeIsVisible<SomeCompanionFeedbackInputField>[];
|
|
197
|
-
type: 'boolean' | 'value' | 'advanced';
|
|
198
|
-
defaultStyle?: CompanionFeedbackButtonStyleResult;
|
|
199
|
-
hasLearn: boolean;
|
|
200
|
-
showInvert: boolean | undefined;
|
|
201
|
-
learnTimeout: number | undefined;
|
|
202
|
-
}>;
|
|
203
|
-
}
|
|
204
|
-
export interface SetVariableDefinitionsMessage {
|
|
205
|
-
variables: Array<{
|
|
206
|
-
id: string;
|
|
207
|
-
name: string;
|
|
208
|
-
}>;
|
|
209
|
-
/** New in v1.7, optionally set values for variables at the same tiem */
|
|
210
|
-
newValues?: Array<{
|
|
211
|
-
id: string;
|
|
212
|
-
value: string | number | boolean | undefined;
|
|
213
|
-
}>;
|
|
214
|
-
}
|
|
215
|
-
export interface SetPresetDefinitionsMessage {
|
|
216
|
-
presets: Array<(CompanionButtonPresetDefinition | CompanionTextPresetDefinition) & {
|
|
217
|
-
id: string;
|
|
218
|
-
}>;
|
|
219
|
-
}
|
|
220
|
-
export interface SetVariableValuesMessage {
|
|
221
|
-
newValues: Array<{
|
|
222
|
-
id: string;
|
|
223
|
-
value: string | number | boolean | undefined;
|
|
224
|
-
}>;
|
|
225
|
-
}
|
|
226
|
-
export interface ExecuteActionMessage {
|
|
227
|
-
action: ActionInstance;
|
|
228
|
-
/** Identifier of the surface which triggered this action */
|
|
229
|
-
surfaceId: string | undefined;
|
|
230
|
-
}
|
|
231
|
-
export interface ExecuteActionResponseMessage {
|
|
232
|
-
success: boolean;
|
|
233
|
-
/** If success=false, a reason for the failure */
|
|
234
|
-
errorMessage: string | undefined;
|
|
235
|
-
}
|
|
236
|
-
export interface UpdateFeedbackValuesMessage {
|
|
237
|
-
values: Array<{
|
|
238
|
-
id: string;
|
|
239
|
-
controlId: string;
|
|
240
|
-
value: JsonValue | Partial<CompanionFeedbackButtonStyleResult> | undefined;
|
|
241
|
-
}>;
|
|
242
|
-
}
|
|
243
|
-
export interface FeedbackInstanceBase {
|
|
244
|
-
id: string;
|
|
245
|
-
upgradeIndex: number | null;
|
|
246
|
-
disabled: boolean;
|
|
247
|
-
feedbackId: string;
|
|
248
|
-
options: OptionsObject;
|
|
249
|
-
}
|
|
250
|
-
export interface FeedbackInstance extends FeedbackInstanceBase {
|
|
251
|
-
controlId: string;
|
|
252
|
-
isInverted: boolean;
|
|
253
|
-
/** If control supports an imageBuffer, the dimensions the buffer must be */
|
|
254
|
-
image?: {
|
|
255
|
-
width: number;
|
|
256
|
-
height: number;
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
export interface UpdateConfigAndLabelMessage {
|
|
260
|
-
label: string;
|
|
261
|
-
config: unknown | undefined;
|
|
262
|
-
secrets: unknown | undefined;
|
|
263
|
-
}
|
|
264
|
-
export interface UpdateFeedbackInstancesMessage {
|
|
265
|
-
feedbacks: {
|
|
266
|
-
[id: string]: FeedbackInstance | null | undefined;
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
export interface ActionInstanceBase {
|
|
270
|
-
id: string;
|
|
271
|
-
upgradeIndex: number | null;
|
|
272
|
-
disabled: boolean;
|
|
273
|
-
actionId: string;
|
|
274
|
-
options: OptionsObject;
|
|
275
|
-
}
|
|
276
|
-
export interface ActionInstance extends ActionInstanceBase {
|
|
277
|
-
controlId: string;
|
|
278
|
-
}
|
|
279
|
-
export interface UpdateActionInstancesMessage {
|
|
280
|
-
actions: {
|
|
281
|
-
[id: string]: ActionInstance | null | undefined;
|
|
282
|
-
};
|
|
283
|
-
}
|
|
284
|
-
export interface UpgradeActionInstance extends Omit<ActionInstanceBase, 'options'> {
|
|
285
|
-
options: OptionsObject;
|
|
286
|
-
controlId: string;
|
|
287
|
-
}
|
|
288
|
-
export interface UpgradeFeedbackInstance extends Omit<FeedbackInstanceBase, 'options'> {
|
|
289
|
-
options: OptionsObject;
|
|
290
|
-
isInverted: boolean;
|
|
291
|
-
/**
|
|
292
|
-
* Only used as an output from the module, when the feedback is being converted to a boolean feedback
|
|
293
|
-
*/
|
|
294
|
-
style?: Partial<CompanionFeedbackButtonStyleResult>;
|
|
295
|
-
controlId: string;
|
|
296
|
-
}
|
|
297
|
-
export interface UpgradeActionAndFeedbackInstancesMessage {
|
|
298
|
-
actions: UpgradeActionInstance[];
|
|
299
|
-
feedbacks: UpgradeFeedbackInstance[];
|
|
300
|
-
defaultUpgradeIndex: number | null;
|
|
301
|
-
}
|
|
302
|
-
export interface UpgradeActionAndFeedbackInstancesResponse {
|
|
303
|
-
updatedConfig: unknown;
|
|
304
|
-
updatedSecrets: unknown;
|
|
305
|
-
updatedActions: UpgradeActionInstance[];
|
|
306
|
-
updatedFeedbacks: UpgradeFeedbackInstance[];
|
|
307
|
-
latestUpgradeIndex: number;
|
|
308
|
-
}
|
|
309
|
-
export interface SaveConfigMessage {
|
|
310
|
-
config: unknown | undefined;
|
|
311
|
-
secrets: unknown | undefined;
|
|
312
|
-
}
|
|
313
|
-
export interface SendOscMessage {
|
|
314
|
-
host: string;
|
|
315
|
-
port: number;
|
|
316
|
-
path: string;
|
|
317
|
-
args: OSCSomeArguments;
|
|
318
|
-
}
|
|
319
|
-
export interface ParseVariablesInStringMessage {
|
|
320
|
-
text: string;
|
|
321
|
-
controlId: string | undefined;
|
|
322
|
-
feedbackInstanceId: string | undefined;
|
|
323
|
-
actionInstanceId: string | undefined;
|
|
324
|
-
}
|
|
325
|
-
export interface ParseVariablesInStringResponseMessage {
|
|
326
|
-
text: string;
|
|
327
|
-
variableIds: string[] | undefined;
|
|
328
|
-
}
|
|
329
|
-
export interface HandleHttpRequestMessage {
|
|
330
|
-
request: CompanionHTTPRequest;
|
|
331
|
-
}
|
|
332
|
-
export interface HandleHttpRequestResponseMessage {
|
|
333
|
-
response: CompanionHTTPResponse;
|
|
334
|
-
}
|
|
335
|
-
export interface LearnActionMessage {
|
|
336
|
-
action: ActionInstance;
|
|
337
|
-
}
|
|
338
|
-
export interface LearnActionResponseMessage {
|
|
339
|
-
options: CompanionOptionValues | undefined;
|
|
340
|
-
}
|
|
341
|
-
export interface LearnFeedbackMessage {
|
|
342
|
-
feedback: FeedbackInstance;
|
|
343
|
-
}
|
|
344
|
-
export interface LearnFeedbackResponseMessage {
|
|
345
|
-
options: CompanionOptionValues | undefined;
|
|
346
|
-
}
|
|
347
|
-
export interface StartStopRecordActionsMessage {
|
|
348
|
-
recording: boolean;
|
|
349
|
-
}
|
|
350
|
-
export interface RecordActionMessage {
|
|
351
|
-
uniquenessId: string | null;
|
|
352
|
-
actionId: string;
|
|
353
|
-
options: CompanionOptionValues;
|
|
354
|
-
delay: number | undefined;
|
|
355
|
-
}
|
|
356
|
-
export interface SetCustomVariableMessage {
|
|
357
|
-
customVariableId: string;
|
|
358
|
-
value: CompanionVariableValue;
|
|
359
|
-
/** Control the variable was set from. This should always be defined, but did not exist in older versions */
|
|
360
|
-
controlId: string | undefined;
|
|
361
|
-
}
|
|
362
|
-
export interface VariablesChangedMessage {
|
|
363
|
-
variablesIds: string[];
|
|
364
|
-
}
|
|
365
|
-
export interface SharedUdpSocketMessageJoin {
|
|
366
|
-
family: 'udp4' | 'udp6';
|
|
367
|
-
portNumber: number;
|
|
368
|
-
}
|
|
369
|
-
export interface SharedUdpSocketMessageLeave {
|
|
370
|
-
handleId: string;
|
|
371
|
-
}
|
|
372
|
-
export interface SharedUdpSocketMessageSend {
|
|
373
|
-
handleId: string;
|
|
374
|
-
message: Buffer;
|
|
375
|
-
address: string;
|
|
376
|
-
port: number;
|
|
377
|
-
}
|
|
378
|
-
export interface SharedUdpSocketMessage {
|
|
379
|
-
handleId: string;
|
|
380
|
-
portNumber: number;
|
|
381
|
-
message: Buffer;
|
|
382
|
-
source: RemoteInfo;
|
|
383
|
-
}
|
|
384
|
-
export interface SharedUdpSocketError {
|
|
385
|
-
handleId: string;
|
|
386
|
-
portNumber: number;
|
|
387
|
-
error: Error;
|
|
388
|
-
}
|
|
389
|
-
//# sourceMappingURL=api.d.ts.map
|