Skip to content

Commit 8c74f69

Browse files
committed
Fix EssentialsX
1 parent 3b757f2 commit 8c74f69

File tree

3 files changed

+43
-10
lines changed

3 files changed

+43
-10
lines changed

converters/converter.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export default class Converter<InputConfig extends object, OutputConfigs extends
3535
const validate = this.ajv.compile(this.conversion.inputSchema)
3636
try {
3737
const valid = validate(untypedInputConfig)
38+
console.log(untypedInputConfig)
39+
console.log(validate.errors)
3840
if (!valid) {
3941
return {
4042
message: validate.errors?.map(e => e.message).join("\n") ?? "Error validating input",
@@ -47,6 +49,7 @@ export default class Converter<InputConfig extends object, OutputConfigs extends
4749
error: true
4850
}
4951
}
52+
5053
const inputConfig = untypedInputConfig as InputConfig
5154

5255
const outputConfigs = this.conversion.Convert(inputConfig);

converters/types/essentialschat.json

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,51 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$ref": "#/definitions/EssentialsChatConfig",
3+
"$ref": "#/definitions/EssentialsChatTypes",
44
"definitions": {
5+
"EssentialsChatTypes": {
6+
"type": "object",
7+
"properties": {
8+
"config": {
9+
"$ref": "#/definitions/EssentialsChatConfig"
10+
},
11+
"language": {
12+
"type": "object",
13+
"properties": {
14+
"msgFormat": {
15+
"type": "string"
16+
}
17+
}
18+
}
19+
},
20+
"required": [
21+
"config",
22+
"language"
23+
]
24+
},
525
"EssentialsChatConfig": {
626
"type": "object",
727
"properties": {
828
"chat": {
929
"type": "object",
1030
"properties": {
1131
"format": {
12-
"type": "string"
32+
"type": [
33+
"string",
34+
"null"
35+
]
1336
},
1437
"group-formats": {
15-
"type": "object",
16-
"additionalProperties": {
17-
"type": "string"
18-
}
38+
"anyOf": [
39+
{
40+
"type": "object",
41+
"additionalProperties": {
42+
"type": "string"
43+
}
44+
},
45+
{
46+
"type": "null"
47+
}
48+
]
1949
}
2050
}
2151
}

converters/types/essentialschat.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
// @ToolBox - EssentialsChatConfig
1+
// @ToolBox - EssentialsChatTypes
22

33
export interface EssentialsChatConfig {
44
chat: {
5-
format?: string
5+
format?: string | null;
66
"group-formats"?: {
77
[key: string]: string
8-
}
8+
} | null
99
}
1010
}
1111

1212
export interface EssentialsChatTypes {
1313
config: EssentialsChatConfig
1414
language: {
15-
msgFormat: string
15+
msgFormat?: string
1616
}
1717
}

0 commit comments

Comments
 (0)