codify-schemas 1.0.86-beta3 → 1.0.86-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.
@@ -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,19 @@
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"
27
31
  }
28
32
  },
29
33
  "additionalProperties": true
30
34
  }
31
35
  },
32
- "required": ["command", "type"],
36
+ "required": ["command"],
33
37
  "additionalProperties": false
34
38
  }
@@ -158,15 +158,12 @@ export interface InitializeRequestData {
158
158
  export interface InitializeResponseData {
159
159
  resourceDefinitions: Array<ResourceDefinition>;
160
160
  }
161
- export declare enum CommandRequestType {
162
- SUDO = "sudo",
163
- INTERACTIVE = "interactive"
164
- }
165
161
  export interface CommandRequestData {
166
162
  command: string;
167
- type: CommandRequestType;
168
163
  options: {
169
164
  cwd?: string;
165
+ interactive?: boolean;
166
+ requiresRoot?: boolean;
170
167
  } & Omit<SpawnOptions, 'stdio' | 'shell' | 'detached'>;
171
168
  }
172
169
  export interface CommandRequestResponseData {
@@ -18,11 +18,6 @@ export var ParameterOperation;
18
18
  ParameterOperation["MODIFY"] = "modify";
19
19
  ParameterOperation["NOOP"] = "noop";
20
20
  })(ParameterOperation || (ParameterOperation = {}));
21
- export var CommandRequestType;
22
- (function (CommandRequestType) {
23
- CommandRequestType["SUDO"] = "sudo";
24
- CommandRequestType["INTERACTIVE"] = "interactive";
25
- })(CommandRequestType || (CommandRequestType = {}));
26
21
  export var SpawnStatus;
27
22
  (function (SpawnStatus) {
28
23
  SpawnStatus["SUCCESS"] = "success";
@@ -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":"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;AA2HD,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codify-schemas",
3
- "version": "1.0.86-beta3",
3
+ "version": "1.0.86-beta4",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/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,19 @@
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"
27
31
  }
28
32
  },
29
33
  "additionalProperties": true
30
34
  }
31
35
  },
32
- "required": ["command", "type"],
36
+ "required": ["command"],
33
37
  "additionalProperties": false
34
38
  }
@@ -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;
@@ -183,16 +183,12 @@ export interface InitializeResponseData {
183
183
  resourceDefinitions: Array<ResourceDefinition>;
184
184
  }
185
185
 
186
- export enum CommandRequestType {
187
- SUDO = 'sudo',
188
- INTERACTIVE = 'interactive'
189
- }
190
-
191
186
  export interface CommandRequestData {
192
187
  command: string;
193
- type: CommandRequestType,
194
188
  options: {
195
189
  cwd?: string;
190
+ interactive?: boolean;
191
+ requiresRoot?: boolean;
196
192
  } & Omit<SpawnOptions, 'stdio' | 'shell' | 'detached'>
197
193
  }
198
194