Skip to content

Commit cada61c

Browse files
committed
feat: Added empty response
1 parent a0400e7 commit cada61c

6 files changed

Lines changed: 16 additions & 16 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codify-schemas",
3-
"version": "1.0.86-beta8",
3+
"version": "1.0.86-beta10",
44
"description": "",
55
"type": "module",
66
"main": "dist/index.js",

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import ResourceSchema from './resource-schema.json' with {type: 'json'}
44
import IpcMessageSchema from './ipc-message-schema.json' with {type: 'json'}
55
import IpcMessageV2Schema from './ipc-message-schema-v2.json' with {type: 'json'}
66
import ApplyRequestDataSchema from './messages/apply-request-data-schema.json' with {type: 'json'}
7-
import ApplyResponseDataSchema from './messages/apply-response-data-schema.json' with {type: 'json'}
87
import ErrorResponseDataSchema from './messages/error-response-data-schema.json' with {type: 'json'}
98
import GetResourceInfoRequestDataSchema from './messages/get-resource-info-request-data-schema.json' with {type: 'json'}
109
import GetResourceInfoResponseDataSchema from './messages/get-resource-info-response-data-schema.json' with {type: 'json'}
@@ -23,6 +22,7 @@ import CommandRequestResponseDataSchema from './messages/command-response-data-s
2322
import PressKeyToContinueRequestDataSchema from './messages/press-key-to-continue-request-data-schema.json' with {type: 'json'};
2423
import PressKeyToContinueResponseDataSchema from './messages/press-key-to-continue-response-data-schema.json' with {type: 'json'};
2524
import SetVerbosityRequestDataSchema from './messages/set-verbosity-request-data-schema.json' with {type: 'json'};
25+
import EmptyResponseDataSchema from './messages/empty-response-data-schema.json' with {type: 'json'};
2626

2727
export {
2828
ConfigFileSchema,
@@ -31,7 +31,6 @@ export {
3131
IpcMessageSchema,
3232
IpcMessageV2Schema,
3333
ApplyRequestDataSchema,
34-
ApplyResponseDataSchema,
3534
ErrorResponseDataSchema,
3635
GetResourceInfoRequestDataSchema,
3736
GetResourceInfoResponseDataSchema,
@@ -50,6 +49,7 @@ export {
5049
PressKeyToContinueRequestDataSchema,
5150
PressKeyToContinueResponseDataSchema,
5251
SetVerbosityRequestDataSchema,
52+
EmptyResponseDataSchema,
5353
}
5454

5555
export * from './types/index.js';

src/messages/apply-response-data-schema.json

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"$id": "https://www.codifycli.com/empty-response-data-schema.json",
4+
"title": "Empty Response Schema Data",
5+
"description": "An empty response",
6+
"type": "null"
7+
}

src/messages/apply-response-data-schema.test.ts renamed to src/messages/empty-response-data-schema.test.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
import schema from './apply-response-data-schema.json';
1+
import schema from './empty-response-data-schema.json';
22
import {describe, expect, it} from 'vitest'
3-
import addFormats from 'ajv-formats';
4-
import Ajv from 'ajv';
3+
import Ajv from 'ajv'
54

65
const ajv = new Ajv({
76
strict: true,
87
})
98

10-
addFormats.default(ajv);
11-
12-
describe('Apply request data schema', () => {
9+
describe('Empty Response Data Schema', () => {
1310
it('compiles', () => {
1411
ajv.compile(schema);
1512
})
1613

17-
it("validates an empty config", () => {
14+
it("Only empty object", () => {
1815
const validate = ajv.compile(schema);
1916
expect(validate(null)).to.be.true;
2017
})

src/types/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ export interface SetVerbosityRequestData {
216216
verbosityLevel: number;
217217
}
218218

219+
export interface EmptyResponseData {}
220+
219221
export enum SpawnStatus {
220222
SUCCESS = 'success',
221223
ERROR = 'error',

0 commit comments

Comments
 (0)