codify-schemas 1.0.79 → 1.0.80

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"]
62
+ "required": ["type", "plugin", "sensitiveParameters", "allowMultiple"]
63
63
  }
@@ -13,16 +13,58 @@
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
+ },
16
20
  "dependencies": {
17
21
  "type": "array",
18
22
  "items": {
19
23
  "type": "string"
20
24
  }
25
+ },
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
+ "sensitiveParameters": {
54
+ "type": "array",
55
+ "items": {
56
+ "type": "string"
57
+ }
58
+ },
59
+ "allowMultiple": {
60
+ "type": "boolean"
21
61
  }
22
62
  },
23
63
  "required": [
24
64
  "type",
25
- "dependencies"
65
+ "dependencies",
66
+ "sensitiveParameters",
67
+ "allowMultiple"
26
68
  ]
27
69
  }
28
70
  }
@@ -123,7 +123,6 @@ export interface ImportRequestData {
123
123
  core: ResourceConfig;
124
124
  parameters: Record<string, unknown>;
125
125
  autoSearchAll?: boolean;
126
- includeSensitive?: boolean;
127
126
  }
128
127
  export interface ImportResponseData {
129
128
  request: ResourceJson;
@@ -144,15 +143,11 @@ export interface ApplyRequestData {
144
143
  }>;
145
144
  };
146
145
  }
147
- export interface ResourceDefinition {
148
- type: string;
149
- dependencies: string[];
150
- }
151
146
  export interface InitializeRequestData {
152
147
  verbosityLevel?: number;
153
148
  }
154
149
  export interface InitializeResponseData {
155
- resourceDefinitions: Array<ResourceDefinition>;
150
+ resourceDefinitions: Array<GetResourceInfoResponseData>;
156
151
  }
157
152
  export interface SudoRequestData {
158
153
  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;AAoHD,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;AA8GD,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.79",
3
+ "version": "1.0.80",
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"]
62
+ "required": ["type", "plugin", "sensitiveParameters", "allowMultiple"]
63
63
  }
@@ -41,7 +41,6 @@ describe('Get resources response data schema', () => {
41
41
  "type": "string"
42
42
  }
43
43
  },
44
- "sensitiveParameters": ['schema']
45
44
  },
46
45
  dependencies: [
47
46
  "typeA",
@@ -57,11 +56,7 @@ describe('Get resources response data schema', () => {
57
56
  requiredParameters: ['plugin']
58
57
  },
59
58
  allowMultiple: true,
60
- })).to.be.true;
61
-
62
- expect(validate({
63
- type: 'type',
64
- plugin: 'core-plugin',
59
+ sensitiveParameters: [],
65
60
  })).to.be.true;
66
61
 
67
62
  // For testing the typescript type
@@ -13,16 +13,58 @@
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
+ },
16
20
  "dependencies": {
17
21
  "type": "array",
18
22
  "items": {
19
23
  "type": "string"
20
24
  }
25
+ },
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
+ "sensitiveParameters": {
54
+ "type": "array",
55
+ "items": {
56
+ "type": "string"
57
+ }
58
+ },
59
+ "allowMultiple": {
60
+ "type": "boolean"
21
61
  }
22
62
  },
23
63
  "required": [
24
64
  "type",
25
- "dependencies"
65
+ "dependencies",
66
+ "sensitiveParameters",
67
+ "allowMultiple"
26
68
  ]
27
69
  }
28
70
  }
@@ -13,18 +13,98 @@ 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
- expect(validate({
16
+ validate({
17
17
  resourceDefinitions: [
18
18
  {
19
- type: 'typeA',
20
- dependencies: ['typeB']
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: [],
21
60
  },
22
61
  {
23
- type: 'typeB',
24
- dependencies: [],
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: [],
25
103
  }
26
104
  ]
27
- })).to.be.true;
105
+ })
106
+
107
+ console.log(validate.errors);
28
108
 
29
109
  expect(validate({
30
110
  resourceDefinitions: [
@@ -142,7 +142,6 @@ export interface ImportRequestData {
142
142
  core: ResourceConfig;
143
143
  parameters: Record<string, unknown>;
144
144
  autoSearchAll?: boolean;
145
- includeSensitive?: boolean;
146
145
  }
147
146
 
148
147
  export interface ImportResponseData {
@@ -166,17 +165,12 @@ export interface ApplyRequestData {
166
165
  }
167
166
  }
168
167
 
169
- export interface ResourceDefinition {
170
- type: string;
171
- dependencies: string[];
172
- }
173
-
174
168
  export interface InitializeRequestData {
175
169
  verbosityLevel?: number;
176
170
  }
177
171
 
178
172
  export interface InitializeResponseData {
179
- resourceDefinitions: Array<ResourceDefinition>;
173
+ resourceDefinitions: Array<GetResourceInfoResponseData>;
180
174
  }
181
175
 
182
176
  export interface SudoRequestData {