codify-schemas 1.0.86-beta1 → 1.0.86-beta11

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.
Files changed (34) hide show
  1. package/dist/index.d.ts +5 -4
  2. package/dist/index.js +5 -4
  3. package/dist/index.js.map +1 -1
  4. package/dist/messages/command-request-data-schema.json +14 -6
  5. package/dist/messages/commands.d.ts +1 -1
  6. package/dist/messages/commands.js +1 -1
  7. package/dist/messages/commands.js.map +1 -1
  8. package/dist/messages/empty-response-data-schema.json +7 -0
  9. package/dist/messages/get-resource-info-response-data-schema.json +7 -0
  10. package/dist/messages/initialize-response-data-schema.json +6 -0
  11. package/dist/messages/set-verbosity-request-data-schema.json +14 -0
  12. package/dist/resource-schema.json +7 -0
  13. package/dist/types/index.d.ts +39 -7
  14. package/dist/types/index.js +28 -5
  15. package/dist/types/index.js.map +1 -1
  16. package/package.json +1 -1
  17. package/src/index.ts +8 -6
  18. package/src/messages/command-request-data-schema.json +14 -6
  19. package/src/messages/command-request-data-schema.test.ts +2 -4
  20. package/src/messages/commands.ts +1 -1
  21. package/src/messages/empty-response-data-schema.json +7 -0
  22. package/src/messages/{apply-response-data-schema.test.ts → empty-response-data-schema.test.ts} +4 -7
  23. package/src/messages/get-resource-info-response-data-schema.json +7 -0
  24. package/src/messages/get-resource-info-response-data-schema.test.ts +1 -1
  25. package/src/messages/initialize-response-data-schema.json +7 -0
  26. package/src/messages/set-verbosity-request-data-schema.json +14 -0
  27. package/src/messages/set-verbosity-request-data-schema.test.ts +20 -0
  28. package/src/resource-schema.json +7 -0
  29. package/src/resource-schema.test.ts +8 -0
  30. package/src/types/index.ts +42 -8
  31. package/tsconfig.json +1 -0
  32. package/dist/messages/sudo-request-data-schema.json +0 -30
  33. package/dist/messages/sudo-response-data-schema.json +0 -19
  34. package/src/messages/apply-response-data-schema.json +0 -6
package/dist/index.d.ts CHANGED
@@ -4,7 +4,6 @@ import ResourceSchema from './resource-schema.json';
4
4
  import IpcMessageSchema from './ipc-message-schema.json';
5
5
  import IpcMessageV2Schema from './ipc-message-schema-v2.json';
6
6
  import ApplyRequestDataSchema from './messages/apply-request-data-schema.json';
7
- import ApplyResponseDataSchema from './messages/apply-response-data-schema.json';
8
7
  import ErrorResponseDataSchema from './messages/error-response-data-schema.json';
9
8
  import GetResourceInfoRequestDataSchema from './messages/get-resource-info-request-data-schema.json';
10
9
  import GetResourceInfoResponseDataSchema from './messages/get-resource-info-response-data-schema.json';
@@ -18,10 +17,12 @@ import ValidateRequestDataSchema from './messages/validate-request-data-schema.j
18
17
  import ValidateResponseDataSchema from './messages/validate-response-data-schema.json';
19
18
  import InitializeRequestDataSchema from './messages/initialize-request-data-schema.json';
20
19
  import InitializeResponseDataSchema from './messages/initialize-response-data-schema.json';
21
- import SudoRequestDataSchema from './messages/command-request-data-schema.json';
22
- import SudoRequestResponseDataSchema from './messages/command-response-data-schema.json';
20
+ import CommandRequestDataSchema from './messages/command-request-data-schema.json';
21
+ import CommandRequestResponseDataSchema from './messages/command-response-data-schema.json';
23
22
  import PressKeyToContinueRequestDataSchema from './messages/press-key-to-continue-request-data-schema.json';
24
23
  import PressKeyToContinueResponseDataSchema from './messages/press-key-to-continue-response-data-schema.json';
25
- export { ConfigFileSchema, ProjectSchema, ResourceSchema, IpcMessageSchema, IpcMessageV2Schema, ApplyRequestDataSchema, ApplyResponseDataSchema, ErrorResponseDataSchema, GetResourceInfoRequestDataSchema, GetResourceInfoResponseDataSchema, ImportRequestDataSchema, ImportResponseDataSchema, MatchRequestDataSchema, MatchResponseDataSchema, PlanRequestDataSchema, PlanResponseDataSchema, ValidateRequestDataSchema, ValidateResponseDataSchema, InitializeRequestDataSchema, InitializeResponseDataSchema, SudoRequestDataSchema, SudoRequestResponseDataSchema, PressKeyToContinueRequestDataSchema, PressKeyToContinueResponseDataSchema, };
24
+ import SetVerbosityRequestDataSchema from './messages/set-verbosity-request-data-schema.json';
25
+ import EmptyResponseDataSchema from './messages/empty-response-data-schema.json';
26
+ export { ConfigFileSchema, ProjectSchema, ResourceSchema, IpcMessageSchema, IpcMessageV2Schema, ApplyRequestDataSchema, ErrorResponseDataSchema, GetResourceInfoRequestDataSchema, GetResourceInfoResponseDataSchema, ImportRequestDataSchema, ImportResponseDataSchema, MatchRequestDataSchema, MatchResponseDataSchema, PlanRequestDataSchema, PlanResponseDataSchema, ValidateRequestDataSchema, ValidateResponseDataSchema, InitializeRequestDataSchema, InitializeResponseDataSchema, CommandRequestDataSchema, CommandRequestResponseDataSchema, PressKeyToContinueRequestDataSchema, PressKeyToContinueResponseDataSchema, SetVerbosityRequestDataSchema, EmptyResponseDataSchema, };
26
27
  export * from './types/index.js';
27
28
  export * from './messages/commands.js';
package/dist/index.js CHANGED
@@ -4,7 +4,6 @@ import ResourceSchema from './resource-schema.json' with { type: 'json' };
4
4
  import IpcMessageSchema from './ipc-message-schema.json' with { type: 'json' };
5
5
  import IpcMessageV2Schema from './ipc-message-schema-v2.json' with { type: 'json' };
6
6
  import ApplyRequestDataSchema from './messages/apply-request-data-schema.json' with { type: 'json' };
7
- import ApplyResponseDataSchema from './messages/apply-response-data-schema.json' with { type: 'json' };
8
7
  import ErrorResponseDataSchema from './messages/error-response-data-schema.json' with { type: 'json' };
9
8
  import GetResourceInfoRequestDataSchema from './messages/get-resource-info-request-data-schema.json' with { type: 'json' };
10
9
  import GetResourceInfoResponseDataSchema from './messages/get-resource-info-response-data-schema.json' with { type: 'json' };
@@ -18,11 +17,13 @@ import ValidateRequestDataSchema from './messages/validate-request-data-schema.j
18
17
  import ValidateResponseDataSchema from './messages/validate-response-data-schema.json' with { type: 'json' };
19
18
  import InitializeRequestDataSchema from './messages/initialize-request-data-schema.json' with { type: 'json' };
20
19
  import InitializeResponseDataSchema from './messages/initialize-response-data-schema.json' with { type: 'json' };
21
- import SudoRequestDataSchema from './messages/command-request-data-schema.json' with { type: 'json' };
22
- import SudoRequestResponseDataSchema from './messages/command-response-data-schema.json' with { type: 'json' };
20
+ import CommandRequestDataSchema from './messages/command-request-data-schema.json' with { type: 'json' };
21
+ import CommandRequestResponseDataSchema from './messages/command-response-data-schema.json' with { type: 'json' };
23
22
  import PressKeyToContinueRequestDataSchema from './messages/press-key-to-continue-request-data-schema.json' with { type: 'json' };
24
23
  import PressKeyToContinueResponseDataSchema from './messages/press-key-to-continue-response-data-schema.json' with { type: 'json' };
25
- export { ConfigFileSchema, ProjectSchema, ResourceSchema, IpcMessageSchema, IpcMessageV2Schema, ApplyRequestDataSchema, ApplyResponseDataSchema, ErrorResponseDataSchema, GetResourceInfoRequestDataSchema, GetResourceInfoResponseDataSchema, ImportRequestDataSchema, ImportResponseDataSchema, MatchRequestDataSchema, MatchResponseDataSchema, PlanRequestDataSchema, PlanResponseDataSchema, ValidateRequestDataSchema, ValidateResponseDataSchema, InitializeRequestDataSchema, InitializeResponseDataSchema, SudoRequestDataSchema, SudoRequestResponseDataSchema, PressKeyToContinueRequestDataSchema, PressKeyToContinueResponseDataSchema, };
24
+ import SetVerbosityRequestDataSchema from './messages/set-verbosity-request-data-schema.json' with { type: 'json' };
25
+ import EmptyResponseDataSchema from './messages/empty-response-data-schema.json' with { type: 'json' };
26
+ export { ConfigFileSchema, ProjectSchema, ResourceSchema, IpcMessageSchema, IpcMessageV2Schema, ApplyRequestDataSchema, ErrorResponseDataSchema, GetResourceInfoRequestDataSchema, GetResourceInfoResponseDataSchema, ImportRequestDataSchema, ImportResponseDataSchema, MatchRequestDataSchema, MatchResponseDataSchema, PlanRequestDataSchema, PlanResponseDataSchema, ValidateRequestDataSchema, ValidateResponseDataSchema, InitializeRequestDataSchema, InitializeResponseDataSchema, CommandRequestDataSchema, CommandRequestResponseDataSchema, PressKeyToContinueRequestDataSchema, PressKeyToContinueResponseDataSchema, SetVerbosityRequestDataSchema, EmptyResponseDataSchema, };
26
27
  export * from './types/index.js';
27
28
  export * from './messages/commands.js';
28
29
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version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AC1G,OAAO,2BAA2B,MAAM,gDAAgD,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAA;AAC5G,OAAO,4BAA4B,MAAM,iDAAiD,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAA;AAC9G,OAAO,wBAAwB,MAAM,6CAA6C,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AACvG,OAAO,gCAAgC,MAAM,8CAA8C,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAChH,OAAO,mCAAmC,MAAM,2DAA2D,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAChI,OAAO,oCAAoC,MAAM,4DAA4D,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAClI,OAAO,6BAA6B,MAAM,mDAAmD,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAClH,OAAO,uBAAuB,MAAM,4CAA4C,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAErG,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,EACvB,gCAAgC,EAChC,iCAAiC,EACjC,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,EACxB,gCAAgC,EAChC,mCAAmC,EACnC,oCAAoC,EACpC,6BAA6B,EAC7B,uBAAuB,GACxB,CAAA;AAED,cAAc,kBAAkB,CAAC;AACjC,cAAc,wBAAwB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "https://www.codifycli.com/sudo-request.json",
3
+ "$id": "https://www.codifycli.com/command-request.json",
4
4
  "title": "Command request",
5
5
  "description": "Request the core CLI to perform a command. This is required for sudo and interactive",
6
6
  "type": "object",
@@ -9,10 +9,6 @@
9
9
  "type": "string",
10
10
  "description": "The command that is requesting sudo"
11
11
  },
12
- "type": {
13
- "enum": ["sudo", "interactive"],
14
- "description": "The request type. Right now only sudo and interactive are supported"
15
- },
16
12
  "options": {
17
13
  "type": "object",
18
14
  "description": "The options for codifySpawn that is needed to run the command",
@@ -24,11 +20,23 @@
24
20
  "argv0": {
25
21
  "type": "string",
26
22
  "description": "Arguments to pass in"
23
+ },
24
+ "requiresRoot": {
25
+ "type": "boolean",
26
+ "description": "Whether or not this command needs to be run in root"
27
+ },
28
+ "interactive": {
29
+ "type": "boolean",
30
+ "description": "Whether or not this command needs to be run in interactive mode"
31
+ },
32
+ "stdin": {
33
+ "type": "boolean",
34
+ "description": "Whether or not this command requires stdin"
27
35
  }
28
36
  },
29
37
  "additionalProperties": true
30
38
  }
31
39
  },
32
- "required": ["command", "type"],
40
+ "required": ["command"],
33
41
  "additionalProperties": false
34
42
  }
@@ -3,7 +3,7 @@ export declare enum MessageCmd {
3
3
  VALIDATE = "validate",
4
4
  PLAN = "plan",
5
5
  APPLY = "apply",
6
- SUDO_REQUEST = "sudo_request",
6
+ COMMAND_REQUEST = "command_request",
7
7
  PRESS_KEY_TO_CONTINUE_REQUEST = "press_key_to_continue_request",
8
8
  CODIFY_CREDENTIALS_REQUEST = "codify_credentials_request"
9
9
  }
@@ -4,7 +4,7 @@ export var MessageCmd;
4
4
  MessageCmd["VALIDATE"] = "validate";
5
5
  MessageCmd["PLAN"] = "plan";
6
6
  MessageCmd["APPLY"] = "apply";
7
- MessageCmd["SUDO_REQUEST"] = "sudo_request";
7
+ MessageCmd["COMMAND_REQUEST"] = "command_request";
8
8
  MessageCmd["PRESS_KEY_TO_CONTINUE_REQUEST"] = "press_key_to_continue_request";
9
9
  MessageCmd["CODIFY_CREDENTIALS_REQUEST"] = "codify_credentials_request";
10
10
  })(MessageCmd || (MessageCmd = {}));
@@ -1 +1 @@
1
- {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/messages/commands.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAQX;AARD,WAAY,UAAU;IACpB,uCAAyB,CAAA;IACzB,mCAAqB,CAAA;IACrB,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,2CAA6B,CAAA;IAC7B,6EAA+D,CAAA;IAC/D,uEAAyD,CAAA;AAC3D,CAAC,EARW,UAAU,KAAV,UAAU,QAQrB"}
1
+ {"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/messages/commands.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAQX;AARD,WAAY,UAAU;IACpB,uCAAyB,CAAA;IACzB,mCAAqB,CAAA;IACrB,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,iDAAmC,CAAA;IACnC,6EAA+D,CAAA;IAC/D,uEAAyD,CAAA;AAC3D,CAAC,EARW,UAAU,KAAV,UAAU,QAQrB"}
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "https://www.codifycli.com/empty-response-data-schema.json",
4
+ "title": "Empty Response Schema Data",
5
+ "description": "An empty response",
6
+ "type": "null"
7
+ }
@@ -28,6 +28,13 @@
28
28
  "enum": ["Darwin", "Linux", "Windows_NT"]
29
29
  }
30
30
  },
31
+ "linuxDistros": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "string",
35
+ "description": "The Linux distros the resource is compatible with"
36
+ }
37
+ },
31
38
  "import": {
32
39
  "type": "object",
33
40
  "properties": {
@@ -30,6 +30,12 @@
30
30
  "items": {
31
31
  "enum": ["Darwin", "Linux", "Windows_NT"]
32
32
  }
33
+ },
34
+ "linuxDistros": {
35
+ "type": "array",
36
+ "items": {
37
+ "type": "string"
38
+ }
33
39
  }
34
40
  },
35
41
  "required": [
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "https://www.codifycli.com/set-verbosity-request.json",
4
+ "title": "Set Verbosity Request",
5
+ "description": "Request the plugin to set its verbosity level",
6
+ "type": "object",
7
+ "properties": {
8
+ "verbosityLevel": {
9
+ "type": "number",
10
+ "description": "The verbosity level to set for the plugin"
11
+ }
12
+ },
13
+ "additionalProperties": false
14
+ }
@@ -9,6 +9,13 @@
9
9
  "type": "string",
10
10
  "pattern": "^[a-zA-Z][\\w-]+$"
11
11
  },
12
+ "os": {
13
+ "type": "array",
14
+ "items": {
15
+ "enum": ["linux", "macOS", "windows"]
16
+ },
17
+ "uniqueItems": true
18
+ },
12
19
  "name": {
13
20
  "description": "Optional name. Useful for specifying multiple resources of the same type",
14
21
  "type": "string",
@@ -1,5 +1,5 @@
1
- import { SpawnOptions } from "node:child_process";
2
- import { ErrorObject } from "ajv";
1
+ import type { SpawnOptions } from "node:child_process";
2
+ import type { ErrorObject } from "ajv";
3
3
  export interface StringIndexedObject {
4
4
  [x: string]: unknown;
5
5
  }
@@ -11,9 +11,15 @@ export interface ProjectConfig extends Config {
11
11
  plugins?: Record<string, string>;
12
12
  description?: string;
13
13
  }
14
+ export declare enum ResourceOs {
15
+ LINUX = "linux",
16
+ MACOS = "macOS",
17
+ WINDOWS = "windows"
18
+ }
14
19
  export interface ResourceConfig extends Config {
15
20
  name?: string;
16
21
  dependsOn?: string[];
22
+ os?: Array<ResourceOs>;
17
23
  }
18
24
  export declare enum MessageStatus {
19
25
  SUCCESS = "success",
@@ -98,6 +104,7 @@ export interface GetResourceInfoResponseData {
98
104
  requiredParameters: string[] | null;
99
105
  };
100
106
  operatingSystems?: OS[];
107
+ linuxDistros?: LinuxDistro[];
101
108
  importAndDestroy?: {
102
109
  requiredParameters: string[] | null;
103
110
  preventImport?: boolean;
@@ -150,6 +157,7 @@ export interface ResourceDefinition {
150
157
  type: string;
151
158
  dependencies: string[];
152
159
  operatingSystems?: OS[];
160
+ linuxDistros?: LinuxDistro[];
153
161
  sensitiveParameters?: string[];
154
162
  }
155
163
  export interface InitializeRequestData {
@@ -158,15 +166,13 @@ export interface InitializeRequestData {
158
166
  export interface InitializeResponseData {
159
167
  resourceDefinitions: Array<ResourceDefinition>;
160
168
  }
161
- export declare enum CommandRequestType {
162
- SUDO = "sudo",
163
- INTERACTIVE = "interactive"
164
- }
165
169
  export interface CommandRequestData {
166
170
  command: string;
167
- type: CommandRequestType;
168
171
  options: {
169
172
  cwd?: string;
173
+ interactive?: boolean;
174
+ requiresRoot?: boolean;
175
+ stdin?: boolean;
170
176
  } & Omit<SpawnOptions, 'stdio' | 'shell' | 'detached'>;
171
177
  }
172
178
  export interface CommandRequestResponseData {
@@ -179,6 +185,11 @@ export interface PressKeyToContinueRequestData {
179
185
  }
180
186
  export interface PressKeyToContinueResponseData {
181
187
  }
188
+ export interface SetVerbosityRequestData {
189
+ verbosityLevel: number;
190
+ }
191
+ export interface EmptyResponseData {
192
+ }
182
193
  export declare enum SpawnStatus {
183
194
  SUCCESS = "success",
184
195
  ERROR = "error"
@@ -188,3 +199,24 @@ export declare enum OS {
188
199
  Linux = "Linux",
189
200
  Windows = "Windows_NT"
190
201
  }
202
+ export declare enum LinuxDistro {
203
+ DEBIAN_BASED = "debian-based",
204
+ RPM_BASED = "rpm-based",
205
+ ARCH = "arch",
206
+ CENTOS = "centos",
207
+ DEBIAN = "debian",
208
+ FEDORA = "fedora",
209
+ RHEL = "rhel",
210
+ UBUNTU = "ubuntu",
211
+ ALPINE = "alpine",
212
+ AMAZON_LINUX = "amzn",
213
+ OPENSUSE = "opensuse",
214
+ SUSE = "sles",
215
+ MANJARO = "manjaro",
216
+ MINT = "linuxmint",
217
+ POP_OS = "pop",
218
+ ELEMENTARY_OS = "elementary",
219
+ KALI = "kali",
220
+ GENTOO = "gentoo",
221
+ SLACKWARE = "slackware"
222
+ }
@@ -1,3 +1,9 @@
1
+ export var ResourceOs;
2
+ (function (ResourceOs) {
3
+ ResourceOs["LINUX"] = "linux";
4
+ ResourceOs["MACOS"] = "macOS";
5
+ ResourceOs["WINDOWS"] = "windows";
6
+ })(ResourceOs || (ResourceOs = {}));
1
7
  export var MessageStatus;
2
8
  (function (MessageStatus) {
3
9
  MessageStatus["SUCCESS"] = "success";
@@ -18,11 +24,6 @@ export var ParameterOperation;
18
24
  ParameterOperation["MODIFY"] = "modify";
19
25
  ParameterOperation["NOOP"] = "noop";
20
26
  })(ParameterOperation || (ParameterOperation = {}));
21
- export var CommandRequestType;
22
- (function (CommandRequestType) {
23
- CommandRequestType["SUDO"] = "sudo";
24
- CommandRequestType["INTERACTIVE"] = "interactive";
25
- })(CommandRequestType || (CommandRequestType = {}));
26
27
  export var SpawnStatus;
27
28
  (function (SpawnStatus) {
28
29
  SpawnStatus["SUCCESS"] = "success";
@@ -34,4 +35,26 @@ export var OS;
34
35
  OS["Linux"] = "Linux";
35
36
  OS["Windows"] = "Windows_NT";
36
37
  })(OS || (OS = {}));
38
+ export var LinuxDistro;
39
+ (function (LinuxDistro) {
40
+ LinuxDistro["DEBIAN_BASED"] = "debian-based";
41
+ LinuxDistro["RPM_BASED"] = "rpm-based";
42
+ LinuxDistro["ARCH"] = "arch";
43
+ LinuxDistro["CENTOS"] = "centos";
44
+ LinuxDistro["DEBIAN"] = "debian";
45
+ LinuxDistro["FEDORA"] = "fedora";
46
+ LinuxDistro["RHEL"] = "rhel";
47
+ LinuxDistro["UBUNTU"] = "ubuntu";
48
+ LinuxDistro["ALPINE"] = "alpine";
49
+ LinuxDistro["AMAZON_LINUX"] = "amzn";
50
+ LinuxDistro["OPENSUSE"] = "opensuse";
51
+ LinuxDistro["SUSE"] = "sles";
52
+ LinuxDistro["MANJARO"] = "manjaro";
53
+ LinuxDistro["MINT"] = "linuxmint";
54
+ LinuxDistro["POP_OS"] = "pop";
55
+ LinuxDistro["ELEMENTARY_OS"] = "elementary";
56
+ LinuxDistro["KALI"] = "kali";
57
+ LinuxDistro["GENTOO"] = "gentoo";
58
+ LinuxDistro["SLACKWARE"] = "slackware";
59
+ })(LinuxDistro || (LinuxDistro = {}));
37
60
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,oCAAmB,CAAA;IACnB,gCAAe,CAAA;AACjB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AA6CD,MAAM,CAAN,IAAY,iBAMX;AAND,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,sCAAiB,CAAA;IACjB,0CAAqB,CAAA;IACrB,kCAAa,CAAA;AACf,CAAC,EANW,iBAAiB,KAAjB,iBAAiB,QAM5B;AAED,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,iCAAW,CAAA;IACX,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;IACjB,mCAAa,CAAA;AACf,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B;AAsGD,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,mCAAa,CAAA;IACb,iDAA2B,CAAA;AAC7B,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAsBD,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAED,MAAM,CAAN,IAAY,EAIX;AAJD,WAAY,EAAE;IACZ,uBAAiB,CAAA;IACjB,qBAAe,CAAA;IACf,4BAAsB,CAAA;AACxB,CAAC,EAJW,EAAE,KAAF,EAAE,QAIb"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,6BAAe,CAAA;IACf,6BAAe,CAAA;IACf,iCAAmB,CAAA;AACrB,CAAC,EAJW,UAAU,KAAV,UAAU,QAIr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W,WAAW,KAAX,WAAW,QAoBtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codify-schemas",
3
- "version": "1.0.86-beta1",
3
+ "version": "1.0.86-beta11",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -4,7 +4,6 @@ import ResourceSchema from './resource-schema.json' with {type: 'json'}
4
4
  import IpcMessageSchema from './ipc-message-schema.json' with {type: 'json'}
5
5
  import IpcMessageV2Schema from './ipc-message-schema-v2.json' with {type: 'json'}
6
6
  import ApplyRequestDataSchema from './messages/apply-request-data-schema.json' with {type: 'json'}
7
- import ApplyResponseDataSchema from './messages/apply-response-data-schema.json' with {type: 'json'}
8
7
  import ErrorResponseDataSchema from './messages/error-response-data-schema.json' with {type: 'json'}
9
8
  import GetResourceInfoRequestDataSchema from './messages/get-resource-info-request-data-schema.json' with {type: 'json'}
10
9
  import GetResourceInfoResponseDataSchema from './messages/get-resource-info-response-data-schema.json' with {type: 'json'}
@@ -18,10 +17,12 @@ import ValidateRequestDataSchema from './messages/validate-request-data-schema.j
18
17
  import ValidateResponseDataSchema from './messages/validate-response-data-schema.json' with {type: 'json'}
19
18
  import InitializeRequestDataSchema from './messages/initialize-request-data-schema.json' with {type: 'json'}
20
19
  import InitializeResponseDataSchema from './messages/initialize-response-data-schema.json' with {type: 'json'}
21
- import SudoRequestDataSchema from './messages/command-request-data-schema.json' with {type: 'json'};
22
- import SudoRequestResponseDataSchema from './messages/command-response-data-schema.json' with {type: 'json'};
20
+ import CommandRequestDataSchema from './messages/command-request-data-schema.json' with {type: 'json'};
21
+ import CommandRequestResponseDataSchema from './messages/command-response-data-schema.json' with {type: 'json'};
23
22
  import PressKeyToContinueRequestDataSchema from './messages/press-key-to-continue-request-data-schema.json' with {type: 'json'};
24
23
  import PressKeyToContinueResponseDataSchema from './messages/press-key-to-continue-response-data-schema.json' with {type: 'json'};
24
+ import SetVerbosityRequestDataSchema from './messages/set-verbosity-request-data-schema.json' with {type: 'json'};
25
+ import EmptyResponseDataSchema from './messages/empty-response-data-schema.json' with {type: 'json'};
25
26
 
26
27
  export {
27
28
  ConfigFileSchema,
@@ -30,7 +31,6 @@ export {
30
31
  IpcMessageSchema,
31
32
  IpcMessageV2Schema,
32
33
  ApplyRequestDataSchema,
33
- ApplyResponseDataSchema,
34
34
  ErrorResponseDataSchema,
35
35
  GetResourceInfoRequestDataSchema,
36
36
  GetResourceInfoResponseDataSchema,
@@ -44,10 +44,12 @@ export {
44
44
  ValidateResponseDataSchema,
45
45
  InitializeRequestDataSchema,
46
46
  InitializeResponseDataSchema,
47
- SudoRequestDataSchema,
48
- SudoRequestResponseDataSchema,
47
+ CommandRequestDataSchema,
48
+ CommandRequestResponseDataSchema,
49
49
  PressKeyToContinueRequestDataSchema,
50
50
  PressKeyToContinueResponseDataSchema,
51
+ SetVerbosityRequestDataSchema,
52
+ EmptyResponseDataSchema,
51
53
  }
52
54
 
53
55
  export * from './types/index.js';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "https://www.codifycli.com/sudo-request.json",
3
+ "$id": "https://www.codifycli.com/command-request.json",
4
4
  "title": "Command request",
5
5
  "description": "Request the core CLI to perform a command. This is required for sudo and interactive",
6
6
  "type": "object",
@@ -9,10 +9,6 @@
9
9
  "type": "string",
10
10
  "description": "The command that is requesting sudo"
11
11
  },
12
- "type": {
13
- "enum": ["sudo", "interactive"],
14
- "description": "The request type. Right now only sudo and interactive are supported"
15
- },
16
12
  "options": {
17
13
  "type": "object",
18
14
  "description": "The options for codifySpawn that is needed to run the command",
@@ -24,11 +20,23 @@
24
20
  "argv0": {
25
21
  "type": "string",
26
22
  "description": "Arguments to pass in"
23
+ },
24
+ "requiresRoot": {
25
+ "type": "boolean",
26
+ "description": "Whether or not this command needs to be run in root"
27
+ },
28
+ "interactive": {
29
+ "type": "boolean",
30
+ "description": "Whether or not this command needs to be run in interactive mode"
31
+ },
32
+ "stdin": {
33
+ "type": "boolean",
34
+ "description": "Whether or not this command requires stdin"
27
35
  }
28
36
  },
29
37
  "additionalProperties": true
30
38
  }
31
39
  },
32
- "required": ["command", "type"],
40
+ "required": ["command"],
33
41
  "additionalProperties": false
34
42
  }
@@ -15,7 +15,6 @@ describe('Get resources response data schema', () => {
15
15
  const validate = ajv.compile(schema);
16
16
  expect(validate({
17
17
  command: 'abc def',
18
- type: 'sudo'
19
18
  })).to.be.true;
20
19
  })
21
20
 
@@ -23,9 +22,9 @@ describe('Get resources response data schema', () => {
23
22
  const validate = ajv.compile(schema);
24
23
  expect(validate({
25
24
  command: 'abc def',
26
- type: 'interactive',
27
25
  options: {
28
26
  cwd: '.',
27
+ interactive: true,
29
28
  }
30
29
  })).to.be.true;
31
30
  })
@@ -34,7 +33,6 @@ describe('Get resources response data schema', () => {
34
33
  const validate = ajv.compile(schema);
35
34
  expect(validate({
36
35
  command: 'abc def',
37
- type: 'sudo',
38
36
  options: {
39
37
  cwd: '.',
40
38
  requiresRoot: true,
@@ -47,9 +45,9 @@ describe('Get resources response data schema', () => {
47
45
  const validate = ajv.compile(schema);
48
46
  expect(validate({
49
47
  command: 'abc def',
50
- type: 'interactive',
51
48
  options: {
52
49
  cwd: '.',
50
+ requiresRoot: true,
53
51
  },
54
52
  additional: {}
55
53
  })).to.be.false;
@@ -3,7 +3,7 @@ export enum MessageCmd {
3
3
  VALIDATE = 'validate',
4
4
  PLAN = 'plan',
5
5
  APPLY = 'apply',
6
- SUDO_REQUEST = 'sudo_request',
6
+ COMMAND_REQUEST = 'command_request',
7
7
  PRESS_KEY_TO_CONTINUE_REQUEST = 'press_key_to_continue_request',
8
8
  CODIFY_CREDENTIALS_REQUEST = 'codify_credentials_request'
9
9
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "https://www.codifycli.com/empty-response-data-schema.json",
4
+ "title": "Empty Response Schema Data",
5
+ "description": "An empty response",
6
+ "type": "null"
7
+ }
@@ -1,20 +1,17 @@
1
- import schema from './apply-response-data-schema.json';
1
+ import schema from './empty-response-data-schema.json';
2
2
  import {describe, expect, it} from 'vitest'
3
- import addFormats from 'ajv-formats';
4
- import Ajv from 'ajv';
3
+ import Ajv from 'ajv'
5
4
 
6
5
  const ajv = new Ajv({
7
6
  strict: true,
8
7
  })
9
8
 
10
- addFormats.default(ajv);
11
-
12
- describe('Apply request data schema', () => {
9
+ describe('Empty Response Data Schema', () => {
13
10
  it('compiles', () => {
14
11
  ajv.compile(schema);
15
12
  })
16
13
 
17
- it("validates an empty config", () => {
14
+ it("Only empty object", () => {
18
15
  const validate = ajv.compile(schema);
19
16
  expect(validate(null)).to.be.true;
20
17
  })
@@ -28,6 +28,13 @@
28
28
  "enum": ["Darwin", "Linux", "Windows_NT"]
29
29
  }
30
30
  },
31
+ "linuxDistros": {
32
+ "type": "array",
33
+ "items": {
34
+ "type": "string",
35
+ "description": "The Linux distros the resource is compatible with"
36
+ }
37
+ },
31
38
  "import": {
32
39
  "type": "object",
33
40
  "properties": {
@@ -1,7 +1,7 @@
1
1
  import schema from './get-resource-info-response-data-schema.json';
2
2
  import { describe, it, expect } from 'vitest'
3
3
  import Ajv from 'ajv'
4
- import {GetResourceInfoResponseData} from "../types.js";
4
+ import {GetResourceInfoResponseData} from "../types/index.js";
5
5
 
6
6
  const ajv = new Ajv({
7
7
  strict: true,
@@ -30,7 +30,14 @@
30
30
  "items": {
31
31
  "enum": ["Darwin", "Linux", "Windows_NT"]
32
32
  }
33
+ },
34
+ "linuxDistros": {
35
+ "type": "array",
36
+ "items": {
37
+ "type": "string"
38
+ }
33
39
  }
40
+
34
41
  },
35
42
  "required": [
36
43
  "type",
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "https://www.codifycli.com/set-verbosity-request.json",
4
+ "title": "Set Verbosity Request",
5
+ "description": "Request the plugin to set its verbosity level",
6
+ "type": "object",
7
+ "properties": {
8
+ "verbosityLevel": {
9
+ "type": "number",
10
+ "description": "The verbosity level to set for the plugin"
11
+ }
12
+ },
13
+ "additionalProperties": false
14
+ }
@@ -0,0 +1,20 @@
1
+ import schema from './set-verbosity-request-data-schema.json';
2
+ import {describe, expect, it} from 'vitest'
3
+ import Ajv from 'ajv'
4
+
5
+ const ajv = new Ajv({
6
+ strict: true,
7
+ })
8
+
9
+ describe('Set Verbosity Request Data Schema', () => {
10
+ it('compiles', () => {
11
+ ajv.compile(schema);
12
+ })
13
+
14
+ it("Sets a verbosity level", () => {
15
+ const validate = ajv.compile(schema);
16
+ expect(validate({
17
+ verbosityLevel: 2,
18
+ })).to.be.true;
19
+ })
20
+ })
@@ -9,6 +9,13 @@
9
9
  "type": "string",
10
10
  "pattern": "^[a-zA-Z][\\w-]+$"
11
11
  },
12
+ "os": {
13
+ "type": "array",
14
+ "items": {
15
+ "enum": ["linux", "macOS", "windows"]
16
+ },
17
+ "uniqueItems": true
18
+ },
12
19
  "name": {
13
20
  "description": "Optional name. Useful for specifying multiple resources of the same type",
14
21
  "type": "string",
@@ -36,4 +36,12 @@ describe("Resource schema tests", () => {
36
36
  expect(validate({ type: "type", dependsOn: "item1" })).to.be.false;
37
37
  expect(validate({ type: "type", dependsOn: [6] })).to.be.false;
38
38
  })
39
+
40
+ it("os supports linux, macOS, and windows", () => {
41
+ const validate = ajv.compile(schema);
42
+ expect(validate({ type: "type", os: ["macOS", "windows", "linux"] })).to.be.true;
43
+ expect(validate({ type: "type", os: ["item1", "item1"] })).to.be.false;
44
+ expect(validate({ type: "type", os: ["macOS"] })).to.be.true;
45
+ expect(validate({ type: "type", os: ["macOS", "macOS"] })).to.be.false;
46
+ })
39
47
  });
@@ -1,5 +1,5 @@
1
- import { SpawnOptions } from "node:child_process";
2
- import { ErrorObject } from "ajv";
1
+ import type {SpawnOptions} from "node:child_process";
2
+ import type {ErrorObject} from "ajv";
3
3
 
4
4
  export interface StringIndexedObject {
5
5
  [x: string]: unknown;
@@ -15,9 +15,16 @@ export interface ProjectConfig extends Config {
15
15
  description?: string;
16
16
  }
17
17
 
18
+ export enum ResourceOs {
19
+ LINUX = 'linux',
20
+ MACOS = 'macOS',
21
+ WINDOWS = 'windows',
22
+ }
23
+
18
24
  export interface ResourceConfig extends Config {
19
25
  name?: string;
20
26
  dependsOn?: string[];
27
+ os?: Array<ResourceOs>;
21
28
  }
22
29
 
23
30
  export enum MessageStatus {
@@ -114,6 +121,7 @@ export interface GetResourceInfoResponseData {
114
121
  requiredParameters: string[] | null;
115
122
  },
116
123
  operatingSystems?: OS[];
124
+ linuxDistros?: LinuxDistro[];
117
125
  importAndDestroy?: {
118
126
  requiredParameters: string[] | null;
119
127
  preventImport?: boolean;
@@ -172,6 +180,7 @@ export interface ResourceDefinition {
172
180
  type: string;
173
181
  dependencies: string[];
174
182
  operatingSystems?: OS[];
183
+ linuxDistros?: LinuxDistro[];
175
184
  sensitiveParameters?: string[];
176
185
  }
177
186
 
@@ -183,16 +192,13 @@ export interface InitializeResponseData {
183
192
  resourceDefinitions: Array<ResourceDefinition>;
184
193
  }
185
194
 
186
- export enum CommandRequestType {
187
- SUDO = 'sudo',
188
- INTERACTIVE = 'interactive'
189
- }
190
-
191
195
  export interface CommandRequestData {
192
196
  command: string;
193
- type: CommandRequestType,
194
197
  options: {
195
198
  cwd?: string;
199
+ interactive?: boolean;
200
+ requiresRoot?: boolean;
201
+ stdin?: boolean;
196
202
  } & Omit<SpawnOptions, 'stdio' | 'shell' | 'detached'>
197
203
  }
198
204
 
@@ -208,6 +214,12 @@ export interface PressKeyToContinueRequestData {
208
214
 
209
215
  export interface PressKeyToContinueResponseData {}
210
216
 
217
+ export interface SetVerbosityRequestData {
218
+ verbosityLevel: number;
219
+ }
220
+
221
+ export interface EmptyResponseData {}
222
+
211
223
  export enum SpawnStatus {
212
224
  SUCCESS = 'success',
213
225
  ERROR = 'error',
@@ -218,3 +230,25 @@ export enum OS {
218
230
  Linux = 'Linux',
219
231
  Windows = 'Windows_NT',
220
232
  }
233
+
234
+ export enum LinuxDistro {
235
+ DEBIAN_BASED = 'debian-based',
236
+ RPM_BASED = 'rpm-based',
237
+ ARCH = 'arch',
238
+ CENTOS = 'centos',
239
+ DEBIAN = 'debian',
240
+ FEDORA = 'fedora',
241
+ RHEL = 'rhel',
242
+ UBUNTU = 'ubuntu',
243
+ ALPINE = 'alpine',
244
+ AMAZON_LINUX = 'amzn',
245
+ OPENSUSE = 'opensuse',
246
+ SUSE = 'sles',
247
+ MANJARO = 'manjaro',
248
+ MINT = 'linuxmint',
249
+ POP_OS = 'pop',
250
+ ELEMENTARY_OS = 'elementary',
251
+ KALI = 'kali',
252
+ GENTOO = 'gentoo',
253
+ SLACKWARE = 'slackware',
254
+ }
package/tsconfig.json CHANGED
@@ -11,6 +11,7 @@
11
11
  "declaration": true,
12
12
  "emitDecoratorMetadata": true,
13
13
  "experimentalDecorators": true,
14
+ "verbatimModuleSyntax": true,
14
15
  "rootDir": "src",
15
16
  "outDir": "./dist"
16
17
  },
@@ -1,30 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "https://www.codifycli.com/sudo-request.json",
4
- "title": "Sudo request",
5
- "description": "Request sudo from the core CLI",
6
- "type": "object",
7
- "properties": {
8
- "command": {
9
- "type": "string",
10
- "description": "The command that is requesting sudo"
11
- },
12
- "options": {
13
- "type": "object",
14
- "description": "The options for codifySpawn that is needed to run the command",
15
- "properties": {
16
- "cwd": {
17
- "type": "string",
18
- "description": "Current working directory to run codifySpawn in"
19
- },
20
- "argv0": {
21
- "type": "string",
22
- "description": "Arguments to pass in"
23
- }
24
- },
25
- "additionalProperties": true
26
- }
27
- },
28
- "required": ["command"],
29
- "additionalProperties": false
30
- }
@@ -1,19 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "https://www.codifycli.com/sudo-request-response.json",
4
- "title": "Sudo request response",
5
- "description": "Response for a sudo request",
6
- "type": "object",
7
- "properties": {
8
- "status": {
9
- "enum": ["success", "error"],
10
- "description": "Reports if the operation was successful"
11
- },
12
- "data": {
13
- "type": "string",
14
- "description": "Data returned by the operation"
15
- }
16
- },
17
- "required": ["status", "data"],
18
- "additionalProperties": false
19
- }
@@ -1,6 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema",
3
- "$id": "https://www.codifycli.com/apply-response-data-schema.json",
4
- "title": "Apply Response Schema Data",
5
- "type": "null"
6
- }