@companion-surface/base 0.4.2 → 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.
- package/CHANGELOG.md +20 -0
- package/assets/manifest.schema.json +30 -1
- package/dist/manifest.d.ts +2 -2
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js.map +1 -1
- package/dist/surface-api/instance.d.ts +11 -0
- package/dist/surface-api/instance.d.ts.map +1 -1
- package/dist/surface-api/pincode.d.ts +1 -0
- package/dist/surface-api/pincode.d.ts.map +1 -1
- package/dist/surface-api/types.d.ts +6 -5
- package/dist/surface-api/types.d.ts.map +1 -1
- package/generated/manifest.d.ts +15 -0
- package/generated/validate_manifest.js +145 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.6.0](https://github.com/bitfocus/companion-surface-api/compare/companion-surface-base-v0.5.0...companion-surface-base-v0.6.0) (2025-11-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add allowMultipleInstances field to manifest ([94bba80](https://github.com/bitfocus/companion-surface-api/commit/94bba800143308a1b8fd6ed1d56249b8fc8a432b))
|
|
9
|
+
|
|
10
|
+
## [0.5.0](https://github.com/bitfocus/companion-surface-api/compare/companion-surface-base-v0.4.2...companion-surface-base-v0.5.0) (2025-11-16)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add usbIds to manifest schema ([3ce6278](https://github.com/bitfocus/companion-surface-api/commit/3ce62785146e2bd363fdfdfd6f0be3e9d9f5af59))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* force host bump ([10ef9bc](https://github.com/bitfocus/companion-surface-api/commit/10ef9bc33b5c7a4fba8424eca23139b5b1f66eca))
|
|
21
|
+
* missing manifest type exports ([b593404](https://github.com/bitfocus/companion-surface-api/commit/b5934044c3a482793e389406009b6df92daae864))
|
|
22
|
+
|
|
3
23
|
## [0.4.2](https://github.com/bitfocus/companion-surface-api/compare/companion-surface-base-v0.4.1...companion-surface-base-v0.4.2) (2025-11-01)
|
|
4
24
|
|
|
5
25
|
|
|
@@ -106,6 +106,34 @@
|
|
|
106
106
|
"items": {
|
|
107
107
|
"type": "string"
|
|
108
108
|
}
|
|
109
|
+
},
|
|
110
|
+
"usbIds": {
|
|
111
|
+
"type": "array",
|
|
112
|
+
"description": "List of USB vendor and product IDs that the module supports. Your module will only be notified of devices matching these IDs.",
|
|
113
|
+
"uniqueItems": true,
|
|
114
|
+
"items": {
|
|
115
|
+
"type": "object",
|
|
116
|
+
"title": "SurfaceModuleManifestUsbIds",
|
|
117
|
+
"properties": {
|
|
118
|
+
"vendorId": {
|
|
119
|
+
"type": "integer"
|
|
120
|
+
},
|
|
121
|
+
"productIds": {
|
|
122
|
+
"type": "array",
|
|
123
|
+
"uniqueItems": true,
|
|
124
|
+
"items": {
|
|
125
|
+
"type": "integer"
|
|
126
|
+
},
|
|
127
|
+
"minItems": 1
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"required": ["vendorId", "productIds"],
|
|
131
|
+
"additionalProperties": false
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"allowMultipleInstances": {
|
|
135
|
+
"type": "boolean",
|
|
136
|
+
"description": "Whether multiple instances of this module can be run simultaneously"
|
|
109
137
|
}
|
|
110
138
|
},
|
|
111
139
|
"required": [
|
|
@@ -121,6 +149,7 @@
|
|
|
121
149
|
"maintainers",
|
|
122
150
|
"runtime",
|
|
123
151
|
"products",
|
|
124
|
-
"keywords"
|
|
152
|
+
"keywords",
|
|
153
|
+
"usbIds"
|
|
125
154
|
]
|
|
126
155
|
}
|
package/dist/manifest.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SurfaceModuleManifest
|
|
2
|
-
export
|
|
1
|
+
import type { SurfaceModuleManifest } from '../generated/manifest.d.ts';
|
|
2
|
+
export type * from '../generated/manifest.d.ts';
|
|
3
3
|
/** Validate that a manifest looks correctly populated */
|
|
4
4
|
export declare function validateSurfaceManifest(manifest: SurfaceModuleManifest, looseChecks: boolean): void;
|
|
5
5
|
//# sourceMappingURL=manifest.d.ts.map
|
package/dist/manifest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAKvE,mBAAmB,4BAA4B,CAAA;AAE/C,yDAAyD;AACzD,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,qBAAqB,EAAE,WAAW,EAAE,OAAO,GAAG,IAAI,CAiCnG"}
|
package/dist/manifest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AACA,8BAA8B;AAC9B,+CAA+C;AAC/C,OAAO,6BAA6B,MAAM,mCAAmC,CAAA;AAI7E,yDAAyD;AACzD,MAAM,UAAU,uBAAuB,CAAC,QAA+B,EAAE,WAAoB;IAC5F,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAA;IAErF,IAAI,CAAC,WAAW,EAAE,CAAC;QAClB,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAA;QAC5C,IAAI,WAAW,CAAC,QAAQ,CAAC,mCAAmC,CAAC;YAC5D,MAAM,IAAI,KAAK,CAAC,qFAAqF,CAAC,CAAA;QAEvG,IAAI,WAAW,CAAC,QAAQ,CAAC,kBAAkB,CAAC;YAC3C,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAA;QAEtF,IAAI,WAAW,CAAC,QAAQ,CAAC,6CAA6C,CAAC;YACtE,MAAM,IAAI,KAAK,CAAC,+FAA+F,CAAC,CAAA;QAEjH,IAAI,WAAW,CAAC,QAAQ,CAAC,WAAW,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAA;QAE/E,IAAI,WAAW,CAAC,QAAQ,CAAC,YAAY,CAAC;YACrC,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAA;QAEhF,IAAI,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAA;QAElF,IAAI,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAA;IACnF,CAAC;IAED,IAAI,CAAC,6BAA6B,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC9C,MAAM,MAAM,GAAG,6BAA6B,CAAC,MAAM,CAAA;QACnD,IAAI,CAAC,MAAM;YAAE,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAA;QAE9E,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACzE,CAAC;AACF,CAAC"}
|
|
@@ -45,7 +45,18 @@ export interface SurfaceInstance {
|
|
|
45
45
|
* @param drawProps Data to draw
|
|
46
46
|
*/
|
|
47
47
|
draw(signal: AbortSignal, drawProps: SurfaceDrawProps): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Called when one of the 'input' transfer variables changes value
|
|
50
|
+
* @param name Name of the variable
|
|
51
|
+
* @param value New value of the variable
|
|
52
|
+
*/
|
|
48
53
|
onVariableValue?(name: string, value: any): void;
|
|
54
|
+
/**
|
|
55
|
+
* Show the locked status of the surface for pincode entry
|
|
56
|
+
* This is only used when the surface was registered with the `custom` pincode map
|
|
57
|
+
* @param locked Whether the surface is locked. When false, this will be shortly followed by draw calls
|
|
58
|
+
* @param characterCount The number of characters of the pincode which have been entered
|
|
59
|
+
*/
|
|
49
60
|
showLockedStatus?(locked: boolean, characterCount: number): void;
|
|
50
61
|
/**
|
|
51
62
|
* Show a status image on the device, instead of the normal operation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance.d.ts","sourceRoot":"","sources":["../../src/surface-api/instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,KAAK,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAA;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE7D,MAAM,WAAW,eAAe;IAC/B;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAA;IAC7B;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAE5B;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAErB;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtB;;;OAGG;IACH,YAAY,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEzD;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAItB;;;OAGG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7C;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IA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,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAItB;;;OAGG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7C;;OAEG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtB;;;;OAIG;IACH,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAErE;;;;OAIG;IACH,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAAA;IAEhD;;;;;OAKG;IACH,gBAAgB,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;IAEhE;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnG;;;;OAIG;IACH,uBAAuB,CAAC,CAAC,aAAa,EAAE,0BAA0B,GAAG,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAA;CAC9G"}
|
|
@@ -5,6 +5,7 @@ import type { ControlId } from './types.js';
|
|
|
5
5
|
export type SurfacePincodeMap = SurfacePincodeMapPageSingle | SurfacePincodeMapPageMultiple | SurfacePincodeMapCustom;
|
|
6
6
|
/**
|
|
7
7
|
* An empty pincode map, for surfaces which do a custom pincode entry arrangement
|
|
8
|
+
* When using this, you should implement the `showLockedStatus` method on the SurfaceInstance to show the locked status
|
|
8
9
|
*/
|
|
9
10
|
export interface SurfacePincodeMapCustom {
|
|
10
11
|
type: 'custom';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pincode.d.ts","sourceRoot":"","sources":["../../src/surface-api/pincode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,2BAA2B,GAAG,6BAA6B,GAAG,uBAAuB,CAAA;AAErH
|
|
1
|
+
{"version":3,"file":"pincode.d.ts","sourceRoot":"","sources":["../../src/surface-api/pincode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,2BAA2B,GAAG,6BAA6B,GAAG,uBAAuB,CAAA;AAErH;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACvC,IAAI,EAAE,QAAQ,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,0BAA0B;IAC9E,IAAI,EAAE,aAAa,CAAA;IACnB,OAAO,EAAE,SAAS,GAAG,IAAI,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC7C,IAAI,EAAE,eAAe,CAAA;IACrB,OAAO,EAAE,SAAS,CAAA;IAClB,QAAQ,EAAE,SAAS,CAAA;IACnB,KAAK,EAAE,OAAO,CAAC,0BAA0B,CAAC,EAAE,CAAA;CAC5C;AAED,MAAM,WAAW,0BAA0B;IAC1C,CAAC,EAAE,SAAS,CAAA;IACZ,CAAC,EAAE,SAAS,CAAA;IACZ,CAAC,EAAE,SAAS,CAAA;IACZ,CAAC,EAAE,SAAS,CAAA;IACZ,CAAC,EAAE,SAAS,CAAA;IACZ,CAAC,EAAE,SAAS,CAAA;IACZ,CAAC,EAAE,SAAS,CAAA;IACZ,CAAC,EAAE,SAAS,CAAA;IACZ,CAAC,EAAE,SAAS,CAAA;IACZ,CAAC,EAAE,SAAS,CAAA;CACZ"}
|
|
@@ -10,13 +10,13 @@ export interface HIDDevice {
|
|
|
10
10
|
vendorId: number;
|
|
11
11
|
productId: number;
|
|
12
12
|
path: string;
|
|
13
|
-
serialNumber
|
|
14
|
-
manufacturer
|
|
15
|
-
product
|
|
13
|
+
serialNumber: string | undefined;
|
|
14
|
+
manufacturer: string | undefined;
|
|
15
|
+
product: string | undefined;
|
|
16
16
|
release: number;
|
|
17
17
|
interface: number;
|
|
18
|
-
usagePage
|
|
19
|
-
usage
|
|
18
|
+
usagePage: number | undefined;
|
|
19
|
+
usage: number | undefined;
|
|
20
20
|
}
|
|
21
21
|
export type SurfaceId = string;
|
|
22
22
|
export type ControlId = string;
|
|
@@ -52,6 +52,7 @@ export interface SurfaceRegisterProps {
|
|
|
52
52
|
transferVariables?: Array<SurfaceInputVariable | SurfaceOutputVariable>;
|
|
53
53
|
/**
|
|
54
54
|
* If the surface supports pincode entry, this is the desired arrangement of the pin entry buttons
|
|
55
|
+
* Set to null to disable pincode entry,
|
|
55
56
|
*/
|
|
56
57
|
pincodeMap: SurfacePincodeMap | null;
|
|
57
58
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/surface-api/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAA;AACxF,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAExE;;;GAGG;AACH,MAAM,WAAW,SAAS;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/surface-api/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM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ACH,YAAY,EAAE,uBAAuB,EAAE,GAAG,IAAI,CAAA;CAC9C;AAED,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,eAAe,CAAA;IACxB,aAAa,EAAE,oBAAoB,CAAA;CACnC;AAED,MAAM,WAAW,gBAAgB;IAChC,SAAS,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,UAAU,CAAA;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,QAAQ;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,2BAA2B;IAC3C,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,aAAa,CAAA;CACrB"}
|
package/generated/manifest.d.ts
CHANGED
|
@@ -54,6 +54,14 @@ export interface SurfaceModuleManifest {
|
|
|
54
54
|
*/
|
|
55
55
|
products: [string, ...string[]];
|
|
56
56
|
keywords: string[];
|
|
57
|
+
/**
|
|
58
|
+
* List of USB vendor and product IDs that the module supports. Your module will only be notified of devices matching these IDs.
|
|
59
|
+
*/
|
|
60
|
+
usbIds: SurfaceModuleManifestUsbIds[];
|
|
61
|
+
/**
|
|
62
|
+
* Whether multiple instances of this module can be run simultaneously
|
|
63
|
+
*/
|
|
64
|
+
allowMultipleInstances?: boolean;
|
|
57
65
|
}
|
|
58
66
|
export interface SurfaceModuleManifestMaintainer {
|
|
59
67
|
name: string;
|
|
@@ -78,3 +86,10 @@ export interface SurfaceModuleManifestRuntime {
|
|
|
78
86
|
*/
|
|
79
87
|
entrypoint: string;
|
|
80
88
|
}
|
|
89
|
+
export interface SurfaceModuleManifestUsbIds {
|
|
90
|
+
vendorId: number;
|
|
91
|
+
/**
|
|
92
|
+
* @minItems 1
|
|
93
|
+
*/
|
|
94
|
+
productIds: [number, ...number[]];
|
|
95
|
+
}
|
|
@@ -52,7 +52,7 @@ var require_equal = __commonJS({
|
|
|
52
52
|
// generated/validate_manifest.js
|
|
53
53
|
var validate = validate20;
|
|
54
54
|
var validate_manifest_default = validate20;
|
|
55
|
-
var schema31 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "title": "SurfaceModuleManifest", "properties": { "$schema": { "type": "string" }, "type": { "type": "string", "enum": ["surface"], "description": "Type of module. Must be: surface" }, "id": { "type": "string", "description": "Unique identifier for the module" }, "name": { "type": "string", "description": "Name of the module" }, "shortname": { "type": "string" }, "description": { "type": "string", "description": "Description of the module " }, "version": { "type": "string", "description": "Current version of the module" }, "isPrerelease": { "type": "boolean", "description": "Is this a pre-release version" }, "license": { "type": "string", "description": "SPDX identifier for license of the module" }, "repository": { "type": "string", "description": "URL to the source repository" }, "bugs": { "type": "string", "description": "URL to bug tracker" }, "maintainers": { "type": "array", "description": "List of active maintiners", "uniqueItems": true, "items": { "type": "object", "title": "SurfaceModuleManifestMaintainer", "properties": { "name": { "type": "string" }, "email": { "type": "string" }, "github": { "type": "string" }, "url": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "runtime": { "type": "object", "title": "SurfaceModuleManifestRuntime", "description": "Information on how to execute the module", "properties": { "type": { "type": "string", "description": "Type of the module. Must be: node18 or node22", "enum": ["node22"] }, "apiVersion": { "type": "string", "description": "The version of the host-api used" }, "entrypoint": { "type": "string", "description": "Entrypoint to pass to the runtime. eg index.js" } }, "required": ["type", "apiVersion", "entrypoint"] }, "products": { "type": "array", "uniqueItems": true, "items": { "type": "string" }, "minItems": 1 }, "keywords": { "type": "array", "uniqueItems": true, "items": { "type": "string" } } }, "required": ["type", "id", "name", "shortname", "description", "version", "license", "repository", "bugs", "maintainers", "runtime", "products", "keywords"] };
|
|
55
|
+
var schema31 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "title": "SurfaceModuleManifest", "properties": { "$schema": { "type": "string" }, "type": { "type": "string", "enum": ["surface"], "description": "Type of module. Must be: surface" }, "id": { "type": "string", "description": "Unique identifier for the module" }, "name": { "type": "string", "description": "Name of the module" }, "shortname": { "type": "string" }, "description": { "type": "string", "description": "Description of the module " }, "version": { "type": "string", "description": "Current version of the module" }, "isPrerelease": { "type": "boolean", "description": "Is this a pre-release version" }, "license": { "type": "string", "description": "SPDX identifier for license of the module" }, "repository": { "type": "string", "description": "URL to the source repository" }, "bugs": { "type": "string", "description": "URL to bug tracker" }, "maintainers": { "type": "array", "description": "List of active maintiners", "uniqueItems": true, "items": { "type": "object", "title": "SurfaceModuleManifestMaintainer", "properties": { "name": { "type": "string" }, "email": { "type": "string" }, "github": { "type": "string" }, "url": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "runtime": { "type": "object", "title": "SurfaceModuleManifestRuntime", "description": "Information on how to execute the module", "properties": { "type": { "type": "string", "description": "Type of the module. Must be: node18 or node22", "enum": ["node22"] }, "apiVersion": { "type": "string", "description": "The version of the host-api used" }, "entrypoint": { "type": "string", "description": "Entrypoint to pass to the runtime. eg index.js" } }, "required": ["type", "apiVersion", "entrypoint"] }, "products": { "type": "array", "uniqueItems": true, "items": { "type": "string" }, "minItems": 1 }, "keywords": { "type": "array", "uniqueItems": true, "items": { "type": "string" } }, "usbIds": { "type": "array", "description": "List of USB vendor and product IDs that the module supports. Your module will only be notified of devices matching these IDs.", "uniqueItems": true, "items": { "type": "object", "title": "SurfaceModuleManifestUsbIds", "properties": { "vendorId": { "type": "integer" }, "productIds": { "type": "array", "uniqueItems": true, "items": { "type": "integer" }, "minItems": 1 } }, "required": ["vendorId", "productIds"], "additionalProperties": false } }, "allowMultipleInstances": { "type": "boolean", "description": "Whether multiple instances of this module can be run simultaneously" } }, "required": ["type", "id", "name", "shortname", "description", "version", "license", "repository", "bugs", "maintainers", "runtime", "products", "keywords", "usbIds"] };
|
|
56
56
|
var func0 = require_equal().default;
|
|
57
57
|
function validate20(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
|
|
58
58
|
let vErrors = null;
|
|
@@ -67,7 +67,7 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
67
67
|
if (errors === 0) {
|
|
68
68
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
69
69
|
let missing0;
|
|
70
|
-
if (data.type === void 0 && (missing0 = "type") || data.id === void 0 && (missing0 = "id") || data.name === void 0 && (missing0 = "name") || data.shortname === void 0 && (missing0 = "shortname") || data.description === void 0 && (missing0 = "description") || data.version === void 0 && (missing0 = "version") || data.license === void 0 && (missing0 = "license") || data.repository === void 0 && (missing0 = "repository") || data.bugs === void 0 && (missing0 = "bugs") || data.maintainers === void 0 && (missing0 = "maintainers") || data.runtime === void 0 && (missing0 = "runtime") || data.products === void 0 && (missing0 = "products") || data.keywords === void 0 && (missing0 = "keywords")) {
|
|
70
|
+
if (data.type === void 0 && (missing0 = "type") || data.id === void 0 && (missing0 = "id") || data.name === void 0 && (missing0 = "name") || data.shortname === void 0 && (missing0 = "shortname") || data.description === void 0 && (missing0 = "description") || data.version === void 0 && (missing0 = "version") || data.license === void 0 && (missing0 = "license") || data.repository === void 0 && (missing0 = "repository") || data.bugs === void 0 && (missing0 = "bugs") || data.maintainers === void 0 && (missing0 = "maintainers") || data.runtime === void 0 && (missing0 = "runtime") || data.products === void 0 && (missing0 = "products") || data.keywords === void 0 && (missing0 = "keywords") || data.usbIds === void 0 && (missing0 = "usbIds")) {
|
|
71
71
|
validate20.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
72
72
|
return false;
|
|
73
73
|
} else {
|
|
@@ -466,6 +466,148 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
466
466
|
} else {
|
|
467
467
|
var valid0 = true;
|
|
468
468
|
}
|
|
469
|
+
if (valid0) {
|
|
470
|
+
if (data.usbIds !== void 0) {
|
|
471
|
+
let data25 = data.usbIds;
|
|
472
|
+
const _errs52 = errors;
|
|
473
|
+
if (errors === _errs52) {
|
|
474
|
+
if (Array.isArray(data25)) {
|
|
475
|
+
var valid9 = true;
|
|
476
|
+
const len3 = data25.length;
|
|
477
|
+
for (let i6 = 0; i6 < len3; i6++) {
|
|
478
|
+
let data26 = data25[i6];
|
|
479
|
+
const _errs54 = errors;
|
|
480
|
+
if (errors === _errs54) {
|
|
481
|
+
if (data26 && typeof data26 == "object" && !Array.isArray(data26)) {
|
|
482
|
+
let missing3;
|
|
483
|
+
if (data26.vendorId === void 0 && (missing3 = "vendorId") || data26.productIds === void 0 && (missing3 = "productIds")) {
|
|
484
|
+
validate20.errors = [{ instancePath: instancePath + "/usbIds/" + i6, schemaPath: "#/properties/usbIds/items/required", keyword: "required", params: { missingProperty: missing3 }, message: "must have required property '" + missing3 + "'" }];
|
|
485
|
+
return false;
|
|
486
|
+
} else {
|
|
487
|
+
const _errs56 = errors;
|
|
488
|
+
for (const key1 in data26) {
|
|
489
|
+
if (!(key1 === "vendorId" || key1 === "productIds")) {
|
|
490
|
+
validate20.errors = [{ instancePath: instancePath + "/usbIds/" + i6, schemaPath: "#/properties/usbIds/items/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" }];
|
|
491
|
+
return false;
|
|
492
|
+
break;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
if (_errs56 === errors) {
|
|
496
|
+
if (data26.vendorId !== void 0) {
|
|
497
|
+
let data27 = data26.vendorId;
|
|
498
|
+
const _errs57 = errors;
|
|
499
|
+
if (!(typeof data27 == "number" && (!(data27 % 1) && !isNaN(data27)) && isFinite(data27))) {
|
|
500
|
+
validate20.errors = [{ instancePath: instancePath + "/usbIds/" + i6 + "/vendorId", schemaPath: "#/properties/usbIds/items/properties/vendorId/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
|
501
|
+
return false;
|
|
502
|
+
}
|
|
503
|
+
var valid10 = _errs57 === errors;
|
|
504
|
+
} else {
|
|
505
|
+
var valid10 = true;
|
|
506
|
+
}
|
|
507
|
+
if (valid10) {
|
|
508
|
+
if (data26.productIds !== void 0) {
|
|
509
|
+
let data28 = data26.productIds;
|
|
510
|
+
const _errs59 = errors;
|
|
511
|
+
if (errors === _errs59) {
|
|
512
|
+
if (Array.isArray(data28)) {
|
|
513
|
+
if (data28.length < 1) {
|
|
514
|
+
validate20.errors = [{ instancePath: instancePath + "/usbIds/" + i6 + "/productIds", schemaPath: "#/properties/usbIds/items/properties/productIds/minItems", keyword: "minItems", params: { limit: 1 }, message: "must NOT have fewer than 1 items" }];
|
|
515
|
+
return false;
|
|
516
|
+
} else {
|
|
517
|
+
var valid11 = true;
|
|
518
|
+
const len4 = data28.length;
|
|
519
|
+
for (let i7 = 0; i7 < len4; i7++) {
|
|
520
|
+
let data29 = data28[i7];
|
|
521
|
+
const _errs61 = errors;
|
|
522
|
+
if (!(typeof data29 == "number" && (!(data29 % 1) && !isNaN(data29)) && isFinite(data29))) {
|
|
523
|
+
validate20.errors = [{ instancePath: instancePath + "/usbIds/" + i6 + "/productIds/" + i7, schemaPath: "#/properties/usbIds/items/properties/productIds/items/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
|
|
524
|
+
return false;
|
|
525
|
+
}
|
|
526
|
+
var valid11 = _errs61 === errors;
|
|
527
|
+
if (!valid11) {
|
|
528
|
+
break;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
if (valid11) {
|
|
532
|
+
let i8 = data28.length;
|
|
533
|
+
let j3;
|
|
534
|
+
if (i8 > 1) {
|
|
535
|
+
const indices2 = {};
|
|
536
|
+
for (; i8--; ) {
|
|
537
|
+
let item2 = data28[i8];
|
|
538
|
+
if (!(typeof item2 == "number" && (!(item2 % 1) && !isNaN(item2)) && isFinite(item2))) {
|
|
539
|
+
continue;
|
|
540
|
+
}
|
|
541
|
+
if (typeof indices2[item2] == "number") {
|
|
542
|
+
j3 = indices2[item2];
|
|
543
|
+
validate20.errors = [{ instancePath: instancePath + "/usbIds/" + i6 + "/productIds", schemaPath: "#/properties/usbIds/items/properties/productIds/uniqueItems", keyword: "uniqueItems", params: { i: i8, j: j3 }, message: "must NOT have duplicate items (items ## " + j3 + " and " + i8 + " are identical)" }];
|
|
544
|
+
return false;
|
|
545
|
+
break;
|
|
546
|
+
}
|
|
547
|
+
indices2[item2] = i8;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
} else {
|
|
553
|
+
validate20.errors = [{ instancePath: instancePath + "/usbIds/" + i6 + "/productIds", schemaPath: "#/properties/usbIds/items/properties/productIds/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
|
|
554
|
+
return false;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
var valid10 = _errs59 === errors;
|
|
558
|
+
} else {
|
|
559
|
+
var valid10 = true;
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
} else {
|
|
565
|
+
validate20.errors = [{ instancePath: instancePath + "/usbIds/" + i6, schemaPath: "#/properties/usbIds/items/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
566
|
+
return false;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
var valid9 = _errs54 === errors;
|
|
570
|
+
if (!valid9) {
|
|
571
|
+
break;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
if (valid9) {
|
|
575
|
+
let i9 = data25.length;
|
|
576
|
+
let j4;
|
|
577
|
+
if (i9 > 1) {
|
|
578
|
+
outer1: for (; i9--; ) {
|
|
579
|
+
for (j4 = i9; j4--; ) {
|
|
580
|
+
if (func0(data25[i9], data25[j4])) {
|
|
581
|
+
validate20.errors = [{ instancePath: instancePath + "/usbIds", schemaPath: "#/properties/usbIds/uniqueItems", keyword: "uniqueItems", params: { i: i9, j: j4 }, message: "must NOT have duplicate items (items ## " + j4 + " and " + i9 + " are identical)" }];
|
|
582
|
+
return false;
|
|
583
|
+
break outer1;
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
} else {
|
|
590
|
+
validate20.errors = [{ instancePath: instancePath + "/usbIds", schemaPath: "#/properties/usbIds/type", keyword: "type", params: { type: "array" }, message: "must be array" }];
|
|
591
|
+
return false;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
var valid0 = _errs52 === errors;
|
|
595
|
+
} else {
|
|
596
|
+
var valid0 = true;
|
|
597
|
+
}
|
|
598
|
+
if (valid0) {
|
|
599
|
+
if (data.allowMultipleInstances !== void 0) {
|
|
600
|
+
const _errs63 = errors;
|
|
601
|
+
if (typeof data.allowMultipleInstances !== "boolean") {
|
|
602
|
+
validate20.errors = [{ instancePath: instancePath + "/allowMultipleInstances", schemaPath: "#/properties/allowMultipleInstances/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
|
|
603
|
+
return false;
|
|
604
|
+
}
|
|
605
|
+
var valid0 = _errs63 === errors;
|
|
606
|
+
} else {
|
|
607
|
+
var valid0 = true;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
469
611
|
}
|
|
470
612
|
}
|
|
471
613
|
}
|
|
@@ -489,7 +631,7 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
489
631
|
validate20.errors = vErrors;
|
|
490
632
|
return errors === 0;
|
|
491
633
|
}
|
|
492
|
-
validate20.evaluated = { "props": { "$schema": true, "type": true, "id": true, "name": true, "shortname": true, "description": true, "version": true, "isPrerelease": true, "license": true, "repository": true, "bugs": true, "maintainers": true, "runtime": true, "products": true, "keywords": true }, "dynamicProps": false, "dynamicItems": false };
|
|
634
|
+
validate20.evaluated = { "props": { "$schema": true, "type": true, "id": true, "name": true, "shortname": true, "description": true, "version": true, "isPrerelease": true, "license": true, "repository": true, "bugs": true, "maintainers": true, "runtime": true, "products": true, "keywords": true, "usbIds": true, "allowMultipleInstances": true }, "dynamicProps": false, "dynamicItems": false };
|
|
493
635
|
export {
|
|
494
636
|
validate_manifest_default as default,
|
|
495
637
|
validate
|