codify-schemas 1.0.80 → 1.0.81

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.
@@ -59,5 +59,5 @@
59
59
  "type": "boolean"
60
60
  }
61
61
  },
62
- "required": ["type", "plugin", "sensitiveParameters", "allowMultiple"]
62
+ "required": ["type", "plugin"]
63
63
  }
@@ -13,58 +13,22 @@
13
13
  "type": {
14
14
  "type": "string"
15
15
  },
16
- "schema": {
17
- "type": "object",
18
- "description": "The JSON Schema validation schema for the resource."
19
- },
20
16
  "dependencies": {
21
17
  "type": "array",
22
18
  "items": {
23
19
  "type": "string"
24
20
  }
25
21
  },
26
- "import": {
27
- "type": "object",
28
- "properties": {
29
- "requiredProperties": {
30
- "type": "array",
31
- "items": {
32
- "type": "string"
33
- }
34
- }
35
- }
36
- },
37
- "importAndDestroy": {
38
- "type": "object",
39
- "properties": {
40
- "requiredParameters": {
41
- "type": "array",
42
- "items": {
43
- "type": "string"
44
- },
45
- "description": "A list of properties that are required for importing and destroying a resource"
46
- },
47
- "preventImport": {
48
- "type": "boolean",
49
- "description": "Controls whether a resource can be imported. For example: action resources cannot be imported"
50
- }
51
- }
52
- },
53
22
  "sensitiveParameters": {
54
23
  "type": "array",
55
24
  "items": {
56
25
  "type": "string"
57
26
  }
58
- },
59
- "allowMultiple": {
60
- "type": "boolean"
61
27
  }
62
28
  },
63
29
  "required": [
64
30
  "type",
65
- "dependencies",
66
- "sensitiveParameters",
67
- "allowMultiple"
31
+ "dependencies"
68
32
  ]
69
33
  }
70
34
  }
@@ -100,7 +100,7 @@ export interface GetResourceInfoResponseData {
100
100
  requiredParameters: string[] | null;
101
101
  preventImport?: boolean;
102
102
  };
103
- sensitiveParameters: string[];
103
+ sensitiveParameters?: string[];
104
104
  allowMultiple: boolean;
105
105
  }
106
106
  export interface MatchRequestData {
@@ -143,11 +143,16 @@ export interface ApplyRequestData {
143
143
  }>;
144
144
  };
145
145
  }
146
+ export interface ResourceDefinition {
147
+ type: string;
148
+ dependencies: string[];
149
+ sensitiveParameters?: string[];
150
+ }
146
151
  export interface InitializeRequestData {
147
152
  verbosityLevel?: number;
148
153
  }
149
154
  export interface InitializeResponseData {
150
- resourceDefinitions: Array<GetResourceInfoResponseData>;
155
+ resourceDefinitions: Array<ResourceDefinition>;
151
156
  }
152
157
  export interface SudoRequestData {
153
158
  command: string;
@@ -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;AA8GD,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB"}
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;AAoHD,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codify-schemas",
3
- "version": "1.0.80",
3
+ "version": "1.0.81",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -59,5 +59,5 @@
59
59
  "type": "boolean"
60
60
  }
61
61
  },
62
- "required": ["type", "plugin", "sensitiveParameters", "allowMultiple"]
62
+ "required": ["type", "plugin"]
63
63
  }
@@ -13,58 +13,22 @@
13
13
  "type": {
14
14
  "type": "string"
15
15
  },
16
- "schema": {
17
- "type": "object",
18
- "description": "The JSON Schema validation schema for the resource."
19
- },
20
16
  "dependencies": {
21
17
  "type": "array",
22
18
  "items": {
23
19
  "type": "string"
24
20
  }
25
21
  },
26
- "import": {
27
- "type": "object",
28
- "properties": {
29
- "requiredProperties": {
30
- "type": "array",
31
- "items": {
32
- "type": "string"
33
- }
34
- }
35
- }
36
- },
37
- "importAndDestroy": {
38
- "type": "object",
39
- "properties": {
40
- "requiredParameters": {
41
- "type": "array",
42
- "items": {
43
- "type": "string"
44
- },
45
- "description": "A list of properties that are required for importing and destroying a resource"
46
- },
47
- "preventImport": {
48
- "type": "boolean",
49
- "description": "Controls whether a resource can be imported. For example: action resources cannot be imported"
50
- }
51
- }
52
- },
53
22
  "sensitiveParameters": {
54
23
  "type": "array",
55
24
  "items": {
56
25
  "type": "string"
57
26
  }
58
- },
59
- "allowMultiple": {
60
- "type": "boolean"
61
27
  }
62
28
  },
63
29
  "required": [
64
30
  "type",
65
- "dependencies",
66
- "sensitiveParameters",
67
- "allowMultiple"
31
+ "dependencies"
68
32
  ]
69
33
  }
70
34
  }
@@ -13,98 +13,19 @@ describe('Get resources response data schema', () => {
13
13
 
14
14
  it("requires type and dependencies to be defined", () => {
15
15
  const validate = ajv.compile(schema);
16
- validate({
16
+ expect(validate({
17
17
  resourceDefinitions: [
18
18
  {
19
- type: 'type',
20
- plugin: 'core-plugin',
21
- schema: {
22
- "$schema": "http://json-schema.org/draft-07/schema",
23
- "$id": "https://www.codifycli.com/get-resource-schema-data-schema.json",
24
- "title": "Get Resource Schema",
25
- "type": "object",
26
- "properties": {
27
- "plugin": {
28
- "type": "string",
29
- "description": "The plugin the resource is from"
30
- },
31
- "type": {
32
- "type": "string",
33
- "description": "The id/type of the resource"
34
- },
35
- "schema": {
36
- "type": "object",
37
- "description": "The JSON Schema validation schema for the resource."
38
- },
39
- "dependencies": {
40
- "type": "array",
41
- "items": {
42
- "type": "string"
43
- }
44
- },
45
- },
46
- },
47
- dependencies: [
48
- "typeA",
49
- "typeB"
50
- ],
51
- import: {
52
- requiredParameters: ['plugin'],
53
- },
54
- importAndDestroy: {
55
- preventImport: true,
56
- requiredParameters: ['plugin']
57
- },
58
- allowMultiple: true,
59
- sensitiveParameters: [],
19
+ type: 'typeA',
20
+ dependencies: ['typeB']
60
21
  },
61
22
  {
62
- type: 'type',
63
- plugin: 'core-plugin',
64
- schema: {
65
- "$schema": "http://json-schema.org/draft-07/schema",
66
- "$id": "https://www.codifycli.com/get-resource-schema-data-schema.json",
67
- "title": "Get Resource Schema",
68
- "type": "object",
69
- "properties": {
70
- "plugin": {
71
- "type": "string",
72
- "description": "The plugin the resource is from"
73
- },
74
- "type": {
75
- "type": "string",
76
- "description": "The id/type of the resource"
77
- },
78
- "schema": {
79
- "type": "object",
80
- "description": "The JSON Schema validation schema for the resource."
81
- },
82
- "dependencies": {
83
- "type": "array",
84
- "items": {
85
- "type": "string"
86
- }
87
- },
88
- },
89
- },
90
- dependencies: [
91
- "typeA",
92
- "typeB"
93
- ],
94
- import: {
95
- requiredParameters: ['plugin'],
96
- },
97
- importAndDestroy: {
98
- preventImport: true,
99
- requiredParameters: ['plugin']
100
- },
101
- allowMultiple: true,
102
- sensitiveParameters: [],
23
+ type: 'typeB',
24
+ dependencies: [],
25
+ sensitiveParameters: ['paramA', 'paramB'],
103
26
  }
104
27
  ]
105
- })
106
-
107
- console.log(validate.errors);
28
+ })).to.be.true;
108
29
 
109
30
  expect(validate({
110
31
  resourceDefinitions: [
@@ -116,7 +116,7 @@ export interface GetResourceInfoResponseData {
116
116
  requiredParameters: string[] | null;
117
117
  preventImport?: boolean;
118
118
  },
119
- sensitiveParameters: string[];
119
+ sensitiveParameters?: string[];
120
120
  allowMultiple: boolean;
121
121
  }
122
122
 
@@ -165,12 +165,18 @@ export interface ApplyRequestData {
165
165
  }
166
166
  }
167
167
 
168
+ export interface ResourceDefinition {
169
+ type: string;
170
+ dependencies: string[];
171
+ sensitiveParameters?: string[];
172
+ }
173
+
168
174
  export interface InitializeRequestData {
169
175
  verbosityLevel?: number;
170
176
  }
171
177
 
172
178
  export interface InitializeResponseData {
173
- resourceDefinitions: Array<GetResourceInfoResponseData>;
179
+ resourceDefinitions: Array<ResourceDefinition>;
174
180
  }
175
181
 
176
182
  export interface SudoRequestData {