@cobbled-creators/cobblemon-schemas 1.7.0

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.
Files changed (85) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +68 -0
  3. package/bin/cobblemon-schemas.mjs +51 -0
  4. package/dist/bundle.json +1 -0
  5. package/dist/validators.mjs +3 -0
  6. package/package.json +66 -0
  7. package/schemas/_shared/common.schema.json +89 -0
  8. package/schemas/_shared/defs/collections.schema.json +32 -0
  9. package/schemas/_shared/defs/drops.schema.json +89 -0
  10. package/schemas/_shared/defs/expressions.schema.json +82 -0
  11. package/schemas/_shared/defs/identifiers.schema.json +24 -0
  12. package/schemas/_shared/defs/npc.schema.json +76 -0
  13. package/schemas/_shared/defs/pokemon.schema.json +41 -0
  14. package/schemas/_shared/defs/ranges.schema.json +70 -0
  15. package/schemas/_shared/defs/ride.schema.json +77 -0
  16. package/schemas/_shared/defs/spawning.schema.json +183 -0
  17. package/schemas/_shared/defs/vectors.schema.json +44 -0
  18. package/schemas/action_effects/schema.json +123 -0
  19. package/schemas/bedrock_pokemon_resolvers/schema.json +184 -0
  20. package/schemas/bedrock_posers/schema.json +367 -0
  21. package/schemas/behaviours/schema.json +145 -0
  22. package/schemas/berries/schema.json +178 -0
  23. package/schemas/cosmetic_items/schema.json +55 -0
  24. package/schemas/dex_additions/schema.json +22 -0
  25. package/schemas/dex_entries/schema.json +83 -0
  26. package/schemas/dex_entry_additions/schema.json +63 -0
  27. package/schemas/dexes/schema.json +89 -0
  28. package/schemas/dialogues/schema.json +260 -0
  29. package/schemas/fossils/schema.json +22 -0
  30. package/schemas/global_species_features/schema.json +6 -0
  31. package/schemas/index.json +244 -0
  32. package/schemas/marks/schema.json +49 -0
  33. package/schemas/mechanics/aprijuices.schema.json +25 -0
  34. package/schemas/mechanics/berries.schema.json +35 -0
  35. package/schemas/mechanics/potions.schema.json +23 -0
  36. package/schemas/mechanics/remedies.schema.json +31 -0
  37. package/schemas/mechanics/slowpoke_tails.schema.json +17 -0
  38. package/schemas/natural_materials/schema.json +40 -0
  39. package/schemas/npc_presets/schema.json +6 -0
  40. package/schemas/npcs/schema.json +443 -0
  41. package/schemas/pokemon_interactions/schema.json +169 -0
  42. package/schemas/pokerods/schema.json +19 -0
  43. package/schemas/ride_settings/bird.schema.json +48 -0
  44. package/schemas/ride_settings/boat.schema.json +45 -0
  45. package/schemas/ride_settings/burst.schema.json +11 -0
  46. package/schemas/ride_settings/dolphin.schema.json +45 -0
  47. package/schemas/ride_settings/glider.schema.json +18 -0
  48. package/schemas/ride_settings/helicopter.schema.json +21 -0
  49. package/schemas/ride_settings/horse.schema.json +36 -0
  50. package/schemas/ride_settings/hover.schema.json +33 -0
  51. package/schemas/ride_settings/jet.schema.json +42 -0
  52. package/schemas/ride_settings/minekart.schema.json +33 -0
  53. package/schemas/ride_settings/rocket.schema.json +36 -0
  54. package/schemas/ride_settings/submarine.schema.json +33 -0
  55. package/schemas/ride_settings/vehicle.schema.json +45 -0
  56. package/schemas/seasonings/schema.json +124 -0
  57. package/schemas/spawn_bait_effects/schema.json +42 -0
  58. package/schemas/spawn_detail_presets/schema.json +79 -0
  59. package/schemas/spawn_pool_world/schema.json +455 -0
  60. package/schemas/spawn_rules/schema.json +217 -0
  61. package/schemas/species/schema.json +1043 -0
  62. package/schemas/species_additions/schema.json +22 -0
  63. package/schemas/species_feature_assignments/schema.json +25 -0
  64. package/schemas/species_features/schema.json +139 -0
  65. package/schemas/starters/schema.json +28 -0
  66. package/schemas/unlockable_pc_box_wallpapers/schema.json +29 -0
  67. package/src/errors/format.mjs +46 -0
  68. package/src/errors/pointer.mjs +30 -0
  69. package/src/errors/simplify.mjs +58 -0
  70. package/src/errors/type-branches.mjs +65 -0
  71. package/src/errors/values.mjs +7 -0
  72. package/src/index.d.ts +74 -0
  73. package/src/index.mjs +6 -0
  74. package/src/json/line-index.mjs +21 -0
  75. package/src/json/parse-json.mjs +28 -0
  76. package/src/json/syntax-errors.mjs +56 -0
  77. package/src/node/load-engine.mjs +30 -0
  78. package/src/node/load-schemas.mjs +35 -0
  79. package/src/node/package-info.mjs +10 -0
  80. package/src/node/read-pack.mjs +18 -0
  81. package/src/node.d.ts +13 -0
  82. package/src/node.mjs +5 -0
  83. package/src/schema-engine.mjs +43 -0
  84. package/src/schema-index.mjs +54 -0
  85. package/src/validate-pack.mjs +28 -0
@@ -0,0 +1,455 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cobblemon-schema.local/spawn_pool_world/schema.json",
4
+ "title": "Cobblemon Spawn Pool Set",
5
+ "type": "object",
6
+ "properties": {
7
+ "comment": {
8
+ "type": "string"
9
+ },
10
+ "enabled": {
11
+ "type": "boolean"
12
+ },
13
+ "neededInstalledMods": {
14
+ "type": "array",
15
+ "items": {
16
+ "type": "string"
17
+ }
18
+ },
19
+ "neededUninstalledMods": {
20
+ "type": "array",
21
+ "items": {
22
+ "type": "string"
23
+ }
24
+ },
25
+ "spawns": {
26
+ "type": "array",
27
+ "items": {
28
+ "$ref": "#/$defs/spawnDetail"
29
+ }
30
+ }
31
+ },
32
+ "required": [
33
+ "enabled",
34
+ "neededInstalledMods",
35
+ "neededUninstalledMods",
36
+ "spawns"
37
+ ],
38
+ "additionalProperties": false,
39
+ "$defs": {
40
+ "conditionOrList": {
41
+ "oneOf": [
42
+ {
43
+ "$ref": "../_shared/defs/spawning.schema.json#/$defs/spawningCondition"
44
+ },
45
+ {
46
+ "type": "array",
47
+ "items": {
48
+ "$ref": "../_shared/defs/spawning.schema.json#/$defs/spawningCondition"
49
+ }
50
+ }
51
+ ]
52
+ },
53
+ "compositeCondition": {
54
+ "type": "object",
55
+ "properties": {
56
+ "conditions": {
57
+ "type": "array",
58
+ "items": {
59
+ "$ref": "../_shared/defs/spawning.schema.json#/$defs/spawningCondition"
60
+ }
61
+ },
62
+ "anticonditions": {
63
+ "type": "array",
64
+ "items": {
65
+ "$ref": "../_shared/defs/spawning.schema.json#/$defs/spawningCondition"
66
+ }
67
+ }
68
+ },
69
+ "additionalProperties": true
70
+ },
71
+ "possibleHeldItem": {
72
+ "oneOf": [
73
+ {
74
+ "type": "string"
75
+ },
76
+ {
77
+ "type": "object",
78
+ "properties": {
79
+ "item": {
80
+ "type": "string"
81
+ },
82
+ "percentage": {
83
+ "type": "number"
84
+ },
85
+ "nbt": {
86
+ "type": "object",
87
+ "additionalProperties": true
88
+ }
89
+ },
90
+ "required": [
91
+ "item"
92
+ ],
93
+ "additionalProperties": false
94
+ }
95
+ ]
96
+ },
97
+ "spawnDetailBase": {
98
+ "type": "object",
99
+ "properties": {
100
+ "id": {
101
+ "type": "string"
102
+ },
103
+ "type": {
104
+ "type": "string",
105
+ "enum": [
106
+ "pokemon",
107
+ "pokemon-herd",
108
+ "npc"
109
+ ]
110
+ },
111
+ "displayName": {
112
+ "type": "string"
113
+ },
114
+ "spawnablePositionType": {
115
+ "type": "string",
116
+ "enum": [
117
+ "grounded",
118
+ "seafloor",
119
+ "lavafloor",
120
+ "submerged",
121
+ "surface",
122
+ "fishing"
123
+ ]
124
+ },
125
+ "context": {
126
+ "type": "string",
127
+ "enum": [
128
+ "grounded",
129
+ "seafloor",
130
+ "lavafloor",
131
+ "submerged",
132
+ "surface",
133
+ "fishing"
134
+ ]
135
+ },
136
+ "bucket": {
137
+ "type": "string"
138
+ },
139
+ "preset": {
140
+ "oneOf": [
141
+ {
142
+ "type": "string"
143
+ },
144
+ {
145
+ "type": "array",
146
+ "items": {
147
+ "type": "string"
148
+ }
149
+ }
150
+ ]
151
+ },
152
+ "presets": {
153
+ "type": "array",
154
+ "items": {
155
+ "type": "string"
156
+ }
157
+ },
158
+ "condition": {
159
+ "$ref": "#/$defs/conditionOrList"
160
+ },
161
+ "conditions": {
162
+ "type": "array",
163
+ "items": {
164
+ "$ref": "../_shared/defs/spawning.schema.json#/$defs/spawningCondition"
165
+ }
166
+ },
167
+ "anticondition": {
168
+ "$ref": "#/$defs/conditionOrList"
169
+ },
170
+ "anticonditions": {
171
+ "type": "array",
172
+ "items": {
173
+ "$ref": "../_shared/defs/spawning.schema.json#/$defs/spawningCondition"
174
+ }
175
+ },
176
+ "compositeCondition": {
177
+ "$ref": "#/$defs/compositeCondition"
178
+ },
179
+ "weightMultiplier": {
180
+ "$ref": "../_shared/defs/spawning.schema.json#/$defs/weightMultiplier"
181
+ },
182
+ "weightMultipliers": {
183
+ "type": "array",
184
+ "items": {
185
+ "$ref": "../_shared/defs/spawning.schema.json#/$defs/weightMultiplier"
186
+ }
187
+ },
188
+ "width": {
189
+ "type": "integer"
190
+ },
191
+ "height": {
192
+ "type": "integer"
193
+ },
194
+ "weight": {
195
+ "type": "number"
196
+ },
197
+ "percentage": {
198
+ "type": "number"
199
+ },
200
+ "labels": {
201
+ "type": "array",
202
+ "items": {
203
+ "type": "string"
204
+ }
205
+ },
206
+ "neededInstalledMods": {
207
+ "type": "array",
208
+ "items": {
209
+ "type": "string"
210
+ }
211
+ },
212
+ "neededUninstalledMods": {
213
+ "type": "array",
214
+ "items": {
215
+ "type": "string"
216
+ }
217
+ }
218
+ },
219
+ "required": [
220
+ "id",
221
+ "type",
222
+ "bucket",
223
+ "weight"
224
+ ],
225
+ "anyOf": [
226
+ {
227
+ "required": [
228
+ "spawnablePositionType"
229
+ ]
230
+ },
231
+ {
232
+ "required": [
233
+ "context"
234
+ ]
235
+ }
236
+ ],
237
+ "additionalProperties": true
238
+ },
239
+ "pokemonSpawn": {
240
+ "allOf": [
241
+ {
242
+ "$ref": "#/$defs/spawnDetailBase"
243
+ },
244
+ {
245
+ "type": "object",
246
+ "properties": {
247
+ "type": {
248
+ "const": "pokemon"
249
+ },
250
+ "pokemon": {
251
+ "$ref": "../_shared/defs/pokemon.schema.json#/$defs/pokemonProperties"
252
+ },
253
+ "level": {
254
+ "$ref": "../_shared/defs/ranges.schema.json#/$defs/intRange"
255
+ },
256
+ "levelRange": {
257
+ "$ref": "../_shared/defs/ranges.schema.json#/$defs/intRange"
258
+ },
259
+ "drops": {
260
+ "$ref": "../_shared/defs/drops.schema.json#/$defs/dropTable"
261
+ },
262
+ "heldItems": {
263
+ "type": "array",
264
+ "items": {
265
+ "$ref": "#/$defs/possibleHeldItem"
266
+ }
267
+ }
268
+ },
269
+ "required": [
270
+ "pokemon"
271
+ ],
272
+ "anyOf": [
273
+ {
274
+ "required": [
275
+ "level"
276
+ ]
277
+ },
278
+ {
279
+ "required": [
280
+ "levelRange"
281
+ ]
282
+ }
283
+ ],
284
+ "additionalProperties": true
285
+ }
286
+ ]
287
+ },
288
+ "pokemonHerdSpawn": {
289
+ "allOf": [
290
+ {
291
+ "$ref": "#/$defs/spawnDetailBase"
292
+ },
293
+ {
294
+ "type": "object",
295
+ "properties": {
296
+ "type": {
297
+ "const": "pokemon-herd"
298
+ },
299
+ "level": {
300
+ "$ref": "../_shared/defs/ranges.schema.json#/$defs/intRange"
301
+ },
302
+ "levelRange": {
303
+ "$ref": "../_shared/defs/ranges.schema.json#/$defs/intRange"
304
+ },
305
+ "maxHerdSize": {
306
+ "type": "integer",
307
+ "minimum": 1
308
+ },
309
+ "minDistanceBetweenSpawns": {
310
+ "type": "number",
311
+ "minimum": 0
312
+ },
313
+ "herdablePokemon": {
314
+ "type": "array",
315
+ "items": {
316
+ "type": "object",
317
+ "properties": {
318
+ "pokemon": {
319
+ "$ref": "../_shared/defs/pokemon.schema.json#/$defs/pokemonProperties"
320
+ },
321
+ "levelRange": {
322
+ "$ref": "../_shared/defs/ranges.schema.json#/$defs/intRange"
323
+ },
324
+ "levelRangeOffset": {
325
+ "$ref": "../_shared/defs/ranges.schema.json#/$defs/intRange"
326
+ },
327
+ "dropTable": {
328
+ "$ref": "../_shared/defs/drops.schema.json#/$defs/dropTable"
329
+ },
330
+ "isLeader": {
331
+ "type": "boolean"
332
+ },
333
+ "weight": {
334
+ "type": "number"
335
+ },
336
+ "maxTimes": {
337
+ "type": "integer"
338
+ }
339
+ },
340
+ "required": [
341
+ "pokemon"
342
+ ],
343
+ "additionalProperties": false
344
+ }
345
+ }
346
+ },
347
+ "required": [
348
+ "herdablePokemon"
349
+ ],
350
+ "anyOf": [
351
+ {
352
+ "required": [
353
+ "level"
354
+ ]
355
+ },
356
+ {
357
+ "required": [
358
+ "levelRange"
359
+ ]
360
+ }
361
+ ],
362
+ "additionalProperties": true
363
+ }
364
+ ]
365
+ },
366
+ "npcSpawn": {
367
+ "allOf": [
368
+ {
369
+ "$ref": "#/$defs/spawnDetailBase"
370
+ },
371
+ {
372
+ "type": "object",
373
+ "properties": {
374
+ "type": {
375
+ "const": "npc"
376
+ },
377
+ "npcClass": {
378
+ "oneOf": [
379
+ {
380
+ "type": "string"
381
+ },
382
+ {
383
+ "$ref": "../npcs/schema.json"
384
+ }
385
+ ]
386
+ },
387
+ "class": {
388
+ "oneOf": [
389
+ {
390
+ "type": "string"
391
+ },
392
+ {
393
+ "$ref": "../npcs/schema.json"
394
+ }
395
+ ]
396
+ },
397
+ "npc": {
398
+ "oneOf": [
399
+ {
400
+ "type": "string"
401
+ },
402
+ {
403
+ "$ref": "../npcs/schema.json"
404
+ }
405
+ ]
406
+ },
407
+ "aspects": {
408
+ "type": "array",
409
+ "items": {
410
+ "type": "string"
411
+ }
412
+ },
413
+ "minLevel": {
414
+ "$ref": "../_shared/defs/expressions.schema.json#/$defs/expressionLike"
415
+ },
416
+ "maxLevel": {
417
+ "$ref": "../_shared/defs/expressions.schema.json#/$defs/expressionLike"
418
+ }
419
+ },
420
+ "anyOf": [
421
+ {
422
+ "required": [
423
+ "npcClass"
424
+ ]
425
+ },
426
+ {
427
+ "required": [
428
+ "class"
429
+ ]
430
+ },
431
+ {
432
+ "required": [
433
+ "npc"
434
+ ]
435
+ }
436
+ ],
437
+ "additionalProperties": true
438
+ }
439
+ ]
440
+ },
441
+ "spawnDetail": {
442
+ "oneOf": [
443
+ {
444
+ "$ref": "#/$defs/pokemonSpawn"
445
+ },
446
+ {
447
+ "$ref": "#/$defs/pokemonHerdSpawn"
448
+ },
449
+ {
450
+ "$ref": "#/$defs/npcSpawn"
451
+ }
452
+ ]
453
+ }
454
+ }
455
+ }
@@ -0,0 +1,217 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://cobblemon-schema.local/spawn_rules/schema.json",
4
+ "title": "Cobblemon Spawn Rule",
5
+ "type": "object",
6
+ "properties": {
7
+ "displayName": {
8
+ "oneOf": [
9
+ {
10
+ "type": "string"
11
+ },
12
+ {
13
+ "type": "object",
14
+ "additionalProperties": true
15
+ }
16
+ ]
17
+ },
18
+ "enabled": {
19
+ "$ref": "../_shared/defs/expressions.schema.json#/$defs/booleanLike"
20
+ },
21
+ "components": {
22
+ "type": "array",
23
+ "items": {
24
+ "$ref": "#/$defs/component"
25
+ }
26
+ }
27
+ },
28
+ "required": [
29
+ "displayName",
30
+ "enabled",
31
+ "components"
32
+ ],
33
+ "additionalProperties": false,
34
+ "$defs": {
35
+ "spawnDetailSelector": {
36
+ "oneOf": [
37
+ {
38
+ "$ref": "../_shared/defs/expressions.schema.json#/$defs/expressionLike"
39
+ },
40
+ {
41
+ "type": "object",
42
+ "properties": {
43
+ "type": {
44
+ "type": "string",
45
+ "enum": [
46
+ "expression"
47
+ ]
48
+ },
49
+ "expression": {
50
+ "$ref": "../_shared/defs/expressions.schema.json#/$defs/expressionLike"
51
+ }
52
+ },
53
+ "required": [
54
+ "type"
55
+ ],
56
+ "additionalProperties": false
57
+ }
58
+ ]
59
+ },
60
+ "spawnablePositionSelector": {
61
+ "oneOf": [
62
+ {
63
+ "$ref": "../_shared/defs/expressions.schema.json#/$defs/expressionLike"
64
+ },
65
+ {
66
+ "type": "object",
67
+ "properties": {
68
+ "type": {
69
+ "type": "string",
70
+ "enum": [
71
+ "expression",
72
+ "conditional"
73
+ ]
74
+ },
75
+ "expression": {
76
+ "$ref": "../_shared/defs/expressions.schema.json#/$defs/expressionLike"
77
+ },
78
+ "conditions": {
79
+ "type": "array",
80
+ "items": {
81
+ "$ref": "../_shared/defs/spawning.schema.json#/$defs/spawningCondition"
82
+ }
83
+ },
84
+ "anticonditions": {
85
+ "type": "array",
86
+ "items": {
87
+ "$ref": "../_shared/defs/spawning.schema.json#/$defs/spawningCondition"
88
+ }
89
+ }
90
+ },
91
+ "additionalProperties": false,
92
+ "allOf": [
93
+ {
94
+ "if": {
95
+ "properties": {
96
+ "type": {
97
+ "const": "expression"
98
+ }
99
+ },
100
+ "required": [
101
+ "type"
102
+ ]
103
+ },
104
+ "then": {
105
+ "required": [
106
+ "expression"
107
+ ]
108
+ }
109
+ },
110
+ {
111
+ "if": {
112
+ "properties": {
113
+ "type": {
114
+ "const": "conditional"
115
+ }
116
+ },
117
+ "required": [
118
+ "type"
119
+ ]
120
+ },
121
+ "then": {
122
+ "anyOf": [
123
+ {
124
+ "required": [
125
+ "conditions"
126
+ ]
127
+ },
128
+ {
129
+ "required": [
130
+ "anticonditions"
131
+ ]
132
+ }
133
+ ]
134
+ }
135
+ }
136
+ ]
137
+ }
138
+ ]
139
+ },
140
+ "componentBase": {
141
+ "type": "object",
142
+ "properties": {
143
+ "type": {
144
+ "type": "string",
145
+ "enum": [
146
+ "weight",
147
+ "filter",
148
+ "location"
149
+ ]
150
+ },
151
+ "spawnDetailSelector": {
152
+ "$ref": "#/$defs/spawnDetailSelector"
153
+ },
154
+ "spawnSelector": {
155
+ "$ref": "#/$defs/spawnDetailSelector"
156
+ },
157
+ "spawnablePositionSelector": {
158
+ "$ref": "#/$defs/spawnablePositionSelector"
159
+ },
160
+ "contextSelector": {
161
+ "$ref": "#/$defs/spawnablePositionSelector"
162
+ },
163
+ "allow": {
164
+ "$ref": "../_shared/defs/expressions.schema.json#/$defs/expressionLike"
165
+ },
166
+ "weight": {
167
+ "$ref": "../_shared/defs/expressions.schema.json#/$defs/expressionLike"
168
+ }
169
+ },
170
+ "required": [
171
+ "type"
172
+ ],
173
+ "additionalProperties": false
174
+ },
175
+ "component": {
176
+ "allOf": [
177
+ {
178
+ "$ref": "#/$defs/componentBase"
179
+ },
180
+ {
181
+ "oneOf": [
182
+ {
183
+ "properties": {
184
+ "type": {
185
+ "const": "weight"
186
+ }
187
+ },
188
+ "required": [
189
+ "weight"
190
+ ]
191
+ },
192
+ {
193
+ "properties": {
194
+ "type": {
195
+ "const": "filter"
196
+ }
197
+ },
198
+ "required": [
199
+ "allow"
200
+ ]
201
+ },
202
+ {
203
+ "properties": {
204
+ "type": {
205
+ "const": "location"
206
+ }
207
+ },
208
+ "required": [
209
+ "allow"
210
+ ]
211
+ }
212
+ ]
213
+ }
214
+ ]
215
+ }
216
+ }
217
+ }