codify-schemas 1.0.80 → 1.0.83
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/apply-request-data-schema.json +4 -0
- package/dist/messages/get-resource-info-response-data-schema.json +1 -1
- package/dist/messages/initialize-response-data-schema.json +1 -37
- package/dist/messages/plan-response-data-schema.json +4 -0
- package/dist/types/index.d.ts +9 -2
- package/dist/types/index.js.map +1 -1
- package/package.json +1 -1
- package/src/messages/apply-request-data-schema.json +4 -0
- package/src/messages/apply-request-data-schema.test.ts +1 -0
- package/src/messages/get-resource-info-response-data-schema.json +1 -1
- package/src/messages/initialize-response-data-schema.json +1 -37
- package/src/messages/initialize-response-data-schema.test.ts +7 -86
- package/src/messages/plan-response-data-schema.json +4 -0
- package/src/messages/plan-response-data-schema.test.ts +2 -1
- package/src/types/index.ts +10 -2
|
@@ -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
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -80,6 +80,7 @@ export interface PlanResponseData {
|
|
|
80
80
|
operation: ParameterOperation;
|
|
81
81
|
previousValue: unknown | null;
|
|
82
82
|
newValue: unknown | null;
|
|
83
|
+
isSensitive?: boolean;
|
|
83
84
|
}>;
|
|
84
85
|
}
|
|
85
86
|
export interface GetResourceInfoRequestData {
|
|
@@ -100,7 +101,7 @@ export interface GetResourceInfoResponseData {
|
|
|
100
101
|
requiredParameters: string[] | null;
|
|
101
102
|
preventImport?: boolean;
|
|
102
103
|
};
|
|
103
|
-
sensitiveParameters
|
|
104
|
+
sensitiveParameters?: string[];
|
|
104
105
|
allowMultiple: boolean;
|
|
105
106
|
}
|
|
106
107
|
export interface MatchRequestData {
|
|
@@ -140,14 +141,20 @@ export interface ApplyRequestData {
|
|
|
140
141
|
operation: ParameterOperation;
|
|
141
142
|
newValue: unknown | null;
|
|
142
143
|
previousValue: unknown | null;
|
|
144
|
+
isSensitive?: boolean;
|
|
143
145
|
}>;
|
|
144
146
|
};
|
|
145
147
|
}
|
|
148
|
+
export interface ResourceDefinition {
|
|
149
|
+
type: string;
|
|
150
|
+
dependencies: string[];
|
|
151
|
+
sensitiveParameters?: string[];
|
|
152
|
+
}
|
|
146
153
|
export interface InitializeRequestData {
|
|
147
154
|
verbosityLevel?: number;
|
|
148
155
|
}
|
|
149
156
|
export interface InitializeResponseData {
|
|
150
|
-
resourceDefinitions: Array<
|
|
157
|
+
resourceDefinitions: Array<ResourceDefinition>;
|
|
151
158
|
}
|
|
152
159
|
export interface SudoRequestData {
|
|
153
160
|
command: string;
|
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;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;
|
|
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;AAsHD,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;AACjB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB"}
|
package/package.json
CHANGED
|
@@ -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: '
|
|
20
|
-
|
|
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: '
|
|
63
|
-
|
|
64
|
-
|
|
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: [
|
package/src/types/index.ts
CHANGED
|
@@ -94,6 +94,7 @@ export interface PlanResponseData {
|
|
|
94
94
|
operation: ParameterOperation;
|
|
95
95
|
previousValue: unknown | null;
|
|
96
96
|
newValue: unknown | null;
|
|
97
|
+
isSensitive?: boolean;
|
|
97
98
|
}>
|
|
98
99
|
}
|
|
99
100
|
|
|
@@ -116,7 +117,7 @@ export interface GetResourceInfoResponseData {
|
|
|
116
117
|
requiredParameters: string[] | null;
|
|
117
118
|
preventImport?: boolean;
|
|
118
119
|
},
|
|
119
|
-
sensitiveParameters
|
|
120
|
+
sensitiveParameters?: string[];
|
|
120
121
|
allowMultiple: boolean;
|
|
121
122
|
}
|
|
122
123
|
|
|
@@ -161,16 +162,23 @@ export interface ApplyRequestData {
|
|
|
161
162
|
operation: ParameterOperation;
|
|
162
163
|
newValue: unknown | null;
|
|
163
164
|
previousValue: unknown | null;
|
|
165
|
+
isSensitive?: boolean;
|
|
164
166
|
}>
|
|
165
167
|
}
|
|
166
168
|
}
|
|
167
169
|
|
|
170
|
+
export interface ResourceDefinition {
|
|
171
|
+
type: string;
|
|
172
|
+
dependencies: string[];
|
|
173
|
+
sensitiveParameters?: string[];
|
|
174
|
+
}
|
|
175
|
+
|
|
168
176
|
export interface InitializeRequestData {
|
|
169
177
|
verbosityLevel?: number;
|
|
170
178
|
}
|
|
171
179
|
|
|
172
180
|
export interface InitializeResponseData {
|
|
173
|
-
resourceDefinitions: Array<
|
|
181
|
+
resourceDefinitions: Array<ResourceDefinition>;
|
|
174
182
|
}
|
|
175
183
|
|
|
176
184
|
export interface SudoRequestData {
|