Skip to content

Commit c933cd1

Browse files
committed
feat: Updated to import and destroy and added allow multiple to getResourceInfo
1 parent 580520f commit c933cd1

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codify-plugin-lib",
3-
"version": "1.0.137",
3+
"version": "1.0.138",
44
"description": "Library plugin library",
55
"main": "dist/index.js",
66
"typings": "dist/index.d.ts",
@@ -16,7 +16,7 @@
1616
"dependencies": {
1717
"ajv": "^8.12.0",
1818
"ajv-formats": "^2.1.1",
19-
"codify-schemas": "1.0.63",
19+
"codify-schemas": "1.0.64",
2020
"@npmcli/promise-spawn": "^7.0.1",
2121
"@homebridge/node-pty-prebuilt-multiarch": "^0.12.0-beta.5",
2222
"uuid": "^10.0.0",

src/plugin/plugin.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,21 @@ export class Plugin {
7272
?? null
7373
) as null | string[];
7474

75+
const allowMultiple = resource.settings.allowMultiple !== undefined
76+
? (typeof resource.settings.allowMultiple === 'boolean'
77+
? { requiredParameters: schema?.required ?? [] }
78+
: { requiredParameters: resource.settings.allowMultiple.requiredParameters ?? schema?.required ?? [] }
79+
) : undefined
80+
7581
return {
7682
plugin: this.name,
7783
type: data.type,
7884
dependencies: resource.dependencies,
7985
schema: schema as Record<string, unknown> | undefined,
80-
import: {
86+
importAndDestroy: {
8187
requiredParameters: requiredPropertyNames,
8288
},
89+
allowMultiple
8390
}
8491
}
8592

0 commit comments

Comments
 (0)