Skip to content

Commit 986081f

Browse files
committed
feat: Add defaultConfig and exampleConfigs and distro
1 parent 9e8e141 commit 986081f

4 files changed

Lines changed: 50 additions & 8 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codifycli/schemas",
3-
"version": "1.0.0",
3+
"version": "1.1.0-beta4",
44
"description": "JSON Schemas and types that govern the message format and Codify config formats for Codify",
55
"type": "module",
66
"main": "dist/index.js",

src/messages/get-resource-info-response-data-schema.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,14 @@
7070
},
7171
"allowMultiple": {
7272
"type": "boolean"
73+
},
74+
"defaultConfig": {
75+
"type": "object",
76+
"description": "The default config that should be added. This prefills some parameters for the user to make it easier for them"
77+
},
78+
"exampleConfigs": {
79+
"type": "object",
80+
"description": "Some example configs. This makes it for the user."
7381
}
7482
},
7583
"required": ["type", "plugin"]

src/resource-schema.json

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@
99
"type": "string",
1010
"pattern": "^[a-zA-Z][\\w-]+$"
1111
},
12-
"os": {
13-
"type": "array",
14-
"items": {
15-
"enum": ["linux", "macOS", "windows"]
16-
},
17-
"uniqueItems": true
18-
},
1912
"name": {
2013
"description": "Optional name. Useful for specifying multiple resources of the same type",
2114
"type": "string",
@@ -27,6 +20,40 @@
2720
"type": "string"
2821
},
2922
"uniqueItems": true
23+
},
24+
"os": {
25+
"type": "array",
26+
"items": {
27+
"enum": ["linux", "macOS", "windows"]
28+
},
29+
"uniqueItems": true
30+
},
31+
"distro": {
32+
"type": "array",
33+
"items": {
34+
"enum": [
35+
"debian-based",
36+
"rpm-based",
37+
"arch",
38+
"centos",
39+
"debian",
40+
"fedora",
41+
"rhel",
42+
"ubuntu",
43+
"alpine",
44+
"amzn",
45+
"opensuse",
46+
"sles",
47+
"manjaro",
48+
"linuxmint",
49+
"pop",
50+
"elementary",
51+
"kali",
52+
"gentoo",
53+
"slackware"
54+
]
55+
},
56+
"uniqueItems": true
3057
}
3158
},
3259
"required": ["type"]

src/types/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export interface ResourceConfig extends Config {
2525
name?: string;
2626
dependsOn?: string[];
2727
os?: Array<ResourceOs>;
28+
distro?: Array<LinuxDistro>
2829
}
2930

3031
export enum MessageStatus {
@@ -128,6 +129,11 @@ export interface GetResourceInfoResponseData {
128129
},
129130
sensitiveParameters?: string[];
130131
allowMultiple: boolean;
132+
defaultConfig?: Record<string, unknown>;
133+
exampleConfigs?: {
134+
example1?: Record<string, unknown>;
135+
example2?: Record<string, unknown>;
136+
};
131137
}
132138

133139
export interface MatchRequestData {
@@ -198,6 +204,7 @@ export interface CommandRequestData {
198204
cwd?: string;
199205
interactive?: boolean;
200206
requiresRoot?: boolean;
207+
requiresSudoAskpass?: boolean;
201208
stdin?: boolean;
202209
} & Omit<SpawnOptions, 'stdio' | 'shell' | 'detached'>
203210
}

0 commit comments

Comments
 (0)