diff --git a/src/Downloader.php b/src/Downloader.php index 0062c99..d107def 100644 --- a/src/Downloader.php +++ b/src/Downloader.php @@ -80,7 +80,6 @@ private function validate(string $schemaFile, array $arguments): void } else { $errors = ''; foreach ($validator->getErrors() as $error) { - var_dump($error); $errors .= join(', ', $error); } throw new DownloaderException($errors); diff --git a/src/fksdb/auth/request.json b/src/fksdb/auth/request.json new file mode 100644 index 0000000..ebc8f55 --- /dev/null +++ b/src/fksdb/auth/request.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "contestId", + "app" + ], + "properties": { + "contestId": { + "type": "integer" + }, + "app": { + "type": "string", + "enum": [ + "wiki", + "pm" + ] + } + } +} diff --git a/src/fksdb/auth/response.json b/src/fksdb/auth/response.json new file mode 100644 index 0000000..2d29fe6 --- /dev/null +++ b/src/fksdb/auth/response.json @@ -0,0 +1,54 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "loginId": { + "type": [ + "integer", + "null" + ] + }, + "login": { + "type": [ + "string", + "null" + ] + }, + "hash": { + "type": [ + "string", + "null" + ] + }, + "email": { + "type": "string" + }, + "roles": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "taskManager", + "dataManager", + "eventManager", + "inboxManager", + "boss", + "org", + "contestant", + "aesop", + "schoolManager", + "web", + "wiki", + "superuser", + "cartesian" + ] + } + } + } + } +} diff --git a/src/fksdb/events/request.json b/src/fksdb/events/request.json new file mode 100644 index 0000000..daaa03c --- /dev/null +++ b/src/fksdb/events/request.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "required": [ + "eventTypes" + ], + "properties": { + "eventTypes": { + "type": "array", + "items": { + "type": "integer" + } + } + } +} diff --git a/src/fksdb/events/response.json b/src/fksdb/events/response.json new file mode 100644 index 0000000..10ac21f --- /dev/null +++ b/src/fksdb/events/response.json @@ -0,0 +1,7 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "array", + "items": { + "type": "object" + } +} diff --git a/tools/downloader.php b/tools/downloader.php index aa4c9d9..c66e1fe 100644 --- a/tools/downloader.php +++ b/tools/downloader.php @@ -16,20 +16,5 @@ 'password' => FKSDB_PASS, ], ]); -var_dump($newDownloader->download('fksdb', 'GetOrganizers', ['contest_id' => 1, 'year' => 37])); + return $newDownloader; -/* -return function (Request $request, bool $soap = true) use ($new): ?string { - try { - if ($soap) { - header('Content-Type: text/xml'); - return $downloader->download($request); - } else { - header('Content-Type: text/json'); - return $downloader->downloadJSON($request); - } - } catch (Throwable $exception) { - var_dump($exception); - } - return null; -};*/