Skip to content

Commit c2d2b53

Browse files
committed
feat: Updated get resource info schema
1 parent 49cfe40 commit c2d2b53

3 files changed

Lines changed: 32 additions & 4 deletions

File tree

src/messages/get-resource-info-response-data-schema.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"type": "string"
2323
}
2424
},
25-
"import": {
25+
"importAndDestroy": {
2626
"type": "object",
2727
"properties": {
2828
"requiredProperties": {
@@ -32,6 +32,18 @@
3232
}
3333
}
3434
}
35+
},
36+
"allowMultiple": {
37+
"type": "object",
38+
"properties": {
39+
"requiredProperties": {
40+
"type": "array",
41+
"items": {
42+
"type": "string"
43+
}
44+
}
45+
},
46+
"required": ["requiredProperties"]
3547
}
3648
},
3749
"required": ["type", "plugin"]

src/messages/get-resource-info-response-data-schema.test.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import schema from './get-resource-info-response-data-schema.json';
22
import { describe, it, expect } from 'vitest'
33
import Ajv from 'ajv'
4-
import {GetResourceInfoResponseData} from "../types";
4+
import {GetResourceInfoResponseData} from "../types.js";
55

66
const ajv = new Ajv({
77
strict: true,
@@ -45,7 +45,14 @@ describe('Get resources response data schema', () => {
4545
dependencies: [
4646
"typeA",
4747
"typeB"
48-
]
48+
],
49+
50+
},
51+
importAndDestroy: {
52+
requiredProperties: ['plugin']
53+
},
54+
allowMultiple: {
55+
requiredProperties: ['plugin']
4956
}
5057
})).to.be.true;
5158

@@ -87,6 +94,12 @@ describe('Get resources response data schema', () => {
8794
"typeA",
8895
"typeB"
8996
]
97+
},
98+
importAndDestroy: {
99+
requiredParameters: ['plugin'],
100+
},
101+
allowMultiple: {
102+
requiredParameters: ['plugin']
90103
}
91104
}
92105
})

src/types/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,11 @@ export interface GetResourceInfoResponseData {
106106
type: string;
107107
schema?: Record<string, unknown>,
108108
dependencies?: string[],
109-
import?: {
109+
importAndDestroy?: {
110110
requiredParameters: string[] | null,
111+
},
112+
allowMultiple?: {
113+
requiredParameters: string[]
111114
}
112115
}
113116

0 commit comments

Comments
 (0)