codify-schemas 1.0.86-beta2 → 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.
- package/dist/messages/command-request-data-schema.json +10 -6
- package/dist/messages/commands.d.ts +1 -1
- package/dist/messages/commands.js +1 -1
- package/dist/messages/commands.js.map +1 -1
- package/dist/types/index.d.ts +2 -5
- package/dist/types/index.js +0 -5
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
- package/src/messages/command-request-data-schema.json +10 -6
- package/src/messages/command-request-data-schema.test.ts +2 -4
- package/src/messages/commands.ts +1 -1
- package/src/types/index.ts +2 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"$id": "https://www.codifycli.com/
|
|
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"
|
|
36
|
+
"required": ["command"],
|
|
33
37
|
"additionalProperties": false
|
|
34
38
|
}
|
|
@@ -3,7 +3,7 @@ export declare enum MessageCmd {
|
|
|
3
3
|
VALIDATE = "validate",
|
|
4
4
|
PLAN = "plan",
|
|
5
5
|
APPLY = "apply",
|
|
6
|
-
|
|
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["
|
|
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,
|
|
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"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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 {
|
package/dist/types/index.js
CHANGED
|
@@ -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";
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IAC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,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
|
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
-
"$id": "https://www.codifycli.com/
|
|
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"
|
|
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;
|
package/src/messages/commands.ts
CHANGED
|
@@ -3,7 +3,7 @@ export enum MessageCmd {
|
|
|
3
3
|
VALIDATE = 'validate',
|
|
4
4
|
PLAN = 'plan',
|
|
5
5
|
APPLY = 'apply',
|
|
6
|
-
|
|
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
|
}
|
package/src/types/index.ts
CHANGED
|
@@ -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
|
|