codify-schemas 1.0.86-beta4 → 1.0.86-beta6
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 +4 -0
- package/dist/resource-schema.json +7 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +6 -0
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
- package/src/messages/command-request-data-schema.json +4 -0
- package/src/resource-schema.json +7 -0
- package/src/resource-schema.test.ts +8 -0
- package/src/types/index.ts +8 -0
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
"interactive": {
|
|
29
29
|
"type": "boolean",
|
|
30
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"
|
|
31
35
|
}
|
|
32
36
|
},
|
|
33
37
|
"additionalProperties": true
|
|
@@ -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",
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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: [ResourceOs.LINUX, ResourceOs.MACOS, ResourceOs.WINDOWS];
|
|
17
23
|
}
|
|
18
24
|
export declare enum MessageStatus {
|
|
19
25
|
SUCCESS = "success",
|
|
@@ -164,6 +170,7 @@ export interface CommandRequestData {
|
|
|
164
170
|
cwd?: string;
|
|
165
171
|
interactive?: boolean;
|
|
166
172
|
requiresRoot?: boolean;
|
|
173
|
+
stdin?: boolean;
|
|
167
174
|
} & Omit<SpawnOptions, 'stdio' | 'shell' | 'detached'>;
|
|
168
175
|
}
|
|
169
176
|
export interface CommandRequestResponseData {
|
package/dist/types/index.js
CHANGED
|
@@ -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";
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"
|
|
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,QAIrB;AAQD,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;AA4HD,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
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
"interactive": {
|
|
29
29
|
"type": "boolean",
|
|
30
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"
|
|
31
35
|
}
|
|
32
36
|
},
|
|
33
37
|
"additionalProperties": true
|
package/src/resource-schema.json
CHANGED
|
@@ -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
|
});
|
package/src/types/index.ts
CHANGED
|
@@ -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: [ResourceOs.LINUX, ResourceOs.MACOS, ResourceOs.WINDOWS];
|
|
21
28
|
}
|
|
22
29
|
|
|
23
30
|
export enum MessageStatus {
|
|
@@ -189,6 +196,7 @@ export interface CommandRequestData {
|
|
|
189
196
|
cwd?: string;
|
|
190
197
|
interactive?: boolean;
|
|
191
198
|
requiresRoot?: boolean;
|
|
199
|
+
stdin?: boolean;
|
|
192
200
|
} & Omit<SpawnOptions, 'stdio' | 'shell' | 'detached'>
|
|
193
201
|
}
|
|
194
202
|
|