codify-schemas 1.0.52 → 1.0.53

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.
@@ -18,21 +18,17 @@ describe("Config file schema tests", () => {
18
18
 
19
19
  expect(validator([
20
20
  {
21
- "type": "resource1",
21
+ "type": "homebrew",
22
22
  },
23
23
  {
24
- "type": "resource2",
25
- "name": "abc",
26
- "prop1": {
27
- "a": "b",
28
- },
29
- "prop2": "c"
24
+ "type": "git",
25
+ "email": "evon@gmail.com"
30
26
  }
31
27
  ])).to.be.true;
32
28
 
33
29
  expect(validator([
34
30
  {
35
- "type": "resource1",
31
+ "type": "jenv",
36
32
  "dependsOn": [
37
33
  "resource2"
38
34
  ]
@@ -45,42 +41,57 @@ describe("Config file schema tests", () => {
45
41
  "version": "0.0.1",
46
42
  "description": "description",
47
43
  }
44
+ ])).to.be.true
45
+
46
+ expect(validator([
47
+ {
48
+ "type": "project",
49
+ },
50
+ {
51
+ "type": "asdf"
52
+ }
48
53
  ])).to.be.true;
49
54
  })
50
55
 
51
56
  it('And errors on improper json', () => {
52
57
  const validator = ajv.compile(schema);
53
58
 
54
- expect(validator({
55
- "a": {},
56
- "b": {},
59
+ expect(validator({ // must be a top level array
57
60
  })).to.be.false;
58
61
 
59
62
  expect(validator([
60
63
  {
61
- "type": "resource1"
64
+ "type": "resource1" // type Id is not valid
65
+ },
66
+ ])).to.be.false;
67
+
68
+ expect(validator([
69
+ {
70
+ "type": "homebrew"
62
71
  },
63
- "homebrew"
72
+ "homebrew" // must be an array of objects
64
73
  ])).to.be.false;
65
74
 
66
75
  expect(validator([
67
76
  {
68
- "type": "resource1"
77
+ "type": "homebrew"
69
78
  },
70
- {}
79
+ {} // must contain type
71
80
  ])).to.be.false;
72
81
 
73
82
  expect(validator([
74
83
  {
75
84
  "type": "resource1",
76
- "dependsOn": {}
85
+ "dependsOn": {} //must be array
77
86
  }
78
87
  ])).to.be.false;
79
88
 
80
89
  expect(validator([
81
90
  {
82
91
  "type": "project",
83
- "additionalProperty": true
92
+ },
93
+ {
94
+ "type": "resource1" // not a valid typeId
84
95
  }
85
96
  ])).to.be.false;
86
97
  })
@@ -31,6 +31,13 @@ export interface IpcMessage {
31
31
  data: unknown | null;
32
32
  }
33
33
 
34
+ export interface IpcMessageV2 {
35
+ cmd: string;
36
+ requestId: string;
37
+ status?: MessageStatus;
38
+ data: unknown | null;
39
+ }
40
+
34
41
  export interface ValidateRequestData {
35
42
  configs: ResourceConfig[];
36
43
  }