@codifycli/plugin-core 1.1.0-beta1 → 1.1.0-beta4
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/dist/plugin/plugin.d.ts
CHANGED
|
@@ -11,10 +11,7 @@ export declare class Plugin {
|
|
|
11
11
|
constructor(name: string, resourceControllers: Map<string, ResourceController<ResourceConfig>>);
|
|
12
12
|
static create(name: string, resources: Resource<any>[]): Plugin;
|
|
13
13
|
initialize(data: InitializeRequestData): Promise<InitializeResponseData>;
|
|
14
|
-
getResourceInfo(data: GetResourceInfoRequestData):
|
|
15
|
-
defaultConfig: unknown;
|
|
16
|
-
exampleConfigs: unknown;
|
|
17
|
-
} & GetResourceInfoResponseData;
|
|
14
|
+
getResourceInfo(data: GetResourceInfoRequestData): GetResourceInfoResponseData;
|
|
18
15
|
match(data: MatchRequestData): Promise<MatchResponseData>;
|
|
19
16
|
import(data: ImportRequestData): Promise<ImportResponseData>;
|
|
20
17
|
validate(data: ValidateRequestData): Promise<ValidateResponseData>;
|
|
@@ -4,9 +4,10 @@ import { ZodObject } from 'zod';
|
|
|
4
4
|
import { ArrayStatefulParameter, StatefulParameter } from '../stateful-parameter/stateful-parameter.js';
|
|
5
5
|
import { ParsedResourceSettings } from './parsed-resource-settings.js';
|
|
6
6
|
import { RefreshContext } from './resource.js';
|
|
7
|
-
export interface ExampleConfig {
|
|
7
|
+
export interface ExampleConfig extends Record<string, unknown> {
|
|
8
|
+
title: string;
|
|
8
9
|
configs: Array<Record<string, unknown>>;
|
|
9
|
-
description
|
|
10
|
+
description?: string;
|
|
10
11
|
}
|
|
11
12
|
export interface ExampleConfigs {
|
|
12
13
|
example1: ExampleConfig;
|
|
@@ -180,7 +181,7 @@ export interface ResourceSettings<T extends StringIndexedObject> {
|
|
|
180
181
|
* A collection of example configs used to give users an idea on how to use this specific resource. These examples
|
|
181
182
|
* don't need to be limited to just the current resource. They can include other resources as well
|
|
182
183
|
*/
|
|
183
|
-
exampleConfigs
|
|
184
|
+
exampleConfigs?: ExampleConfigs;
|
|
184
185
|
}
|
|
185
186
|
/**
|
|
186
187
|
* The type of parameter. This value is mainly used to determine a pre-set equality method for comparing the current
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codifycli/plugin-core",
|
|
3
|
-
"version": "1.1.0-
|
|
3
|
+
"version": "1.1.0-beta4",
|
|
4
4
|
"description": "TypeScript library for building Codify plugins to manage system resources (applications, CLI tools, settings) through infrastructure-as-code",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"license": "ISC",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@codifycli/schemas": "1.
|
|
38
|
+
"@codifycli/schemas": "1.1.0-beta2",
|
|
39
39
|
"@homebridge/node-pty-prebuilt-multiarch": "^0.13.1",
|
|
40
40
|
"ajv": "^8.18.0",
|
|
41
41
|
"ajv-formats": "^2.1.1",
|
package/src/plugin/plugin.ts
CHANGED
|
@@ -83,7 +83,7 @@ export class Plugin {
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
getResourceInfo(data: GetResourceInfoRequestData):
|
|
86
|
+
getResourceInfo(data: GetResourceInfoRequestData): GetResourceInfoResponseData {
|
|
87
87
|
if (!this.resourceControllers.has(data.type)) {
|
|
88
88
|
throw new Error(`Cannot get info for resource ${data.type}, resource doesn't exist`);
|
|
89
89
|
}
|
|
@@ -5,7 +5,8 @@ import { z, ZodObject } from 'zod';
|
|
|
5
5
|
import { StatefulParameterController } from '../stateful-parameter/stateful-parameter-controller.js';
|
|
6
6
|
import {
|
|
7
7
|
ArrayParameterSetting,
|
|
8
|
-
DefaultParameterSetting,
|
|
8
|
+
DefaultParameterSetting,
|
|
9
|
+
ExampleConfigs,
|
|
9
10
|
InputTransformation,
|
|
10
11
|
ParameterSetting,
|
|
11
12
|
resolveElementEqualsFn,
|
|
@@ -15,9 +15,10 @@ import {
|
|
|
15
15
|
import { ParsedResourceSettings } from './parsed-resource-settings.js';
|
|
16
16
|
import { RefreshContext } from './resource.js';
|
|
17
17
|
|
|
18
|
-
export interface ExampleConfig {
|
|
18
|
+
export interface ExampleConfig extends Record<string, unknown> {
|
|
19
|
+
title: string;
|
|
19
20
|
configs: Array<Record<string, unknown>>;
|
|
20
|
-
description
|
|
21
|
+
description?: string;
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
export interface ExampleConfigs {
|
|
@@ -216,7 +217,7 @@ export interface ResourceSettings<T extends StringIndexedObject> {
|
|
|
216
217
|
* A collection of example configs used to give users an idea on how to use this specific resource. These examples
|
|
217
218
|
* don't need to be limited to just the current resource. They can include other resources as well
|
|
218
219
|
*/
|
|
219
|
-
exampleConfigs
|
|
220
|
+
exampleConfigs?: ExampleConfigs
|
|
220
221
|
}
|
|
221
222
|
|
|
222
223
|
/**
|