@companion-module/base 1.10.0-0 → 1.10.0-node22

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.10.0](https://github.com/bitfocus/companion-module-base/compare/v1.9.0...v1.10.0) (2024-08-24)
4
+
5
+
6
+ ### Features
7
+
8
+ * add `AuthenticationFailure` status [#86](https://github.com/bitfocus/companion-module-base/issues/86) ([5e71bf9](https://github.com/bitfocus/companion-module-base/commit/5e71bf92471d4671dc98f95de9492f06f0f9b59c))
9
+ * support additional imageBuffer properties ([2c96af2](https://github.com/bitfocus/companion-module-base/commit/2c96af223e424f184b424fd8daa3acce30f3dbb0))
10
+ * support multiple bonjourQueries per query input field [#87](https://github.com/bitfocus/companion-module-base/issues/87) ([64772ae](https://github.com/bitfocus/companion-module-base/commit/64772aea51779430e5ffac2785b69480ac822b26))
11
+
3
12
  ## [1.9.0](https://github.com/bitfocus/companion-module-base/compare/v1.8.1...v1.9.0) (2024-07-28)
4
13
 
5
14
 
@@ -73,7 +73,8 @@
73
73
  "properties": {
74
74
  "type": {
75
75
  "type": "string",
76
- "description": "Type of the module. Must be: node18"
76
+ "description": "Type of the module. Must be: node18 or node22",
77
+ "enum": ["node18", "node22"]
77
78
  },
78
79
  "api": {
79
80
  "type": "string",
@@ -114,30 +115,17 @@
114
115
  "description": "If the device or software for your module supports bonjour announcements, Companion will offer an easy way to watch for these announcements.\nEach query you define must have a matching config field of type 'bonjour-device' with the same name",
115
116
  "patternProperties": {
116
117
  "": {
117
- "type": "object",
118
- "title": "ModuleBonjourQuery",
119
- "description": "",
120
- "properties": {
121
- "type": {
122
- "type": "string"
123
- },
124
- "protocol": {
125
- "type": "string",
126
- "enum": ["tcp", "udp"]
118
+ "oneOf": [
119
+ {
120
+ "$ref": "#/definitions/bonjourQuery"
127
121
  },
128
- "txt": {
129
- "type": "object",
130
- "description": "Match on any txt values returned in the query. This is useful to filter out devices of the same 'type' that are not supported",
131
- "patternProperties": {
132
- "": {
133
- "type": "string"
134
- }
135
- },
136
- "additionalProperties": false
122
+ {
123
+ "type": "array",
124
+ "items": {
125
+ "$ref": "#/definitions/bonjourQuery"
126
+ }
137
127
  }
138
- },
139
- "required": ["type", "protocol"],
140
- "additionalProperties": false
128
+ ]
141
129
  }
142
130
  },
143
131
  "additionalProperties": false
@@ -159,5 +147,33 @@
159
147
  "manufacturer",
160
148
  "products",
161
149
  "keywords"
162
- ]
150
+ ],
151
+ "definitions": {
152
+ "bonjourQuery": {
153
+ "type": "object",
154
+ "title": "ModuleBonjourQuery",
155
+ "description": "",
156
+ "properties": {
157
+ "type": {
158
+ "type": "string"
159
+ },
160
+ "protocol": {
161
+ "type": "string",
162
+ "enum": ["tcp", "udp"]
163
+ },
164
+ "txt": {
165
+ "type": "object",
166
+ "description": "Match on any txt values returned in the query. This is useful to filter out devices of the same 'type' that are not supported",
167
+ "patternProperties": {
168
+ "": {
169
+ "type": "string"
170
+ }
171
+ },
172
+ "additionalProperties": false
173
+ }
174
+ },
175
+ "required": ["type", "protocol"],
176
+ "additionalProperties": false
177
+ }
178
+ }
163
179
  }
@@ -9,7 +9,8 @@ export declare enum InstanceStatus {
9
9
  ConnectionFailure = "connection_failure",
10
10
  BadConfig = "bad_config",
11
11
  UnknownError = "unknown_error",
12
- UnknownWarning = "unknown_warning"
12
+ UnknownWarning = "unknown_warning",
13
+ AuthenticationFailure = "authentication_failure"
13
14
  }
14
15
  export type LogLevel = 'info' | 'warn' | 'error' | 'debug';
15
16
  export declare namespace Regex {
@@ -1 +1 @@
1
- {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/module-api/enums.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,cAAc;IACzB,EAAE,OAAO;IACT,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,iBAAiB,uBAAuB;IACxC,SAAS,eAAe;IACxB,YAAY,kBAAkB;IAC9B,cAAc,oBAAoB;CAClC;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAG1D,yBAAiB,KAAK,CAAC;IAEf,MAAM,EAAE,mGAAmG,CAAA;IAC3G,MAAM,QAAQ,iHAC0F,CAAA;IACxG,MAAM,OAAO,0BAA0B,CAAA;IACvC,MAAM,IAAI,4LACyK,CAAA;IACnL,MAAM,WAAW,+CAA+C,CAAA;IAChE,MAAM,OAAO,+BAA+B,CAAA;IAC5C,MAAM,KAAK,2BAA2B,CAAA;IACtC,MAAM,YAAY,gCAAgC,CAAA;IAClD,MAAM,YAAY,6BAA6B,CAAA;IAC/C,MAAM,MAAM,aAAa,CAAA;IACzB,MAAM,aAAa,kBAAkB,CAAA;IACrC,MAAM,SAAS,WAAW,CAAA;IAC1B,MAAM,QAAQ,uGACgF,CAAA;CACrG"}
1
+ {"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/module-api/enums.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,cAAc;IACzB,EAAE,OAAO;IACT,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,iBAAiB,uBAAuB;IACxC,SAAS,eAAe;IACxB,YAAY,kBAAkB;IAC9B,cAAc,oBAAoB;IAClC,qBAAqB,2BAA2B;CAChD;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAG1D,yBAAiB,KAAK,CAAC;IAEf,MAAM,EAAE,mGAAmG,CAAA;IAC3G,MAAM,QAAQ,iHAC0F,CAAA;IACxG,MAAM,OAAO,0BAA0B,CAAA;IACvC,MAAM,IAAI,4LACyK,CAAA;IACnL,MAAM,WAAW,+CAA+C,CAAA;IAChE,MAAM,OAAO,+BAA+B,CAAA;IAC5C,MAAM,KAAK,2BAA2B,CAAA;IACtC,MAAM,YAAY,gCAAgC,CAAA;IAClD,MAAM,YAAY,6BAA6B,CAAA;IAC/C,MAAM,MAAM,aAAa,CAAA;IACzB,MAAM,aAAa,kBAAkB,CAAA;IACrC,MAAM,SAAS,WAAW,CAAA;IAC1B,MAAM,QAAQ,uGACgF,CAAA;CACrG"}
@@ -14,6 +14,7 @@ var InstanceStatus;
14
14
  InstanceStatus["BadConfig"] = "bad_config";
15
15
  InstanceStatus["UnknownError"] = "unknown_error";
16
16
  InstanceStatus["UnknownWarning"] = "unknown_warning";
17
+ InstanceStatus["AuthenticationFailure"] = "authentication_failure";
17
18
  })(InstanceStatus || (exports.InstanceStatus = InstanceStatus = {}));
18
19
  // eslint-disable-next-line @typescript-eslint/no-namespace
19
20
  var Regex;
@@ -1 +1 @@
1
- {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/module-api/enums.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,cAQX;AARD,WAAY,cAAc;IACzB,2BAAS,CAAA;IACT,2CAAyB,CAAA;IACzB,+CAA6B,CAAA;IAC7B,0DAAwC,CAAA;IACxC,0CAAwB,CAAA;IACxB,gDAA8B,CAAA;IAC9B,oDAAkC,CAAA;AACnC,CAAC,EARW,cAAc,8BAAd,cAAc,QAQzB;AAID,2DAA2D;AAC3D,IAAiB,KAAK,CAkBrB;AAlBD,WAAiB,KAAK;IACrB,kCAAkC;IACrB,QAAE,GAAG,gGAAgG,CAAA;IACrG,cAAQ,GACpB,8GAA8G,CAAA;IAClG,aAAO,GAAG,uBAAuB,CAAA;IACjC,UAAI,GAChB,yLAAyL,CAAA;IAC7K,iBAAW,GAAG,4CAA4C,CAAA;IAC1D,aAAO,GAAG,4BAA4B,CAAA;IACtC,WAAK,GAAG,wBAAwB,CAAA;IAChC,kBAAY,GAAG,6BAA6B,CAAA;IAC5C,kBAAY,GAAG,0BAA0B,CAAA;IACzC,YAAM,GAAG,UAAU,CAAA;IACnB,mBAAa,GAAG,eAAe,CAAA;IAC/B,eAAS,GAAG,QAAQ,CAAA;IACpB,cAAQ,GACpB,oGAAoG,CAAA;AACtG,CAAC,EAlBgB,KAAK,qBAAL,KAAK,QAkBrB"}
1
+ {"version":3,"file":"enums.js","sourceRoot":"","sources":["../../src/module-api/enums.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,IAAY,cASX;AATD,WAAY,cAAc;IACzB,2BAAS,CAAA;IACT,2CAAyB,CAAA;IACzB,+CAA6B,CAAA;IAC7B,0DAAwC,CAAA;IACxC,0CAAwB,CAAA;IACxB,gDAA8B,CAAA;IAC9B,oDAAkC,CAAA;IAClC,kEAAgD,CAAA;AACjD,CAAC,EATW,cAAc,8BAAd,cAAc,QASzB;AAID,2DAA2D;AAC3D,IAAiB,KAAK,CAkBrB;AAlBD,WAAiB,KAAK;IACrB,kCAAkC;IACrB,QAAE,GAAG,gGAAgG,CAAA;IACrG,cAAQ,GACpB,8GAA8G,CAAA;IAClG,aAAO,GAAG,uBAAuB,CAAA;IACjC,UAAI,GAChB,yLAAyL,CAAA;IAC7K,iBAAW,GAAG,4CAA4C,CAAA;IAC1D,aAAO,GAAG,4BAA4B,CAAA;IACtC,WAAK,GAAG,wBAAwB,CAAA;IAChC,kBAAY,GAAG,6BAA6B,CAAA;IAC5C,kBAAY,GAAG,0BAA0B,CAAA;IACzC,YAAM,GAAG,UAAU,CAAA;IACnB,mBAAa,GAAG,eAAe,CAAA;IAC/B,eAAS,GAAG,QAAQ,CAAA;IACpB,cAAQ,GACpB,oGAAoG,CAAA;AACtG,CAAC,EAlBgB,KAAK,qBAAL,KAAK,QAkBrB"}
@@ -56,7 +56,11 @@ export interface ModuleManifest {
56
56
  * Each query you define must have a matching config field of type 'bonjour-device' with the same name
57
57
  */
58
58
  bonjourQueries?: {
59
- [k: string]: ModuleBonjourQuery;
59
+ /**
60
+ * This interface was referenced by `undefined`'s JSON-Schema definition
61
+ * via the `patternProperty` "".
62
+ */
63
+ [k: string]: ModuleBonjourQuery | ModuleBonjourQuery[];
60
64
  };
61
65
  }
62
66
  export interface ModuleManifestMaintainer {
@@ -70,9 +74,9 @@ export interface ModuleManifestMaintainer {
70
74
  */
71
75
  export interface ModuleManifestRuntime {
72
76
  /**
73
- * Type of the module. Must be: node18
77
+ * Type of the module. Must be: node18 or node22
74
78
  */
75
- type: string;
79
+ type: "node18" | "node22";
76
80
  /**
77
81
  * Which host-api does it use. In the future alternate options will be allowed
78
82
  */
@@ -87,10 +91,6 @@ export interface ModuleManifestRuntime {
87
91
  entrypoint: string;
88
92
  [k: string]: unknown;
89
93
  }
90
- /**
91
- * This interface was referenced by `undefined`'s JSON-Schema definition
92
- * via the `patternProperty` "".
93
- */
94
94
  export interface ModuleBonjourQuery {
95
95
  type: string;
96
96
  protocol: "tcp" | "udp";
@@ -1 +1 @@
1
- "use strict";module.exports = validate20;module.exports.default = validate20;const schema22 = {"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"ModuleManifest","properties":{"$schema":{"type":"string"},"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"},"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":"ModuleManifestMaintainer","properties":{"name":{"type":"string"},"email":{"type":"string"},"github":{"type":"string"}},"required":["name"]}},"legacyIds":{"type":"array","description":"If the module had a different unique identifier previously, then specify it here","uniqueItems":true,"items":{"type":"string"}},"runtime":{"type":"object","title":"ModuleManifestRuntime","description":"Information on how to execute the module","properties":{"type":{"type":"string","description":"Type of the module. Must be: node18"},"api":{"type":"string","description":"Which host-api does it use. In the future alternate options will be allowed","enum":["nodejs-ipc"]},"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","api","apiVersion","entrypoint"]},"manufacturer":{"type":"string"},"products":{"type":"array","uniqueItems":true,"items":{"type":"string"},"minItems":1},"keywords":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"bonjourQueries":{"type":"object","description":"If the device or software for your module supports bonjour announcements, Companion will offer an easy way to watch for these announcements.\nEach query you define must have a matching config field of type 'bonjour-device' with the same name","patternProperties":{"":{"type":"object","title":"ModuleBonjourQuery","description":"","properties":{"type":{"type":"string"},"protocol":{"type":"string","enum":["tcp","udp"]},"txt":{"type":"object","description":"Match on any txt values returned in the query. This is useful to filter out devices of the same 'type' that are not supported","patternProperties":{"":{"type":"string"}},"additionalProperties":false}},"required":["type","protocol"],"additionalProperties":false}},"additionalProperties":false}},"additionalProperties":false,"required":["id","name","shortname","description","version","license","repository","bugs","maintainers","legacyIds","runtime","manufacturer","products","keywords"]};const func4 = Object.prototype.hasOwnProperty;const func0 = require("ajv/dist/runtime/equal").default;const pattern0 = new RegExp("", "u");function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((((((((((((((data.id === undefined) && (missing0 = "id")) || ((data.name === undefined) && (missing0 = "name"))) || ((data.shortname === undefined) && (missing0 = "shortname"))) || ((data.description === undefined) && (missing0 = "description"))) || ((data.version === undefined) && (missing0 = "version"))) || ((data.license === undefined) && (missing0 = "license"))) || ((data.repository === undefined) && (missing0 = "repository"))) || ((data.bugs === undefined) && (missing0 = "bugs"))) || ((data.maintainers === undefined) && (missing0 = "maintainers"))) || ((data.legacyIds === undefined) && (missing0 = "legacyIds"))) || ((data.runtime === undefined) && (missing0 = "runtime"))) || ((data.manufacturer === undefined) && (missing0 = "manufacturer"))) || ((data.products === undefined) && (missing0 = "products"))) || ((data.keywords === undefined) && (missing0 = "keywords"))){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(!(func4.call(schema22.properties, key0))){validate20.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.$schema !== undefined){const _errs2 = errors;if(typeof data.$schema !== "string"){validate20.errors = [{instancePath:instancePath+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.id !== undefined){const _errs4 = errors;if(typeof data.id !== "string"){validate20.errors = [{instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs4 === errors;}else {var valid0 = true;}if(valid0){if(data.name !== undefined){const _errs6 = errors;if(typeof data.name !== "string"){validate20.errors = [{instancePath:instancePath+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs6 === errors;}else {var valid0 = true;}if(valid0){if(data.shortname !== undefined){const _errs8 = errors;if(typeof data.shortname !== "string"){validate20.errors = [{instancePath:instancePath+"/shortname",schemaPath:"#/properties/shortname/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs8 === errors;}else {var valid0 = true;}if(valid0){if(data.description !== undefined){const _errs10 = errors;if(typeof data.description !== "string"){validate20.errors = [{instancePath:instancePath+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs10 === errors;}else {var valid0 = true;}if(valid0){if(data.version !== undefined){const _errs12 = errors;if(typeof data.version !== "string"){validate20.errors = [{instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs12 === errors;}else {var valid0 = true;}if(valid0){if(data.license !== undefined){const _errs14 = errors;if(typeof data.license !== "string"){validate20.errors = [{instancePath:instancePath+"/license",schemaPath:"#/properties/license/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs14 === errors;}else {var valid0 = true;}if(valid0){if(data.repository !== undefined){const _errs16 = errors;if(typeof data.repository !== "string"){validate20.errors = [{instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs16 === errors;}else {var valid0 = true;}if(valid0){if(data.bugs !== undefined){const _errs18 = errors;if(typeof data.bugs !== "string"){validate20.errors = [{instancePath:instancePath+"/bugs",schemaPath:"#/properties/bugs/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs18 === errors;}else {var valid0 = true;}if(valid0){if(data.maintainers !== undefined){let data9 = data.maintainers;const _errs20 = errors;if(errors === _errs20){if(Array.isArray(data9)){var valid1 = true;const len0 = data9.length;for(let i0=0; i0<len0; i0++){let data10 = data9[i0];const _errs22 = errors;if(errors === _errs22){if(data10 && typeof data10 == "object" && !Array.isArray(data10)){let missing1;if((data10.name === undefined) && (missing1 = "name")){validate20.errors = [{instancePath:instancePath+"/maintainers/" + i0,schemaPath:"#/properties/maintainers/items/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {if(data10.name !== undefined){const _errs24 = errors;if(typeof data10.name !== "string"){validate20.errors = [{instancePath:instancePath+"/maintainers/" + i0+"/name",schemaPath:"#/properties/maintainers/items/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs24 === errors;}else {var valid2 = true;}if(valid2){if(data10.email !== undefined){const _errs26 = errors;if(typeof data10.email !== "string"){validate20.errors = [{instancePath:instancePath+"/maintainers/" + i0+"/email",schemaPath:"#/properties/maintainers/items/properties/email/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs26 === errors;}else {var valid2 = true;}if(valid2){if(data10.github !== undefined){const _errs28 = errors;if(typeof data10.github !== "string"){validate20.errors = [{instancePath:instancePath+"/maintainers/" + i0+"/github",schemaPath:"#/properties/maintainers/items/properties/github/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs28 === errors;}else {var valid2 = true;}}}}}else {validate20.errors = [{instancePath:instancePath+"/maintainers/" + i0,schemaPath:"#/properties/maintainers/items/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid1 = _errs22 === errors;if(!valid1){break;}}if(valid1){let i1 = data9.length;let j0;if(i1 > 1){outer0:for(;i1--;){for(j0 = i1; j0--;){if(func0(data9[i1], data9[j0])){validate20.errors = [{instancePath:instancePath+"/maintainers",schemaPath:"#/properties/maintainers/uniqueItems",keyword:"uniqueItems",params:{i: i1, j: j0},message:"must NOT have duplicate items (items ## "+j0+" and "+i1+" are identical)"}];return false;break outer0;}}}}}}else {validate20.errors = [{instancePath:instancePath+"/maintainers",schemaPath:"#/properties/maintainers/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs20 === errors;}else {var valid0 = true;}if(valid0){if(data.legacyIds !== undefined){let data14 = data.legacyIds;const _errs30 = errors;if(errors === _errs30){if(Array.isArray(data14)){var valid4 = true;const len1 = data14.length;for(let i2=0; i2<len1; i2++){const _errs32 = errors;if(typeof data14[i2] !== "string"){validate20.errors = [{instancePath:instancePath+"/legacyIds/" + i2,schemaPath:"#/properties/legacyIds/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid4 = _errs32 === errors;if(!valid4){break;}}if(valid4){let i3 = data14.length;let j1;if(i3 > 1){const indices0 = {};for(;i3--;){let item0 = data14[i3];if(typeof item0 !== "string"){continue;}if(typeof indices0[item0] == "number"){j1 = indices0[item0];validate20.errors = [{instancePath:instancePath+"/legacyIds",schemaPath:"#/properties/legacyIds/uniqueItems",keyword:"uniqueItems",params:{i: i3, j: j1},message:"must NOT have duplicate items (items ## "+j1+" and "+i3+" are identical)"}];return false;break;}indices0[item0] = i3;}}}}else {validate20.errors = [{instancePath:instancePath+"/legacyIds",schemaPath:"#/properties/legacyIds/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs30 === errors;}else {var valid0 = true;}if(valid0){if(data.runtime !== undefined){let data16 = data.runtime;const _errs34 = errors;if(errors === _errs34){if(data16 && typeof data16 == "object" && !Array.isArray(data16)){let missing2;if(((((data16.type === undefined) && (missing2 = "type")) || ((data16.api === undefined) && (missing2 = "api"))) || ((data16.apiVersion === undefined) && (missing2 = "apiVersion"))) || ((data16.entrypoint === undefined) && (missing2 = "entrypoint"))){validate20.errors = [{instancePath:instancePath+"/runtime",schemaPath:"#/properties/runtime/required",keyword:"required",params:{missingProperty: missing2},message:"must have required property '"+missing2+"'"}];return false;}else {if(data16.type !== undefined){const _errs36 = errors;if(typeof data16.type !== "string"){validate20.errors = [{instancePath:instancePath+"/runtime/type",schemaPath:"#/properties/runtime/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid6 = _errs36 === errors;}else {var valid6 = true;}if(valid6){if(data16.api !== undefined){let data18 = data16.api;const _errs38 = errors;if(typeof data18 !== "string"){validate20.errors = [{instancePath:instancePath+"/runtime/api",schemaPath:"#/properties/runtime/properties/api/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(data18 === "nodejs-ipc")){validate20.errors = [{instancePath:instancePath+"/runtime/api",schemaPath:"#/properties/runtime/properties/api/enum",keyword:"enum",params:{allowedValues: schema22.properties.runtime.properties.api.enum},message:"must be equal to one of the allowed values"}];return false;}var valid6 = _errs38 === errors;}else {var valid6 = true;}if(valid6){if(data16.apiVersion !== undefined){const _errs40 = errors;if(typeof data16.apiVersion !== "string"){validate20.errors = [{instancePath:instancePath+"/runtime/apiVersion",schemaPath:"#/properties/runtime/properties/apiVersion/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid6 = _errs40 === errors;}else {var valid6 = true;}if(valid6){if(data16.entrypoint !== undefined){const _errs42 = errors;if(typeof data16.entrypoint !== "string"){validate20.errors = [{instancePath:instancePath+"/runtime/entrypoint",schemaPath:"#/properties/runtime/properties/entrypoint/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid6 = _errs42 === errors;}else {var valid6 = true;}}}}}}else {validate20.errors = [{instancePath:instancePath+"/runtime",schemaPath:"#/properties/runtime/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs34 === errors;}else {var valid0 = true;}if(valid0){if(data.manufacturer !== undefined){const _errs44 = errors;if(typeof data.manufacturer !== "string"){validate20.errors = [{instancePath:instancePath+"/manufacturer",schemaPath:"#/properties/manufacturer/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs44 === errors;}else {var valid0 = true;}if(valid0){if(data.products !== undefined){let data22 = data.products;const _errs46 = errors;if(errors === _errs46){if(Array.isArray(data22)){if(data22.length < 1){validate20.errors = [{instancePath:instancePath+"/products",schemaPath:"#/properties/products/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"}];return false;}else {var valid7 = true;const len2 = data22.length;for(let i4=0; i4<len2; i4++){const _errs48 = errors;if(typeof data22[i4] !== "string"){validate20.errors = [{instancePath:instancePath+"/products/" + i4,schemaPath:"#/properties/products/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid7 = _errs48 === errors;if(!valid7){break;}}if(valid7){let i5 = data22.length;let j2;if(i5 > 1){const indices1 = {};for(;i5--;){let item1 = data22[i5];if(typeof item1 !== "string"){continue;}if(typeof indices1[item1] == "number"){j2 = indices1[item1];validate20.errors = [{instancePath:instancePath+"/products",schemaPath:"#/properties/products/uniqueItems",keyword:"uniqueItems",params:{i: i5, j: j2},message:"must NOT have duplicate items (items ## "+j2+" and "+i5+" are identical)"}];return false;break;}indices1[item1] = i5;}}}}}else {validate20.errors = [{instancePath:instancePath+"/products",schemaPath:"#/properties/products/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs46 === errors;}else {var valid0 = true;}if(valid0){if(data.keywords !== undefined){let data24 = data.keywords;const _errs50 = errors;if(errors === _errs50){if(Array.isArray(data24)){var valid9 = true;const len3 = data24.length;for(let i6=0; i6<len3; i6++){const _errs52 = errors;if(typeof data24[i6] !== "string"){validate20.errors = [{instancePath:instancePath+"/keywords/" + i6,schemaPath:"#/properties/keywords/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid9 = _errs52 === errors;if(!valid9){break;}}if(valid9){let i7 = data24.length;let j3;if(i7 > 1){const indices2 = {};for(;i7--;){let item2 = data24[i7];if(typeof item2 !== "string"){continue;}if(typeof indices2[item2] == "number"){j3 = indices2[item2];validate20.errors = [{instancePath:instancePath+"/keywords",schemaPath:"#/properties/keywords/uniqueItems",keyword:"uniqueItems",params:{i: i7, j: j3},message:"must NOT have duplicate items (items ## "+j3+" and "+i7+" are identical)"}];return false;break;}indices2[item2] = i7;}}}}else {validate20.errors = [{instancePath:instancePath+"/keywords",schemaPath:"#/properties/keywords/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs50 === errors;}else {var valid0 = true;}if(valid0){if(data.bonjourQueries !== undefined){let data26 = data.bonjourQueries;const _errs54 = errors;if(errors === _errs54){if(data26 && typeof data26 == "object" && !Array.isArray(data26)){const _errs56 = errors;for(const key1 in data26){if(!(pattern0.test(key1))){validate20.errors = [{instancePath:instancePath+"/bonjourQueries",schemaPath:"#/properties/bonjourQueries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs56 === errors){var valid11 = true;for(const key2 in data26){if(pattern0.test(key2)){let data27 = data26[key2];const _errs57 = errors;if(errors === _errs57){if(data27 && typeof data27 == "object" && !Array.isArray(data27)){let missing3;if(((data27.type === undefined) && (missing3 = "type")) || ((data27.protocol === undefined) && (missing3 = "protocol"))){validate20.errors = [{instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/bonjourQueries/patternProperties//required",keyword:"required",params:{missingProperty: missing3},message:"must have required property '"+missing3+"'"}];return false;}else {const _errs59 = errors;for(const key3 in data27){if(!(((key3 === "type") || (key3 === "protocol")) || (key3 === "txt"))){validate20.errors = [{instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/bonjourQueries/patternProperties//additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"}];return false;break;}}if(_errs59 === errors){if(data27.type !== undefined){const _errs60 = errors;if(typeof data27.type !== "string"){validate20.errors = [{instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/type",schemaPath:"#/properties/bonjourQueries/patternProperties//properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid12 = _errs60 === errors;}else {var valid12 = true;}if(valid12){if(data27.protocol !== undefined){let data29 = data27.protocol;const _errs62 = errors;if(typeof data29 !== "string"){validate20.errors = [{instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/protocol",schemaPath:"#/properties/bonjourQueries/patternProperties//properties/protocol/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!((data29 === "tcp") || (data29 === "udp"))){validate20.errors = [{instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/protocol",schemaPath:"#/properties/bonjourQueries/patternProperties//properties/protocol/enum",keyword:"enum",params:{allowedValues: schema22.properties.bonjourQueries.patternProperties[""].properties.protocol.enum},message:"must be equal to one of the allowed values"}];return false;}var valid12 = _errs62 === errors;}else {var valid12 = true;}if(valid12){if(data27.txt !== undefined){let data30 = data27.txt;const _errs64 = errors;if(errors === _errs64){if(data30 && typeof data30 == "object" && !Array.isArray(data30)){const _errs66 = errors;for(const key4 in data30){if(!(pattern0.test(key4))){validate20.errors = [{instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/txt",schemaPath:"#/properties/bonjourQueries/patternProperties//properties/txt/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"}];return false;break;}}if(_errs66 === errors){var valid13 = true;for(const key5 in data30){if(pattern0.test(key5)){const _errs67 = errors;if(typeof data30[key5] !== "string"){validate20.errors = [{instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/txt/" + key5.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/bonjourQueries/patternProperties//properties/txt/patternProperties//type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid13 = _errs67 === errors;if(!valid13){break;}}}}}else {validate20.errors = [{instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/txt",schemaPath:"#/properties/bonjourQueries/patternProperties//properties/txt/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid12 = _errs64 === errors;}else {var valid12 = true;}}}}}}else {validate20.errors = [{instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/bonjourQueries/patternProperties//type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid11 = _errs57 === errors;if(!valid11){break;}}}}}else {validate20.errors = [{instancePath:instancePath+"/bonjourQueries",schemaPath:"#/properties/bonjourQueries/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs54 === 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;}
1
+ "use strict";module.exports = validate20;module.exports.default = validate20;const schema22 = {"$schema":"http://json-schema.org/draft-07/schema#","type":"object","title":"ModuleManifest","properties":{"$schema":{"type":"string"},"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"},"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":"ModuleManifestMaintainer","properties":{"name":{"type":"string"},"email":{"type":"string"},"github":{"type":"string"}},"required":["name"]}},"legacyIds":{"type":"array","description":"If the module had a different unique identifier previously, then specify it here","uniqueItems":true,"items":{"type":"string"}},"runtime":{"type":"object","title":"ModuleManifestRuntime","description":"Information on how to execute the module","properties":{"type":{"type":"string","description":"Type of the module. Must be: node18 or node22","enum":["node18","node22"]},"api":{"type":"string","description":"Which host-api does it use. In the future alternate options will be allowed","enum":["nodejs-ipc"]},"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","api","apiVersion","entrypoint"]},"manufacturer":{"type":"string"},"products":{"type":"array","uniqueItems":true,"items":{"type":"string"},"minItems":1},"keywords":{"type":"array","uniqueItems":true,"items":{"type":"string"}},"bonjourQueries":{"type":"object","description":"If the device or software for your module supports bonjour announcements, Companion will offer an easy way to watch for these announcements.\nEach query you define must have a matching config field of type 'bonjour-device' with the same name","patternProperties":{"":{"oneOf":[{"$ref":"#/definitions/bonjourQuery"},{"type":"array","items":{"$ref":"#/definitions/bonjourQuery"}}]}},"additionalProperties":false}},"additionalProperties":false,"required":["id","name","shortname","description","version","license","repository","bugs","maintainers","legacyIds","runtime","manufacturer","products","keywords"],"definitions":{"bonjourQuery":{"type":"object","title":"ModuleBonjourQuery","description":"","properties":{"type":{"type":"string"},"protocol":{"type":"string","enum":["tcp","udp"]},"txt":{"type":"object","description":"Match on any txt values returned in the query. This is useful to filter out devices of the same 'type' that are not supported","patternProperties":{"":{"type":"string"}},"additionalProperties":false}},"required":["type","protocol"],"additionalProperties":false}}};const schema23 = {"type":"object","title":"ModuleBonjourQuery","description":"","properties":{"type":{"type":"string"},"protocol":{"type":"string","enum":["tcp","udp"]},"txt":{"type":"object","description":"Match on any txt values returned in the query. This is useful to filter out devices of the same 'type' that are not supported","patternProperties":{"":{"type":"string"}},"additionalProperties":false}},"required":["type","protocol"],"additionalProperties":false};const func4 = Object.prototype.hasOwnProperty;const func0 = require("ajv/dist/runtime/equal").default;const pattern0 = new RegExp("", "u");function validate20(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){let vErrors = null;let errors = 0;if(errors === 0){if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if(((((((((((((((data.id === undefined) && (missing0 = "id")) || ((data.name === undefined) && (missing0 = "name"))) || ((data.shortname === undefined) && (missing0 = "shortname"))) || ((data.description === undefined) && (missing0 = "description"))) || ((data.version === undefined) && (missing0 = "version"))) || ((data.license === undefined) && (missing0 = "license"))) || ((data.repository === undefined) && (missing0 = "repository"))) || ((data.bugs === undefined) && (missing0 = "bugs"))) || ((data.maintainers === undefined) && (missing0 = "maintainers"))) || ((data.legacyIds === undefined) && (missing0 = "legacyIds"))) || ((data.runtime === undefined) && (missing0 = "runtime"))) || ((data.manufacturer === undefined) && (missing0 = "manufacturer"))) || ((data.products === undefined) && (missing0 = "products"))) || ((data.keywords === undefined) && (missing0 = "keywords"))){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(!(func4.call(schema22.properties, key0))){validate20.errors = [{instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"}];return false;break;}}if(_errs1 === errors){if(data.$schema !== undefined){const _errs2 = errors;if(typeof data.$schema !== "string"){validate20.errors = [{instancePath:instancePath+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs2 === errors;}else {var valid0 = true;}if(valid0){if(data.id !== undefined){const _errs4 = errors;if(typeof data.id !== "string"){validate20.errors = [{instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs4 === errors;}else {var valid0 = true;}if(valid0){if(data.name !== undefined){const _errs6 = errors;if(typeof data.name !== "string"){validate20.errors = [{instancePath:instancePath+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs6 === errors;}else {var valid0 = true;}if(valid0){if(data.shortname !== undefined){const _errs8 = errors;if(typeof data.shortname !== "string"){validate20.errors = [{instancePath:instancePath+"/shortname",schemaPath:"#/properties/shortname/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs8 === errors;}else {var valid0 = true;}if(valid0){if(data.description !== undefined){const _errs10 = errors;if(typeof data.description !== "string"){validate20.errors = [{instancePath:instancePath+"/description",schemaPath:"#/properties/description/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs10 === errors;}else {var valid0 = true;}if(valid0){if(data.version !== undefined){const _errs12 = errors;if(typeof data.version !== "string"){validate20.errors = [{instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs12 === errors;}else {var valid0 = true;}if(valid0){if(data.license !== undefined){const _errs14 = errors;if(typeof data.license !== "string"){validate20.errors = [{instancePath:instancePath+"/license",schemaPath:"#/properties/license/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs14 === errors;}else {var valid0 = true;}if(valid0){if(data.repository !== undefined){const _errs16 = errors;if(typeof data.repository !== "string"){validate20.errors = [{instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs16 === errors;}else {var valid0 = true;}if(valid0){if(data.bugs !== undefined){const _errs18 = errors;if(typeof data.bugs !== "string"){validate20.errors = [{instancePath:instancePath+"/bugs",schemaPath:"#/properties/bugs/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs18 === errors;}else {var valid0 = true;}if(valid0){if(data.maintainers !== undefined){let data9 = data.maintainers;const _errs20 = errors;if(errors === _errs20){if(Array.isArray(data9)){var valid1 = true;const len0 = data9.length;for(let i0=0; i0<len0; i0++){let data10 = data9[i0];const _errs22 = errors;if(errors === _errs22){if(data10 && typeof data10 == "object" && !Array.isArray(data10)){let missing1;if((data10.name === undefined) && (missing1 = "name")){validate20.errors = [{instancePath:instancePath+"/maintainers/" + i0,schemaPath:"#/properties/maintainers/items/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];return false;}else {if(data10.name !== undefined){const _errs24 = errors;if(typeof data10.name !== "string"){validate20.errors = [{instancePath:instancePath+"/maintainers/" + i0+"/name",schemaPath:"#/properties/maintainers/items/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs24 === errors;}else {var valid2 = true;}if(valid2){if(data10.email !== undefined){const _errs26 = errors;if(typeof data10.email !== "string"){validate20.errors = [{instancePath:instancePath+"/maintainers/" + i0+"/email",schemaPath:"#/properties/maintainers/items/properties/email/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs26 === errors;}else {var valid2 = true;}if(valid2){if(data10.github !== undefined){const _errs28 = errors;if(typeof data10.github !== "string"){validate20.errors = [{instancePath:instancePath+"/maintainers/" + i0+"/github",schemaPath:"#/properties/maintainers/items/properties/github/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid2 = _errs28 === errors;}else {var valid2 = true;}}}}}else {validate20.errors = [{instancePath:instancePath+"/maintainers/" + i0,schemaPath:"#/properties/maintainers/items/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid1 = _errs22 === errors;if(!valid1){break;}}if(valid1){let i1 = data9.length;let j0;if(i1 > 1){outer0:for(;i1--;){for(j0 = i1; j0--;){if(func0(data9[i1], data9[j0])){validate20.errors = [{instancePath:instancePath+"/maintainers",schemaPath:"#/properties/maintainers/uniqueItems",keyword:"uniqueItems",params:{i: i1, j: j0},message:"must NOT have duplicate items (items ## "+j0+" and "+i1+" are identical)"}];return false;break outer0;}}}}}}else {validate20.errors = [{instancePath:instancePath+"/maintainers",schemaPath:"#/properties/maintainers/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs20 === errors;}else {var valid0 = true;}if(valid0){if(data.legacyIds !== undefined){let data14 = data.legacyIds;const _errs30 = errors;if(errors === _errs30){if(Array.isArray(data14)){var valid4 = true;const len1 = data14.length;for(let i2=0; i2<len1; i2++){const _errs32 = errors;if(typeof data14[i2] !== "string"){validate20.errors = [{instancePath:instancePath+"/legacyIds/" + i2,schemaPath:"#/properties/legacyIds/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid4 = _errs32 === errors;if(!valid4){break;}}if(valid4){let i3 = data14.length;let j1;if(i3 > 1){const indices0 = {};for(;i3--;){let item0 = data14[i3];if(typeof item0 !== "string"){continue;}if(typeof indices0[item0] == "number"){j1 = indices0[item0];validate20.errors = [{instancePath:instancePath+"/legacyIds",schemaPath:"#/properties/legacyIds/uniqueItems",keyword:"uniqueItems",params:{i: i3, j: j1},message:"must NOT have duplicate items (items ## "+j1+" and "+i3+" are identical)"}];return false;break;}indices0[item0] = i3;}}}}else {validate20.errors = [{instancePath:instancePath+"/legacyIds",schemaPath:"#/properties/legacyIds/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs30 === errors;}else {var valid0 = true;}if(valid0){if(data.runtime !== undefined){let data16 = data.runtime;const _errs34 = errors;if(errors === _errs34){if(data16 && typeof data16 == "object" && !Array.isArray(data16)){let missing2;if(((((data16.type === undefined) && (missing2 = "type")) || ((data16.api === undefined) && (missing2 = "api"))) || ((data16.apiVersion === undefined) && (missing2 = "apiVersion"))) || ((data16.entrypoint === undefined) && (missing2 = "entrypoint"))){validate20.errors = [{instancePath:instancePath+"/runtime",schemaPath:"#/properties/runtime/required",keyword:"required",params:{missingProperty: missing2},message:"must have required property '"+missing2+"'"}];return false;}else {if(data16.type !== undefined){let data17 = data16.type;const _errs36 = errors;if(typeof data17 !== "string"){validate20.errors = [{instancePath:instancePath+"/runtime/type",schemaPath:"#/properties/runtime/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!((data17 === "node18") || (data17 === "node22"))){validate20.errors = [{instancePath:instancePath+"/runtime/type",schemaPath:"#/properties/runtime/properties/type/enum",keyword:"enum",params:{allowedValues: schema22.properties.runtime.properties.type.enum},message:"must be equal to one of the allowed values"}];return false;}var valid6 = _errs36 === errors;}else {var valid6 = true;}if(valid6){if(data16.api !== undefined){let data18 = data16.api;const _errs38 = errors;if(typeof data18 !== "string"){validate20.errors = [{instancePath:instancePath+"/runtime/api",schemaPath:"#/properties/runtime/properties/api/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}if(!(data18 === "nodejs-ipc")){validate20.errors = [{instancePath:instancePath+"/runtime/api",schemaPath:"#/properties/runtime/properties/api/enum",keyword:"enum",params:{allowedValues: schema22.properties.runtime.properties.api.enum},message:"must be equal to one of the allowed values"}];return false;}var valid6 = _errs38 === errors;}else {var valid6 = true;}if(valid6){if(data16.apiVersion !== undefined){const _errs40 = errors;if(typeof data16.apiVersion !== "string"){validate20.errors = [{instancePath:instancePath+"/runtime/apiVersion",schemaPath:"#/properties/runtime/properties/apiVersion/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid6 = _errs40 === errors;}else {var valid6 = true;}if(valid6){if(data16.entrypoint !== undefined){const _errs42 = errors;if(typeof data16.entrypoint !== "string"){validate20.errors = [{instancePath:instancePath+"/runtime/entrypoint",schemaPath:"#/properties/runtime/properties/entrypoint/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid6 = _errs42 === errors;}else {var valid6 = true;}}}}}}else {validate20.errors = [{instancePath:instancePath+"/runtime",schemaPath:"#/properties/runtime/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs34 === errors;}else {var valid0 = true;}if(valid0){if(data.manufacturer !== undefined){const _errs44 = errors;if(typeof data.manufacturer !== "string"){validate20.errors = [{instancePath:instancePath+"/manufacturer",schemaPath:"#/properties/manufacturer/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid0 = _errs44 === errors;}else {var valid0 = true;}if(valid0){if(data.products !== undefined){let data22 = data.products;const _errs46 = errors;if(errors === _errs46){if(Array.isArray(data22)){if(data22.length < 1){validate20.errors = [{instancePath:instancePath+"/products",schemaPath:"#/properties/products/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"}];return false;}else {var valid7 = true;const len2 = data22.length;for(let i4=0; i4<len2; i4++){const _errs48 = errors;if(typeof data22[i4] !== "string"){validate20.errors = [{instancePath:instancePath+"/products/" + i4,schemaPath:"#/properties/products/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid7 = _errs48 === errors;if(!valid7){break;}}if(valid7){let i5 = data22.length;let j2;if(i5 > 1){const indices1 = {};for(;i5--;){let item1 = data22[i5];if(typeof item1 !== "string"){continue;}if(typeof indices1[item1] == "number"){j2 = indices1[item1];validate20.errors = [{instancePath:instancePath+"/products",schemaPath:"#/properties/products/uniqueItems",keyword:"uniqueItems",params:{i: i5, j: j2},message:"must NOT have duplicate items (items ## "+j2+" and "+i5+" are identical)"}];return false;break;}indices1[item1] = i5;}}}}}else {validate20.errors = [{instancePath:instancePath+"/products",schemaPath:"#/properties/products/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs46 === errors;}else {var valid0 = true;}if(valid0){if(data.keywords !== undefined){let data24 = data.keywords;const _errs50 = errors;if(errors === _errs50){if(Array.isArray(data24)){var valid9 = true;const len3 = data24.length;for(let i6=0; i6<len3; i6++){const _errs52 = errors;if(typeof data24[i6] !== "string"){validate20.errors = [{instancePath:instancePath+"/keywords/" + i6,schemaPath:"#/properties/keywords/items/type",keyword:"type",params:{type: "string"},message:"must be string"}];return false;}var valid9 = _errs52 === errors;if(!valid9){break;}}if(valid9){let i7 = data24.length;let j3;if(i7 > 1){const indices2 = {};for(;i7--;){let item2 = data24[i7];if(typeof item2 !== "string"){continue;}if(typeof indices2[item2] == "number"){j3 = indices2[item2];validate20.errors = [{instancePath:instancePath+"/keywords",schemaPath:"#/properties/keywords/uniqueItems",keyword:"uniqueItems",params:{i: i7, j: j3},message:"must NOT have duplicate items (items ## "+j3+" and "+i7+" are identical)"}];return false;break;}indices2[item2] = i7;}}}}else {validate20.errors = [{instancePath:instancePath+"/keywords",schemaPath:"#/properties/keywords/type",keyword:"type",params:{type: "array"},message:"must be array"}];return false;}}var valid0 = _errs50 === errors;}else {var valid0 = true;}if(valid0){if(data.bonjourQueries !== undefined){let data26 = data.bonjourQueries;const _errs54 = errors;if(errors === _errs54){if(data26 && typeof data26 == "object" && !Array.isArray(data26)){const _errs56 = errors;for(const key1 in data26){if(!(pattern0.test(key1))){validate20.errors = [{instancePath:instancePath+"/bonjourQueries",schemaPath:"#/properties/bonjourQueries/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"}];return false;break;}}if(_errs56 === errors){var valid11 = true;for(const key2 in data26){if(pattern0.test(key2)){let data27 = data26[key2];const _errs57 = errors;const _errs58 = errors;let valid12 = false;let passing0 = null;const _errs59 = errors;const _errs60 = errors;if(errors === _errs60){if(data27 && typeof data27 == "object" && !Array.isArray(data27)){let missing3;if(((data27.type === undefined) && (missing3 = "type")) || ((data27.protocol === undefined) && (missing3 = "protocol"))){const err0 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/bonjourQuery/required",keyword:"required",params:{missingProperty: missing3},message:"must have required property '"+missing3+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}else {const _errs62 = errors;for(const key3 in data27){if(!(((key3 === "type") || (key3 === "protocol")) || (key3 === "txt"))){const err1 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/bonjourQuery/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;break;}}if(_errs62 === errors){if(data27.type !== undefined){const _errs63 = errors;if(typeof data27.type !== "string"){const err2 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/type",schemaPath:"#/definitions/bonjourQuery/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}var valid14 = _errs63 === errors;}else {var valid14 = true;}if(valid14){if(data27.protocol !== undefined){let data29 = data27.protocol;const _errs65 = errors;if(typeof data29 !== "string"){const err3 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/protocol",schemaPath:"#/definitions/bonjourQuery/properties/protocol/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(!((data29 === "tcp") || (data29 === "udp"))){const err4 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/protocol",schemaPath:"#/definitions/bonjourQuery/properties/protocol/enum",keyword:"enum",params:{allowedValues: schema23.properties.protocol.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}var valid14 = _errs65 === errors;}else {var valid14 = true;}if(valid14){if(data27.txt !== undefined){let data30 = data27.txt;const _errs67 = errors;if(errors === _errs67){if(data30 && typeof data30 == "object" && !Array.isArray(data30)){const _errs69 = errors;for(const key4 in data30){if(!(pattern0.test(key4))){const err5 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/txt",schemaPath:"#/definitions/bonjourQuery/properties/txt/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;break;}}if(_errs69 === errors){var valid15 = true;for(const key5 in data30){if(pattern0.test(key5)){const _errs70 = errors;if(typeof data30[key5] !== "string"){const err6 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/txt/" + key5.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/bonjourQuery/properties/txt/patternProperties//type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}var valid15 = _errs70 === errors;if(!valid15){break;}}}}}else {const err7 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/txt",schemaPath:"#/definitions/bonjourQuery/properties/txt/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}var valid14 = _errs67 === errors;}else {var valid14 = true;}}}}}}else {const err8 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/bonjourQuery/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}var _valid0 = _errs59 === errors;if(_valid0){valid12 = true;passing0 = 0;}const _errs72 = errors;if(errors === _errs72){if(Array.isArray(data27)){var valid16 = true;const len4 = data27.length;for(let i8=0; i8<len4; i8++){let data32 = data27[i8];const _errs74 = errors;const _errs75 = errors;if(errors === _errs75){if(data32 && typeof data32 == "object" && !Array.isArray(data32)){let missing4;if(((data32.type === undefined) && (missing4 = "type")) || ((data32.protocol === undefined) && (missing4 = "protocol"))){const err9 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/" + i8,schemaPath:"#/definitions/bonjourQuery/required",keyword:"required",params:{missingProperty: missing4},message:"must have required property '"+missing4+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}else {const _errs77 = errors;for(const key6 in data32){if(!(((key6 === "type") || (key6 === "protocol")) || (key6 === "txt"))){const err10 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/" + i8,schemaPath:"#/definitions/bonjourQuery/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key6},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;break;}}if(_errs77 === errors){if(data32.type !== undefined){const _errs78 = errors;if(typeof data32.type !== "string"){const err11 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/" + i8+"/type",schemaPath:"#/definitions/bonjourQuery/properties/type/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}var valid18 = _errs78 === errors;}else {var valid18 = true;}if(valid18){if(data32.protocol !== undefined){let data34 = data32.protocol;const _errs80 = errors;if(typeof data34 !== "string"){const err12 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/" + i8+"/protocol",schemaPath:"#/definitions/bonjourQuery/properties/protocol/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(!((data34 === "tcp") || (data34 === "udp"))){const err13 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/" + i8+"/protocol",schemaPath:"#/definitions/bonjourQuery/properties/protocol/enum",keyword:"enum",params:{allowedValues: schema23.properties.protocol.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}var valid18 = _errs80 === errors;}else {var valid18 = true;}if(valid18){if(data32.txt !== undefined){let data35 = data32.txt;const _errs82 = errors;if(errors === _errs82){if(data35 && typeof data35 == "object" && !Array.isArray(data35)){const _errs84 = errors;for(const key7 in data35){if(!(pattern0.test(key7))){const err14 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/" + i8+"/txt",schemaPath:"#/definitions/bonjourQuery/properties/txt/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key7},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;break;}}if(_errs84 === errors){var valid19 = true;for(const key8 in data35){if(pattern0.test(key8)){const _errs85 = errors;if(typeof data35[key8] !== "string"){const err15 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/" + i8+"/txt/" + key8.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/definitions/bonjourQuery/properties/txt/patternProperties//type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}var valid19 = _errs85 === errors;if(!valid19){break;}}}}}else {const err16 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/" + i8+"/txt",schemaPath:"#/definitions/bonjourQuery/properties/txt/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}var valid18 = _errs82 === errors;}else {var valid18 = true;}}}}}}else {const err17 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/" + i8,schemaPath:"#/definitions/bonjourQuery/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}var valid16 = _errs74 === errors;if(!valid16){break;}}}else {const err18 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/bonjourQueries/patternProperties//oneOf/1/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}var _valid0 = _errs72 === errors;if(_valid0 && valid12){valid12 = false;passing0 = [passing0, 1];}else {if(_valid0){valid12 = true;passing0 = 1;}}if(!valid12){const err19 = {instancePath:instancePath+"/bonjourQueries/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/bonjourQueries/patternProperties//oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;validate20.errors = vErrors;return false;}else {errors = _errs58;if(vErrors !== null){if(_errs58){vErrors.length = _errs58;}else {vErrors = null;}}}var valid11 = _errs57 === errors;if(!valid11){break;}}}}}else {validate20.errors = [{instancePath:instancePath+"/bonjourQueries",schemaPath:"#/properties/bonjourQueries/type",keyword:"type",params:{type: "object"},message:"must be object"}];return false;}}var valid0 = _errs54 === 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;}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@companion-module/base",
3
- "version": "1.10.0-0",
3
+ "version": "1.10.0-node22",
4
4
  "type": "commonjs",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "unit": "jest"
19
19
  },
20
20
  "engines": {
21
- "node": "^18.12"
21
+ "node": "^18.12 || ^22.8"
22
22
  },
23
23
  "files": [
24
24
  "README.md",
@@ -37,24 +37,24 @@
37
37
  "nanoid": "^3.3.7",
38
38
  "p-queue": "^6.6.2",
39
39
  "p-timeout": "^4.1.0",
40
- "tslib": "^2.6.3"
40
+ "tslib": "^2.7.0"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@companion-module/tools": "^1.5.1",
44
44
  "@tsconfig/node18": "^18.2.4",
45
45
  "@types/ejson": "^2.2.2",
46
46
  "@types/jest": "^29.5.12",
47
- "@types/node": "^18.19.42",
47
+ "@types/node": "^18.19.45",
48
48
  "ajv-cli": "^5.0.0",
49
49
  "jest": "^29.7.0",
50
50
  "jest-extended": "^4.0.2",
51
51
  "jest-mock-extended": "^3.0.7",
52
52
  "json-schema-to-typescript": "^13.1.2",
53
53
  "prettier": "^2.8.8",
54
- "ts-jest": "^29.2.3",
54
+ "ts-jest": "^29.2.5",
55
55
  "typedoc": "^0.25.13",
56
56
  "typescript": "~5.1.6"
57
57
  },
58
58
  "packageManager": "yarn@4.4.0",
59
- "stableVersion": "1.9.0"
59
+ "stableVersion": "1.10.0"
60
60
  }