@companion-surface/base 0.4.1 → 0.5.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 +26 -1
- package/assets/surface-layout.schema.json +1 -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 +11 -0
- package/generated/surface-layout.d.ts +1 -1
- package/generated/validate_manifest.js +133 -3
- package/generated/validate_surface_layout.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [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)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add usbIds to manifest schema ([3ce6278](https://github.com/bitfocus/companion-surface-api/commit/3ce62785146e2bd363fdfdfd6f0be3e9d9f5af59))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* force host bump ([10ef9bc](https://github.com/bitfocus/companion-surface-api/commit/10ef9bc33b5c7a4fba8424eca23139b5b1f66eca))
|
|
14
|
+
* missing manifest type exports ([b593404](https://github.com/bitfocus/companion-surface-api/commit/b5934044c3a482793e389406009b6df92daae864))
|
|
15
|
+
|
|
16
|
+
## [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)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* restore rgb mode, it was valid ([d694b5f](https://github.com/bitfocus/companion-surface-api/commit/d694b5fa6c73d05316d83cd0e140e806ec95e528))
|
|
22
|
+
|
|
3
23
|
## [0.4.1](https://github.com/bitfocus/companion-surface-api/compare/companion-surface-base-v0.4.0...companion-surface-base-v0.4.1) (2025-11-01)
|
|
4
24
|
|
|
5
25
|
|
|
@@ -106,6 +106,30 @@
|
|
|
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
|
+
}
|
|
109
133
|
}
|
|
110
134
|
},
|
|
111
135
|
"required": [
|
|
@@ -121,6 +145,7 @@
|
|
|
121
145
|
"maintainers",
|
|
122
146
|
"runtime",
|
|
123
147
|
"products",
|
|
124
|
-
"keywords"
|
|
148
|
+
"keywords",
|
|
149
|
+
"usbIds"
|
|
125
150
|
]
|
|
126
151
|
}
|
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;IAEtB;;;;OAIG;IACH,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAErE,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,IAAI,CAAA;IAEhD,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"}
|
|
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;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,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,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC,OAAO,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;CACzB;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAC9B,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAE9B,MAAM,WAAW,oBAAoB;IACpC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,OAAO,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;CACpB;AACD,MAAM,WAAW,qBAAqB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,QAAQ,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,CAAC,EAAE,MAAM,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,UAAU,EAAE,OAAO,CAAA;IACnB;;OAEG;IACH,aAAa,EAAE,6BAA6B,CAAA;IAC5C;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,oBAAoB,GAAG,qBAAqB,CAAC,CAAA;IACvE;;;OAGG;IACH,UAAU,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAEpC;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAEvB;;OAEG;IACH,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,10 @@ 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[];
|
|
57
61
|
}
|
|
58
62
|
export interface SurfaceModuleManifestMaintainer {
|
|
59
63
|
name: string;
|
|
@@ -78,3 +82,10 @@ export interface SurfaceModuleManifestRuntime {
|
|
|
78
82
|
*/
|
|
79
83
|
entrypoint: string;
|
|
80
84
|
}
|
|
85
|
+
export interface SurfaceModuleManifestUsbIds {
|
|
86
|
+
vendorId: number;
|
|
87
|
+
/**
|
|
88
|
+
* @minItems 1
|
|
89
|
+
*/
|
|
90
|
+
productIds: [number, ...number[]];
|
|
91
|
+
}
|
|
@@ -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 } } }, "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,136 @@ 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
|
+
}
|
|
469
599
|
}
|
|
470
600
|
}
|
|
471
601
|
}
|
|
@@ -489,7 +619,7 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
489
619
|
validate20.errors = vErrors;
|
|
490
620
|
return errors === 0;
|
|
491
621
|
}
|
|
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 };
|
|
622
|
+
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 }, "dynamicProps": false, "dynamicItems": false };
|
|
493
623
|
export {
|
|
494
624
|
validate_manifest_default as default,
|
|
495
625
|
validate
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";export const validate = validate20;export default validate20;const schema31 = {"$schema":"https://json-schema.org/draft/2020-12/schema","title":"SurfaceSchemaLayoutDefinition","description":"Schema describing a surface layout: default styling and a map of controls with positions and optional style overrides.","type":"object","$defs":{"size":{"title":"SurfaceSchemaBitmapConfig","description":"Bitmap content dimensions and format.","type":"object","properties":{"w":{"description":"Width in pixels (non-negative).","type":"number","minimum":0},"h":{"description":"Height in pixels (non-negative).","type":"number","minimum":0},"format":{"description":"Buffer pixel format","type":"string","title":"SurfaceSchemaPixelFormat","enum":["rgb","rgba","bgr","bgra"],"default":"rgb"}},"required":["w","h"],"additionalProperties":false},"stylePreset":{"title":"SurfaceSchemaControlStylePreset","description":"Styling options that can be applied to controls. Can be used as the default style or as per-control overrides.","type":"object","properties":{"bitmap":{"description":"If set, bitmaps of the specified size will be reported.","$ref":"#/$defs/size"},"text":{"description":"If true, the control requests text to be reported.","type":"boolean"},"textStyle":{"description":"If true, the control requests text style properties to be reported","type":"boolean"},"colors":{"description":"If set, the control requests colours to be reported.","type":"string","enum":["hex"]}},"additionalProperties":false}},"properties":{"stylePresets":{"description":"Named collection of style presets. The preset named `default` is required and is used as the fallback style for controls when no `stylePreset` is specified.","type":"object","properties":{"default":{"$ref":"#/$defs/stylePreset"}},"patternProperties":{"^.+$":{"$ref":"#/$defs/stylePreset"}},"required":["default"],"additionalProperties":false},"controls":{"type":"object","patternProperties":{"^[a-zA-Z0-9\\-\\/]+$":{"title":"SurfaceSchemaControlDefinition","description":"Single control definition. The id must be unique and may be user facing in logs. Typically the id would be in the form of 1/0, matching the row/column of the control.","type":"object","properties":{"row":{"description":"Zero-based row index for layout placement.","type":"number","minimum":0},"column":{"description":"Zero-based column index for layout placement.","type":"number","minimum":0},"stylePreset":{"description":"Optional name of a style preset defined in `stylePresets`. If present, the control will use the named preset instead of the default style.","type":"string","pattern":"^.+$"}},"required":["row","column"],"additionalProperties":false}},"additionalProperties":false}},"required":["stylePresets","controls"],"additionalProperties":false};const pattern4 = new RegExp("^.+$", "u");const pattern6 = new RegExp("^[a-zA-Z0-9\\-\\/]+$", "u");const schema32 = {"title":"SurfaceSchemaControlStylePreset","description":"Styling options that can be applied to controls. Can be used as the default style or as per-control overrides.","type":"object","properties":{"bitmap":{"description":"If set, bitmaps of the specified size will be reported.","$ref":"#/$defs/size"},"text":{"description":"If true, the control requests text to be reported.","type":"boolean"},"textStyle":{"description":"If true, the control requests text style properties to be reported","type":"boolean"},"colors":{"description":"If set, the control requests colours to be reported.","type":"string","enum":["hex"]}},"additionalProperties":false};const schema33 = {"title":"SurfaceSchemaBitmapConfig","description":"Bitmap content dimensions and format.","type":"object","properties":{"w":{"description":"Width in pixels (non-negative).","type":"number","minimum":0},"h":{"description":"Height in pixels (non-negative).","type":"number","minimum":0},"format":{"description":"Buffer pixel format","type":"string","title":"SurfaceSchemaPixelFormat","enum":["rgb","rgba","bgr","bgra"],"default":"rgb"}},"required":["w","h"],"additionalProperties":false};function validate21(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate21.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){const _errs1 = errors;for(const key0 in data){if(!((((key0 === "bitmap") || (key0 === "text")) || (key0 === "textStyle")) || (key0 === "colors"))){validate21.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.bitmap !== undefined){let data0 = data.bitmap;const _errs2 = errors;const _errs3 = errors;if(errors === _errs3){if(data0 && typeof data0 == "object" && !Array.isArray(data0)){let missing0;if(((data0.w === undefined) && (missing0 = "w")) || ((data0.h === undefined) && (missing0 = "h"))){validate21.errors = [{instancePath:instancePath+"/bitmap",schemaPath:"#/$defs/size/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const _errs5 = errors;for(const key1 in data0){if(!(((key1 === "w") || (key1 === "h")) || (key1 === "format"))){validate21.errors = [{instancePath:instancePath+"/bitmap",schemaPath:"#/$defs/size/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs5 === errors){if(data0.w !== undefined){let data1 = data0.w;const _errs6 = errors;if(errors === _errs6){if((typeof data1 == "number") && (isFinite(data1))){if(data1 < 0 || isNaN(data1)){validate21.errors = [{instancePath:instancePath+"/bitmap/w",schemaPath:"#/$defs/size/properties/w/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}else {validate21.errors = [{instancePath:instancePath+"/bitmap/w",schemaPath:"#/$defs/size/properties/w/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}}var valid2 = _errs6 === errors;}else {var valid2 = true;}if(valid2){if(data0.h !== undefined){let data2 = data0.h;const _errs8 = errors;if(errors === _errs8){if((typeof data2 == "number") && (isFinite(data2))){if(data2 < 0 || isNaN(data2)){validate21.errors = [{instancePath:instancePath+"/bitmap/h",schemaPath:"#/$defs/size/properties/h/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}else {validate21.errors = [{instancePath:instancePath+"/bitmap/h",schemaPath:"#/$defs/size/properties/h/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}}var valid2 = _errs8 === errors;}else {var valid2 = true;}if(valid2){if(data0.format !== undefined){let data3 = data0.format;const _errs10 = errors;if(typeof data3 !== "string"){validate21.errors = [{instancePath:instancePath+"/bitmap/format",schemaPath:"#/$defs/size/properties/format/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!((((data3 === "rgb") || (data3 === "rgba")) || (data3 === "bgr")) || (data3 === "bgra"))){validate21.errors = [{instancePath:instancePath+"/bitmap/format",schemaPath:"#/$defs/size/properties/format/enum",keyword:"enum",params:{allowedValues: schema33.properties.format.enum},message:"must be equal to one of the allowed values"}];return false;}var valid2 = _errs10 === errors;}else {var valid2 = true;}}}}}}else {validate21.errors = [{instancePath:instancePath+"/bitmap",schemaPath:"#/$defs/size/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.text !== undefined){const _errs12 = errors;if(typeof data.text !== "boolean"){validate21.errors = [{instancePath:instancePath+"/text",schemaPath:"#/properties/text/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs12 === errors;}else {var valid0 = true;}if(valid0){if(data.textStyle !== undefined){const _errs14 = errors;if(typeof data.textStyle !== "boolean"){validate21.errors = [{instancePath:instancePath+"/textStyle",schemaPath:"#/properties/textStyle/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs14 === errors;}else {var valid0 = true;}if(valid0){if(data.colors !== undefined){let data6 = data.colors;const _errs16 = errors;if(typeof data6 !== "string"){validate21.errors = [{instancePath:instancePath+"/colors",schemaPath:"#/properties/colors/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(data6 === "hex")){validate21.errors = [{instancePath:instancePath+"/colors",schemaPath:"#/properties/colors/enum",keyword:"enum",params:{allowedValues: schema32.properties.colors.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs16 === errors;}else {var valid0 = true;}}}}}}else {validate21.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate21.errors = vErrors;return errors === 0;}validate21.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate20.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((data.stylePresets === undefined) && (missing0 = "stylePresets")) || ((data.controls === undefined) && (missing0 = "controls"))){validate20.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const _errs1 = errors;for(const key0 in data){if(!((key0 === "stylePresets") || (key0 === "controls"))){validate20.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.stylePresets !== undefined){let data0 = data.stylePresets;const _errs2 = errors;if(errors === _errs2){if(data0 && typeof data0 == "object" && !Array.isArray(data0)){let missing1;if((data0.default === undefined) && (missing1 = "default")){validate20.errors = [{instancePath:instancePath+"/stylePresets",schemaPath:"#/properties/stylePresets/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {const _errs4 = errors;for(const key1 in data0){if(!((key1 === "default") || (pattern4.test(key1)))){validate20.errors = [{instancePath:instancePath+"/stylePresets",schemaPath:"#/properties/stylePresets/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs4 === errors){if(data0.default !== undefined){const _errs5 = errors;if(!(validate21(data0.default, {instancePath:instancePath+"/stylePresets/default",parentData:data0,parentDataProperty:"default",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);errors = vErrors.length;}var valid1 = _errs5 === errors;}else {var valid1 = true;}if(valid1){var valid2 = true;for(const key2 in data0){if(pattern4.test(key2)){const _errs6 = errors;if(!(validate21(data0[key2], {instancePath:instancePath+"/stylePresets/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),parentData:data0,parentDataProperty:key2,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);errors = vErrors.length;}var valid2 = _errs6 === errors;if(!valid2){break;}}}}}}}else {validate20.errors = [{instancePath:instancePath+"/stylePresets",schemaPath:"#/properties/stylePresets/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.controls !== undefined){let data3 = data.controls;const _errs7 = errors;if(errors === _errs7){if(data3 && typeof data3 == "object" && !Array.isArray(data3)){const _errs9 = errors;for(const key3 in data3){if(!(pattern6.test(key3))){validate20.errors = [{instancePath:instancePath+"/controls",schemaPath:"#/properties/controls/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"}];return false;break;}}if(_errs9 === errors){var valid3 = true;for(const key4 in data3){if(pattern6.test(key4)){let data4 = data3[key4];const _errs10 = errors;if(errors === _errs10){if(data4 && typeof data4 == "object" && !Array.isArray(data4)){let missing2;if(((data4.row === undefined) && (missing2 = "row")) || ((data4.column === undefined) && (missing2 = "column"))){validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/required",keyword:"required",params:{missingProperty: missing2},message:"must have required property '"+missing2+"'"}];return false;}else {const _errs12 = errors;for(const key5 in data4){if(!(((key5 === "row") || (key5 === "column")) || (key5 === "stylePreset"))){validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"}];return false;break;}}if(_errs12 === errors){if(data4.row !== undefined){let data5 = data4.row;const _errs13 = errors;if(errors === _errs13){if((typeof data5 == "number") && (isFinite(data5))){if(data5 < 0 || isNaN(data5)){validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1")+"/row",schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/properties/row/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}else {validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1")+"/row",schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/properties/row/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}}var valid4 = _errs13 === errors;}else {var valid4 = true;}if(valid4){if(data4.column !== undefined){let data6 = data4.column;const _errs15 = errors;if(errors === _errs15){if((typeof data6 == "number") && (isFinite(data6))){if(data6 < 0 || isNaN(data6)){validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1")+"/column",schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/properties/column/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}else {validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1")+"/column",schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/properties/column/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}}var valid4 = _errs15 === errors;}else {var valid4 = true;}if(valid4){if(data4.stylePreset !== undefined){let data7 = data4.stylePreset;const _errs17 = errors;if(errors === _errs17){if(typeof data7 === "string"){if(!pattern4.test(data7)){validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1")+"/stylePreset",schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/properties/stylePreset/pattern",keyword:"pattern",params:{pattern: "^.+$"},message:"must match pattern \""+"^.+$"+"\""}];return false;}}else {validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1")+"/stylePreset",schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/properties/stylePreset/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid4 = _errs17 === errors;}else {var valid4 = true;}}}}}}else {validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid3 = _errs10 === errors;if(!valid3){break;}}}}}else {validate20.errors = [{instancePath:instancePath+"/controls",schemaPath:"#/properties/controls/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs7 === errors;}else {var valid0 = true;}}}}}else {validate20.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};
|
|
1
|
+
"use strict";export const validate = validate20;export default validate20;const schema31 = {"$schema":"https://json-schema.org/draft/2020-12/schema","title":"SurfaceSchemaLayoutDefinition","description":"Schema describing a surface layout: default styling and a map of controls with positions and optional style overrides.","type":"object","$defs":{"size":{"title":"SurfaceSchemaBitmapConfig","description":"Bitmap content dimensions and format.","type":"object","properties":{"w":{"description":"Width in pixels (non-negative).","type":"number","minimum":0},"h":{"description":"Height in pixels (non-negative).","type":"number","minimum":0},"format":{"description":"Buffer pixel format","type":"string","title":"SurfaceSchemaPixelFormat","enum":["rgb","rgba","bgr","bgra"],"default":"rgb"}},"required":["w","h"],"additionalProperties":false},"stylePreset":{"title":"SurfaceSchemaControlStylePreset","description":"Styling options that can be applied to controls. Can be used as the default style or as per-control overrides.","type":"object","properties":{"bitmap":{"description":"If set, bitmaps of the specified size will be reported.","$ref":"#/$defs/size"},"text":{"description":"If true, the control requests text to be reported.","type":"boolean"},"textStyle":{"description":"If true, the control requests text style properties to be reported","type":"boolean"},"colors":{"description":"If set, the control requests colours to be reported.","type":"string","enum":["hex","rgb"]}},"additionalProperties":false}},"properties":{"stylePresets":{"description":"Named collection of style presets. The preset named `default` is required and is used as the fallback style for controls when no `stylePreset` is specified.","type":"object","properties":{"default":{"$ref":"#/$defs/stylePreset"}},"patternProperties":{"^.+$":{"$ref":"#/$defs/stylePreset"}},"required":["default"],"additionalProperties":false},"controls":{"type":"object","patternProperties":{"^[a-zA-Z0-9\\-\\/]+$":{"title":"SurfaceSchemaControlDefinition","description":"Single control definition. The id must be unique and may be user facing in logs. Typically the id would be in the form of 1/0, matching the row/column of the control.","type":"object","properties":{"row":{"description":"Zero-based row index for layout placement.","type":"number","minimum":0},"column":{"description":"Zero-based column index for layout placement.","type":"number","minimum":0},"stylePreset":{"description":"Optional name of a style preset defined in `stylePresets`. If present, the control will use the named preset instead of the default style.","type":"string","pattern":"^.+$"}},"required":["row","column"],"additionalProperties":false}},"additionalProperties":false}},"required":["stylePresets","controls"],"additionalProperties":false};const pattern4 = new RegExp("^.+$", "u");const pattern6 = new RegExp("^[a-zA-Z0-9\\-\\/]+$", "u");const schema32 = {"title":"SurfaceSchemaControlStylePreset","description":"Styling options that can be applied to controls. Can be used as the default style or as per-control overrides.","type":"object","properties":{"bitmap":{"description":"If set, bitmaps of the specified size will be reported.","$ref":"#/$defs/size"},"text":{"description":"If true, the control requests text to be reported.","type":"boolean"},"textStyle":{"description":"If true, the control requests text style properties to be reported","type":"boolean"},"colors":{"description":"If set, the control requests colours to be reported.","type":"string","enum":["hex","rgb"]}},"additionalProperties":false};const schema33 = {"title":"SurfaceSchemaBitmapConfig","description":"Bitmap content dimensions and format.","type":"object","properties":{"w":{"description":"Width in pixels (non-negative).","type":"number","minimum":0},"h":{"description":"Height in pixels (non-negative).","type":"number","minimum":0},"format":{"description":"Buffer pixel format","type":"string","title":"SurfaceSchemaPixelFormat","enum":["rgb","rgba","bgr","bgra"],"default":"rgb"}},"required":["w","h"],"additionalProperties":false};function validate21(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate21.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){const _errs1 = errors;for(const key0 in data){if(!((((key0 === "bitmap") || (key0 === "text")) || (key0 === "textStyle")) || (key0 === "colors"))){validate21.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.bitmap !== undefined){let data0 = data.bitmap;const _errs2 = errors;const _errs3 = errors;if(errors === _errs3){if(data0 && typeof data0 == "object" && !Array.isArray(data0)){let missing0;if(((data0.w === undefined) && (missing0 = "w")) || ((data0.h === undefined) && (missing0 = "h"))){validate21.errors = [{instancePath:instancePath+"/bitmap",schemaPath:"#/$defs/size/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const _errs5 = errors;for(const key1 in data0){if(!(((key1 === "w") || (key1 === "h")) || (key1 === "format"))){validate21.errors = [{instancePath:instancePath+"/bitmap",schemaPath:"#/$defs/size/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs5 === errors){if(data0.w !== undefined){let data1 = data0.w;const _errs6 = errors;if(errors === _errs6){if((typeof data1 == "number") && (isFinite(data1))){if(data1 < 0 || isNaN(data1)){validate21.errors = [{instancePath:instancePath+"/bitmap/w",schemaPath:"#/$defs/size/properties/w/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}else {validate21.errors = [{instancePath:instancePath+"/bitmap/w",schemaPath:"#/$defs/size/properties/w/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}}var valid2 = _errs6 === errors;}else {var valid2 = true;}if(valid2){if(data0.h !== undefined){let data2 = data0.h;const _errs8 = errors;if(errors === _errs8){if((typeof data2 == "number") && (isFinite(data2))){if(data2 < 0 || isNaN(data2)){validate21.errors = [{instancePath:instancePath+"/bitmap/h",schemaPath:"#/$defs/size/properties/h/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}else {validate21.errors = [{instancePath:instancePath+"/bitmap/h",schemaPath:"#/$defs/size/properties/h/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}}var valid2 = _errs8 === errors;}else {var valid2 = true;}if(valid2){if(data0.format !== undefined){let data3 = data0.format;const _errs10 = errors;if(typeof data3 !== "string"){validate21.errors = [{instancePath:instancePath+"/bitmap/format",schemaPath:"#/$defs/size/properties/format/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!((((data3 === "rgb") || (data3 === "rgba")) || (data3 === "bgr")) || (data3 === "bgra"))){validate21.errors = [{instancePath:instancePath+"/bitmap/format",schemaPath:"#/$defs/size/properties/format/enum",keyword:"enum",params:{allowedValues: schema33.properties.format.enum},message:"must be equal to one of the allowed values"}];return false;}var valid2 = _errs10 === errors;}else {var valid2 = true;}}}}}}else {validate21.errors = [{instancePath:instancePath+"/bitmap",schemaPath:"#/$defs/size/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.text !== undefined){const _errs12 = errors;if(typeof data.text !== "boolean"){validate21.errors = [{instancePath:instancePath+"/text",schemaPath:"#/properties/text/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs12 === errors;}else {var valid0 = true;}if(valid0){if(data.textStyle !== undefined){const _errs14 = errors;if(typeof data.textStyle !== "boolean"){validate21.errors = [{instancePath:instancePath+"/textStyle",schemaPath:"#/properties/textStyle/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];return false;}var valid0 = _errs14 === errors;}else {var valid0 = true;}if(valid0){if(data.colors !== undefined){let data6 = data.colors;const _errs16 = errors;if(typeof data6 !== "string"){validate21.errors = [{instancePath:instancePath+"/colors",schemaPath:"#/properties/colors/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!((data6 === "hex") || (data6 === "rgb"))){validate21.errors = [{instancePath:instancePath+"/colors",schemaPath:"#/properties/colors/enum",keyword:"enum",params:{allowedValues: schema32.properties.colors.enum},message:"must be equal to one of the allowed values"}];return false;}var valid0 = _errs16 === errors;}else {var valid0 = true;}}}}}}else {validate21.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate21.errors = vErrors;return errors === 0;}validate21.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate20.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((data.stylePresets === undefined) && (missing0 = "stylePresets")) || ((data.controls === undefined) && (missing0 = "controls"))){validate20.errors = [{instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: missing0},message:"must have required property '"+missing0+"'"}];return false;}else {const _errs1 = errors;for(const key0 in data){if(!((key0 === "stylePresets") || (key0 === "controls"))){validate20.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.stylePresets !== undefined){let data0 = data.stylePresets;const _errs2 = errors;if(errors === _errs2){if(data0 && typeof data0 == "object" && !Array.isArray(data0)){let missing1;if((data0.default === undefined) && (missing1 = "default")){validate20.errors = [{instancePath:instancePath+"/stylePresets",schemaPath:"#/properties/stylePresets/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {const _errs4 = errors;for(const key1 in data0){if(!((key1 === "default") || (pattern4.test(key1)))){validate20.errors = [{instancePath:instancePath+"/stylePresets",schemaPath:"#/properties/stylePresets/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs4 === errors){if(data0.default !== undefined){const _errs5 = errors;if(!(validate21(data0.default, {instancePath:instancePath+"/stylePresets/default",parentData:data0,parentDataProperty:"default",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);errors = vErrors.length;}var valid1 = _errs5 === errors;}else {var valid1 = true;}if(valid1){var valid2 = true;for(const key2 in data0){if(pattern4.test(key2)){const _errs6 = errors;if(!(validate21(data0[key2], {instancePath:instancePath+"/stylePresets/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),parentData:data0,parentDataProperty:key2,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate21.errors : vErrors.concat(validate21.errors);errors = vErrors.length;}var valid2 = _errs6 === errors;if(!valid2){break;}}}}}}}else {validate20.errors = [{instancePath:instancePath+"/stylePresets",schemaPath:"#/properties/stylePresets/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.controls !== undefined){let data3 = data.controls;const _errs7 = errors;if(errors === _errs7){if(data3 && typeof data3 == "object" && !Array.isArray(data3)){const _errs9 = errors;for(const key3 in data3){if(!(pattern6.test(key3))){validate20.errors = [{instancePath:instancePath+"/controls",schemaPath:"#/properties/controls/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"}];return false;break;}}if(_errs9 === errors){var valid3 = true;for(const key4 in data3){if(pattern6.test(key4)){let data4 = data3[key4];const _errs10 = errors;if(errors === _errs10){if(data4 && typeof data4 == "object" && !Array.isArray(data4)){let missing2;if(((data4.row === undefined) && (missing2 = "row")) || ((data4.column === undefined) && (missing2 = "column"))){validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/required",keyword:"required",params:{missingProperty: missing2},message:"must have required property '"+missing2+"'"}];return false;}else {const _errs12 = errors;for(const key5 in data4){if(!(((key5 === "row") || (key5 === "column")) || (key5 === "stylePreset"))){validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key5},message:"must NOT have additional properties"}];return false;break;}}if(_errs12 === errors){if(data4.row !== undefined){let data5 = data4.row;const _errs13 = errors;if(errors === _errs13){if((typeof data5 == "number") && (isFinite(data5))){if(data5 < 0 || isNaN(data5)){validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1")+"/row",schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/properties/row/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}else {validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1")+"/row",schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/properties/row/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}}var valid4 = _errs13 === errors;}else {var valid4 = true;}if(valid4){if(data4.column !== undefined){let data6 = data4.column;const _errs15 = errors;if(errors === _errs15){if((typeof data6 == "number") && (isFinite(data6))){if(data6 < 0 || isNaN(data6)){validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1")+"/column",schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/properties/column/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"}];return false;}}else {validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1")+"/column",schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/properties/column/type",keyword:"type",params:{type: "number"},message:"must be number"}];return false;}}var valid4 = _errs15 === errors;}else {var valid4 = true;}if(valid4){if(data4.stylePreset !== undefined){let data7 = data4.stylePreset;const _errs17 = errors;if(errors === _errs17){if(typeof data7 === "string"){if(!pattern4.test(data7)){validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1")+"/stylePreset",schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/properties/stylePreset/pattern",keyword:"pattern",params:{pattern: "^.+$"},message:"must match pattern \""+"^.+$"+"\""}];return false;}}else {validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1")+"/stylePreset",schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/properties/stylePreset/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}}var valid4 = _errs17 === errors;}else {var valid4 = true;}}}}}}else {validate20.errors = [{instancePath:instancePath+"/controls/" + key4.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/controls/patternProperties/%5E%5Ba-zA-Z0-9%5C-%5C~1%5D%2B%24/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid3 = _errs10 === errors;if(!valid3){break;}}}}}else {validate20.errors = [{instancePath:instancePath+"/controls",schemaPath:"#/properties/controls/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs7 === errors;}else {var valid0 = true;}}}}}else {validate20.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}validate20.errors = vErrors;return errors === 0;}validate20.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};
|