Skip to content

Commit 91ca022

Browse files
author
GeneralPractitioner-GP
committed
add some descripts and patterns and few small changes
1 parent bdabfb5 commit 91ca022

File tree

1 file changed

+77
-60
lines changed

1 file changed

+77
-60
lines changed

schemas/config-schema.json

Lines changed: 77 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,70 @@
33
"type": "object",
44
"additionalProperties": false,
55
"definitions": {
6+
"run": {
7+
"type": "string",
8+
"pattern": "^run$"
9+
},
610
"hourly": {
711
"type": "string",
812
"pattern": "^hourly\\([0-5][0-9]\\)$"
913
},
1014
"daily": {
1115
"type": "string",
12-
"pattern": "^daily\\((?:([01]?[0-9]|2[0-3]):([0-5][0-9])\\|)?([01]?[0-9]|2[0-3]):([0-5][0-9])\\)$"
16+
"pattern": "^daily\\(((?:[01]?[0-9]|2[0-3]):([0-5][0-9])(?:\\|(?:[01]?[0-9]|2[0-3]):([0-5][0-9]))*)\\)$"
1317
},
1418
"weekly": {
1519
"type": "string",
1620
"pattern": "^weekly\\((monday|tuesday|wednesday|thursday|friday|saturday|sunday)@(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9])\\)$"
1721
},
22+
"monthly": {
23+
"type": "string",
24+
"pattern": "^monthly\\((?:28@(?:[01]?[0-9]|2[0-3]):([0-5][0-9]))\\)$"
25+
},
1826
"cron": {
1927
"type": "string",
2028
"pattern": "^cron\\(([^)\\s]+ [^)\\s]+ [^)\\s]+ [^)\\s]+ [^)\\s]+)\\)$"
2129
},
30+
"schedule": {
31+
"oneOf": [
32+
{
33+
"$ref": "#/definitions/run"
34+
},
35+
{
36+
"$ref": "#/definitions/hourly"
37+
},
38+
{
39+
"$ref": "#/definitions/daily"
40+
},
41+
{
42+
"$ref": "#/definitions/weekly"
43+
},
44+
{
45+
"$ref": "#/definitions/monthly"
46+
},
47+
{
48+
"$ref": "#/definitions/cron"
49+
},
50+
{
51+
"type": "null"
52+
}
53+
],
54+
"description": "A schedule of either run, hourly, daily, weekly, monthly, or cron. If null, the task will not be scheduled.\nExamples:\nrun\nhourly(30)\ndaily(12:23)\ndaily(10:18|12:23)\nweekly(monday@12:00)\nmonthly(15@12:00)\ncron(0 0 * * *)"
55+
},
2256
"instance": {
2357
"type": "object",
2458
"additionalProperties": {
2559
"type": "object",
2660
"additionalProperties": false,
2761
"properties": {
2862
"url": {
29-
"type": "string"
63+
"type": "string",
64+
"description": "The URL of the instance, including the protocol and port. Example: http://localhost:8989",
65+
"pattern": "^https?://[^\\s]+(:[0-9]+)?$"
3066
},
3167
"api": {
32-
"type": "string"
68+
"type": "string",
69+
"description": "The API key of the instance"
3370
}
3471
},
3572
"required": [
@@ -42,25 +79,6 @@
4279
"type": "string",
4380
"pattern": "^debug|info|warning|error$"
4481
},
45-
"schedule": {
46-
"oneOf": [
47-
{
48-
"type": "null"
49-
},
50-
{
51-
"$ref": "#/definitions/hourly"
52-
},
53-
{
54-
"$ref": "#/definitions/daily"
55-
},
56-
{
57-
"$ref": "#/definitions/weekly"
58-
},
59-
{
60-
"$ref": "#/definitions/cron"
61-
}
62-
]
63-
},
6482
"stringOrNull": {
6583
"type": [
6684
"string",
@@ -78,16 +96,25 @@
7896
"additionalProperties": false,
7997
"properties": {
8098
"discord_webhook": {
81-
"$ref": "#/definitions/stringOrNull"
99+
"$ref": "#/definitions/stringOrNull",
100+
"description": "The Discord webhook URL to send messages to. If null, no messages will be sent.",
101+
"pattern": "^https?://[^\\s]+(:[0-9]+)?$"
82102
},
83103
"channel_id": {
84-
"$ref": "#/definitions/integerOrNull"
104+
"$ref": "#/definitions/integerOrNull",
105+
"description": "The Discord channel ID to send messages to if you are using Notifarr. If null, no messages will be sent.\nhttps://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID"
85106
}
86107
},
87108
"required": [
88109
"discord_webhook",
89110
"channel_id"
90111
]
112+
},
113+
"uniqueArray": {
114+
"uniqueItems": true,
115+
"items": {
116+
"type": "string"
117+
}
91118
}
92119
},
93120
"properties": {
@@ -172,7 +199,9 @@
172199
"additionalProperties": false,
173200
"properties": {
174201
"notifiarr_webhook": {
175-
"$ref": "#/definitions/stringOrNull"
202+
"$ref": "#/definitions/stringOrNull",
203+
"pattern": "^https?://[^\\s]+(:[0-9]+)?$",
204+
"description": "Notifiarr Passthrough URL. If null, no messages will be sent."
176205
},
177206
"main": {
178207
"$ref": "#/definitions/discord"
@@ -287,16 +316,16 @@
287316
"type": "boolean"
288317
},
289318
"library_names": {
290-
"type": "array"
319+
"$ref": "#/definitions/uniqueArray"
291320
},
292321
"source_dirs": {
293-
"type": "array"
322+
"$ref": "#/definitions/uniqueArray"
294323
},
295324
"destination_dir": {
296325
"type": "string"
297326
},
298327
"instances": {
299-
"type": "array"
328+
"$ref": "#/definitions/uniqueArray"
300329
}
301330
},
302331
"required": [
@@ -324,7 +353,7 @@
324353
"type": "boolean"
325354
},
326355
"source_dirs": {
327-
"type": "array"
356+
"$ref": "#/definitions/uniqueArray"
328357
},
329358
"destination_dir": {
330359
"type": "string"
@@ -385,7 +414,7 @@
385414
"$ref": "#/definitions/logLevel"
386415
},
387416
"instances": {
388-
"type": "array"
417+
"$ref": "#/definitions/uniqueArray"
389418
},
390419
"ignore_root_folders": {
391420
"type": [
@@ -394,13 +423,13 @@
394423
]
395424
},
396425
"library_names": {
397-
"type": "array"
426+
"$ref": "#/definitions/uniqueArray"
398427
},
399428
"ignore_collections": {
400-
"type": "array"
429+
"$ref": "#/definitions/uniqueArray"
401430
},
402431
"source_dirs": {
403-
"type": "array"
432+
"$ref": "#/definitions/uniqueArray"
404433
}
405434
},
406435
"required": [
@@ -423,16 +452,16 @@
423452
"type": "boolean"
424453
},
425454
"library_names": {
426-
"type": "array"
455+
"$ref": "#/definitions/uniqueArray"
427456
},
428457
"ignore_collections": {
429-
"type": "array"
458+
"$ref": "#/definitions/uniqueArray"
430459
},
431460
"source_dirs": {
432-
"type": "array"
461+
"$ref": "#/definitions/uniqueArray"
433462
},
434463
"instances": {
435-
"type": "array"
464+
"$ref": "#/definitions/uniqueArray"
436465
}
437466
},
438467
"required": [
@@ -505,7 +534,7 @@
505534
"type": "string"
506535
},
507536
"instances": {
508-
"type": "array"
537+
"$ref": "#/definitions/uniqueArray"
509538
}
510539
},
511540
"required": [
@@ -533,10 +562,10 @@
533562
"type": "boolean"
534563
},
535564
"instances": {
536-
"type": "array"
565+
"$ref": "#/definitions/uniqueArray"
537566
},
538567
"paths": {
539-
"type": "array"
568+
"$ref": "#/definitions/uniqueArray"
540569
},
541570
"filters": {
542571
"type": "object",
@@ -546,10 +575,10 @@
546575
"type": "string"
547576
},
548577
"exclude_movies": {
549-
"type": "array"
578+
"$ref": "#/definitions/uniqueArray"
550579
},
551580
"exclude_series": {
552-
"type": "array"
581+
"$ref": "#/definitions/uniqueArray"
553582
}
554583
},
555584
"required": [
@@ -585,22 +614,13 @@
585614
"type": "object",
586615
"properties": {
587616
"library_names": {
588-
"type": "array",
589-
"items": {
590-
"type": "string"
591-
}
617+
"$ref": "#/definitions/uniqueArray"
592618
},
593619
"plex_instances": {
594-
"type": "array",
595-
"items": {
596-
"type": "string"
597-
}
620+
"$ref": "#/definitions/uniqueArray"
598621
},
599622
"labels": {
600-
"type": "array",
601-
"items": {
602-
"type": "string"
603-
}
623+
"$ref": "#/definitions/uniqueArray"
604624
}
605625
},
606626
"required": [
@@ -628,10 +648,7 @@
628648
"type": "boolean"
629649
},
630650
"instances": {
631-
"type": "array",
632-
"items": {
633-
"type": "string"
634-
}
651+
"$ref": "#/definitions/uniqueArray"
635652
}
636653
},
637654
"required": [
@@ -655,10 +672,10 @@
655672
"$ref": "#/definitions/stringOrNull"
656673
},
657674
"include": {
658-
"type": "array"
675+
"$ref": "#/definitions/uniqueArray"
659676
},
660677
"exclude": {
661-
"type": "array"
678+
"$ref": "#/definitions/uniqueArray"
662679
}
663680
},
664681
"required": [

0 commit comments

Comments
 (0)