Compare commits

...

666 commits

Author SHA1 Message Date
Mikołaj Pich
340245d8cc
Version 2.7.0 2024-06-12 21:18:10 +02:00
Mikołaj Pich
018623b809
Add missing AutoryzacjaPesel mapping 2024-06-12 20:55:24 +02:00
Mikołaj Pich
9b7e8585b0
Fix ustawienia values in grades response in uonetplus-uczenplus 2024-06-12 20:39:07 +02:00
Mikołaj Pich
77d6083752
Add v24.05 api endpoints 2024-06-12 20:15:49 +02:00
Mikołaj Pich
aab4d4f971
Version 2.6.14 2024-06-10 18:45:36 +02:00
Mikołaj Pich
b2c289349f
Update user agent 2024-06-10 18:45:28 +02:00
Mikołaj Pich
e015980284
Add uonetplus-uczenplus v0010 mappings 2024-05-30 19:49:43 +02:00
Mikołaj Pich
fe53c38f75
Version 2.6.13 2024-05-30 17:38:22 +02:00
Mikołaj Pich
444dbc67f2
Add missing Delete endpoint mapping in v0010 messages 2024-05-30 17:16:54 +02:00
Mikołaj Pich
f7c24e7725
Replace key with value in response mapping 2024-05-30 16:54:45 +02:00
Mikołaj Pich
1a1878acd9
Make possible to map responses recursively 2024-05-30 16:35:02 +02:00
Mikołaj Pich
7f9456fe6c
Add dynamic endpoints response json keys mapping 2024-05-30 15:37:35 +02:00
Mikołaj Pich
be44f3b25c
Add some missing mapping to uonetplus-uczen v0010 2024-05-30 12:14:26 +02:00
Mikołaj Pich
3463188b41
Fix previous commit... 2024-05-30 11:58:02 +02:00
Mikołaj Pich
414209d8da
Enable back docs workflow 2024-05-30 11:57:46 +02:00
Mikołaj Pich
4d263fa4d7
Add missing endpoints, fix vheader name, add vtokens to messages module 2024-05-30 11:56:54 +02:00
loadstring1
edd743d1e4
add wiadomości plus endpoints :) (#206)
na ślepo to zrobiłem bez testowania w firefoksie nawet nie wiem czy to w ogóle działa xd
2024-05-30 11:47:38 +02:00
Mikołaj Pich
fc343c3cbf
Version 2.6.12 2024-05-29 17:22:37 +02:00
Mikołaj Pich
c812f272eb
Add vheaders to uonetplus-uczen during register 2024-05-29 16:56:20 +02:00
Mikołaj Pich
1f6a0471e5
Fix lint 2024-05-29 16:36:05 +02:00
Mikołaj Pich
c8fb4478ce
Add support for uonetplus-uczen v24.04.0010.58863 2024-05-29 16:34:22 +02:00
Mikołaj Pich
3f7e8eba8e
Version 2.6.11 2024-05-23 23:12:37 +02:00
Mikołaj Pich
f42bdaaf48
Fix register to many symbols 2024-05-23 23:12:13 +02:00
Mikołaj Pich
2ebd08cf44
Enable writing to additional cookie manager to make possible using it in webview fallback 2024-05-23 21:20:57 +02:00
Mikołaj Pich
d3594f3861
Add support for multipart paths mapping 2024-05-23 20:58:55 +02:00
Mikołaj Pich
ccd2a96f3d
Add 0009 endpoints 2024-05-23 20:22:13 +02:00
Mikołaj Pich
28edf8a006
Version 2.6.10 2024-05-22 21:49:09 +02:00
Mikołaj Pich
d838b0d338
Update mappings 2024-05-22 21:47:46 +02:00
Mikołaj Pich
3235599ff7
Fix student info endpoint 2024-05-22 21:16:55 +02:00
Mikołaj Pich
09f9a39550
Move symbol derivative to vParamsRaw 2024-05-22 20:10:26 +02:00
Mikołaj Pich
b8ff96f5fd
Change vTokenSchemeMapping to vHeaders with configurable header name 2024-05-22 19:35:18 +02:00
Mikołaj Pich
bc52de44f9
Version 2.6.9 2024-05-22 08:47:40 +02:00
Mikołaj Pich
00de384ca2
Add local mapping fallback if there is no data in overriden maps 2024-05-22 08:45:54 +02:00
Mikołaj Pich
905a74524b
Fix fetching user name from homepage 2024-05-22 08:39:52 +02:00
Mikołaj Pich
e4b2a70831
Update mappings, update messages header name 2024-05-22 08:07:35 +02:00
Mikołaj Pich
0c3d9bd382
Version 2.6.8 2024-05-17 20:52:07 +02:00
Mikołaj Pich
5558b73771
Fix eduone student registration 2024-05-17 19:45:14 +02:00
Mikołaj Pich
5127c75edf
Add some old uonetplus-uczenplus mapping to v0005 2024-05-17 19:41:29 +02:00
Mikołaj Pich
0a779b148b
Version 2.6.7 2024-05-17 07:25:31 +02:00
Mikołaj Pich
b5238db5d4
Update apiKey regex 2024-05-17 07:11:42 +02:00
Mikołaj Pich
1eeea1e249
Add vparam js evaluation 2024-05-16 23:12:22 +02:00
Mikołaj Pich
0989dc2442
Fix get token endpoint on old student module 2024-05-16 18:51:00 +02:00
Mikołaj Pich
20813d9978
Version 2.6.6 2024-05-16 08:28:30 +02:00
Mikołaj Pich
0e49ff8549
Update apiKey extraction logic 2024-05-16 08:00:23 +02:00
Mikołaj Pich
f644b2a2a2
Add 0006 mappings 2024-05-16 07:40:57 +02:00
Mikołaj Pich
2cadf274f1
Replace Pair<HttpUrl, Document> with LoginModuleResult 2024-05-15 22:04:31 +02:00
londek
660e075cce
feat: apiKey parsing (#205)
Co-authored-by: Mikołaj Pich <m.pich@outlook.com>
2024-05-15 13:02:34 +02:00
Mikołaj Pich
de2a887188
Remove Document from VulcanServerError 2024-05-15 07:46:56 +02:00
Mikołaj Pich
29a1dc73f7
Update messages module mapping 2024-05-15 07:21:32 +02:00
Mikołaj Pich
b0f9653c0b
Add all 00005 uonetplus-uczen mapping 2024-05-15 06:45:19 +02:00
Mikołaj Pich
d28f3e6f1c
Hotfix uonetplus-uczen 2024-05-15 06:26:28 +02:00
Mikołaj Pich
209ea24aa7
Version 2.6.5 2024-05-14 22:07:51 +02:00
Mikołaj Pich
03066e18a2
Make vtokens scheme configurable 2024-05-14 21:43:27 +02:00
Mikołaj Pich
50e06b2a06
Add rest of uonetplus-uczen mappings 2024-05-14 19:40:38 +02:00
Mikołaj Pich
fdaae2b913
Update endpoint mapping, change VToken calc schema 2024-05-14 09:27:33 +02:00
Mikołaj Pich
c653ca7148
Version 2.6.4 2024-05-12 17:38:32 +02:00
Mikołaj Pich
6fff07e52a
Add workarounds to detect not mapped urls as NotLoggedIn errors in multi threaded envs 2024-05-12 17:32:29 +02:00
Mikołaj Pich
ce84113020
Add rest of eduOne endpoints mapping 2024-05-12 14:46:28 +02:00
Mikołaj Pich
5999e046e4
Fix adding vToken headers during registration 2024-05-12 14:46:11 +02:00
Mikołaj Pich
c1e40d8538
Add missing V-Token headers to eduOne requests during registration 2024-05-12 13:48:19 +02:00
Mikołaj Pich
f50690a95a
Make setters for endpoints mapping public 2024-05-11 20:55:00 +02:00
Mikołaj Pich
2f4bbfdc70
Simplify attachModuleHeaders method 2024-05-11 17:18:18 +02:00
Mikołaj Pich
48a6c72d00
Migrate rest of ApiEndpoints usages to ApiEndpoints2 with map-based mapping 2024-05-11 16:56:53 +02:00
Mikołaj Pich
816e41f41f
Extract url mapping code to utils 2024-05-11 16:24:31 +02:00
Mikołaj Pich
e970108661
Move auto login interceptor related singletons to scrapper object
Related #198
2024-05-11 15:31:51 +02:00
Mikołaj Pich
1be3e9fa42
Use interceptor-based url mapping for uczenplus and wiadomosciplus modules 2024-05-11 14:58:01 +02:00
Mikołaj Pich
35d0a5a327
Use interceptor-based url mapping for uonetplus-uczen 2024-05-11 14:09:06 +02:00
Mikołaj Pich
8ddca83b53
Fix tests 2024-05-11 11:44:16 +02:00
Mikołaj Pich
460b09ad7e
Version 2.6.3 2024-05-10 12:10:34 +02:00
Mikołaj Pich
6416b16b88
Add new uuid mapping from v58698, add vtoken support 2024-05-10 12:05:46 +02:00
Mikołaj Pich
0766e5b30a
Version 2.6.2 2024-05-09 22:12:39 +02:00
Mikołaj Pich
4f90df84a0
Change error logs in error interceptor to warn level 2024-05-09 22:11:24 +02:00
Mikołaj Pich
06119e4a55
Fix student discover during registration on old vulcan versions 2024-05-09 22:06:12 +02:00
Mikołaj Pich
b57cbe04e8
Add dumb student plus matching 2024-05-09 21:53:01 +02:00
Mikołaj Pich
0cca5034c6
Add missing eduOne endpoint mapping 2024-05-09 20:48:50 +02:00
Mikołaj Pich
d440e46498
Version 2.6.1 2024-05-08 01:37:26 +02:00
Mikołaj Pich
41e77aaa09
Disable codecov 2024-05-08 01:32:52 +02:00
Mikołaj Pich
7c081268b4
Use proper endpoints scheme based on register version 2024-05-08 01:32:03 +02:00
Mikołaj Pich
ebb54d067b
Make possible to switch between api endpoints dynamically 2024-05-08 01:12:35 +02:00
Mikołaj Pich
91736bf8a0
Add new endpoints from uonet v24_4_2_58666 2024-05-08 00:43:40 +02:00
Mikołaj Pich
8abb8a9490
Version 2.6.0 2024-05-01 22:02:27 +02:00
Mikołaj Pich
fa8ef5ab9f
Disable docs gh action workflow 2024-05-01 21:42:07 +02:00
Mikołaj Pich
44bc5e1723
Change studentSchools selector to be less specific 2024-05-01 21:23:54 +02:00
Mikołaj Pich
979649a57d
Bring back AccountInactiveException handling support 2024-05-01 21:20:22 +02:00
Mikołaj Pich
676e837401
Adjust maintenance errors to avoid false positives 2024-05-01 21:08:32 +02:00
Mikołaj Pich
d251656df6
Move bad credentials error handling to login helper 2024-05-01 20:48:07 +02:00
Mikołaj Pich
f1084de2cd
Log all previously disabled error checks 2024-05-01 19:50:53 +02:00
Mikołaj Pich
66680fbaa7
Version 2.5.8 2024-04-25 12:24:05 +02:00
Mikołaj Pich
905da09e1e
Update vulcan error detection 2024-04-25 11:59:26 +02:00
Mikołaj Pich
39668c543f
Ultimate error fix 2024-04-25 11:10:47 +02:00
Mikołaj Pich
8dc36dd101
Disable .errorBlock.errorTitle check 2024-04-25 10:10:29 +02:00
Mikołaj Pich
609381bfee
Add workaround to false positive AccountInactiveException errors 2024-04-25 09:26:28 +02:00
Mikołaj Pich
d1f65c851e
Version 2.5.7 2024-04-22 22:11:00 +02:00
Mikołaj Pich
11873c7ee7
Add pointsSumAllYear field to grade summary 2024-04-22 15:26:07 +02:00
Mikołaj Pich
3331b6b65f
Add new averageAllYear field to grade summaries 2024-04-22 15:09:02 +02:00
Mikołaj Pich
d32f1b75ed
Version 2.5.6 2024-04-22 00:20:45 +02:00
Mikołaj Pich
5239094360
Add database update error check 2024-04-21 23:38:18 +02:00
Mikołaj Pich
d766d243be
Attach proper school name to RegisterUnit inside register repo 2024-04-21 23:12:36 +02:00
Mikołaj Pich
617b4eb62c
Add fallback to no-permissions students fetch from student(plus) module 2024-04-20 13:26:41 +02:00
Mikołaj Pich
2c498c5d85
Refactor register units fetching during registration 2024-04-20 12:27:41 +02:00
Mikołaj Pich
a579beb91d
Version 2.5.5 2024-03-26 19:31:16 +01:00
Faierbel
a5181dcfbb Update comments in AutoLoginInterceptor 2024-03-26 18:51:28 +01:00
Mikołaj Pich
1d9e0109b6
Add new behavior handling of not logged in user on old student module 2024-03-26 18:08:24 +01:00
Mikołaj Pich
15c0e15ef8
Version 2.5.4 2024-03-26 12:55:55 +01:00
Mikołaj Pich
af6a8c66e7
Remove retrowhing original exception from auto login interceptor 2024-03-26 12:49:05 +01:00
Mikołaj Pich
bef50f7f68
Fix semesters sync if there is no valid diaryId set 2024-03-26 12:43:08 +01:00
Mikołaj Pich
0f1974643a
Fix lint issues 2024-03-26 12:38:11 +01:00
Mikołaj Pich
dde984685b
Avoid extra mapping step during register to fix issues with number formatting 2024-03-26 00:32:21 +01:00
Mikołaj Pich
8902a0c463
Refactor students extracting in register repo 2024-03-26 00:21:35 +01:00
Mikołaj Pich
71654e3186
Don't allow null in getCurrentStudent() 2024-03-26 00:13:36 +01:00
Mikołaj Pich
5459ac7fc4
Unify semesters handling between getCurrentStudent and getSemesters in eduOne 2024-03-26 00:07:36 +01:00
Mikołaj Pich
35dec57cb6
Throw error if there is no matching eduOne student in getSemesters() method 2024-03-25 23:49:21 +01:00
Mikołaj Pich
a324bee117
Version 2.5.3 2024-03-24 23:24:51 +01:00
Mikołaj Pich
9d11cce2ea
Change debug log in getDecodedKey 2024-03-24 22:28:20 +01:00
Mikołaj Pich
3d5bfea0bd
Don' try to fetch semesters when auth required, provide empty-invalid semester instead 2024-03-24 22:04:20 +01:00
Mikołaj Pich
5dfe351104
Fetch semesters along with current student 2024-03-24 21:50:45 +01:00
Mikołaj Pich
a3adb07eb1
Extract ContextStudent mapper to separate method 2024-03-24 21:27:10 +01:00
Mikołaj Pich
969cf79d97
Match current user only by userId, without unitId 2024-03-24 20:46:28 +01:00
Mikołaj Pich
44c31fa0d5
Handle case when message details response body is null 2024-03-24 20:05:29 +01:00
Mikołaj Pich
b4941cb70a
Change way of matching student semesters 2024-03-24 15:11:42 +01:00
Mikołaj Pich
8b444cad99
Don't require diaryId in getCurrentStudent from eduOne 2024-03-24 04:19:51 +01:00
Mikołaj Pich
d9f750deea
Don't fail if there is missing parts in decoded key 2024-03-24 04:14:33 +01:00
Mikołaj Pich
10cda38505
Move getStudent() from student repo to student start repo 2024-03-24 04:10:02 +01:00
Mikołaj Pich
c1c8cbe4c0
Revert changes in CustomDateAdapter causing regression in date formatting 2024-03-23 15:52:25 +01:00
Mikołaj Pich
43d4cf2eb3
Throw FeatureUnavailableException for features not available in eduOne mode 2024-03-23 15:45:22 +01:00
Mikołaj Pich
e27a5f19bb
Add student info impl via eduOne 2024-03-23 15:37:27 +01:00
Mikołaj Pich
545a90e2a0
Fix getToken implementation 2024-03-23 15:06:28 +01:00
Mikołaj Pich
dab976890f
Make field dyrektorzy nullable 2024-03-23 14:53:58 +01:00
Mikołaj Pich
cd31377aed
Add missing key query param to mobile devices, school and teachers endpoints 2024-03-23 14:51:50 +01:00
Michael
28fc7a7d40
Add basic device support for eduOne (#197) 2024-03-22 23:19:01 +01:00
Michael
67c637b91b
Fix description in eduOne grades (#196) 2024-03-22 22:30:19 +01:00
Michael
e0a5753e11
Add eduOne support for school and teachers (#195) 2024-03-22 22:18:17 +01:00
Mikołaj Pich
8e26580752
Make possible to detect is currently set up student have eduOne register 2024-03-22 00:33:03 +01:00
Mikołaj Pich
6261efbc3d
Always return list of timetable headers from eduOne timetable 2024-03-21 23:01:50 +01:00
Mikołaj Pich
ebd4a8b90b
Avoid adding StudentCookieInterceptor to student plus service 2024-03-21 22:56:52 +01:00
Mikołaj Pich
3ee9a2e132
Add missing timetable headers from eduOne 2024-03-21 21:14:16 +01:00
Mikołaj Pich
c2f8981ad4
Version 2.5.2 2024-03-20 02:00:40 +01:00
Mikołaj Pich
c847d37c9f
Fix tests 2024-03-20 02:00:20 +01:00
Mikołaj Pich
1ae931c5a0
Fix marking account as parent when loggin via eduOne account 2024-03-20 01:37:31 +01:00
Mikołaj Pich
da19305b31
Fix non authorized edu one students discovery 2024-03-20 01:23:35 +01:00
Mikołaj Pich
b2cc35e317
Forbid accessing to grade statistics methods in edu one mode 2024-03-20 00:42:59 +01:00
Mikołaj Pich
1b6e840917
Add missing semester fetch impl via eduOne 2024-03-20 00:31:51 +01:00
Mikołaj Pich
2583e044e7
Fix isEduOne flag 2024-03-20 00:16:36 +01:00
Mikołaj Pich
801089a7b1
Fix semesterId and diary name issues 2024-03-20 00:05:36 +01:00
Mikołaj Pich
e73761051a
Add error body to http errors if content body is json 2024-03-19 23:55:57 +01:00
Mikołaj Pich
72ec14c148
Fix url generator in registration for eduOne student 2024-03-19 23:51:07 +01:00
Mikołaj Pich
3e4d549d79
Expose isEduOne flag setter and getters 2024-03-19 23:50:48 +01:00
Mikołaj Pich
91e847ee47
Add support for conferences via eduOne 2024-03-19 23:25:34 +01:00
Mikołaj Pich
e86fd1b332
Add support for notes via eduOne 2024-03-19 23:05:00 +01:00
Mikołaj Pich
6bcdadad88
Improve some things in timetable changes parsing 2024-03-19 22:44:55 +01:00
Mikołaj Pich
dda1dc908b
Add support for lesson move with change in timetable 2024-03-19 22:24:21 +01:00
Mikołaj Pich
45cbe64fd0
Add support for lesson move change in timetable 2024-03-19 22:00:03 +01:00
Mikołaj Pich
f04da5385b
Add support for more teach change in timetable 2024-03-19 21:58:25 +01:00
Mikołaj Pich
d4f6f3571c
Add auto login to eduOne module 2024-03-19 21:23:01 +01:00
Mikołaj Pich
a618b19dd3
Add support for timetable via eduOne 2024-03-19 21:18:34 +01:00
Mikołaj Pich
990eecc5d5
Fix attendance summary 2024-03-19 20:29:10 +01:00
Mikołaj Pich
f53776c373
Merge pull request #194 from Marioneq4958/eduone-homework
Add student+ homework and fix teacherSymbol in exams
2024-03-19 20:22:14 +01:00
Mikołaj Pich
5cbe97b9a0
Add tests to eduOne homework 2024-03-19 20:18:18 +01:00
Mikołaj Pich
8428eb6ce9
Fix syntax errors in homework 2024-03-19 20:11:54 +01:00
Mikołaj Pich
a3da581298
Merge branch 'master' into eduone-homework 2024-03-19 20:00:40 +01:00
Mikołaj Pich
3c7d8b9545
Add support for attendance summary via eduOne 2024-03-19 20:00:19 +01:00
Mikołaj Pich
fd5eb26a9d
Don't try to auth uonetplus-uczen module when eduOne is enabled 2024-03-19 19:58:20 +01:00
Marioneq 4958
0d225dc30f Add student+ homework and fix teacherSymbol in exams 2024-03-19 19:07:10 +01:00
Mikołaj Pich
d26a5513ac
Merge pull request #193 from Marioneq4958/patch-1
Oceny i sprawdziany Uczeń+
2024-03-19 18:15:47 +01:00
Mikołaj Pich
5bfcd16c0b
Add tests to eduOne exams 2024-03-19 18:12:34 +01:00
Mikołaj Pich
4071569fb4
Fix syntax and missing imports 2024-03-19 18:01:45 +01:00
Mikołaj Pich
1c67564742
Add tests to eduOne grades 2024-03-19 17:55:56 +01:00
Marioneq 4958
94083e087f Merge branch 'patch-1' of https://github.com/Marioneq4958/sdk into patch-1 2024-03-19 17:41:22 +01:00
Marioneq 4958
8f3a35c153 Exams 2024-03-19 17:39:57 +01:00
Mikołaj Pich
cc9615f5b1
Add missing paramters to getGrades() method 2024-03-19 17:36:34 +01:00
Mikołaj Pich
d17eaa2190
Merge branch 'master' into patch-1 2024-03-19 17:35:02 +01:00
Mikołaj Pich
db89678f5b
Update dependencies 2024-03-19 17:34:31 +01:00
Marioneq 4958
f53fc32821 Add getGrades() in StudentPlusService 2024-03-19 15:28:27 +01:00
Marioneq 4958
eaff0f4bf2 Update GradesResponse.kt 2024-03-19 15:00:08 +01:00
Marioneq 4958
eb2a967ef6
Update Grade.kt 2024-03-19 13:59:52 +01:00
Marioneq 4958
aba27876c2
Update Grade data class 2024-03-19 13:55:56 +01:00
Marioneq 4958
4a9dadc042
Add grades endpoint in StudentPlusService 2024-03-19 13:41:57 +01:00
Mikołaj Pich
41aef1a68b
Add support for register via eduOne 2024-03-19 00:33:58 +01:00
Mikołaj Pich
79f55fba1d
Version 2.5.1 2024-03-03 10:35:29 +01:00
Mikołaj Pich
e97d565bbf
Fix expected response in excuse info in edu one attendance 2024-03-03 09:56:10 +01:00
Mikołaj Pich
03fb607415
Version 2.5.0 2024-03-02 21:02:59 +01:00
Mikołaj Pich
badcf2460d
Version 2.4.2 2024-03-02 20:35:01 +01:00
Mikołaj Pich
bcb7797733
Fix api dump 2024-03-02 15:45:55 +01:00
Mikołaj Pich
83e59cca40
Don't throw error from student module login if there is only eduOne module available 2024-03-02 15:37:43 +01:00
Mikołaj Pich
939e4428c8
Add missing homepage permissions token refreshing 2024-03-02 15:24:09 +01:00
Mikołaj Pich
acabb144bd
Add missing author field to last announcement pojo 2024-03-02 15:23:49 +01:00
Mikołaj Pich
04661c77f0
Rethrow original exception if login not succeed 2024-03-02 12:58:10 +01:00
Mikołaj Pich
c0b5cd2b63
Update dependencies 2024-03-02 11:07:55 +01:00
Mikołaj Pich
8ffd7b0d35 Add last announcement feature 2024-03-02 10:45:42 +01:00
Mikołaj Pich
e077867957 Add support for detect whole day excuses in old student module 2024-02-29 23:56:48 +01:00
Mikołaj Pich
b7081d1ac1 Fix error handling in message endpoints and add more info to http 403 json exceptions 2024-02-29 22:58:31 +01:00
Mikołaj Pich
fcdf0aaf1e Add registration token impl to edu one 2024-02-25 18:32:19 +01:00
Mikołaj Pich
73ad35c0e6 Add attendance excuse feature to eduOne 2024-02-25 17:00:55 +01:00
Mikołaj Pich
10040718e9 Add method to restore messages from trash 2024-02-25 14:29:54 +01:00
Mikołaj Pich
8143878d88 Add support for authorize eduOne student 2024-02-25 12:56:25 +01:00
Mikołaj Pich
8dfcb1b881 Version 2.4.1 2024-02-17 12:45:42 +01:00
dependabot[bot]
49b282cd34
Bump slf4j from 2.0.10 to 2.0.11 (#187) 2024-02-17 11:45:07 +00:00
dependabot[bot]
73260402c6
Bump org.jlleitschuh.gradle.ktlint from 12.0.3 to 12.1.0 (#188) 2024-02-17 11:44:50 +00:00
dependabot[bot]
fbc50399e0
Bump io.mockk:mockk-jvm from 1.13.8 to 1.13.9 (#189) 2024-02-17 11:44:31 +00:00
Mikołaj Pich
b5f64f0dbc Check if every last used symbol exist if there is more than 5 symbol to check 2024-02-16 21:28:17 +01:00
Mikołaj Pich
743cc22760 Add initial symbol check in getUserSubjects() call 2024-02-16 21:10:43 +01:00
Mikołaj Pich
0171e7b246 Add missing FormUrlEncoded annotation to sendModuleCertificate methods 2024-02-09 22:35:39 +01:00
Mikołaj Pich
fa883c411e Version 2.4.0 2024-02-09 19:20:42 +01:00
Mikołaj Pich
78fda15f02 Add additional module login before every *sensitive* endpoint call 2024-02-09 19:00:14 +01:00
Mikołaj Pich
8632c2f425 Fix saving module headers in auto login interceptor 2024-02-09 17:41:20 +01:00
Mikołaj Pich
fc4b8260ea Add method to SDK to check is symbol exist 2024-02-09 16:45:37 +01:00
Mikołaj Pich
4e64026b8f Refactor saveModuleHeaders 2024-02-09 14:45:15 +01:00
Mikołaj Pich
c8037914ca Add className to semester and student to help distinguish them 2024-02-07 19:49:10 +01:00
Mikołaj Pich
33b64c6427 Version 2.3.7 2024-01-21 20:44:37 +01:00
Mikołaj Pich
29bf265a71 Fix lint 2024-01-21 20:41:07 +01:00
Mikołaj Pich
5e066fe9a9 Add detecting cloudflare block page 2024-01-21 20:39:36 +01:00
Mikołaj Pich
81028998e1 Don't try to reach completed lessons endpoint if it is disabled in student config 2024-01-21 20:09:23 +01:00
Mikołaj Pich
ce3296fc43 Add missing status param to api/RealizacjaZajec endpoint 2024-01-21 17:13:33 +01:00
Mikołaj Pich
150c0957ca Add missing unitId field to Sdk 2024-01-21 17:12:13 +01:00
Mikołaj Pich
1056a1ff2a Add support for new AccountInactiveException error message 2024-01-21 16:21:16 +01:00
Mikołaj Pich
c900846ca9 Add implementation of completed lessons from studentplus 2024-01-18 18:14:28 +01:00
Mikołaj Pich
48af6bfc14 Always fetch student site cookies, fetch studentplus only if eduOne enabled 2024-01-18 18:00:41 +01:00
Mikołaj Pich
06a2e33822 Try to login to studentplus module if there is a url to that module for selected school on homepage 2024-01-18 17:20:43 +01:00
Mikołaj Pich
7017d55c81 Fix generating student key for eduOne endpoints 2024-01-18 16:54:37 +01:00
Mikołaj Pich
0156b4ba51 Version 2.3.6 2024-01-14 17:06:50 +01:00
Mikołaj Pich
cd68beb772 Try to fix attendance when eduOne is on 2024-01-14 13:52:23 +01:00
Mikołaj Pich
0bba02045f Add some glue code to possible future closer integration with app cookie manager 2024-01-14 11:17:04 +01:00
Mikołaj Pich
640fb0913b Remove reusing of previously thrown error in auto login interceptor 2024-01-14 09:54:28 +01:00
Mikołaj Pich
60a6d31b45 Add writing to additional cookie manager from MergeCookieManager 2024-01-14 09:54:08 +01:00
Mikołaj Pich
b039d531c3 Save and attach csrf token from and to requests from subdomain modules 2024-01-13 22:18:01 +01:00
Mikołaj Pich
f23585e489 Fix cloudflare check and make it global 2024-01-13 00:07:11 +01:00
Mikołaj Pich
c2edf9498b Add MergeCookieManager to add additional cookies to suitable uri getters 2024-01-12 17:09:38 +01:00
Mikołaj Pich
d4d878065e Add user agent getter 2024-01-12 15:03:57 +01:00
Mikołaj Pich
a7f5fa26af Add CookieJarCabinet to manage multiple cookie stores 2024-01-12 14:53:45 +01:00
Mikołaj Pich
212f0e33d5 Expose alternative cookie manager used for registration 2024-01-12 11:54:00 +01:00
Mikołaj Pich
6c7c919978 Reset version to development 2024-01-12 10:47:02 +01:00
Mikołaj Pich
fd3d4ac624 Expose scrapper cookie manager 2024-01-12 10:46:39 +01:00
Mikołaj Pich
06ba354ef4 Add original url to cloduflare verification error exception 2024-01-12 10:44:54 +01:00
Mikołaj Pich
c895c42059 Add detecting cloudflare verificaiton page 2024-01-12 10:37:06 +01:00
Mikołaj Pich
55afa6836d Version 2.3.5 2024-01-09 21:30:21 +01:00
Mikołaj Pich
e23e5bc2d2 Don't allow to throw runtime exceptions from auto login interceptor 2024-01-09 21:29:54 +01:00
Mikołaj Pich
8271de8dfb Version 2.3.4 2024-01-09 18:55:41 +01:00
Mikołaj Pich
8926db8525 Always clear cookies in sendCredentials method 2024-01-09 09:55:23 +01:00
Mikołaj Pich
04d34c018f Clear scrapper cookies only on e-mail, password or symbol change 2024-01-09 09:53:51 +01:00
Mikołaj Pich
6e3c3418b4 Make cookies jar static 2024-01-09 00:27:36 +01:00
Mikołaj Pich
e3951be709 Load cookies manually to retry requests in auto login interceptor 2024-01-08 23:38:23 +01:00
Mikołaj Pich
8c8af98a36 Bring back emptyCookieJarIntercept to fail not authorized requests quickly 2024-01-08 19:55:46 +01:00
Mikołaj Pich
4a7a502c1a Update homepage start path 2024-01-08 19:27:51 +01:00
Mikołaj Pich
e29d72ae09 Move chain.proceed call in auto login interceptor 2024-01-08 18:46:11 +01:00
Mikołaj Pich
7f6585b69c Save last error during auto login and throw it in other threads instead of retrying requests without session 2024-01-05 00:12:10 +01:00
Mikołaj Pich
444caeafa7 Version 2.3.3 2024-01-03 15:37:48 +01:00
Mikołaj Pich
ee396f1650 Limit coroutines usage in auto login interceptor to fix deadlock issues 2024-01-03 14:51:05 +01:00
Mikołaj Pich
f378f912d0 Fix student module url, add some logs, etc 2024-01-03 13:30:49 +01:00
Mikołaj Pich
7caaddcf51 Don't try to login to both messages and student modules 2024-01-03 12:54:31 +01:00
Mikołaj Pich
96464549f0 Change run blocking and return statements in auto login interceptor 2024-01-03 12:42:55 +01:00
Mikołaj Pich
62fcec2bb4 Move lock to auto login interceptor object 2024-01-03 12:29:54 +01:00
Mikołaj Pich
dbe881c05b Change synchronization block in autologin 2024-01-03 12:20:18 +01:00
Mikołaj Pich
b6566da99f Retry original requests outside of reentrant lock 2024-01-03 03:57:17 +01:00
Mikołaj Pich
526df3c8aa Update logger.debug place in autologin 2024-01-03 03:25:52 +01:00
Mikołaj Pich
2e615da85f Simplify reentrant lock in auto login interceptor 2024-01-03 03:09:18 +01:00
Mikołaj Pich
c0dc1bdfbb Use ReentrantReadWriteLock in auto login intereptor 2024-01-03 02:58:12 +01:00
Mikołaj Pich
40d7e85d75 Try to fetch cookies from both student and message module 2024-01-03 02:25:56 +01:00
Mikołaj Pich
ce4695a7a1 Restore reentrant lock logic to synchronize auto login interceptor 2024-01-03 02:13:48 +01:00
Mikołaj Pich
4a2f8e88e7 Version 2.3.2 2024-01-03 01:55:44 +01:00
Mikołaj Pich
5000080a7a Don't clear cookies from auto login interceptor 2024-01-03 01:44:36 +01:00
Mikołaj Pich
049c428fd3 Synchronize whole requests in auto login interceptor 2024-01-03 01:31:46 +01:00
Mikołaj Pich
d9da6614e7 Move module cookies fetch logic to auto login interceptor 2024-01-03 00:58:41 +01:00
Mikołaj Pich
59384cafa1 Fix clearing start page cache on login completed 2024-01-02 19:02:30 +01:00
Mikołaj Pich
9409a90dde Version 2.3.1 2024-01-02 01:34:51 +01:00
Mikołaj Pich
bfd4439132 Fix wtrealm url scheme for adfs cards 2024-01-02 00:47:50 +01:00
Mikołaj Pich
62d7b56a9d Fix clearing start page cache on login completed 2024-01-02 00:25:17 +01:00
Mikołaj Pich
a8f4c11db1 Version 2.3.0 2024-01-01 23:45:20 +01:00
Mikołaj Pich
65011203ec Don't try to clear studentStart cache if student start repo is not yet initialized 2024-01-01 23:22:01 +01:00
dependabot[bot]
0d596d770b
Bump slf4j from 2.0.9 to 2.0.10 (#186) 2024-01-01 22:21:03 +00:00
dependabot[bot]
7c7bef0722
Bump org.jsoup:jsoup from 1.17.1 to 1.17.2 (#185) 2024-01-01 22:16:55 +00:00
Mikołaj Pich
9442a1db44 Reset version to development 2024-01-01 22:22:09 +01:00
Mikołaj Pich
d77189664c Add missing start request in student start repo, add clearing start cache after successfull login 2024-01-01 22:15:01 +01:00
Mikołaj Pich
fc3ecf7257 Version 2.2.7 2023-12-27 21:41:00 +01:00
Mikołaj Pich
bd81855a28 Fix unit tests 2023-12-27 21:38:25 +01:00
Mikołaj Pich
a29fb83318 Update adfs light scoped wctx param 2023-12-27 21:33:00 +01:00
Mikołaj Pich
f16c029c16 Fix account permission exception message scraping 2023-12-27 19:45:42 +01:00
Mikołaj Pich
5f2128721c Fix students discovery after latest vulcan changes 2023-12-27 19:29:43 +01:00
Mikołaj Pich
e3706b0398 Fix handling new behaviour of LoginEndpoint.aspx in uonetplus-uczen and uonetplus-wiadomosciplus 2023-12-27 17:00:02 +01:00
Mikołaj Pich
11d2063201 Add full support for LoginEndpoint.aspx in uonetplus-uczen 2023-12-27 15:47:30 +01:00
Mikołaj Pich
46a4c3b139 Use LoginEndpoint.aspx endpoint instead of App directly 2023-12-22 18:10:39 +01:00
Mikołaj Pich
88fbdfc8d9 Make login url even more like the original one 2023-12-22 16:07:41 +01:00
Mikołaj Pich
fc3b386a2e Fix login to umt.tarnow.pl 2023-12-22 14:39:24 +01:00
dependabot[bot]
d0f87da8d1
Bump org.jlleitschuh.gradle.ktlint from 12.0.2 to 12.0.3 (#184) 2023-12-22 12:45:38 +00:00
Mikołaj Pich
f0c7093521 Update dependencies, update ktlint rules 2023-12-22 13:39:47 +01:00
Mikołaj Pich
29af590dd8 Update api dump 2023-12-22 12:59:10 +01:00
Mikołaj Pich
65fdac0cf6 Update kotlin to 1.9.21, use signer version from sonatype snapshots 2023-11-28 22:55:58 +01:00
dependabot[bot]
3b2616561c
Bump org.jsoup:jsoup from 1.16.1 to 1.16.2 (#179) 2023-11-28 20:25:39 +00:00
dependabot[bot]
9a26dab997
Bump org.jlleitschuh.gradle.ktlint from 11.6.0 to 11.6.1 (#180) 2023-11-28 20:24:48 +00:00
Mikołaj Pich
a56a163cbe Version 2.2.6 2023-11-06 11:05:06 +01:00
Mikołaj Pich
f6195151e3 Try to fix ADFSLightScoped login 2023-11-06 10:33:55 +01:00
Mikołaj Pich
fa42a71287 Back to snapshot version 2023-11-06 09:31:38 +01:00
Mikołaj Pich
e7540e7599 Add intermediate realm to main host login 2023-11-06 09:30:31 +01:00
Mikołaj Pich
8695e7bac5 Add not logged in error handling during registration 2023-11-05 23:10:27 +01:00
Mikołaj Pich
42cab75447 Version 2.2.5 2023-11-03 22:33:45 +01:00
Mikołaj Pich
d062bd1a74 Remove missing LinkedAccountUids field in permissions fields, add some default values too 2023-11-03 22:06:42 +01:00
Mikołaj Pich
717943fd32 Version 2.2.4 2023-10-27 14:21:26 +02:00
Mikołaj Pich
eb7d179c68 Version 2.2.3 2023-10-26 18:12:29 +02:00
Mikołaj Pich
7af0f5c0a6 Version 2.2.2 2023-10-23 19:37:28 +02:00
Mikołaj Pich
186dfcb767 Update okhttp 2023-10-23 19:37:03 +02:00
Mikołaj Pich
622c11a86b Fix parsing grade point percent if there is slash and some value which parsed to 0d 2023-10-18 21:32:29 +02:00
Mikołaj Pich
48f82f28b5 Version 2.2.1 2023-10-03 00:53:52 +02:00
dependabot[bot]
57cf508cdf
Bump slf4j from 2.0.7 to 2.0.9 (#177) 2023-10-02 22:53:09 +00:00
dependabot[bot]
c7f9b4bbe0
Bump org.jlleitschuh.gradle.ktlint from 11.5.1 to 11.6.0 (#178) 2023-10-02 22:52:55 +00:00
Mikołaj Pich
4eb33ca209 Update dependencies 2023-09-26 22:46:42 +02:00
Mikołaj Pich
358e12113c Version 2.2.0 2023-09-26 22:37:34 +02:00
dependabot[bot]
61f9d6abe0
Bump org.jlleitschuh.gradle.ktlint from 11.5.0 to 11.5.1 (#175) 2023-09-24 14:43:55 +00:00
Mikołaj Pich
faca5a161b Version 2.1.0 2023-08-24 23:34:29 +02:00
Mikołaj Pich
6c1fe18065 Update dependencies 2023-08-24 23:30:56 +02:00
dependabot[bot]
f3646bf851
Bump org.jlleitschuh.gradle.ktlint from 11.4.2 to 11.5.0 (#174) 2023-08-22 22:47:47 +00:00
dependabot[bot]
0e47d7afdf
Bump org.jlleitschuh.gradle.ktlint from 11.3.2 to 11.4.2 (#173) 2023-07-22 13:36:24 +00:00
Mikołaj Pich
bca5158a1c Fix messed up params in sendPasswordResetRequest() call 2023-06-08 23:14:12 +02:00
Mikołaj Pich
96051b36bc Make description in grade descriptive scrpper pojo nullable 2023-06-05 21:17:14 +02:00
dependabot[bot]
368cfac7b1
Bump org.jetbrains.kotlinx:kotlinx-serialization-json (#172) 2023-06-05 17:13:27 +00:00
Mikołaj Pich
33f05d67ed Version 2.0.8 2023-06-01 23:21:01 +02:00
Mikołaj Pich
16cb07f73e Fix mapping not initialized attendance category when using eduOne fallback 2023-06-01 15:01:41 +02:00
Mikołaj Pich
d1486bade5 Fix duplicated json names in Conference pojo 2023-06-01 13:37:57 +02:00
Mikołaj Pich
567679d1a0 Version 2.0.7 2023-06-01 09:11:16 +02:00
Mikołaj Pich
773402ceb1 Add fallback to eduOne attendance if there is eduOne: true in student start page 2023-05-29 00:03:49 +02:00
Mikołaj Pich
f9be659490 Add descriptive grades 2023-05-28 23:03:20 +02:00
Mikołaj Pich
69651688f0 Add missing domain suffix in cookie interceptor 2023-05-28 23:03:20 +02:00
Mikołaj Pich
d196b49046 Make snapshot repo clickable 2023-05-28 23:03:20 +02:00
Mikołaj Pich
4a67e1e3fa Add domain suffix parameter 2023-05-28 23:03:17 +02:00
Mikołaj Pich
d6bdb4e74a Add grades demo 2023-05-26 00:26:23 +02:00
Mikołaj Pich
95eafd838f Add registration.md to docs 2023-05-25 23:49:40 +02:00
Mikołaj Pich
20ea9fa4cc Fix needs build name 2023-05-25 22:22:03 +02:00
Mikołaj Pich
6b2c69833f Fix docs publishing workflow 2023-05-25 22:21:04 +02:00
Mikołaj Pich
6087e79308 Use official deploy-pages action to deploy docs 2023-05-25 22:16:59 +02:00
Mikołaj Pich
ecc58a4d8a Add base of docs 2023-05-25 22:11:38 +02:00
Mikołaj Pich
05f8073499 Refactor addLessonDetails method 2023-05-25 20:25:43 +02:00
Mikołaj Pich
e639d0e751 Add support for lesson cancelled two times 2023-05-25 20:10:37 +02:00
Mikołaj Pich
f66c7e9998 Refactor divs matching in timetable parser 2023-05-25 20:00:13 +02:00
Mikołaj Pich
e37a007e48 Add support for new format of lessons substitution with different subject 2023-05-24 23:09:51 +02:00
Mikołaj Pich
41b8496045 Don't reverse teachers names (as VULCAN stopped doing this) 2023-05-24 22:27:12 +02:00
Mikołaj Pich
05be2d1d9d Fix parsing lessons with 'zastępstwo' as a reason of teacher absence 2023-05-24 21:58:28 +02:00
Mikołaj Pich
43c85e6695 Version 2.0.6 2023-05-23 15:45:52 +02:00
Mikołaj Pich
6f06410133 Add detection of some new error screens 2023-05-23 14:02:46 +02:00
Mikołaj Pich
c17fcee052 Version 2.0.5 2023-05-23 02:23:44 +02:00
Mikołaj Pich
b72bc42cbc Use snapshot version of retrofit to fix r8 full mode issues 2023-05-23 02:23:03 +02:00
Mikołaj Pich
d83be8fb12 Version 2.0.4 2023-05-22 16:52:52 +02:00
Mikołaj Pich
3d9aa4c6ff Change version param assignment 2023-05-20 16:53:48 +02:00
Mikołaj Pich
94261a487a Update deploy workflow config 2023-05-20 16:48:00 +02:00
Mikołaj Pich
fc5719d166 Move lib ver def out of versions catalog config 2023-05-20 16:40:52 +02:00
Mikołaj Pich
742b218c61 Debug sonatype release 2023-05-20 00:04:34 +02:00
Mikołaj Pich
8387bef56c Update dependencies 2023-05-19 23:05:35 +02:00
Mikołaj Pich
485e4bef99 Add new maintenance page detection 2023-05-19 22:36:56 +02:00
Mikołaj Pich
97c46aa410 Replace migbase64 with base64 decoder from kotlin stdlib 2023-05-13 21:45:24 +02:00
Mikołaj Pich
f96563dc21 Update dependencies 2023-05-13 21:36:57 +02:00
Mikołaj Pich
9e76c0cf4e Version 2.0.3 2023-05-12 22:53:03 +02:00
Mikołaj Pich
a92198fc8f Add missing handleErrors() on authorize permission response 2023-05-12 22:52:09 +02:00
Mikołaj Pich
38e6bcfa8a Add missing headers to authorize permissions method 2023-05-12 21:11:14 +02:00
Mikołaj Pich
b86f188dba Version 2.0.1 2023-05-11 23:59:20 +02:00
Mikołaj Pich
c1573f04c5 Add AuthorizationRequiredException 2023-05-11 10:57:35 +02:00
Mikołaj Pich
f7716915d3 Add getCurrentStudent method 2023-05-11 10:47:53 +02:00
Mikołaj Pich
d897ce49ae Add isAuthorized flag to students 2023-05-10 22:57:25 +02:00
Mikołaj Pich
5ce34018e3 Add authorize permission method 2023-05-10 22:45:14 +02:00
Mikołaj Pich
fa4b1aa7e0 Make unused homework attachement fields nullable 2023-05-09 12:01:40 +02:00
Mikołaj Pich
60f8a506a5 Version 2.0.0 2023-05-07 23:17:48 +02:00
Mikołaj Pich
14267a9a89 Fix previous workaround by handling fake http 404 errors 2023-05-07 21:27:32 +02:00
Mikołaj Pich
8973b01694 Add workaround for main uonetplus-uczen endpoint change 2023-05-07 20:57:22 +02:00
Mikołaj Pich
62d5ff05ef Add InvalidSymbolException to hebe 2023-05-05 00:14:37 +02:00
Mikołaj Pich
8726501d8b Remove flag for empty cookie jar interceptor 2023-05-04 23:59:45 +02:00
Mikołaj Pich
81951eb29f Fix log level in hebe 2023-05-04 23:55:28 +02:00
Mikołaj Pich
f42afd1602 Fix exam dates 2023-05-04 23:49:12 +02:00
Mikołaj Pich
432241919a Refactor exam fetch from hebe 2023-05-04 22:16:43 +02:00
dependabot[bot]
b5028a6437
Bump io.mockk:mockk-jvm from 1.13.4 to 1.13.5 (#169) 2023-05-04 19:32:08 +00:00
dependabot[bot]
fb76454793
Bump org.jsoup:jsoup from 1.15.4 to 1.16.1 (#170) 2023-05-04 19:31:35 +00:00
dependabot[bot]
99bc1db9f5
Bump org.jlleitschuh.gradle.ktlint from 11.3.1 to 11.3.2 (#171) 2023-05-04 19:31:06 +00:00
Mikołaj Pich
7a0c173925 Update conference field names
Resolves #147
2023-05-02 00:23:10 +02:00
Mikołaj Pich
b040618458 Update okhttp and retrofit 2023-05-02 00:03:35 +02:00
Mikołaj Pich
0a1268e5af
Merge pull request #167 from wulkanowy/hebe
Add Hebe
2023-05-01 23:24:42 +02:00
Mikołaj Pich
33ccfdb77b Merge branch 'master' into hebe 2023-05-01 23:19:12 +02:00
Mikołaj Pich
3e3f17151a Make getNormalizedSymbol public 2023-05-01 23:14:51 +02:00
Bartosz Bieniek
2e8eb1de3c
Add support for meal menu (#168) 2023-05-01 21:11:16 +02:00
Mikołaj Pich
efd332d4f3 Add basic method to fetch exams from hebe 2023-04-29 17:19:35 +02:00
Mikołaj Pich
a18fe84ce7 Add grades summary and averages 2023-04-18 23:07:00 +02:00
Mikołaj Pich
24b5b16f72 Fix grade date format 2023-04-16 23:31:05 +02:00
Mikołaj Pich
4ef106e4c9 Fix initialize pupil id, add generic method to handle api errors 2023-04-16 23:26:26 +02:00
Mikołaj Pich
51dd70067b Add method to fetch grades from hebe 2023-04-16 23:00:10 +02:00
Mikołaj Pich
6b602b35d6 Fix searching student to get token in hybrid mode 2023-04-16 22:11:21 +02:00
Mikołaj Pich
0fb794e246 Make Pupil.loginValue nullable 2023-04-16 22:01:05 +02:00
Mikołaj Pich
c55d0bf251 Make firebaseToken non-required and default-nullable 2023-04-16 21:57:10 +02:00
Mikołaj Pich
8dfcd24753 Fix device model assignment to hebe 2023-04-16 21:52:47 +02:00
Mikołaj Pich
17e702834b Fix Educator.id type 2023-04-16 21:51:30 +02:00
Mikołaj Pich
22018ce911 Fix second name nullable 2023-04-16 21:45:38 +02:00
Mikołaj Pich
e2ddf47f29 Fix hebe students fetch 2023-04-16 21:33:56 +02:00
Mikołaj Pich
57660cc7c9 Add interceptors to hebe too 2023-04-16 21:27:31 +02:00
Mikołaj Pich
d228df6c6d Add missing serializable annotations 2023-04-16 21:17:03 +02:00
Mikołaj Pich
d3b74448f8 Use https in routing rules url 2023-04-16 21:08:35 +02:00
Mikołaj Pich
522241b5de Fix hebe registration 2023-04-16 21:01:07 +02:00
Mikołaj Pich
d85a85235f Add PoC of request signing 2023-04-16 12:41:53 +02:00
Mikołaj Pich
64b007425f Fix return type of register hybrid, add some missing exceptions 2023-04-16 10:16:30 +02:00
Mikołaj Pich
32d6505e4b Add some missing API 2023-04-16 09:40:48 +02:00
Mikołaj Pich
430e388b7d Merge branch 'master' into hebe 2023-04-16 09:32:52 +02:00
Mikołaj Pich
8f01c8c98a Make getNormalizedSymbol public 2023-04-16 08:22:39 +02:00
Mikołaj Pich
8c1af1192d Add binary compatibility valiator 2023-04-15 23:38:35 +02:00
Mikołaj Pich
07d68f5425 Remove getStudents() API 2023-04-15 22:39:36 +02:00
Mikołaj Pich
4ce5701f5a Update kotlin and ksp 2023-04-15 22:17:05 +02:00
Mikołaj Pich
c057907efa Update gradle wrapper to 8.1 2023-04-15 22:12:33 +02:00
Mikołaj Pich
a71c27a3b4 Bring back getStudentsHybrid method 2023-04-15 21:04:29 +02:00
Mikołaj Pich
8d37efb8e8 Fix compilation errors 2023-04-15 20:58:33 +02:00
Mikołaj Pich
ae322f4966 Merge branch 'master' into hebe 2023-04-15 20:50:43 +02:00
Mikołaj Pich
76e6a0e5bd Remove deprecated sdk-mobile module 2023-04-08 01:09:29 +02:00
Mikołaj Pich
d9638eeba7 Simplify API of grades 2023-04-08 00:49:24 +02:00
Mikołaj Pich
8adeb5842f Rename Timetable to Lesson, simplify timetable API 2023-04-08 00:15:36 +02:00
Mikołaj Pich
06304ded47 Fix sdk student mapper 2023-04-07 23:47:03 +02:00
Mikołaj Pich
1a68b5af21 Remove deprecated methods and fields from Sdk API 2023-04-07 23:41:28 +02:00
Mikołaj Pich
995e652716 Remove deprecated LocalDateTime in sdk pojos 2023-04-07 23:41:07 +02:00
Mikołaj Pich
5cb09ec919 Remove unused group property from exam pojo 2023-04-07 23:18:17 +02:00
Mikołaj Pich
2aea471b94 Make kotlin serialization plugin depends on kotlin version 2023-04-02 09:21:33 +02:00
Mikołaj Pich
492f8ede8f Add some version catalogs config 2023-04-02 09:17:16 +02:00
dependabot[bot]
615a9b8cc4
Bump io.github.gradle-nexus.publish-plugin from 1.2.0 to 1.3.0 (#163) 2023-04-02 06:48:58 +00:00
dependabot[bot]
2bab8112cf
Bump slf4j from 2.0.6 to 2.0.7 (#166) 2023-04-02 06:41:03 +00:00
dependabot[bot]
ba495da583
Bump org.jlleitschuh.gradle.ktlint from 11.2.0 to 11.3.1 (#162) 2023-04-02 06:39:36 +00:00
Mikołaj Pich
cd3b738e81 Version 1.9.2 2023-03-08 21:04:56 +01:00
Mikołaj Pich
5e02645dd3 Add cloudflare detection 2023-03-07 00:02:10 +01:00
Mikołaj Pich
f87dd17bae Handle new account permission exception page 2023-03-06 22:40:34 +01:00
dependabot[bot]
34814cc062
Bump org.jsoup:jsoup from 1.15.3 to 1.15.4 (#161) 2023-03-01 23:00:10 +00:00
dependabot[bot]
d8baaedb09
Bump org.jetbrains.kotlinx:kotlinx-serialization-json (#160) 2023-03-01 22:59:45 +00:00
Mikołaj Pich
3bcc87b4a0 Update chromeRev in default user agent 2023-03-01 21:48:01 +01:00
Mikołaj Pich
b883539c1f Add option to set custom user agent template 2023-03-01 21:43:56 +01:00
Mikołaj Pich
b02a093c4b Update dependencies 2023-03-01 21:03:21 +01:00
Mikołaj Pich
5143ad223f Add missing trailing commas 2023-03-01 21:03:10 +01:00
dependabot[bot]
3a8b351d2b
Bump io.mockk:mockk-jvm from 1.13.3 to 1.13.4 (#156) 2023-02-12 14:27:56 +00:00
dependabot[bot]
8def0961c6
Bump org.jlleitschuh.gradle.ktlint from 11.0.0 to 11.1.0 (#157) 2023-02-12 14:27:39 +00:00
Mikołaj Pich
6a3e04f0af Always try to mark message as read when markAsRead flag is true
wulkanowy/wulkanowy#2082
2023-01-12 20:35:45 +01:00
dependabot[bot]
366a52afee
Bump org.jetbrains.kotlin.jvm from 1.7.22 to 1.8.0 (#152) 2023-01-06 14:40:34 +00:00
dependabot[bot]
b95bd8004c
Bump org.jetbrains.kotlin.plugin.serialization from 1.7.22 to 1.8.0 (#150) 2023-01-06 14:40:13 +00:00
dependabot[bot]
8189776975
Bump com.google.devtools.ksp from 1.7.22-1.0.8 to 1.8.0-1.0.8 (#151) 2023-01-06 14:34:12 +00:00
Mikołaj Pich
510f067bb0 Version 1.9.1 2023-01-05 22:44:14 +01:00
Mikołaj Pich
af6595de1f Add some antybot errors detection to prevent other strange errors 2023-01-05 21:51:24 +01:00
Mikołaj Pich
d19d74d254 Fix sign in to registers using full login with prefix 2023-01-05 21:15:40 +01:00
dependabot[bot]
6b8049af23
Bump slf4j from 2.0.5 to 2.0.6 (#153) 2023-01-05 19:32:08 +00:00
Mikołaj Pich
3012cdd678 Version 1.9.0 2023-01-01 20:30:56 +01:00
Patryk
2d0fc79855
Update date in LICENSE file (#149) 2023-01-01 20:30:28 +01:00
Mikołaj Pich
a3b97edd48 Fix getNormalizedSymbol() for Ł letter 2022-12-30 21:29:40 +01:00
Mikołaj Pich
3c5a4d66ce Update account unlock error validation 2022-12-30 18:20:24 +01:00
Mikołaj Pich
c9005720c9 Add workaround for 'Login Service' page errors 2022-12-27 23:12:38 +01:00
Mikołaj Pich
a0572e7743 Move inactive account detection to error interceptor 2022-12-27 22:51:47 +01:00
Mikołaj Pich
a2ff889ee4 Fix inactive account detection in register repo 2022-12-27 14:56:38 +01:00
Mikołaj Pich
170485fea2 Move inactive account detection to auto login interceptor and register repo 2022-12-27 14:37:28 +01:00
Mikołaj Pich
0ab26a65dd Switch teacher to employee in register terminology 2022-12-26 21:13:50 +01:00
Mikołaj Pich
f4b4c70b67 Add inactive account detection 2022-12-26 20:40:30 +01:00
Mikołaj Pich
19260cd862 Fix login service error message 2022-12-26 01:44:07 +01:00
Mikołaj Pich
285a03b5c2 Catch Login service errors 2022-12-26 01:06:16 +01:00
Mikołaj Pich
a5389a960c Fix parent ids value 2022-12-25 23:15:47 +01:00
Mikołaj Pich
73fe1e21fc Fix graduate exception message 2022-12-25 23:15:30 +01:00
Mikołaj Pich
34a0059df9 Add raw subject ids 2022-12-25 22:52:43 +01:00
Mikołaj Pich
bf63509acd Detect student graduate message 2022-12-25 22:41:58 +01:00
Mikołaj Pich
0b487191ec Add very basic support for teachers 2022-12-24 10:50:45 +01:00
Mikołaj Pich
3b25f5d9bf Add new abstraction around registration, use it in old getStudents() API 2022-12-23 23:52:33 +01:00
Mikołaj Pich
42dbd67a39 Extract UrlGenerator to separate file 2022-12-22 01:10:21 +01:00
Mikołaj Pich
55b2283c33 Version 1.8.3 2022-12-21 13:14:16 +01:00
Mikołaj Pich
c42d008bbf Fix adfs id for non-rzeszowprojekt 2022-12-21 12:52:43 +01:00
Mikołaj Pich
41e7140216 Version 1.8.2 2022-12-20 23:45:53 +01:00
Mikołaj Pich
98b37273bb Fix gh actions badge 2022-12-20 23:33:12 +01:00
Mikołaj Pich
c74512daa7 Fix id in url login to adfs light scoped 2022-12-20 23:15:45 +01:00
Mikołaj Pich
d66c9805b2 Remove resman.pl mentions 2022-12-20 13:03:36 +01:00
dependabot[bot]
bc992b3f85
Bump org.jetbrains.kotlin.plugin.serialization from 1.7.20 to 1.7.22 (#143) 2022-12-02 19:35:55 +00:00
dependabot[bot]
8e99f6baf6
Bump com.google.devtools.ksp from 1.7.20-1.0.7 to 1.7.22-1.0.8 (#145) 2022-12-02 19:32:38 +00:00
dependabot[bot]
336187c93e
Bump mockk-jvm from 1.13.2 to 1.13.3 (#142) 2022-12-02 19:31:22 +00:00
dependabot[bot]
1ac8a7bf33
Bump slf4j from 2.0.3 to 2.0.5 (#144) 2022-12-02 19:29:59 +00:00
dependabot[bot]
44965445df
Bump org.jetbrains.kotlin.jvm from 1.7.20 to 1.7.22 (#146) 2022-12-02 19:29:05 +00:00
Mikołaj Pich
41168eec22 Reset to development version 2022-12-02 20:28:39 +01:00
Mikołaj Pich
e2e1081405 Version 1.8.1 2022-11-19 23:33:14 +01:00
Mikołaj Pich
876b00ca32 Update default user agent details 2022-11-19 22:14:10 +01:00
Mikołaj Pich
12250eb07f Version 1.8.0 2022-11-16 13:52:07 +01:00
Mikołaj Pich
701016eda2 Update dependencies 2022-11-16 10:48:49 +01:00
dependabot[bot]
868009a3e6
Bump com.google.devtools.ksp from 1.7.20-1.0.6 to 1.7.20-1.0.7 (#140) 2022-11-03 16:59:04 +00:00
dependabot[bot]
07a05b0db1
Bump kotlinx-serialization-json from 1.4.0 to 1.4.1 (#141) 2022-11-03 16:51:42 +00:00
Mikołaj Pich
497f4f5910 Fix parsing recipient with special name
Fixes #132
2022-10-02 20:03:14 +02:00
Mikołaj Pich
7745db956c Add readBy/unreadBy field to message meta objects 2022-10-02 19:50:07 +02:00
dependabot[bot]
588d8b3022
Bump org.jlleitschuh.gradle.ktlint from 10.3.0 to 11.0.0 (#131) 2022-10-02 14:42:03 +00:00
dependabot[bot]
0169e7ace5
Bump slf4j from 1.7.36 to 2.0.3 (#135) 2022-10-02 14:40:45 +00:00
dependabot[bot]
4bfd823e39
Bump moshi from 1.13.0 to 1.14.0 (#137) 2022-10-02 14:34:41 +00:00
dependabot[bot]
f65faabbd7
Bump mockk from 1.12.5 to 1.13.2 (#134) 2022-10-02 14:34:04 +00:00
Mikołaj Pich
ba6e403d21 Update kotlin 2022-10-02 16:25:41 +02:00
Mikołaj Pich
2840d9d6d0 Use null to indicate invalid grade value instead of 0 2022-09-28 23:00:05 +02:00
Mikołaj Pich
f3acb5df18 Use empty string instead of 0 to indicate no average available for subject 2022-09-28 22:48:18 +02:00
Mikołaj Pich
bc21110445 Don't expect MessageDetails response from markMessageAsRead method 2022-09-17 11:34:48 +02:00
Mikołaj Pich
0d43710ac6 Return empty states from some methods when diaryId == 0 2022-09-08 21:33:37 +02:00
Mikołaj Pich
f1340f1696 Add attendance records endpoint method 2022-09-08 21:22:20 +02:00
Mikołaj Pich
459faf2932 Version 1.7.5 2022-09-02 20:49:12 +02:00
Mikołaj Pich
dcd8bd8b19 Filter out units where there is no student or parent ids in auth info 2022-09-02 19:06:21 +02:00
Mikołaj Pich
c8e3e4f9fd Update gradle wrapper 2022-09-01 17:10:33 +02:00
Mikołaj Pich
2749540049 Version 1.7.4 2022-09-01 17:08:34 +02:00
Mikołaj Pich
4d591f2672 Add log stmt to studentSchools links 2022-09-01 17:04:38 +02:00
Mikołaj Pich
43f462c49d Add log stmt to error from mark message as read 2022-09-01 16:55:15 +02:00
Mikołaj Pich
0e00d4d2ac Version 1.7.3 2022-08-31 18:59:45 +02:00
Mikołaj Pich
006a238bda Use organizationName property over unit.name 2022-08-31 16:01:15 +02:00
Mikołaj Pich
e92e696725 Use permissions property instead of extract school id from DOM 2022-08-31 14:59:30 +02:00
Mikołaj Pich
21e4d75e1b Add missing headers to mark message as read request 2022-08-31 12:16:17 +02:00
Mikołaj Pich
047c1f83c8 Try to mark message as read only if message not already read 2022-08-31 11:57:18 +02:00
Mikołaj Pich
2a7743f56f Add flag to mark message as read 2022-08-31 11:37:06 +02:00
Mikołaj Pich
ca19c41b04 Version 1.7.2 2022-08-30 12:13:23 +02:00
Mikołaj Pich
a1bf69486b Add support for another datetime format in custom date adapter 2022-08-30 10:56:01 +02:00
Mikołaj Pich
09e5215894 Deploy snapshot verion on each push to master 2022-08-29 22:35:42 +02:00
Mikołaj Pich
a19f3c8648 Update dependencies 2022-08-29 22:26:26 +02:00
Mikołaj Pich
8485454de4 Fix HTTP_CONFLICT handling 2022-08-29 22:21:02 +02:00
Mikołaj Pich
12ffe47326 Trim student name, add studentId as a fallback of userLoginId 2022-08-29 21:26:56 +02:00
Mikołaj Pich
cad9b16a5f Add support for another datetime format in custom date adapter 2022-08-24 09:26:15 +02:00
Mikołaj Pich
4ca1b6bcea Fix message date formatting 2022-08-23 20:20:20 +02:00
Mikołaj Pich
925ff6e157 Version 1.7.0 2022-08-22 14:53:55 +02:00
Mikołaj Pich
e26ab8ccf6
Merge pull request #128 from wulkanowy/feature/messages-plus
Add support for new messages module
2022-08-22 14:52:27 +02:00
Mikołaj Pich
dbe87aac67 Update get sent messages tests 2022-08-20 14:01:54 +02:00
Mikołaj Pich
b78b1c1efb Update get message replay details test 2022-08-20 13:53:22 +02:00
Mikołaj Pich
40ad359073 Add option to remove messages pernamently 2022-08-20 13:48:07 +02:00
Mikołaj Pich
d90ba40e55 Update send message test 2022-08-20 13:36:04 +02:00
Mikołaj Pich
af0ec25114 Update delete messages test 2022-08-20 13:18:55 +02:00
Mikołaj Pich
bc76d18427 Update deleted messages method test 2022-08-20 13:13:37 +02:00
Mikołaj Pich
c38f2734fc Add MailboxType to Recipient and Mailbox pojos 2022-08-19 23:48:16 +02:00
Mikołaj Pich
985d751fc3 Add missing type to Mailbox pojo 2022-08-19 23:30:34 +02:00
Mikołaj Pich
8b21629478 Add user/full names to Mailbox pojo 2022-08-19 23:27:17 +02:00
Mikołaj Pich
90687bdc3d Add some missing fields in pojos 2022-08-19 22:52:17 +02:00
Mikołaj Pich
09965f5965 Add missing headers to send message method 2022-08-19 22:34:48 +02:00
Mikołaj Pich
2a14fd19b7 Fix sendMessage and deleteMessage response types 2022-08-19 00:18:34 +02:00
Mikołaj Pich
19dd28401d Add missing headers to remove messages method 2022-08-18 23:21:40 +02:00
Mikołaj Pich
041953380d Handle not logged in errors in messages+ 2022-08-18 23:11:36 +02:00
Mikołaj Pich
007176fed2 Add missing mapping 2022-08-18 00:19:23 +02:00
Mikołaj Pich
cadf48de4a Make some fields not nullable 2022-08-18 00:17:14 +02:00
Mikołaj Pich
b210dcac04 Split get message details and get message replay details 2022-08-17 23:49:27 +02:00
Mikołaj Pich
9176c250ca Add mailboxKey param to message methods 2022-08-17 23:15:46 +02:00
Mikołaj Pich
32d1dce278 Update message.id field name 2022-08-17 23:06:57 +02:00
Mikołaj Pich
44a8180292 Generate random uuid in new message request 2022-08-17 21:29:28 +02:00
Mikołaj Pich
b41a4e2f22 Fix recipients parsing 2022-08-15 18:00:51 +02:00
Mikołaj Pich
c3db2cdc3d Parse mailboxes names 2022-08-15 17:20:10 +02:00
Mikołaj Pich
cf29b966d6 Parse recipients names 2022-08-15 17:10:00 +02:00
Mikołaj Pich
ceafa0f411 Add more fields to message details and new message 2022-08-15 16:27:54 +02:00
Mikołaj Pich
1825a9a60d Add example of message details 2022-08-15 16:05:15 +02:00
Mikołaj Pich
2e46ab689f Fix parsing message meta 2022-08-15 14:59:25 +02:00
Mikołaj Pich
497713dac9 Add initial support for messages plus API 2022-08-14 17:10:11 +02:00
Mikołaj Pich
3f77767434 Change source of user name 2022-08-13 00:46:21 +02:00
Mikołaj Pich
26230e50e7 Add grades full method with metadata 2022-08-07 22:23:33 +02:00
Mikołaj Pich
59042d9458 Specify return type explicity in public API 2022-08-07 14:28:22 +02:00
Mikołaj Pich
4c50ae000f
Merge pull request #127 from wulkanowy/feature/kotlinx-serialization
Migrate from moshi to kotlinx serialization
2022-08-02 00:35:06 +02:00
Mikołaj Pich
9032e33686 Fix empty object serialization 2022-08-02 00:26:56 +02:00
Mikołaj Pich
e18302b50f Allow unknown keys in Permission objects 2022-08-02 00:02:06 +02:00
Mikołaj Pich
2f1c0a20af Add jdk config for jitpack 2022-08-01 23:22:24 +02:00
Mikołaj Pich
84b6675269 Fix lint issues 2022-08-01 23:10:02 +02:00
Mikołaj Pich
bafb07cf5d Migrate from moshi to kotlinx serialization 2022-08-01 00:59:49 +02:00
Mikołaj Pich
aec4ea5221 Remove deprecations from tests 2022-07-30 16:48:58 +02:00
Mikołaj Pich
953233590b Update dependencies 2022-07-30 16:32:05 +02:00
Mikołaj Pich
0a1171b8f9 Stop cashing cache response in student repo 2022-07-30 16:27:58 +02:00
dependabot[bot]
5ae2a915fd
Bump coroutines from 1.6.2 to 1.6.3 (#125) 2022-07-09 07:36:05 +00:00
Mikołaj Pich
b0d057ca21 Update dependencies 2022-06-18 12:24:28 +02:00
Mikołaj Pich
16811fbe90 Add referrer header to send certificate request 2022-06-18 11:11:54 +02:00
dependabot[bot]
44184f07f7
Bump coroutines from 1.6.1 to 1.6.2 (#122) 2022-06-04 11:20:17 +00:00
dependabot[bot]
42d4731dd7
Bump org.jlleitschuh.gradle.ktlint from 10.2.1 to 10.3.0 (#124) 2022-06-04 11:19:58 +00:00
dependabot[bot]
fdedb95207
Bump jsoup from 1.14.3 to 1.15.1 (#123) 2022-06-04 11:19:33 +00:00
Mikołaj Pich
a8ba963a0b Version 1.6.4 2022-05-16 23:24:43 +02:00
Mikołaj Pich
189f5ecee0 Trim whitespaces from strings in GradeSummary 2022-05-16 21:29:42 +02:00
Mikołaj Pich
3ecb494372 Handle null in attendance subject 2022-05-16 21:24:11 +02:00
dependabot[bot]
19be4c01f9
Bump org.jetbrains.kotlin.jvm from 1.6.10 to 1.6.21 (#121) 2022-05-03 10:13:13 +00:00
dependabot[bot]
f0d07bb30c
Bump coroutines from 1.6.0 to 1.6.1 (#120) 2022-05-01 22:06:08 +00:00
Mikołaj Pich
abc43f7fd3 Version 1.6.0 2022-04-02 20:33:53 +02:00
Mikołaj Pich
fba873461e Add more fields to Diary model 2022-03-12 12:17:20 +01:00
Mikołaj Pich
14ae84db0b Allow null in timetable full 2022-03-12 11:52:17 +01:00
Mikołaj Pich
f0272ef252 Allow null in grade details and summary list 2022-03-12 11:49:35 +01:00
Mikołaj Pich
e70e970d32
Merge pull request #106 from wulkanowy/feature/student-photo
Add student photo
2022-03-12 11:26:53 +01:00
Mikołaj Pich
fd6125f322
Merge pull request #117 from xVemu/master
Add support for room replacement in timetable
2022-03-08 20:46:33 +01:00
xVemu
3b17f04b9d
Add support for room replacement in timetable 2022-03-05 12:57:38 +01:00
dependabot[bot]
442bd060d7
Bump slf4j from 1.7.35 to 1.7.36 (#118) 2022-03-04 11:54:24 +00:00
dependabot[bot]
aea2fb4b88
Bump org.jetbrains.kotlin.jvm from 1.5.31 to 1.6.10 (#113) 2022-02-28 20:03:03 +00:00
dependabot[bot]
9d9a18c5c2
Bump moshi from 1.12.0 to 1.13.0 (#111) 2022-02-28 19:57:08 +00:00
dependabot[bot]
c2a82ae136
Bump coroutines from 1.5.2 to 1.6.0 (#112) 2022-02-28 19:53:13 +00:00
Mikołaj Pich
2447e0de15
Merge pull request #116 from Zaptyp/patch-1
Update date in LICENSE file
2022-02-28 20:46:03 +01:00
dependabot[bot]
65f1a02936
Bump org.jlleitschuh.gradle.ktlint from 10.2.0 to 10.2.1 (#110) 2022-02-28 19:39:41 +00:00
dependabot[bot]
dd87697f59
Bump slf4j from 1.7.32 to 1.7.35 (#115) 2022-02-28 19:38:01 +00:00
Patryk
6394571614
Update date in LICENSE file 2022-02-03 10:16:12 +01:00
Mikołaj Pich
57680ecb3f
Remove unused TableContent property from GradePointsSummary 2022-01-09 16:15:09 +01:00
Mikołaj Pich
4e5cb29ce5 Version 1.5.0 2022-01-01 16:17:52 +01:00
Mikołaj Pich
db5820b81b Update default android version, build tag and chrome version 2021-12-31 16:06:49 +01:00
Mikołaj Pich
5713a6d1ee Fix lint issues 2021-12-31 15:59:01 +01:00
Mikołaj Pich
6e1b8eb26a Unescape entities from homework content 2021-12-31 14:56:40 +01:00
Mikołaj Pich
f6f32b755a Fix unit id matching for kindergarten students 2021-12-30 22:43:37 +01:00
Mikołaj Pich
fbb42782b3 Add switchDiary with kindergartenDiaryId param 2021-12-30 19:45:50 +01:00
Mikołaj Pich
d653df338a Add kindergartenDiaryId to Sdk 2021-12-30 19:35:46 +01:00
Mikołaj Pich
27f95f923c Fix student start repo validation 2021-12-30 19:33:16 +01:00
Mikołaj Pich
4e88b0f8d4 Fix ScrapperRemoteTests 2021-12-30 19:15:33 +01:00
Mikołaj Pich
7b52d0e5e1 Add tests for filtering users without diaries 2021-12-30 18:54:20 +01:00
Mikołaj Pich
8971d39691 Add base support for kindergarten diaries 2021-12-30 17:12:52 +01:00
Mikołaj Pich
42bce37748 Simplify timetable date and time parsing 2021-12-29 16:20:08 +01:00
Mikołaj Pich
7efab423b5 Block sdk tz at Europe/Warsaw 2021-12-29 13:35:37 +01:00
Mikołaj Pich
aa7b141cb5 Add ZonedDateTime fields next to LocalDateTime in sdk pojos 2021-12-28 16:57:12 +01:00
Mikołaj Pich
01c62bffbe Version 1.4.4 2021-12-19 22:10:12 +01:00
Mikołaj Pich
4e9fa5d240 Fix compatibility issues in edu.gdansk.pl login hotfix 2021-12-19 21:40:58 +01:00
Mikołaj Pich
e472eec5a2 Hotfix edu.gdansk.pl login 2021-12-17 19:37:10 +01:00
dependabot[bot]
dd0d3f03e6
Merge pull request #108 from wulkanowy/dependabot/gradle/com.squareup.okhttp3-okhttp-bom-4.9.3 2021-12-17 18:08:01 +00:00
dependabot[bot]
c5a6fa275c
Bump okhttp-bom from 4.9.2 to 4.9.3
Bumps [okhttp-bom](https://github.com/square/okhttp) from 4.9.2 to 4.9.3.
- [Release notes](https://github.com/square/okhttp/releases)
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okhttp/compare/parent-4.9.2...parent-4.9.3)

---
updated-dependencies:
- dependency-name: com.squareup.okhttp3:okhttp-bom
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-01 22:01:42 +00:00
Mikołaj Pich
5b9cd070d4 Version 1.4.3 2021-11-26 22:03:21 +01:00
Mikołaj Pich
a45110c8de Fix tests 2021-11-26 21:18:56 +01:00
Mikołaj Pich
15477ccdfa Add more info to log statements in registration 2021-11-26 20:55:23 +01:00
Mikołaj Pich
1738c40121 Version 1.4.2 2021-11-21 13:21:40 +01:00
Mikołaj Pich
fffa4d7d91 Allow null in date field of grade details item 2021-11-21 09:27:49 +01:00
Mikołaj Pich
4f85472244 Version 1.4.0 2021-11-16 22:17:16 +01:00
Mikołaj Pich
4efd64264b Bump uonet-request-signer 2021-10-13 23:17:34 +02:00
Mateusz Idziejczak
a0a30a7944 Add student photo 2021-10-11 19:43:52 +02:00
Mikołaj Pich
12548d8746
Merge pull request #105 from wulkanowy/bugfix/timetable-canceled-substitution
Fix showing teacher
2021-10-07 21:34:22 +02:00
dependabot[bot]
07316b4ffd
Bump org.jlleitschuh.gradle.ktlint from 10.1.0 to 10.2.0 (#100) 2021-10-07 19:30:39 +00:00
dependabot[bot]
64826b4119
Bump jsoup from 1.14.2 to 1.14.3 (#101) 2021-10-07 19:30:06 +00:00
dependabot[bot]
3470eaffa9
Bump coroutines from 1.5.1 to 1.5.2 (#102) 2021-10-07 19:25:50 +00:00
dependabot[bot]
4b24f2946c
Bump org.jetbrains.kotlin.jvm from 1.5.30 to 1.5.31 (#103) 2021-10-07 19:25:31 +00:00
dependabot[bot]
cdc6049d29
Bump okhttp-bom from 4.9.1 to 4.9.2 (#104) 2021-10-07 19:25:15 +00:00
Mikołaj Pich
f94cdfea16 Improve info message 2021-10-07 21:21:59 +02:00
Mateusz Idziejczak
96ee8ba947 Fix showing teacher 2021-10-06 21:50:40 +02:00
Mikołaj Pich
364f3c0295 Version 1.3.0 2021-09-28 22:30:01 +02:00
Mikołaj Pich
f62736adb0 Fix eszkola.opolskie.pl login 2021-09-28 18:35:26 +02:00
Mikołaj Pich
5151856da1 Fix build 2021-09-28 14:15:12 +02:00
Mikołaj Pich
9ccb4298d8 Update gradle wrapper to 7.2 2021-09-25 13:56:34 +02:00
Mikołaj Pich
49c2071d10
Merge pull request #99 from wulkanowy/bugfix/timetable-teacher
Fix lesson with replacement teacher
2021-09-24 23:26:53 +02:00
Mikołaj Pich
230d2075df Add missing support for lesson light replacement without group 2021-09-24 22:57:00 +02:00
Mikołaj Pich
5a8f9c6206 Refactor teacher replacement 2021-09-24 22:36:02 +02:00
Mateusz Idziejczak
e7f36785d7 Reverse teacher 2021-09-22 21:06:18 +02:00
Mateusz Idziejczak
783733eaf7 Fix tests 2021-09-22 20:43:03 +02:00
Mateusz Idziejczak
c3b021e8f7 Fix lesson with replacement teacher 2021-09-22 20:34:05 +02:00
Mikołaj Pich
8f3721f1f9 Trim dots in bad credentials error message 2021-09-19 17:01:21 +02:00
Mikołaj Pich
b9a45cfb4b Use okhttp-bom artifact 2021-09-18 11:12:30 +02:00
Mikołaj Pich
90d6a13275 Version 1.2.3 2021-09-16 11:42:31 +02:00
Mikołaj Pich
d74acd3989 Fix mixed room with teacher in timetable after 21.11.0.28 update 2021-09-15 23:39:10 +02:00
Mikołaj Pich
792ac61884 Version 1.2.2 2021-09-13 12:37:58 +02:00
Mikołaj Pich
66cfe3e996 Split teacher in exams mapper only once 2021-09-13 12:37:23 +02:00
Mikołaj Pich
55980b2178 Cleanup tests 2021-09-13 12:31:47 +02:00
Mikołaj Pich
7b28b74502 Override date field in homework mapping 2021-09-13 11:05:08 +02:00
Mikołaj Pich
3cbb26b6f9 Version 1.2.1 2021-09-05 22:02:28 +02:00
Mikołaj Pich
7c399ffaea Upgrade jsoup to 1.14.2 2021-09-04 12:45:34 +02:00
dependabot[bot]
46ce30f2b8
Bump org.jetbrains.kotlin.jvm from 1.5.21 to 1.5.30 (#98) 2021-09-04 10:33:31 +00:00
Mikołaj Pich
d01e5f5299 Version 1.2.0 2021-08-29 20:12:10 +02:00
Mikołaj Pich
5c17530cd9 Remove group parsing from exams subject 2021-08-29 00:53:58 +02:00
dependabot[bot]
b991d0c5b6
Bump org.jlleitschuh.gradle.ktlint from 9.2.1 to 10.1.0 (#90) 2021-08-22 10:24:37 +00:00
Mikołaj Pich
f15cc8223a Update dependencies 2021-08-22 10:31:43 +02:00
Mikołaj Pich
18e16b2034 Update exams schema (fixes #97) 2021-08-22 10:20:14 +02:00
Mikołaj Pich
ae8798806d Make birthPlace nullable 2021-05-28 19:18:28 +02:00
Mikołaj Pich
496dc01d15 Fix lint 2021-05-21 11:25:03 +02:00
Mikołaj Pich
88111ea725 Fix sending messages 2021-05-21 11:18:04 +02:00
Mikołaj Pich
bb083546e0 Fix marking as non-changed if cell don't have classes 2021-05-16 22:58:19 +02:00
Mikołaj Pich
e282a7a50e Fix marking canceled lesson only as changed 2021-05-16 22:50:56 +02:00
Mikołaj Pich
b70f3be069 Fix project structure 2021-05-16 22:05:23 +02:00
Mikołaj Pich
f66cac410a Add constants with day offests in timetable tests 2021-05-16 21:38:53 +02:00
Mikołaj Pich
15eb227965 Use jacoco 0.8.7 2021-05-16 21:20:49 +02:00
Mikołaj Pich
f3f37e9066 Upgrade kotlin to 1.5.0 2021-05-16 21:10:02 +02:00
Mikołaj Pich
d0c4470ccb Remove jcenter() from repositories 2021-05-16 20:57:55 +02:00
Mikołaj Pich
d212ea8109 Make kinship optional 2021-05-13 09:58:38 +02:00
Mikołaj Pich
f7e0df0241
Add link to maven central info 2021-05-02 12:10:08 +02:00
Mikołaj Pich
eab3580749 Add deploy to sonatype workflow 2021-05-01 23:56:18 +02:00
Mikołaj Pich
f8b0b6bfac Fix building with jitpack 2021-05-01 23:45:11 +02:00
Mikołaj Pich
3fa6936c2f Update README.md 2021-05-01 23:38:26 +02:00
Mikołaj Pich
a2c270c9d2 Replace bintray with sonatype 2021-05-01 23:06:13 +02:00
Mikołaj Pich
567705a2d4 Replace circleci badge with gh actions 2021-05-01 17:06:56 +02:00
Mikołaj Pich
8580cac720 Remove circleci config 2021-05-01 17:03:39 +02:00
Mikołaj Pich
50f74b2c6a Disable simultaneousLoginWithError test 2021-05-01 16:59:47 +02:00
Mikołaj Pich
2005f3f60d
Create test.yml 2021-05-01 16:53:25 +02:00
dependabot-preview[bot]
5d07788345
Bump moshi from 1.11.0 to 1.12.0 (#78)
Bumps [moshi](https://github.com/square/moshi) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/square/moshi/releases)
- [Changelog](https://github.com/square/moshi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/moshi/compare/moshi-parent-1.11.0...parent-1.12.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
2021-05-01 16:43:40 +02:00
dependabot[bot]
8bf1de5d05
Bump retrofit from 2.6.4 to 2.9.0 (#84) 2021-05-01 14:37:39 +00:00
dependabot[bot]
9606d8bf79
Bump okhttp3 from 3.12.13 to 4.9.1 (#83)
* Bump okhttp3 from 3.12.13 to 4.9.1

Bumps `okhttp3` from 3.12.13 to 4.9.1.

Updates `logging-interceptor` from 3.12.13 to 4.9.1
- [Release notes](https://github.com/square/okhttp/releases)
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okhttp/compare/parent-3.12.13...parent-4.9.1)

Updates `mockwebserver` from 3.12.13 to 4.9.1
- [Release notes](https://github.com/square/okhttp/releases)
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okhttp/compare/parent-3.12.13...parent-4.9.1)

Updates `okhttp` from 3.12.13 to 4.9.1
- [Release notes](https://github.com/square/okhttp/releases)
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okhttp/compare/parent-3.12.13...parent-4.9.1)

Updates `okhttp-urlconnection` from 3.12.13 to 4.9.1
- [Release notes](https://github.com/square/okhttp/releases)
- [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/square/okhttp/compare/parent-3.12.13...parent-4.9.1)

Signed-off-by: dependabot[bot] <support@github.com>

* Migrate to okhttp 4

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mikołaj Pich <m.pich@outlook.com>
2021-05-01 16:27:11 +02:00
Mikołaj Pich
5afc998441 Add moshi version variable 2021-05-01 16:17:32 +02:00
dependabot[bot]
b5920ae7c1
Bump kotlinx-coroutines-core from 1.4.2 to 1.4.3 (#85) 2021-05-01 14:13:37 +00:00
dependabot[bot]
fe87a7c21e
Bump kotlinx-coroutines-test from 1.4.2 to 1.4.3 (#86) 2021-05-01 14:13:08 +00:00
dependabot-preview[bot]
f7e2d3c88c
Upgrade to GitHub-native Dependabot (#81)
* Upgrade to GitHub-native Dependabot

* Update dependabot.yml

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Mikołaj Pich <m.pich@outlook.com>
2021-05-01 16:06:23 +02:00
Mikołaj Pich
d85e16cdcd Workaround nullable grade date 2021-05-01 16:03:52 +02:00
Mikołaj Pich
07a21c110e Merge branch 'support/1.1.x' 2021-04-18 19:58:01 +02:00
Mikołaj Pich
6ed5b675a1 Fix crash grade parser on non-standard number of modifiers 2021-04-18 19:54:08 +02:00
dependabot-preview[bot]
2334d340e5
Bump org.jetbrains.kotlin.jvm from 1.4.31 to 1.4.32 (#77) 2021-04-07 09:28:31 +00:00
Mikołaj Pich
877b913588 Collect day headers with line breaks too 2021-04-03 19:37:50 +02:00
Mikołaj Pich
e21c18cb70 Add method to get timetable day headers 2021-04-03 13:01:07 +02:00
Mikołaj Pich
9bd61f8fe9 Remove deprecated timetable format parser 2021-04-03 12:08:56 +02:00
Mikołaj Pich
9f172c1056 Add some register methods, pojos and more 2020-03-22 23:44:48 +01:00
Mikołaj Pich
f14abea44c Add hebe scaffolding 2020-03-22 00:45:40 +01:00
491 changed files with 20408 additions and 9146 deletions

View file

@ -1,70 +0,0 @@
version: 2.1
references:
workspace_root: &workspace_root
~/sdk
container_config: &container_config
docker:
- image: circleci/openjdk:8-jdk-stretch
working_directory: *workspace_root
attach_workspace: &attach_workspace
attach_workspace:
at: *workspace_root
general_cache_key: &general_cache_key
key: cache-{{ checksum "build.gradle" }}
paths:
- ~/.gradle
jobs:
test:
<<: *container_config
steps:
- *attach_workspace
- checkout
- restore_cache:
<<: *general_cache_key
- run: ./.circleci/host-hotfix.sh
- run: ./gradlew build -x check --no-daemon --stacktrace --console=plain -PdisablePreDex
- run: ./gradlew check jacocoTestReport --no-daemon --stacktrace --console=plain -PdisablePreDex
- save_cache:
<<: *general_cache_key
- run: bash <(curl -s https://codecov.io/bash)
- store_test_results:
path: ./build/test-results
- store_artifacts:
path: ./build/reports/jacoco/test
- store_test_results:
path: ./build/reports/tests/test
- store_artifacts:
path: ./build/libs/sdk-1.1.5.jar
deploy:
<<: *container_config
steps:
- *attach_workspace
- checkout
- restore_cache:
<<: *general_cache_key
- run: ./gradlew bintrayUpload --no-daemon --stacktrace --console=plain -PdisablePreDex
workflows:
version: 2
test-and-deploy:
jobs:
- test
- deploy:
requires:
- test
filters:
tags:
only: /\d+\.\d+\.\d+/
branches:
ignore: /.*/

View file

@ -1,9 +0,0 @@
#!/usr/bin/env bash
echo "127.0.0.1 fakelog.localhost" | sudo tee -a /etc/hosts
echo "127.0.0.1 adfs.fakelog.localhost" | sudo tee -a /etc/hosts
echo "127.0.0.1 adfslight.fakelog.localhost" | sudo tee -a /etc/hosts
echo "127.0.0.1 cufs.fakelog.localhost" | sudo tee -a /etc/hosts
echo "127.0.0.1 uonetplus.fakelog.localhost" | sudo tee -a /etc/hosts
echo "127.0.0.1 uonetplus-uzytkownik.fakelog.localhost" | sudo tee -a /etc/hosts
echo "127.0.0.1 uonetplus-uczen.fakelog.localhost" | sudo tee -a /etc/hosts

View file

@ -5,9 +5,23 @@ insert_final_newline=true
indent_style=space
indent_size=4
[*.json]
[*.{json,xml}]
indent_size=2
[*.{kt,kts}]
disabled_rules=import-ordering,no-wildcard-imports
max_line_length=177
ij_kotlin_allow_trailing_comma_on_call_site=true
ij_kotlin_allow_trailing_comma=true
ktlint_standard_no-empty-first-line-in-class-body=disabled
ktlint_standard_function-signature=disabled
ktlint_standard_string-template-indent=disabled
ktlint_standard_string-template-indent-expression-wrapping=disabled
ktlint_standard_multiline-expression-wrapping=disabled
ktlint_standard_max-line-length=disabled
ktlint_standard_no-blank-line-in-list=disabled
ktlint_standard_parameter-list-wrapping=disabled
ktlint_standard_discouraged-comment-location=disabled
ktlint_standard_if-else-wrapping=disabled
ktlint_standard_property-naming=disabled
ktlint_standard_class-naming=disabled

17
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: gradle
directory: "/"
schedule:
interval: monthly
open-pull-requests-limit: 10
ignore:
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-core
versions:
- 1.4.3-native-mt
- dependency-name: org.jetbrains.kotlinx:kotlinx-coroutines-test
versions:
- 1.4.3-native-mt
- dependency-name: org.jlleitschuh.gradle.ktlint
versions:
- 9.4.1

31
.github/workflows/deploy.yml vendored Normal file
View file

@ -0,0 +1,31 @@
name: Deploy
on:
push:
branches: [ master ]
jobs:
deploy-sonatype:
name: Deploy to sonatype
runs-on: ubuntu-latest
timeout-minutes: 10
environment: ossrh
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}
- name: Build and publish
env:
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MAVEN_SIGNING_KEY: ${{ secrets.MAVEN_SIGNING_KEY }}
MAVEN_SIGNING_PASSWORD: ${{ secrets.MAVEN_SIGNING_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository --stacktrace

48
.github/workflows/docs.yml vendored Normal file
View file

@ -0,0 +1,48 @@
name: Docs
on:
push:
branches: [ master ]
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
docs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: fkirc/skip-duplicate-actions@master
- uses: actions/checkout@v3
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}
- name: Generate docs
run: ./gradlew mkdocsBuild
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./build/mkdocs
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
id-token: write
pages: write
needs: docs
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1

59
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,59 @@
name: Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
unit-tests:
name: Unit tests
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: fkirc/skip-duplicate-actions@master
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}
- name: Unit tests
run: |
./gradlew test --stacktrace
./gradlew jacocoTestReport --stacktrace
- name: API changes check
run: |
./gradlew :sdk:apiCheck --stacktrace
./gradlew :sdk-hebe:apiCheck --stacktrace
./gradlew :sdk-scrapper:apiCheck --stacktrace
# - uses: codecov/codecov-action@v1
lint:
name: Lint check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: fkirc/skip-duplicate-actions@master
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 11
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*') }}
- name: Lint
run: |
./gradlew ktlintCheck --stacktrace
# - uses: codecov/codecov-action@v1

38
.gitignore vendored
View file

@ -22,8 +22,36 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
.idea/
!.idea/codeStyles/
# IntelliJ configurations
*.iml
.idea/workspace.xml
.idea/tasks.xml
#.idea/gradle.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/caches
.idea/modules.xml
.idea/navEditor.xml
.idea/caches/
.idea/libraries/
.idea/shelf/
.idea/.name
.idea/compiler.xml
.idea/copyright/profiles_settings.xml
.idea/encodings.xml
.idea/misc.xml
.idea/scopes/scope_settings.xml
.idea/vcs.xml
.idea/jsLibraryMappings.xml
.idea/datasources.xml
.idea/dataSources.ids
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
.idea/runConfigurations.xml
.idea/discord.xml
.idea/jarRepositories.xml
.gradle
build/
out/
@ -43,3 +71,9 @@ gradle-app.setting
*iml
classes
.DS_Store
.idea/libraries-with-intellij-classes.xml
.idea/kotlinc.xml
.idea/jpa-buddy.xml
.idea/kotlinScripting.xml
Snap.*.trc
javacore.*.txt

View file

@ -17,6 +17,7 @@
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
<option name="RIGHT_MARGIN" value="155" />
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
<option name="LINE_COMMENT_ADD_SPACE" value="true" />
@ -24,13 +25,6 @@
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="5" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="METHOD_PARAMETERS_LPAREN_ON_NEXT_LINE" value="true" />
<option name="METHOD_PARAMETERS_RPAREN_ON_NEXT_LINE" value="true" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<option name="WRAP_ON_TYPING" value="0" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />

20
.idea/gradle.xml Normal file
View file

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleMigrationSettings" migrationVersion="1" />
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="gradleJvm" value="corretto-17" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/sdk" />
<option value="$PROJECT_DIR$/sdk-hebe" />
<option value="$PROJECT_DIR$/sdk-scrapper" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

25
.idea/jsonSchemas.xml Normal file
View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JsonSchemaMappingsProjectConfiguration">
<state>
<map>
<entry key="GitHub Workflow">
<value>
<SchemaInfo>
<option name="name" value="GitHub Workflow" />
<option name="relativePathToSchema" value="https://json.schemastore.org/github-workflow.json" />
<option name="applicationDefined" value="true" />
<option name="patterns">
<list>
<Item>
<option name="path" value=".github/workflows/deploy.yml" />
</Item>
</list>
</option>
</SchemaInfo>
</value>
</entry>
</map>
</state>
</component>
</project>

View file

@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2020 Wulkanowy
Copyright 2023 Wulkanowy
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View file

@ -1,8 +1,9 @@
# VULCAN UONET+ SDK
[![GitHub Workflow status](https://img.shields.io/github/actions/workflow/status/wulkanowy/sdk/test.yml?branch=master&style=flat-square)](https://github.com/wulkanowy/sdk/actions)
[![Codecov branch](https://img.shields.io/codecov/c/github/wulkanowy/sdk/master.svg?style=flat-square)](https://codecov.io/gh/wulkanowy/sdk)
[![CircleCI branch](https://img.shields.io/circleci/project/github/wulkanowy/sdk/master.svg?style=flat-square)](https://circleci.com/gh/wulkanowy/sdk)
[![Bintray](https://img.shields.io/bintray/v/wulkanowy/wulkanowy/sdk.svg?style=flat-square)](https://bintray.com/wulkanowy/wulkanowy/sdk)
[![Maven Central](https://img.shields.io/maven-central/v/io.github.wulkanowy/sdk?style=flat-square)](https://search.maven.org/artifact/io.github.wulkanowy/sdk)
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.wulkanowy/sdk?server=https%3A%2F%2Fs01.oss.sonatype.org&style=flat-square)](https://s01.oss.sonatype.org/content/repositories/snapshots/io/github/wulkanowy/sdk/)
[![JitPack](https://img.shields.io/jitpack/v/wulkanowy/sdk.svg?style=flat-square)](https://jitpack.io/#wulkanowy/sdk)
[![License](https://img.shields.io/github/license/wulkanowy/sdk.svg?style=flat-square)](https://github.com/wulkanowy/sdk)
[![Discord](https://img.shields.io/discord/390889354199040011.svg?style=flat-square)](https://discord.gg/vccAQBr)
@ -14,7 +15,6 @@
Check it out [full public api](https://github.com/wulkanowy/sdk/blob/master/sdk/src/main/kotlin/io/github/wulkanowy/sdk/Sdk.kt)
and [test examples](https://github.com/wulkanowy/sdk/blob/master/sdk/src/test/kotlin/io/github/wulkanowy/sdk/SdkRemoteTest.kt).
## Documentation
Check [wiki page](https://github.com/wulkanowy/sdk/wiki).
@ -24,11 +24,17 @@ Check [wiki page](https://github.com/wulkanowy/sdk/wiki).
```gradle
allprojects {
repositories {
...
// for stable releases
mavenCentral()
// for snapshots
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
// for everything
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'io.github.wulkanowy:sdk:1.1.5'
implementation 'io.github.wulkanowy:sdk:<version>'
}
```

View file

@ -1,64 +1,107 @@
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.4.31' apply false
id "org.jlleitschuh.gradle.ktlint" version "9.2.1"
id 'com.jfrog.bintray' version '1.8.5'
alias(libs.plugins.kotlin) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.serialization)
id "org.jlleitschuh.gradle.ktlint" version "12.1.0"
id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
id 'ru.vyarus.mkdocs' version '3.0.0'
}
mkdocs.sourcesDir = 'docs'
ext {
PUBLISH_VERSION = '1.1.5'
SITE_URL = 'https://github.com/wulkanowy/sdk'
GIT_URL = 'https://github.com/wulkanowy/sdk.git'
jspoon = "1.3.2"
okhttp3 = "3.12.13"
retrofit = "2.6.4"
slf4j = "1.7.30"
jsoup = "1.17.2"
slf4j = "2.0.12"
moshi = "1.13.0"
}
version = "2.7.0"
group = "io.github.wulkanowy"
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
allprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'kotlin'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: "org.jlleitschuh.gradle.ktlint"
apply plugin: 'com.jfrog.bintray'
apply plugin: 'kotlinx-serialization'
repositories {
mavenCentral()
jcenter()
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://jitpack.io" }
}
dependencies {
implementation "org.slf4j:slf4j-api:$slf4j"
testImplementation "org.slf4j:slf4j-simple:$slf4j"
implementation platform(libs.okhttp.bom)
}
version = PUBLISH_VERSION
group = "io.github.wulkanowy"
java {
withJavadocJar()
withSourcesJar()
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
configurations = ['archives']
publishing {
publications {
sdk(MavenPublication) {
from components.java
version = rootProject.version
pkg {
repo = 'wulkanowy'
name = 'sdk'
desc = 'Unified way of retrieving data from the UONET+ register through mobile api and scraping api'
pom {
name = 'VULCAN UONET+ SDK'
description = 'Unified way of retrieving data from the UONET+ register through mobile api and scraping api'
url = 'https://github.com/wulkanowy/sdk'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'mklkj'
name = 'Mikołaj Pich'
email = 'm.pich@outlook.com'
}
}
scm {
connection = 'https://github.com/wulkanowy/sdk.git'
developerConnection = 'git@github.com:wulkanowy/sdk.git'
url = 'https://github.com/wulkanowy/sdk'
}
}
}
}
websiteUrl = 'https://github.com/wulkanowy/sdk'
issueTrackerUrl = 'https://github.com/wulkanowy/sdk/issues'
vcsUrl = 'https://github.com/wulkanowy/sdk.git'
licenses = ['Apache-2.0']
userOrg = 'wulkanowy'
labels = ['wulkanowy', 'sdk']
publicDownloadNumbers = true
publish = true
if (System.getenv("MAVEN_SIGNING_KEY")) {
signing {
def signingKey = System.getenv("MAVEN_SIGNING_KEY") ?: ""
def signingPassword = System.getenv("MAVEN_SIGNING_PASSWORD")
useInMemoryPgpKeys(new String(signingKey.decodeBase64()), signingPassword)
sign publishing.publications.sdk
}
}
version {
name = PUBLISH_VERSION
vcsTag = PUBLISH_VERSION
released = new Date()
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
}
@ -68,69 +111,56 @@ subprojects {
apply plugin: 'jacoco'
ktlint {
additionalEditorconfigFile = file(".editorconfig")
// additionalEditorconfigFile.set(file(".editorconfig"))
disabledRules = [
"no-wildcard-imports",
"import-ordering",
"max-line-length"
"max-line-length",
"multiline-if-else"
]
filter {
exclude { element -> element.file.path.contains("generated/") }
}
}
sourceCompatibility = 1.8
compileKotlin {
kotlinOptions {
jvmTarget = "1.6"
javaParameters = true
kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of("11"))
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2'
implementation libs.coroutines.core
implementation "com.squareup.okhttp3:logging-interceptor:$okhttp3"
implementation "com.squareup.okhttp3:logging-interceptor"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3"
testImplementation "junit:junit:4.13.2"
testImplementation "com.squareup.okhttp3:mockwebserver:$okhttp3"
testImplementation "com.squareup.retrofit2:retrofit-mock:$retrofit"
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.2'
testImplementation "com.squareup.okhttp3:mockwebserver"
testImplementation libs.retrofit.mock
testImplementation libs.coroutines.test
}
jacocoTestReport {
reports {
xml.enabled true
xml.getRequired().set(true)
}
}
jacoco {
toolVersion "0.8.10"
}
test {
testLogging.showStandardStreams = false
}
group = "io.github.wulkanowy.sdk"
if (project.plugins.hasPlugin('java')) {
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
}
}
dependencies {
compile project(":sdk")
compile project(":sdk-mobile")
compile project(":sdk-scrapper")
api project(":sdk")
api project(":sdk-hebe")
api project(":sdk-scrapper")
compile "com.squareup.okhttp3:okhttp:$okhttp3"
api "com.squareup.okhttp3:okhttp"
}

View file

@ -0,0 +1,26 @@
### 2.0.6 (2023.05.23)
* dodanie rozpoznawania strony błędu z aktualizacją bazy danych
### 2.0.5 (2023.05.23)
* aktualizacja retrofita do 2.10.0-SNAPSHOT, żeby naprawić błędy spowodowane przez R8 full mode w aplikacji
### 2.0.4 (2023.05.22)
* migracja z migbase64 na kotlin.io.encoding.Base64
* aktualizacja kotlina do 1.8.21
* wsparcie dla rozpoznawania nowych stron błędów z przerwą techniczną
### 2.0.3 (2023.05.12)
* fix autoryzacji poprzez dodanie brakujących nagłówków i ciasteczek do żądania z autoryzacją
### 2.0.1 (2023.05.12)
* fix pobierania zadań domowych z załącznikami, gdzie dziennik zaczął zwracać mniej danych niż kiedyś
* dodanie metod umożliwiających sprawdzenie, czy uczeń został zautoryzowany oraz wykonanie jego autoryzacji w razie potrzeby
### 2.0.0 (2023.05.07)
* *Wersja bazowa*

49
docs/docs/guide/grades.md Normal file
View file

@ -0,0 +1,49 @@
# Oceny
Poniżej przedstawiamy przykład pobrania ocen przez nasze Sdk, od początkowego logowania, przez wybór ucznia aż do wyświetlenia listy wszystkich ocen z ostatniego semestru wybranego ucznia.
!!! warning
Nie wykonuj za każdym razem wyszukiwania listy uczniów — trwa to długo i nie ma z tego żadnego pożytku.
Zamiast tego zapisz gdzieś wybrany `symbol`, `schoolSymbol`, `studentId`, `diaryId` oraz `semesterId` i używaj tych zapisanych danych do późniejszego ustawiania Sdk.
```kotlin
// ustawiamy dane logowania
val userEmail = "jan@fakelog.cf"
val userPassword = "jan123"
val host = "https://fakelog.cf/"
// tworzymy obiekt Sdk i pobieramy listę dostępnych uczniów
val sdk = Sdk()
val registerUser: RegisterUser = sdk.getUserSubjectsFromScrapper(
email = userEmail,
password = userPassword,
scrapperBaseUrl = host,
)
// na potrzeby tego demo odfiltrowujemy puste symbole i szkoły bez aktywnych uczniów
val registerSymbol = registerUser.symbols
.filter { it.schools.isNotEmpty() }
.first { it.schools.all { school -> school.subjects.isNotEmpty() } }
val registerUnit = registerSymbol.schools.first()
val registerStudent = registerUnit.subjects.filterIsInstance<RegisterStudent>().first()
val semester = registerStudent.semesters.last()
// re-inicjalizujemy Sdk z wcześniej pozyskanymi danymi
sdk.apply {
email = userEmail
password = userPassword
scrapperBaseUrl = host
loginType = Sdk.ScrapperLoginType.valueOf(registerUser.loginType?.name!!) // todo: to akurat brzydkie, przeoczyłem to jakoś
symbol = registerSymbol.symbol
schoolSymbol = registerUnit.schoolId
studentId = registerStudent.studentId
diaryId = semester.diaryId
}
// pobieramy i wyświetlamy oceny z ostatniego semestru pierwszego dostępnego ucznia
val grades = sdk.getGrades(semester.semesterId)
grades.details.forEach {
println("${it.entry} - ${it.date}")
}
```

View file

@ -0,0 +1,34 @@
# Instalacja
[![Maven Central](https://img.shields.io/maven-central/v/io.github.wulkanowy/sdk?style=flat-square)](https://search.maven.org/artifact/io.github.wulkanowy/sdk)
Ostatnią stabilną wersję SDK możesz łatwo pobrać z repozytorium Maven Central:
```groovy
allprojects {
repositories {
mavenCentral()
}
}
dependencies {
implementation 'io.github.wulkanowy:sdk:2.0.6' // lub nowsza wersja, patrz na badge wyżej
}
```
---
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.wulkanowy/sdk?server=https%3A%2F%2Fs01.oss.sonatype.org&style=flat-square)](https://s01.oss.sonatype.org/content/repositories/snapshots/io/github/wulkanowy/sdk/)
W razie potrzeby możesz też pobrać wersję SNAPSHOT zawierającą jeszcze niewydane zmiany, które znajdą się w następnej wersji:
```
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation 'io.github.wulkanowy:sdk:2.0.7-SNAPSHOT' // lub nowsza wersja, patrz na badge powyżej
}
```

View file

@ -0,0 +1,122 @@
# Rejestracja
Zależnie od wybranego trybu "rejestracja" zachowuje się inaczej, lecz ostatecznie jej wynikiem jest zwrócenie listy uczniów podpiętych do konta.
I tak dla trybu:
* SCRAPPER — SDK spróbuje wyszukać na ostatnich 10 symbolach, na które logował się użytkownik, wszystkich dostępnych uczniów
* HEBE — zarejestrowane zostanie urządzenie przez "Mobilny dostęp" i zwróceni zostaną uczniowie z tylko z danego symbolu
* HYBRID — połączenie obu metod — SDK zarejestruje urządzenie dla każdego z symboli
!!! note
Każda z tych metod zwraca tę samą strukturę danych, czyli `RegisterUser`, w której znajdują się wszystkie potrzebne dane, by używać reszty SDK.
## Tryby działania
### SCRAPPER
Scrapper obsługuje wszystkie obecnie znane strony logowania do różnych _odmian_ dziennika UONET+.
W niektórych odmianach zamiast emaila stosuje się przyznany login (np. JANKOWA12).
Opis parametrów:
* `email` — adres e-mail użytkownika w przypadku odmiany vulcan.net.pl, w przypadku innych przydzielony login
* `password` — hasło użytkownika
* `scrapperBaseUrl` — adres bazowy odmiany dziennika. W większości przypadków będzie to `https://vulcan.net.pl/`, ale mogą być też inne, np. `https://opolska.eszkola.pl/`
* `symbol` — opcjonalne (domyślnie `Default`). Symbol, od którego SDK będzie rozpoczynało przeszukiwanie dziennika.
!!! warning
Jeśli używasz innej odmiany niż `vulcan.net.pl` to zawsze podawaj konkretny symbol, inaczej SDK prawdopodobnie niczego nie znajdzie.
```kotlin
import io.github.wulkanowy.sdk.Sdk
val sdk = Sdk()
val registerUser: RegisterUser = sdk.getUserSubjectsFromScrapper(
email = "jan@fakelog.cf",
password = "jan123",
scrapperBaseUrl = "https://fakelog.cf/",
symbol = "powiatwulkanowy",
)
```
### HEBE
Hebe, dzięki swojej koncepcji wspiera i póki będzie istnieć, to będzie wspierać wszystkie odmiany dziennika.
Z tego powodu wygrywa z trybem SCRAPPER pod względem stabilności i odporności na możliwe zmiany.
!!! warning
Obsługa trybu HEBE jest w tej chwili mocno wybrakowana.
By zdobyć token, pin i symbol musisz ręcznie [zarejestrować urządzenie](https://wulkanowy.github.io/czesto-zadawane-pytania/co-to-jest-symbol).
`FirebaseToken` jest opcjonalnym parametrem, gdzie można przekazać... firebase token, używany do wysyłania powiadomień.
```kotlin
import io.github.wulkanowy.sdk.Sdk
val sdk = Sdk()
val registerUser: RegisterUser = sdk.getStudentsFromHebe(
token = "FK100000",
pin = "999999",
symbol = "powiatwulkanowy",
firebaseToken = null,
)
```
### HYBRID
Tryb hybrydowy to specjalny tryb, który pod spodem używa dwóch powyższych metod, tj. najpierw wyszukuje wszystkich uczniów przez scrapper, a następnie rejestruje dla każdego znalezionego symbolu po jednym urządzeniu mobilnym.
Z tego powodu nie ma potrzeby ręcznego przekazywania tokenu i pinu, bo SDK zdobędzie je samodzielnie.
```kotlin
import io.github.wulkanowy.sdk.Sdk
val sdk = Sdk()
val registerUser: RegisterUser = sdk.getStudentsHybrid(
email = "jan@fakelog.cf",
password = "jan123",
scrapperBaseUrl = "https://fakelog.cf/",
startSymbol = "powiatwulkanowy",
firebaseToken = null,
)
```
## Struktura RegisterUser
`RegisterUser` ma budowę _hierarchiczną_, dzięki czemu odzwierciedla faktyczne zależności między kolejnymi poziomami dostępu do danych.
Rzeczona hierarchia wygląda następująco:
```
RegisterUser
RegisterSymbol
RegisterUnit
RegisterSubject
- RegisterEmployee
- RegisterStudent
Semester
```
### RegisterUser
Na szczycie tej hierarchii jest użytkownik, w którym dołączone podstawowe informacje o koncie, tj. użyty e-mail, faktyczny login, typ logowania (którego ma używać później SDK), wybrany tryb działania SDK, jak i symbole (`RegisterSymbol`).
### RegisterSymbol
Każdy użytkownik dziennika może mieć dostęp do danych na wielu symbolach (np. rodzic, którego jedno dziecko uczy się w szkole podstawowej w mieście powiatowym, a drugie dziecko w szkole średniej w tym samym mieście).
Oprócz informacji o samym symbolu znajduje się tutaj informacja o możliwym błędzie przy próbie dostępu (jeśli takowy wystąpił), imię i nazwisko użytkownika, dane wykorzystywane przez HEBE (tj. `keyId`, `privatePem` i `hebeBaseUrl`) oraz listę szkół, znajdujących się pod danym symbolem, a do których dostęp ma dany użytkownik.
### RegisterUnit
Każda szkoła (jednostka — `unit`) ma swój identyfikator (`schoolId`), nazwę długą i krótką (`schoolName` i `schoolShortName`), trochę idków różnych typów użytkowników, podobnie jak w `RegisterSymbol` pole na możliwe błędy oraz listę _subjectów_ (podmiotów?), którymi mogą być uczeń lub pracownik.
### RegisterSubject
`RegisterSubject` to interfejs, który ma dwie implementacje: `RegisterEmployee` oraz `RegisterStudent`.
Pierwszej można użyć, do pobrania informacji o pracowniku (np. nauczycielu), by móc dalej używać SDK np. do obsługi wiadomości dla takiego użytkownika.
Druga to uczeń, który oprócz takich podstawowych informacji jak imiona, nazwa klasy, id ucznia oraz klasy posiada również listę semestrów.

11
docs/docs/index.md Normal file
View file

@ -0,0 +1,11 @@
# Witaj w Kotlin SDK dla VULCAN UONET+
[![Maven Central](https://img.shields.io/maven-central/v/io.github.wulkanowy/sdk?style=flat-square)](https://search.maven.org/artifact/io.github.wulkanowy/sdk)
[![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.wulkanowy/sdk?server=https%3A%2F%2Fs01.oss.sonatype.org&style=flat-square)](https://s01.oss.sonatype.org/content/repositories/snapshots/io/github/wulkanowy/sdk/)
[![Discord](https://img.shields.io/discord/390889354199040011.svg?style=flat-square)](https://discord.gg/vccAQBr)
## Składniki SDK
- sdk-hebe — używa API "Hebe", którego używa oficjalna aplikacja "Dzienniczek VULCAN". W tej chwili posiada bardzo ograniczoną funkcjonalność
- sdk-scrapper — jak wskazuje nazwa, "scrapuje" stronę www dziennika
- sdk — łączy dwie powyższe metody w miarę spójny interfejs

105
docs/mkdocs.yml Normal file
View file

@ -0,0 +1,105 @@
site_name: VULCAN UONET+ SDK
# Meta tags (placed in header)
site_description:
#site_author: Your Name
site_url: # https://github.com/wulkanowy/sdk
# Repository (add link to repository on each page)
repo_name: sdk
repo_url: https://github.com/wulkanowy/sdk
edit_uri: edit/master/docs/docs/
#Copyright (shown at the footer)
copyright: 'Copyright &copy; 2023 Wulkanowy'
# Meterial theme
theme:
name: 'material'
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
primary: red
accent: red
toggle:
icon: material/brightness-7
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: red
accent: red
toggle:
icon: material/brightness-4
name: Switch to light mode
features:
#- navigation.tabs
#- navigation.tabs.sticky
#- navigation.instant
- navigation.tracking
- navigation.top
plugins:
- search
# Required for variables support (https://github.com/rosscdh/mkdocs-markdownextradata-plugin)
# - markdownextradata
extra:
# version:
# provider: mike
social:
- icon: fontawesome/brands/facebook
link: https://facebook.com/wulkanowy
- icon: fontawesome/brands/github
link: https://github.com/wulkanowy
- icon: fontawesome/brands/twitter
link: https://twitter.com/wulkanowy
#
# Google Analytics
# analytics:
# provider: google
# property: UA-XXXXXXXX-X
markdown_extensions:
# Python Markdown
- abbr
- admonition
- attr_list
- def_list
- footnotes
- meta
- md_in_html
- toc:
permalink: true
# Python Markdown Extensions
- pymdownx.arithmatex:
generic: true
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.details
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg
- pymdownx.highlight
- pymdownx.inlinehilite
- pymdownx.keys
- pymdownx.mark
- pymdownx.smartsymbols
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true
- pymdownx.tasklist:
custom_checkbox: true
- pymdownx.tilde
nav:
- Start: index.md
- User guide:
- Instalacja: guide/installation.md
- Rejestracja: guide/registration.md
- Oceny: guide/grades.md
- O projekcie:
- Historia wydań: about/history.md

Binary file not shown.

View file

@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

288
gradlew vendored
View file

@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@ -17,67 +17,98 @@
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
echo "$*"
}
} >&2
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@ -87,9 +118,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@ -98,7 +129,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
@ -106,80 +137,109 @@ location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

15
gradlew.bat vendored
View file

@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal

2
jitpack.yml Normal file
View file

@ -0,0 +1,2 @@
jdk:
- openjdk11

1164
sdk-hebe/api/sdk-hebe.api Normal file

File diff suppressed because it is too large Load diff

20
sdk-hebe/build.gradle Normal file
View file

@ -0,0 +1,20 @@
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm'
alias(libs.plugins.validator)
id 'jacoco'
}
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
implementation 'io.github.wulkanowy.signer:hebe-jvm:0.1.0-SNAPSHOT'
implementation libs.retrofit.core
implementation libs.retrofit.scalars
implementation libs.retrofit.serialization
testImplementation "io.mockk:mockk-jvm:1.13.10"
}

View file

@ -0,0 +1,39 @@
package io.github.wulkanowy.sdk.hebe
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import java.time.ZoneId
import java.time.ZonedDateTime
import java.time.format.DateTimeFormatter.ofPattern
import java.util.UUID
@Serializable
internal data class ApiRequest<T>(
@SerialName("API")
val apiVersion: Int = 1,
@SerialName("AppName")
val appName: String = "DzienniczekPlus 2.0",
@SerialName("AppVersion")
val appVersion: String = "22.09.02 (G)",
@SerialName("CertificateId")
val certificateId: String,
@SerialName("Envelope")
val envelope: T,
@SerialName("FirebaseToken")
val firebaseToken: String,
@SerialName("RequestId")
val requestId: String = UUID.randomUUID().toString(),
@SerialName("Timestamp")
val timestamp: Long = ZonedDateTime.now(ZoneId.of("GMT")).toInstant().toEpochMilli(),
@SerialName("TimestampFormatted")
val timestampFormatted: String = ZonedDateTime.now(ZoneId.of("GMT")).format(ofPattern("yyyy-MM-dd hh:mm:ss")),
)

View file

@ -0,0 +1,39 @@
package io.github.wulkanowy.sdk.hebe
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
internal class ApiResponse<T> {
@SerialName("Envelope")
var envelope: T? = null
@SerialName("EnvelopeType")
lateinit var envelopeType: String
@SerialName("InResponseTo")
var inResponseTo: String? = null
@SerialName("RequestId")
lateinit var requestId: String
@SerialName("Status")
lateinit var status: Status
@SerialName("Timestamp")
var timestamp: Long = 0
@SerialName("TimestampFormatted")
lateinit var timestampFormatted: String
@Serializable
data class Status(
@SerialName("Code")
val code: Int,
@SerialName("Message")
val message: String,
)
}

View file

@ -0,0 +1,33 @@
package io.github.wulkanowy.sdk.hebe
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.KSerializer
import kotlinx.serialization.Serializer
import kotlinx.serialization.encoding.Decoder
import kotlinx.serialization.encoding.Encoder
import java.time.LocalDate
import java.time.format.DateTimeFormatter
@OptIn(ExperimentalSerializationApi::class)
@Serializer(forClass = LocalDate::class)
internal object CustomDateAdapter : KSerializer<LocalDate> {
private const val DATE_FORMAT_1 = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX"
private const val DATE_FORMAT_2 = "yyyy-MM-dd'T'HH:mm:ss.SSXXX"
private const val DATE_FORMAT_3 = "yyyy-MM-dd'T'HH:mm:ss.SXXX"
private const val DATE_FORMAT_4 = "yyyy-MM-dd'T'HH:mm:ssXXX"
private const val DATE_FORMAT_5 = "yyyy-MM-dd HH:mm:ss"
private const val DATE_FORMAT_6 = "yyyy-MM-dd"
private val formatter = DateTimeFormatter.ofPattern("[$DATE_FORMAT_1][$DATE_FORMAT_2][$DATE_FORMAT_3][$DATE_FORMAT_4][$DATE_FORMAT_5][$DATE_FORMAT_6]")
override fun deserialize(decoder: Decoder): LocalDate {
val date = decoder.decodeString()
return LocalDate.parse(date, formatter)
}
override fun serialize(encoder: Encoder, value: LocalDate) {
encoder.encodeString(value.format(formatter))
}
}

View file

@ -0,0 +1,151 @@
package io.github.wulkanowy.sdk.hebe
import io.github.wulkanowy.sdk.hebe.models.Exam
import io.github.wulkanowy.sdk.hebe.models.Grade
import io.github.wulkanowy.sdk.hebe.models.GradeAverage
import io.github.wulkanowy.sdk.hebe.models.GradeSummary
import io.github.wulkanowy.sdk.hebe.register.RegisterDevice
import io.github.wulkanowy.sdk.hebe.register.StudentInfo
import io.github.wulkanowy.sdk.hebe.repository.RepositoryManager
import io.github.wulkanowy.signer.hebe.generateKeyPair
import okhttp3.Interceptor
import okhttp3.logging.HttpLoggingInterceptor
import java.time.LocalDate
class Hebe {
private val resettableManager = resettableManager()
var logLevel = HttpLoggingInterceptor.Level.BASIC
set(value) {
field = value
resettableManager.reset()
}
var keyId = ""
set(value) {
field = value
resettableManager.reset()
}
var privatePem = ""
set(value) {
field = value
resettableManager.reset()
}
var baseUrl = ""
set(value) {
field = value
resettableManager.reset()
}
var schoolId = ""
set(value) {
field = value
resettableManager.reset()
}
var pupilId = -1
set(value) {
field = value
resettableManager.reset()
}
var deviceModel = ""
set(value) {
field = value
resettableManager.reset()
}
private val appInterceptors: MutableList<Pair<Interceptor, Boolean>> = mutableListOf()
fun addInterceptor(interceptor: Interceptor, network: Boolean = false) {
appInterceptors.add(interceptor to network)
}
private val serviceManager by resettableLazy(resettableManager) {
RepositoryManager(
logLevel = logLevel,
keyId = keyId,
privatePem = privatePem,
deviceModel = deviceModel,
).apply {
appInterceptors.forEach { (interceptor, isNetwork) ->
setInterceptor(interceptor, isNetwork)
}
}
}
private val routes by resettableLazy(resettableManager) { serviceManager.getRoutesRepository() }
private val studentRepository by resettableLazy(resettableManager) {
serviceManager.getStudentRepository(
baseUrl = baseUrl,
schoolId = schoolId,
)
}
suspend fun register(token: String, pin: String, symbol: String, firebaseToken: String? = null): RegisterDevice {
val (publicPem, privatePem, publicHash) = generateKeyPair()
this.keyId = publicHash
this.privatePem = privatePem
val envelope = serviceManager.getRegisterRepository(
baseUrl = routes.getRouteByToken(token),
symbol = symbol,
).register(
firebaseToken = firebaseToken,
token = token,
pin = pin,
certificatePem = publicPem,
certificateId = publicHash,
deviceModel = deviceModel,
)
return RegisterDevice(
loginId = envelope.loginId,
restUrl = envelope.restUrl,
userLogin = envelope.userLogin,
userName = envelope.userName,
certificateHash = publicHash,
privatePem = privatePem,
)
}
suspend fun getStudents(url: String): List<StudentInfo> {
return serviceManager
.getRegisterRepository(url)
.getStudentInfo()
}
suspend fun getGrades(periodId: Int): List<Grade> {
return studentRepository.getGrades(
pupilId = pupilId,
periodId = periodId,
)
}
suspend fun getGradesSummary(periodId: Int): List<GradeSummary> {
return studentRepository.getGradesSummary(
pupilId = pupilId,
periodId = periodId,
)
}
suspend fun getGradesAverage(periodId: Int): List<GradeAverage> {
return studentRepository.getGradesAverage(
pupilId = pupilId,
periodId = periodId,
)
}
suspend fun getExams(startDate: LocalDate, endDate: LocalDate): List<Exam> {
return studentRepository.getExams(
pupilId = pupilId,
startDate = startDate,
endDate = endDate,
)
}
}

View file

@ -0,0 +1,12 @@
package io.github.wulkanowy.sdk.hebe
internal fun <T> ApiResponse<T>.getEnvelopeOrThrowError(): T? {
if (envelope == null) {
when (status.code) {
// 100 -> "Użytkownik nie jest uprawniony do przeglądania żądanych danych"
// todo: add more codes
else -> error("Unknown error: ${status.message}")
}
}
return envelope
}

View file

@ -1,4 +1,4 @@
package io.github.wulkanowy.sdk.mobile
package io.github.wulkanowy.sdk.hebe
import java.util.LinkedList
import kotlin.reflect.KProperty
@ -6,7 +6,7 @@ import kotlin.reflect.KProperty
/**
* see https://stackoverflow.com/a/35757638/6695449
*/
class ResettableLazyManager {
internal class ResettableLazyManager {
// we synchronize to make sure the timing of a reset() call and new inits do not collide
val managedDelegates = LinkedList<Resettable>()
@ -24,11 +24,11 @@ class ResettableLazyManager {
}
}
interface Resettable {
internal interface Resettable {
fun reset()
}
class ResettableLazy<PROPTYPE>(val manager: ResettableLazyManager, val init: () -> PROPTYPE) : Resettable {
internal class ResettableLazy<PROPTYPE>(val manager: ResettableLazyManager, val init: () -> PROPTYPE) : Resettable {
@Volatile
var lazyHolder = makeInitBlock()
@ -48,8 +48,8 @@ class ResettableLazy<PROPTYPE>(val manager: ResettableLazyManager, val init: ()
}
}
fun <PROPTYPE> resettableLazy(manager: ResettableLazyManager, init: () -> PROPTYPE): ResettableLazy<PROPTYPE> {
internal fun <PROPTYPE> resettableLazy(manager: ResettableLazyManager, init: () -> PROPTYPE): ResettableLazy<PROPTYPE> {
return ResettableLazy(manager, init)
}
fun resettableManager(): ResettableLazyManager = ResettableLazyManager()
internal fun resettableManager(): ResettableLazyManager = ResettableLazyManager()

View file

@ -0,0 +1,5 @@
package io.github.wulkanowy.sdk.hebe.exception
import java.io.IOException
class InvalidPinException : IOException()

View file

@ -1,4 +1,4 @@
package io.github.wulkanowy.sdk.mobile.exception
package io.github.wulkanowy.sdk.hebe.exception
import java.io.IOException

View file

@ -0,0 +1,5 @@
package io.github.wulkanowy.sdk.hebe.exception
import java.io.IOException
class InvalidTokenException(message: String) : IOException(message)

View file

@ -0,0 +1,5 @@
package io.github.wulkanowy.sdk.hebe.exception
import java.io.IOException
class TokenDeadException : IOException()

View file

@ -0,0 +1,5 @@
package io.github.wulkanowy.sdk.hebe.exception
import java.io.IOException
class UnknownTokenException(message: String) : IOException(message)

View file

@ -0,0 +1,11 @@
package io.github.wulkanowy.sdk.hebe.interceptor
import okhttp3.Interceptor
import okhttp3.Response
internal class ErrorInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
return chain.proceed(chain.request())
}
}

View file

@ -0,0 +1,44 @@
package io.github.wulkanowy.sdk.hebe.interceptor
import io.github.wulkanowy.signer.hebe.getSignatureHeaders
import okhttp3.Interceptor
import okhttp3.Response
import okio.Buffer
import java.nio.charset.Charset
import java.time.ZoneId
import java.time.ZonedDateTime
internal class SignInterceptor(
private val keyId: String,
private val privatePem: String,
private val deviceModel: String,
) : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
val original = chain.request()
val request = original.newBuilder()
request.header("User-Agent", "Dart/2.10 (dart:io)")
request.header("vOS", "Android")
request.header("vDeviceModel", deviceModel)
request.header("vAPI", "1")
if (privatePem.isNotBlank()) {
val signatureHeaders = Buffer().run {
original.body?.writeTo(this)
getSignatureHeaders(
keyId = keyId,
privatePem = privatePem,
body = readString(Charset.defaultCharset()),
requestPath = original.url.pathSegments.drop(1).joinToString("/"),
timestamp = ZonedDateTime.now(ZoneId.of("GMT")),
)
}
signatureHeaders.forEach { (key, value) ->
request.header(key, value)
}
}
return chain.proceed(request.method(original.method, original.body).build())
}
}

View file

@ -0,0 +1,95 @@
package io.github.wulkanowy.sdk.hebe.models
import io.github.wulkanowy.sdk.hebe.CustomDateAdapter
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import java.time.LocalDate
@Serializable
data class Exam(
@SerialName("Content")
val content: String,
@SerialName("Creator")
val creator: Creator,
@SerialName("DateCreated")
val dateCreated: DateCreated,
@SerialName("DateModify")
val dateModify: DateModify,
@SerialName("Deadline")
val deadline: Deadline,
@SerialName("Id")
val id: Int,
@SerialName("Key")
val key: String,
@SerialName("PupilId")
val pupilId: Int,
@SerialName("Subject")
val subject: Subject,
@SerialName("Type")
val type: String,
) {
@Serializable
data class Creator(
@SerialName("DisplayName")
val displayName: String,
@SerialName("Id")
val id: Int,
@SerialName("Name")
val name: String,
@SerialName("Surname")
val surname: String,
)
@Serializable
data class DateCreated(
@SerialName("Date")
@Serializable(with = CustomDateAdapter::class)
val date: LocalDate,
@SerialName("DateDisplay")
val dateDisplay: String,
@SerialName("Time")
val time: String,
@SerialName("Timestamp")
val timestamp: Long,
)
@Serializable
data class DateModify(
@SerialName("Date")
@Serializable(with = CustomDateAdapter::class)
val date: LocalDate,
@SerialName("DateDisplay")
val dateDisplay: String,
@SerialName("Time")
val time: String,
@SerialName("Timestamp")
val timestamp: Long,
)
@Serializable
data class Deadline(
@SerialName("Date")
@Serializable(with = CustomDateAdapter::class)
val date: LocalDate,
@SerialName("DateDisplay")
val dateDisplay: String,
@SerialName("Time")
val time: String,
@SerialName("Timestamp")
val timestamp: Long,
)
@Serializable
data class Subject(
@SerialName("Id")
val id: Int,
@SerialName("Key")
val key: String,
@SerialName("Kod")
val kod: String,
@SerialName("Name")
val name: String,
@SerialName("Position")
val position: Int,
)
}

View file

@ -0,0 +1,134 @@
package io.github.wulkanowy.sdk.hebe.models
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class Grade(
@SerialName("Column")
val column: Column,
@SerialName("Comment")
val comment: String,
@SerialName("Content")
val content: String,
@SerialName("ContentRaw")
val contentRaw: String,
@SerialName("Creator")
val creator: Creator,
@SerialName("DateCreated")
val dateCreated: DateCreated,
@SerialName("DateModify")
val dateModify: DateModify,
// @SerialName("Denominator")
// val denominator: Any?,
@SerialName("Id")
val id: Int,
@SerialName("Key")
val key: String,
@SerialName("Modifier")
val modifier: Modifier,
// @SerialName("Numerator")
// val numerator: Any?,
@SerialName("PupilId")
val pupilId: Int,
@SerialName("Value")
val value: Double? = null,
) {
@Serializable
data class Column(
@SerialName("Category")
val category: Category? = null,
@SerialName("Code")
val code: String,
@SerialName("Color")
val color: Int,
@SerialName("Group")
val group: String? = null,
@SerialName("Id")
val id: Int,
@SerialName("Key")
val key: String,
@SerialName("Name")
val name: String,
@SerialName("Number")
val number: Int,
@SerialName("PeriodId")
val periodId: Int,
@SerialName("Subject")
val subject: Subject,
@SerialName("Weight")
val weight: Double,
) {
@Serializable
data class Category(
@SerialName("Code")
val code: String,
@SerialName("Id")
val id: Int,
@SerialName("Name")
val name: String,
)
@Serializable
data class Subject(
@SerialName("Id")
val id: Int,
@SerialName("Key")
val key: String,
@SerialName("Kod")
val kod: String,
@SerialName("Name")
val name: String,
@SerialName("Position")
val position: Int,
)
}
@Serializable
data class Creator(
@SerialName("DisplayName")
val displayName: String,
@SerialName("Id")
val id: Int,
@SerialName("Name")
val name: String,
@SerialName("Surname")
val surname: String,
)
@Serializable
data class DateCreated(
@SerialName("Date")
val date: String,
@SerialName("DateDisplay")
val dateDisplay: String,
@SerialName("Time")
val time: String,
@SerialName("Timestamp")
val timestamp: Long,
)
@Serializable
data class DateModify(
@SerialName("Date")
val date: String,
@SerialName("DateDisplay")
val dateDisplay: String,
@SerialName("Time")
val time: String,
@SerialName("Timestamp")
val timestamp: Long,
)
@Serializable
data class Modifier(
@SerialName("DisplayName")
val displayName: String,
@SerialName("Id")
val id: Int,
@SerialName("Name")
val name: String,
@SerialName("Surname")
val surname: String,
)
}

View file

@ -0,0 +1,34 @@
package io.github.wulkanowy.sdk.hebe.models
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class GradeAverage(
@SerialName("Average")
val average: String,
@SerialName("Id")
val id: Int,
@SerialName("PeriodId")
val periodId: Int,
// @SerialName("Points")
// val points: Any?,
@SerialName("PupilId")
val pupilId: Int,
@SerialName("Subject")
val subject: Subject,
) {
@Serializable
data class Subject(
@SerialName("Id")
val id: Int,
@SerialName("Key")
val key: String,
@SerialName("Kod")
val kod: String,
@SerialName("Name")
val name: String,
@SerialName("Position")
val position: Int,
)
}

View file

@ -0,0 +1,50 @@
package io.github.wulkanowy.sdk.hebe.models
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class GradeSummary(
@SerialName("DateModify")
val dateModify: DateModify,
@SerialName("Entry_1")
val entry1: String? = null,
@SerialName("Entry_2")
val entry2: String? = null,
// @SerialName("Entry_3")
// val entry3: Any?,
@SerialName("Id")
val id: Int,
@SerialName("PeriodId")
val periodId: Int,
@SerialName("PupilId")
val pupilId: Int,
@SerialName("Subject")
val subject: Subject,
) {
@Serializable
data class DateModify(
@SerialName("Date")
val date: String,
@SerialName("DateDisplay")
val dateDisplay: String,
@SerialName("Time")
val time: String,
@SerialName("Timestamp")
val timestamp: Long,
)
@Serializable
data class Subject(
@SerialName("Id")
val id: Int,
@SerialName("Key")
val key: String,
@SerialName("Kod")
val kod: String,
@SerialName("Name")
val name: String,
@SerialName("Position")
val position: Int,
)
}

View file

@ -0,0 +1,10 @@
package io.github.wulkanowy.sdk.hebe.register
data class RegisterDevice(
val loginId: Int,
val restUrl: String,
val userLogin: String,
val userName: String,
val certificateHash: String,
val privatePem: String,
)

View file

@ -0,0 +1,33 @@
package io.github.wulkanowy.sdk.hebe.register
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import java.util.UUID
@Serializable
internal data class RegisterRequest(
@SerialName("Certificate")
val certificate: String,
@SerialName("CertificateThumbprint")
val certificateThumbprint: String,
@SerialName("CertificateType")
val certificateType: String = "RSA_PEM",
@SerialName("DeviceModel")
val deviceModel: String,
@SerialName("OS")
val os: String = "Android",
@SerialName("PIN")
val pin: String,
@SerialName("SecurityToken")
val securityToken: String,
@SerialName("SelfIdentifier")
val selfIdentifier: String = UUID.randomUUID().toString(),
)

View file

@ -0,0 +1,20 @@
package io.github.wulkanowy.sdk.hebe.register
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
internal data class RegisterResponse(
@SerialName("LoginId")
val loginId: Int,
@SerialName("RestURL")
val restUrl: String,
@SerialName("UserLogin")
val userLogin: String,
@SerialName("UserName")
val userName: String,
)

View file

@ -0,0 +1,277 @@
package io.github.wulkanowy.sdk.hebe.register
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
class StudentInfo(
@SerialName("Capabilities")
val capabilities: List<String>,
@SerialName("ClassDisplay")
val classDisplay: String,
@SerialName("ConstituentUnit")
val constituentUnit: ConstituentUnit,
@SerialName("Educators")
val educators: List<Educator>,
@SerialName("FullSync")
val fullSync: Boolean,
@SerialName("InfoDisplay")
val infoDisplay: String,
@SerialName("Journal")
val journal: Journal,
@SerialName("Login")
val login: Login,
@SerialName("Partition")
val partition: String,
@SerialName("Periods")
val periods: List<Period>,
@SerialName("Pupil")
val pupil: Pupil,
@SerialName("SenderEntry")
val senderEntry: SenderEntry,
@SerialName("TopLevelPartition")
val topLevelPartition: String,
@SerialName("Unit")
val unit: Unit,
) {
@Serializable
data class ConstituentUnit(
@SerialName("Address")
val address: String,
@SerialName("Id")
val id: Int,
@SerialName("Name")
val name: String,
@SerialName("Patron")
val patron: String,
@SerialName("SchoolTopic")
val schoolTopic: String,
@SerialName("Short")
val short: String,
)
@Serializable
data class Educator(
@SerialName("Id")
val id: String,
@SerialName("Initials")
val initials: String,
@SerialName("LoginId")
val loginId: Int,
@SerialName("Name")
val name: String,
@SerialName("Surname")
val surname: String,
@SerialName("Roles")
val roles: List<Role>,
) {
@Serializable
data class Role(
@SerialName("Address")
val address: String,
@SerialName("AddressHash")
val addressHash: String,
@SerialName("ClassSymbol")
val classSymbol: String,
@SerialName("ConstituentUnitSymbol")
val constituentUnitSymbol: String,
@SerialName("Initials")
val initials: String,
@SerialName("Name")
val name: String,
@SerialName("RoleName")
val roleName: String,
@SerialName("RoleOrder")
val roleOrder: Int,
@SerialName("Surname")
val surname: String,
@SerialName("UnitSymbol")
val unitSymbol: String? = null,
)
}
@Serializable
data class Journal(
@SerialName("Id")
val id: Int,
@SerialName("YearStart")
val yearStart: PeriodDate,
@SerialName("YearEnd")
val yearEnd: PeriodDate,
)
@Serializable
data class PeriodDate(
@SerialName("Date")
val date: String,
@SerialName("DateDisplay")
val dateDisplay: String,
@SerialName("Time")
val time: String,
@SerialName("Timestamp")
val timestamp: Long,
)
@Serializable
data class Login(
@SerialName("DisplayName")
val displayName: String,
@SerialName("FirstName")
val firstName: String,
@SerialName("Id")
val id: Int,
@SerialName("LoginRole")
val loginRole: String,
@SerialName("SecondName")
val secondName: String?,
@SerialName("Surname")
val surname: String,
@SerialName("Value")
val value: String,
)
@Serializable
data class Period(
@SerialName("Current")
val current: Boolean,
@SerialName("End")
val end: PeriodDate,
@SerialName("Id")
val id: Int,
@SerialName("Last")
val last: Boolean,
@SerialName("Level")
val level: Int,
@SerialName("Number")
val number: Int,
@SerialName("Start")
val start: PeriodDate,
)
@Serializable
data class Pupil(
@SerialName("Id")
val id: Int,
@SerialName("LoginId")
val loginId: Int = -1,
@SerialName("LoginValue")
val loginValue: String? = null,
@SerialName("FirstName")
val firstName: String,
@SerialName("SecondName")
val secondName: String = "",
@SerialName("Surname")
val surname: String,
@SerialName("Sex")
val sex: Boolean,
)
@Serializable
data class SenderEntry(
@SerialName("Address")
val address: String,
@SerialName("AddressHash")
val addressHash: String,
@SerialName("Initials")
val initials: String,
@SerialName("LoginId")
val loginId: Int,
)
@Serializable
data class Unit(
@SerialName("Address")
val address: String,
@SerialName("DisplayName")
val displayName: String,
@SerialName("Id")
val id: Int,
@SerialName("Name")
val name: String,
@SerialName("Patron")
val patron: String,
@SerialName("RestURL")
val restUrl: String,
@SerialName("Short")
val short: String,
@SerialName("Symbol")
val symbol: String,
)
}

View file

@ -0,0 +1,64 @@
package io.github.wulkanowy.sdk.hebe.repository
import io.github.wulkanowy.sdk.hebe.ApiRequest
import io.github.wulkanowy.sdk.hebe.ApiResponse
import io.github.wulkanowy.sdk.hebe.exception.InvalidSymbolException
import io.github.wulkanowy.sdk.hebe.getEnvelopeOrThrowError
import io.github.wulkanowy.sdk.hebe.register.RegisterRequest
import io.github.wulkanowy.sdk.hebe.register.RegisterResponse
import io.github.wulkanowy.sdk.hebe.register.StudentInfo
import io.github.wulkanowy.sdk.hebe.service.RegisterService
import retrofit2.HttpException
import java.net.HttpURLConnection.HTTP_INTERNAL_ERROR
internal class RegisterRepository(private val service: RegisterService) {
suspend fun register(
token: String,
pin: String,
deviceModel: String,
certificatePem: String,
certificateId: String,
firebaseToken: String?,
): RegisterResponse = registerDevice(
privateKey = certificatePem,
certificateId = certificateId,
deviceModel = deviceModel,
firebaseToken = firebaseToken.orEmpty(),
pin = pin,
token = token,
).getEnvelopeOrThrowError()!!
private suspend fun registerDevice(
privateKey: String,
certificateId: String,
deviceModel: String,
firebaseToken: String,
pin: String,
token: String,
): ApiResponse<RegisterResponse> = runCatching {
service.registerDevice(
ApiRequest(
certificateId = certificateId,
firebaseToken = firebaseToken,
envelope = RegisterRequest(
certificate = privateKey,
certificateThumbprint = certificateId,
deviceModel = deviceModel,
pin = pin,
securityToken = token,
),
),
)
}.onFailure {
if (it is HttpException && it.code() == HTTP_INTERNAL_ERROR) {
if ("ArgumentException" in it.response()?.errorBody()?.string().orEmpty()) {
throw InvalidSymbolException()
}
}
}.getOrThrow()
suspend fun getStudentInfo(): List<StudentInfo> {
return service.getStudentsInfo().envelope!!
}
}

View file

@ -0,0 +1,94 @@
package io.github.wulkanowy.sdk.hebe.repository
import io.github.wulkanowy.sdk.hebe.interceptor.ErrorInterceptor
import io.github.wulkanowy.sdk.hebe.interceptor.SignInterceptor
import kotlinx.serialization.ExperimentalSerializationApi
import kotlinx.serialization.json.Json
import okhttp3.Interceptor
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.converter.kotlinx.serialization.asConverterFactory
import retrofit2.converter.scalars.ScalarsConverterFactory
import retrofit2.create
internal class RepositoryManager(
private val keyId: String,
private val privatePem: String,
private val deviceModel: String,
logLevel: HttpLoggingInterceptor.Level,
) {
private val interceptors: MutableList<Pair<Interceptor, Boolean>> = mutableListOf(
HttpLoggingInterceptor().setLevel(logLevel) to true,
ErrorInterceptor() to false,
)
fun setInterceptor(interceptor: Interceptor, network: Boolean = false) {
interceptors.add(0, interceptor to network)
}
@OptIn(ExperimentalSerializationApi::class)
private val json by lazy {
Json {
explicitNulls = false
encodeDefaults = true
ignoreUnknownKeys = true
coerceInputValues = true
isLenient = true
}
}
fun getRoutesRepository(): RoutingRulesRepository {
return RoutingRulesRepository(
getRetrofitBuilder(isJson = false, signInterceptor = false)
.baseUrl("https://komponenty.vulcan.net.pl")
.build()
.create(),
)
}
fun getStudentRepository(baseUrl: String, schoolId: String): StudentRepository = StudentRepository(
getRetrofitBuilder(isJson = true, signInterceptor = true)
.baseUrl("${baseUrl.removeSuffix("/")}/$schoolId/")
.build()
.create(),
)
internal fun getRegisterRepository(baseUrl: String, symbol: String = ""): RegisterRepository = getRegisterRepository(
baseUrl = "${baseUrl.removeSuffix("/")}/$symbol",
)
private fun getRegisterRepository(baseUrl: String): RegisterRepository = RegisterRepository(
getRetrofitBuilder(signInterceptor = true)
.baseUrl("${baseUrl.removeSuffix("/")}/api/mobile/register/")
.build()
.create(),
)
private fun getRetrofitBuilder(isJson: Boolean = true, signInterceptor: Boolean): Retrofit.Builder {
return Retrofit.Builder()
.apply {
when {
isJson -> addConverterFactory(json.asConverterFactory("application/json".toMediaType()))
else -> addConverterFactory(ScalarsConverterFactory.create())
}
}
.client(
OkHttpClient().newBuilder()
.apply {
if (signInterceptor) {
addInterceptor(SignInterceptor(keyId, privatePem, deviceModel))
}
interceptors.forEach {
when {
it.second -> addNetworkInterceptor(it.first)
else -> addInterceptor(it.first)
}
}
}
.build(),
)
}
}

View file

@ -0,0 +1,22 @@
package io.github.wulkanowy.sdk.hebe.repository
import io.github.wulkanowy.sdk.hebe.exception.InvalidTokenException
import io.github.wulkanowy.sdk.hebe.exception.UnknownTokenException
import io.github.wulkanowy.sdk.hebe.service.RoutingRulesService
internal class RoutingRulesRepository(private val api: RoutingRulesService) {
suspend fun getRouteByToken(token: String): String {
if (token.length < 4) throw InvalidTokenException("Token '$token' is too short")
val tokenSymbol = token.substring(0..2)
if ("FK1" == tokenSymbol) return "https://api.fakelog.cf"
return api.getRoutingRules()
.split("\r?\n".toRegex())
.singleOrNull { tokenSymbol == it.substringBefore(",") }
?.substringAfter(",")
?: throw UnknownTokenException("This token: '$token' is unsupported")
}
}

View file

@ -0,0 +1,54 @@
package io.github.wulkanowy.sdk.hebe.repository
import io.github.wulkanowy.sdk.hebe.getEnvelopeOrThrowError
import io.github.wulkanowy.sdk.hebe.models.Exam
import io.github.wulkanowy.sdk.hebe.models.Grade
import io.github.wulkanowy.sdk.hebe.models.GradeAverage
import io.github.wulkanowy.sdk.hebe.models.GradeSummary
import io.github.wulkanowy.sdk.hebe.service.StudentService
import java.time.LocalDate
import java.time.format.DateTimeFormatter
internal class StudentRepository(private val studentService: StudentService) {
suspend fun getGrades(pupilId: Int, periodId: Int): List<Grade> {
return studentService.getGrades(
createQueryMap(pupilId = pupilId, periodId = periodId),
).getEnvelopeOrThrowError().orEmpty()
}
suspend fun getGradesSummary(pupilId: Int, periodId: Int): List<GradeSummary> {
return studentService.getGradesSummary(
createQueryMap(pupilId = pupilId, periodId = periodId),
).getEnvelopeOrThrowError().orEmpty()
}
suspend fun getGradesAverage(pupilId: Int, periodId: Int): List<GradeAverage> {
return studentService.getGradesAverage(
createQueryMap(pupilId = pupilId, periodId = periodId),
).getEnvelopeOrThrowError().orEmpty()
}
suspend fun getExams(pupilId: Int, startDate: LocalDate, endDate: LocalDate): List<Exam> {
return studentService.getExams(
createQueryMap(pupilId = pupilId, dateFrom = startDate),
).getEnvelopeOrThrowError().orEmpty().filter {
it.deadline.date in startDate..endDate
}
}
private fun createQueryMap(
pupilId: Int,
periodId: Int? = null,
dateFrom: LocalDate? = null,
dateTo: LocalDate? = null,
): Map<String, Any?> = mapOf(
"pupilId" to pupilId,
"periodId" to periodId,
"lastSyncDate" to "1970-01-01 01:00:00",
"lastId" to Int.MIN_VALUE,
"pageSize" to 500,
"dateFrom" to dateFrom?.format(DateTimeFormatter.ISO_DATE),
"dateTo" to dateTo?.format(DateTimeFormatter.ISO_DATE),
).filterValues { it != null }
}

View file

@ -0,0 +1,19 @@
package io.github.wulkanowy.sdk.hebe.service
import io.github.wulkanowy.sdk.hebe.ApiRequest
import io.github.wulkanowy.sdk.hebe.ApiResponse
import io.github.wulkanowy.sdk.hebe.register.RegisterRequest
import io.github.wulkanowy.sdk.hebe.register.RegisterResponse
import io.github.wulkanowy.sdk.hebe.register.StudentInfo
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
internal interface RegisterService {
@POST("new")
suspend fun registerDevice(@Body request: ApiRequest<RegisterRequest>): ApiResponse<RegisterResponse>
@GET("hebe")
suspend fun getStudentsInfo(): ApiResponse<List<StudentInfo>>
}

View file

@ -1,8 +1,8 @@
package io.github.wulkanowy.sdk.mobile.service
package io.github.wulkanowy.sdk.hebe.service
import retrofit2.http.GET
interface RoutingRulesService {
internal interface RoutingRulesService {
@GET("/UonetPlusMobile/RoutingRules.txt")
suspend fun getRoutingRules(): String

View file

@ -0,0 +1,25 @@
package io.github.wulkanowy.sdk.hebe.service
import io.github.wulkanowy.sdk.hebe.ApiResponse
import io.github.wulkanowy.sdk.hebe.models.Exam
import io.github.wulkanowy.sdk.hebe.models.Grade
import io.github.wulkanowy.sdk.hebe.models.GradeAverage
import io.github.wulkanowy.sdk.hebe.models.GradeSummary
import retrofit2.http.GET
import retrofit2.http.QueryMap
@JvmSuppressWildcards
internal interface StudentService {
@GET("api/mobile/grade/byPupil")
suspend fun getGrades(@QueryMap query: Map<String, Any?>): ApiResponse<List<Grade>>
@GET("api/mobile/grade/summary/byPupil")
suspend fun getGradesSummary(@QueryMap query: Map<String, Any?>): ApiResponse<List<GradeSummary>>
@GET("api/mobile/grade/average/byPupil")
suspend fun getGradesAverage(@QueryMap query: Map<String, Any?>): ApiResponse<List<GradeAverage>>
@GET("api/mobile/exam/byPupil")
suspend fun getExams(@QueryMap query: Map<String, Any?>): ApiResponse<List<Exam>>
}

View file

@ -0,0 +1,63 @@
package io.github.wulkanowy.sdk.hebe
import kotlinx.coroutines.test.runTest
import okhttp3.logging.HttpLoggingInterceptor
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Ignore
import org.junit.Test
import java.time.LocalDate
@Ignore
class HebeRemoteTest {
private val hebe = Hebe()
@Before
fun setUp() {
with(hebe) {
logLevel = HttpLoggingInterceptor.Level.BODY
keyId = "///"
privatePem = "///"
baseUrl = "https://api.fakelog.cf/powiatwulkanowy/"
pupilId = 1234
schoolId = "008520"
deviceModel = "Pixel 4a (5G)"
}
}
@Test
fun `register device`() = runTest {
val res = hebe.register(
firebaseToken = "",
token = "FK11234",
pin = "123456",
symbol = "powiatwulkanowy",
)
assertTrue(res.privatePem.isNotEmpty())
}
@Test
fun `get students`() = runTest {
val res = hebe.getStudents(hebe.baseUrl)
assertTrue(res.isNotEmpty())
}
@Test
fun `get grades`() = runTest {
val grades = hebe.getGrades(560)
assertTrue(grades.isNotEmpty())
}
@Test
fun `get grades summary`() = runTest {
val summaries = hebe.getGradesSummary(560)
assertTrue(summaries.isNotEmpty())
}
@Test
fun `get exams`() = runTest {
val exams = hebe.getExams(LocalDate.of(2023, 4, 1), LocalDate.of(2023, 5, 1))
assertTrue(exams.isNotEmpty())
}
}

View file

@ -1,19 +0,0 @@
plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm'
id 'kotlin-kapt'
}
dependencies {
implementation "io.github.wulkanowy:uonet-request-signer:36c4365"
implementation "com.brsanthu:migbase64:2.2"
implementation "com.squareup.retrofit2:retrofit:$retrofit"
implementation "com.squareup.retrofit2:converter-moshi:$retrofit"
implementation "com.squareup.retrofit2:converter-scalars:$retrofit"
implementation "com.squareup.moshi:moshi:1.11.0"
implementation 'com.squareup.moshi:moshi-adapters:1.11.0'
kapt "com.squareup.moshi:moshi-kotlin-codegen:1.11.0"
}

View file

@ -1,31 +0,0 @@
package io.github.wulkanowy.sdk.mobile
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import java.time.LocalDateTime.now
import java.time.ZoneOffset
import java.util.UUID
@Suppress("unused")
@JsonClass(generateAdapter = true)
open class ApiRequest(
@Json(name = "RemoteMobileTimeKey")
val remoteMobileTimeKey: Long = now().toEpochSecond(ZoneOffset.UTC),
@Json(name = "TimeKey")
val timeKey: Long = now().toEpochSecond(ZoneOffset.UTC) - 1,
@Json(name = "RequestId")
val requestId: String = UUID.randomUUID().toString(),
@Json(name = "RemoteMobileAppVersion")
val remoteMobileAppVersion: String = MOBILE_APP_VERSION,
@Json(name = "RemoteMobileAppName")
val remoteMobileAppName: String = "VULCAN-Android-ModulUcznia"
) {
companion object {
const val MOBILE_APP_VERSION = "20.1.1.447"
}
}

View file

@ -1,29 +0,0 @@
package io.github.wulkanowy.sdk.mobile
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class ApiResponse<out T>(
@Json(name = "Status")
val status: String,
@Json(name = "TimeKey")
val timeKey: String,
@Json(name = "TimeValue")
val timeValue: String,
@Json(name = "RequestId")
val requestId: String,
@Json(name = "DayOfWeek")
val dayOfWeek: String,
@Json(name = "AppVersion")
val appVersion: String,
@Json(name = "Data")
val data: T?
)

View file

@ -1,186 +0,0 @@
package io.github.wulkanowy.sdk.mobile
import com.migcomponents.migbase64.Base64
import io.github.wulkanowy.sdk.mobile.attendance.Attendance
import io.github.wulkanowy.sdk.mobile.dictionaries.Dictionaries
import io.github.wulkanowy.sdk.mobile.exams.Exam
import io.github.wulkanowy.sdk.mobile.exception.InvalidPinException
import io.github.wulkanowy.sdk.mobile.exception.NoStudentsException
import io.github.wulkanowy.sdk.mobile.exception.TokenDeadException
import io.github.wulkanowy.sdk.mobile.exception.TokenNotFoundException
import io.github.wulkanowy.sdk.mobile.exception.UnknownTokenException
import io.github.wulkanowy.sdk.mobile.exception.UnsupportedTokenException
import io.github.wulkanowy.sdk.mobile.grades.Grade
import io.github.wulkanowy.sdk.mobile.grades.GradesSummaryResponse
import io.github.wulkanowy.sdk.mobile.homework.Homework
import io.github.wulkanowy.sdk.mobile.messages.Message
import io.github.wulkanowy.sdk.mobile.messages.Recipient
import io.github.wulkanowy.sdk.mobile.notes.Note
import io.github.wulkanowy.sdk.mobile.register.CertificateResponse
import io.github.wulkanowy.sdk.mobile.register.Student
import io.github.wulkanowy.sdk.mobile.repository.RepositoryManager
import io.github.wulkanowy.sdk.mobile.school.Teacher
import io.github.wulkanowy.sdk.mobile.timetable.Lesson
import io.github.wulkanowy.signer.getPrivateKeyFromCert
import okhttp3.Interceptor
import okhttp3.logging.HttpLoggingInterceptor
import java.nio.charset.Charset
import java.time.LocalDate
import java.time.LocalDateTime
class Mobile {
var classId = 0
var studentId = 0
var loginId = 0
private val resettableManager = resettableManager()
var logLevel = HttpLoggingInterceptor.Level.BASIC
set(value) {
field = value
resettableManager.reset()
}
var privateKey = ""
set(value) {
field = value
resettableManager.reset()
}
var certKey = ""
set(value) {
field = value
resettableManager.reset()
}
var baseUrl = ""
set(value) {
field = value
resettableManager.reset()
}
var schoolSymbol = ""
set(value) {
field = value
resettableManager.reset()
}
private val serviceManager by resettableLazy(resettableManager) { RepositoryManager(logLevel, privateKey, certKey, interceptors, baseUrl, schoolSymbol) }
private val routes by resettableLazy(resettableManager) { serviceManager.getRoutesRepository() }
private val mobile by resettableLazy(resettableManager) { serviceManager.getMobileRepository() }
private val interceptors: MutableList<Pair<Interceptor, Boolean>> = mutableListOf()
fun setInterceptor(interceptor: Interceptor, network: Boolean = false) {
interceptors.add(interceptor to network)
}
private lateinit var dictionaries: Dictionaries
suspend fun getDictionaries(): Dictionaries {
if (::dictionaries.isInitialized) return dictionaries
return mobile.getDictionaries(0, 0, classId)
.apply { dictionaries = this }
}
suspend fun getCertificate(token: String, pin: String, symbol: String, deviceName: String, androidVer: String, firebaseToken: String): CertificateResponse {
val baseUrl = routes.getRouteByToken(token)
return serviceManager.getRegisterRepository(baseUrl, symbol).getCertificate(token, pin, deviceName, androidVer, firebaseToken)
}
suspend fun getStudents(certRes: CertificateResponse, apiKey: String = ""): List<Student> {
if (certRes.isError) when {
certRes.message == "TokenDead" -> throw TokenDeadException(certRes.message)
certRes.message == "TokenNotFound" -> throw TokenNotFoundException(certRes.message)
certRes.message?.startsWith("Podany numer PIN jest niepoprawny") == true -> throw InvalidPinException(certRes.message.orEmpty())
certRes.message?.startsWith("Trzykrotnie wpisano niepoprawny kod PIN") == true -> throw InvalidPinException(certRes.message.orEmpty())
certRes.message == "NoPupils" -> throw NoStudentsException(certRes.message.orEmpty())
certRes.message == "OnlyKindergarten" -> throw UnsupportedTokenException(certRes.message)
else -> throw UnknownTokenException(certRes.message.orEmpty())
}
val cert = certRes.tokenCert!!
certKey = cert.certificateKey
baseUrl = cert.baseUrl.removeSuffix("/")
privateKey = getPrivateKeyFromCert(apiKey.ifEmpty {
Base64.decode(if (cert.baseUrl.contains("fakelog")) "KDAxMjM0NTY3ODkwMTIzNDU2Nzg5MDEyMzQ1Njc4OUFCKQ==" else "KENFNzVFQTU5OEM3NzQzQUQ5QjBCNzMyOERFRDg1QjA2KQ==")
.toString(Charset.defaultCharset())
.removeSurrounding("(", ")")
}, cert.certificatePfx)
return serviceManager.getRegisterRepository(cert.baseUrl).getStudents().map {
it.copy().apply {
certificateKey = this@Mobile.certKey
privateKey = this@Mobile.privateKey
mobileBaseUrl = this@Mobile.baseUrl
}
}
}
suspend fun getStudents(): List<Student> {
return serviceManager.getRegisterRepository(baseUrl).getStudents()
}
suspend fun getAttendance(start: LocalDate, end: LocalDate, classificationPeriodId: Int): List<Attendance> {
return mobile.getAttendance(start, end, classId, classificationPeriodId, studentId)
}
suspend fun getExams(start: LocalDate, end: LocalDate, classificationPeriodId: Int): List<Exam> {
return mobile.getExams(start, end, classId, classificationPeriodId, studentId)
}
suspend fun getGrades(classificationPeriodId: Int): Pair<List<Grade>, GradesSummaryResponse> {
return getGradesDetails(classificationPeriodId) to getGradesSummary(classificationPeriodId)
}
suspend fun getGradesDetails(classificationPeriodId: Int): List<Grade> {
return mobile.getGradesDetails(classId, classificationPeriodId, studentId)
}
suspend fun getGradesSummary(classificationPeriodId: Int): GradesSummaryResponse {
return mobile.getGradesSummary(classId, classificationPeriodId, studentId)
}
suspend fun getHomework(start: LocalDate, end: LocalDate, classificationPeriodId: Int): List<Homework> {
return mobile.getHomework(start, end, classId, classificationPeriodId, studentId)
}
suspend fun getNotes(classificationPeriodId: Int): List<Note> {
return mobile.getNotes(classificationPeriodId, studentId)
}
suspend fun getTeachers(studentId: Int, semesterId: Int): List<Teacher> {
return mobile.getTeachers(studentId, semesterId)
}
suspend fun getMessages(start: LocalDateTime, end: LocalDateTime): List<Message> {
return mobile.getMessages(start, end, loginId, studentId)
}
suspend fun getMessagesSent(start: LocalDateTime, end: LocalDateTime): List<Message> {
return mobile.getMessagesSent(start, end, loginId, studentId)
}
suspend fun getMessagesDeleted(start: LocalDateTime, end: LocalDateTime): List<Message> {
return mobile.getMessagesDeleted(start, end, loginId, studentId)
}
suspend fun changeMessageStatus(messageId: Int, folder: String, status: String): String {
return mobile.changeMessageStatus(messageId, folder, status, loginId, studentId)
}
suspend fun sendMessage(subject: String, content: String, recipients: List<Recipient>): Message {
val sender = getStudents().singleOrNull { it.loginId == loginId }?.name.orEmpty()
return mobile.sendMessage(sender, subject, content, recipients, loginId, studentId)
}
suspend fun getTimetable(start: LocalDate, end: LocalDate, classificationPeriodId: Int): List<Lesson> {
return mobile.getTimetable(start, end, classId, classificationPeriodId, studentId)
}
}

View file

@ -1,9 +0,0 @@
package io.github.wulkanowy.sdk.mobile
import java.time.LocalDate
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter.ofPattern
fun LocalDate.toFormat(): String = format(ofPattern("yyyy-MM-dd"))
fun LocalDateTime.toFormat(): String = format(ofPattern("yyyy-MM-dd"))

View file

@ -1,29 +0,0 @@
package io.github.wulkanowy.sdk.mobile.attendance
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class Attendance(
@Json(name = "IdKategoria")
val categoryId: Int,
@Json(name = "Numer")
val number: Int,
@Json(name = "IdPoraLekcji")
val lessonTimeId: Int,
@Json(name = "Dzien")
val date: Long,
@Json(name = "DzienTekst")
val dateText: String,
@Json(name = "IdPrzedmiot")
val subjectId: Int,
@Json(name = "PrzedmiotNazwa")
val subjectName: String
)

View file

@ -1,24 +0,0 @@
package io.github.wulkanowy.sdk.mobile.attendance
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import io.github.wulkanowy.sdk.mobile.ApiRequest
@JsonClass(generateAdapter = true)
data class AttendanceRequest(
@Json(name = "DataPoczatkowa")
val startDate: String,
@Json(name = "DataKoncowa")
val endDate: String,
@Json(name = "IdOddzial")
val classId: Int,
@Json(name = "IdOkresKlasyfikacyjny")
val classificationPeriodId: Int,
@Json(name = "IdUczen")
val studentId: Int
) : ApiRequest()

View file

@ -1,23 +0,0 @@
package io.github.wulkanowy.sdk.mobile.attendance
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class AttendanceResponse(
@Json(name = "DataPoczatkowa")
val dateStart: Long,
@Json(name = "DataPoczatkowaTekst")
val dateStartText: String,
@Json(name = "DataKoncowa")
val dateEnd: Long,
@Json(name = "DataKoncowaTekst")
val dateEndText: String,
@Json(name = "Frekwencje")
val items: List<Attendance>
)

View file

@ -1,35 +0,0 @@
package io.github.wulkanowy.sdk.mobile.dictionaries
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class AttendanceCategory(
@Json(name = "Id")
val id: Int,
@Json(name = "Nazwa")
val name: String,
@Json(name = "Pozycja")
val position: Int,
@Json(name = "Obecnosc")
val presence: Boolean,
@Json(name = "Nieobecnosc")
val absence: Boolean,
@Json(name = "Zwolnienie")
val exemption: Boolean,
@Json(name = "Spoznienie")
val lateness: Boolean,
@Json(name = "Usprawiedliwione")
val excused: Boolean,
@Json(name = "Usuniete")
val deleted: Boolean
)

View file

@ -1,26 +0,0 @@
package io.github.wulkanowy.sdk.mobile.dictionaries
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class AttendanceType(
@Json(name = "Id")
val id: Int,
@Json(name = "Symbol")
val symbol: String,
@Json(name = "Nazwa")
val name: String,
@Json(name = "Aktywny")
val active: Boolean,
@Json(name = "WpisDomyslny")
val defaultEntry: Boolean,
@Json(name = "IdKategoriaFrek")
val categoryId: Int
)

View file

@ -1,35 +0,0 @@
package io.github.wulkanowy.sdk.mobile.dictionaries
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class Dictionaries(
@Json(name = "TimeKey")
val timeKey: Long,
@Json(name = "Nauczyciele")
val teachers: List<Teacher>,
@Json(name = "Pracownicy")
val employees: List<Employee>,
@Json(name = "Przedmioty")
val subjects: List<Subject>,
@Json(name = "PoryLekcji")
val lessonTimes: List<LessonTime>,
@Json(name = "KategorieOcen")
val gradeCategories: List<GradeCategory>,
@Json(name = "KategorieUwag")
val noteCategories: List<NoteCategory>,
@Json(name = "KategorieFrekwencji")
val attendanceCategories: List<AttendanceCategory>,
@Json(name = "TypyFrekwencji")
val attendanceTypes: List<AttendanceType>
)

View file

@ -1,19 +0,0 @@
package io.github.wulkanowy.sdk.mobile.dictionaries
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import io.github.wulkanowy.sdk.mobile.ApiRequest
@JsonClass(generateAdapter = true)
data class DictionariesRequest(
@Json(name = "IdUczen")
val userId: Int,
@Json(name = "IdOkresKlasyfikacyjny")
val classificationPeriodId: Int,
@Json(name = "IdOddzial")
val classId: Int
) : ApiRequest()

View file

@ -1,29 +0,0 @@
package io.github.wulkanowy.sdk.mobile.dictionaries
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class Employee(
@Json(name = "Id")
val id: Int,
@Json(name = "Imie")
val name: String,
@Json(name = "Nazwisko")
val surname: String,
@Json(name = "Kod")
val code: String,
@Json(name = "Aktywny")
val active: Boolean,
@Json(name = "Nauczyciel")
val teacher: Boolean,
@Json(name = "LoginId")
val loginId: Int
)

View file

@ -1,17 +0,0 @@
package io.github.wulkanowy.sdk.mobile.dictionaries
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class GradeCategory(
@Json(name = "Id")
val id: Int,
@Json(name = "Kod")
val code: String,
@Json(name = "Nazwa")
val name: String
)

View file

@ -1,26 +0,0 @@
package io.github.wulkanowy.sdk.mobile.dictionaries
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class LessonTime(
@Json(name = "Id")
val id: Int,
@Json(name = "Numer")
val number: Int,
@Json(name = "Poczatek")
val start: Long,
@Json(name = "PoczatekTekst")
val startText: String,
@Json(name = "Koniec")
val end: Long,
@Json(name = "KoniecTekst")
val endText: String
)

View file

@ -1,17 +0,0 @@
package io.github.wulkanowy.sdk.mobile.dictionaries
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class NoteCategory(
@Json(name = "Id")
val id: Int,
@Json(name = "Nazwa")
val name: String,
@Json(name = "Aktywny")
val isActive: Boolean
)

View file

@ -1,23 +0,0 @@
package io.github.wulkanowy.sdk.mobile.dictionaries
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class Subject(
@Json(name = "Id")
val id: Int,
@Json(name = "Nazwa")
val name: String,
@Json(name = "Kod")
val code: String,
@Json(name = "Aktywny")
val active: Boolean,
@Json(name = "Pozycja")
val position: Int
)

View file

@ -1,29 +0,0 @@
package io.github.wulkanowy.sdk.mobile.dictionaries
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class Teacher(
@Json(name = "Id")
val id: Int,
@Json(name = "Imie")
val name: String,
@Json(name = "Nazwisko")
val surname: String,
@Json(name = "Kod")
val code: String,
@Json(name = "Aktywny")
val active: Boolean,
@Json(name = "Nauczyciel")
val teacher: Boolean,
@Json(name = "LoginId")
val loginId: Int
)

View file

@ -1,41 +0,0 @@
package io.github.wulkanowy.sdk.mobile.exams
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class Exam(
@Json(name = "Id")
val id: Int,
@Json(name = "IdPrzedmiot")
val subjectId: Int,
@Json(name = "IdPracownik")
val employeeId: Int,
@Json(name = "IdOddzial")
val classId: Int?,
@Json(name = "IdPodzial")
val divideId: Int?,
@Json(name = "PodzialNazwa")
val divideName: String?,
@Json(name = "Rodzaj")
val type: Boolean, // false - quiz, true - test
@Json(name = "RodzajNumer")
val typeNumber: Int,
@Json(name = "Opis")
val description: String,
@Json(name = "Data")
val date: Long,
@Json(name = "DataTekst")
val dateText: String
)

View file

@ -1,24 +0,0 @@
package io.github.wulkanowy.sdk.mobile.exams
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import io.github.wulkanowy.sdk.mobile.ApiRequest
@JsonClass(generateAdapter = true)
data class ExamsRequest(
@Json(name = "DataPoczatkowa")
val startDate: String,
@Json(name = "DataKoncowa")
val endDate: String,
@Json(name = "IdOddzial")
val classId: Int,
@Json(name = "IdOkresKlasyfikacyjny")
val classificationPeriodId: Int,
@Json(name = "IdUczen")
val studentId: Int
) : ApiRequest()

View file

@ -1,5 +0,0 @@
package io.github.wulkanowy.sdk.mobile.exception
import java.io.IOException
class InvalidPinException(message: String) : IOException(message)

View file

@ -1,5 +0,0 @@
package io.github.wulkanowy.sdk.mobile.exception
import java.io.IOException
open class InvalidTokenException internal constructor(message: String) : IOException(message)

View file

@ -1,5 +0,0 @@
package io.github.wulkanowy.sdk.mobile.exception
import java.io.IOException
class NoStudentsException(message: String) : IOException(message)

View file

@ -1,3 +0,0 @@
package io.github.wulkanowy.sdk.mobile.exception
class TokenDeadException(message: String) : InvalidTokenException(message)

View file

@ -1,3 +0,0 @@
package io.github.wulkanowy.sdk.mobile.exception
class TokenNotFoundException(message: String) : InvalidTokenException(message)

View file

@ -1,3 +0,0 @@
package io.github.wulkanowy.sdk.mobile.exception
class UnknownTokenException(message: String) : InvalidTokenException(message)

View file

@ -1,5 +0,0 @@
package io.github.wulkanowy.sdk.mobile.exception
import java.io.IOException
class UnsupportedTokenException(message: String) : IOException(message)

View file

@ -1,68 +0,0 @@
package io.github.wulkanowy.sdk.mobile.grades
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class Grade(
@Json(name = "Id")
val id: Int,
@Json(name = "Pozycja")
val position: Int,
@Json(name = "PrzedmiotPozycja")
val subjectPosition: Int,
@Json(name = "IdPrzedmiot")
val subjectId: Int,
@Json(name = "IdKategoria")
val categoryId: Int,
@Json(name = "Wpis")
val entry: String,
@Json(name = "Wartosc")
val value: Double,
@Json(name = "WagaModyfikatora")
val modificationWeight: Double?,
@Json(name = "WagaOceny")
val gradeWeight: Double,
@Json(name = "Licznik")
val counter: Double?,
@Json(name = "Mianownik")
val denominator: Int?,
@Json(name = "Komentarz")
val comment: String?,
@Json(name = "Waga")
val weight: String,
@Json(name = "Opis")
val description: String,
@Json(name = "DataUtworzenia")
val creationDate: Long,
@Json(name = "DataUtworzeniaTekst")
val creationDateText: String,
@Json(name = "DataModyfikacji")
val modificationDate: Long,
@Json(name = "DataModyfikacjiTekst")
val modificationDateText: String,
@Json(name = "IdPracownikD")
val employeeIdD: Int,
@Json(name = "IdPracownikM")
val employeeIdM: Int
)

View file

@ -1,20 +0,0 @@
package io.github.wulkanowy.sdk.mobile.grades
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class GradeSummary(
@Json(name = "IdPrzedmiot")
val subjectId: Int = 0,
@Json(name = "Wpis")
val entry: String = "",
@Json(name = "SredniaOcen")
val average: String = "0",
@Json(name = "SumaPunktow")
val pointsSum: String = ""
)

View file

@ -1,18 +0,0 @@
package io.github.wulkanowy.sdk.mobile.grades
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import io.github.wulkanowy.sdk.mobile.ApiRequest
@JsonClass(generateAdapter = true)
data class GradesRequest(
@Json(name = "IdOddzial")
val classId: Int,
@Json(name = "IdOkresKlasyfikacyjny")
val classificationPeriodId: Int,
@Json(name = "IdUczen")
val studentId: Int
) : ApiRequest()

View file

@ -1,17 +0,0 @@
package io.github.wulkanowy.sdk.mobile.grades
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class GradesSummaryResponse(
@Json(name = "OcenyPrzewidywane")
val predicted: List<GradeSummary>,
@Json(name = "OcenyKlasyfikacyjne")
val evaluative: List<GradeSummary>,
@Json(name = "SrednieOcen")
val average: List<GradeSummary>
)

View file

@ -1,29 +0,0 @@
package io.github.wulkanowy.sdk.mobile.homework
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class Homework(
@Json(name = "Id")
val id: Int,
@Json(name = "IdUczen")
val studentId: Int,
@Json(name = "Data")
val date: Long,
@Json(name = "DataTekst")
val dateText: String,
@Json(name = "IdPracownik")
val employeeId: Int,
@Json(name = "IdPrzedmiot")
val subjectId: Int,
@Json(name = "Opis")
val content: String
)

View file

@ -1,24 +0,0 @@
package io.github.wulkanowy.sdk.mobile.homework
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import io.github.wulkanowy.sdk.mobile.ApiRequest
@JsonClass(generateAdapter = true)
data class HomeworkRequest(
@Json(name = "DataPoczatkowa")
val startDate: String,
@Json(name = "DataKoncowa")
val endDate: String,
@Json(name = "IdOddzial")
val classId: Int,
@Json(name = "IdOkresKlasyfikacyjny")
val classificationPeriodId: Int,
@Json(name = "IdUczen")
val studentId: Int
) : ApiRequest()

View file

@ -1,21 +0,0 @@
package io.github.wulkanowy.sdk.mobile.interceptor
import io.github.wulkanowy.sdk.mobile.exception.InvalidSymbolException
import okhttp3.Interceptor
import okhttp3.Response
import java.io.IOException
class ErrorInterceptor : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
val response = chain.proceed(chain.request())
val body = response.peekBody(Long.MAX_VALUE).string()
when {
body == "Bad Request" -> throw IOException(body)
body.contains("Podany symbol grupujący jest nieprawidłowy") -> throw InvalidSymbolException()
}
return response
}
}

View file

@ -1,32 +0,0 @@
package io.github.wulkanowy.sdk.mobile.interceptor
import io.github.wulkanowy.signer.signContent
import okhttp3.Interceptor
import okhttp3.Response
import okio.Buffer
import java.nio.charset.Charset
class SignInterceptor(
private val privateKey: String,
private val certKey: String
) : Interceptor {
override fun intercept(chain: Interceptor.Chain): Response {
val original = chain.request()
val request = original.newBuilder()
request.header("User-Agent", "MobileUserAgent")
if (privateKey.isNotBlank()) {
val signature = Buffer().run {
original.body()?.writeTo(this)
signContent(privateKey, readString(Charset.defaultCharset()))
}
request.header("RequestCertificateKey", certKey)
request.header("RequestSignatureValue", signature)
}
return chain.proceed(request.method(original.method(), original.body()).build())
}
}

View file

@ -1,56 +0,0 @@
package io.github.wulkanowy.sdk.mobile.messages
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class Message(
@Json(name = "WiadomoscId")
val messageId: Int,
@Json(name = "Nadawca")
val senderName: String?,
@Json(name = "NadawcaId")
val senderId: Int,
@Json(name = "Adresaci")
val recipients: List<Recipient>?,
@Json(name = "Tytul")
val subject: String,
@Json(name = "Tresc")
val content: String,
@Json(name = "DataWyslania")
val sentDate: String,
@Json(name = "DataWyslaniaUnixEpoch")
val sentDateTime: Long,
@Json(name = "GodzinaWyslania")
val sentHour: String,
@Json(name = "DataPrzeczytania")
val readDate: String?,
@Json(name = "DataPrzeczytaniaUnixEpoch")
val readDateTime: Long?,
@Json(name = "GodzinaPrzeczytania")
val readHour: String?,
@Json(name = "StatusWiadomosci")
val status: String,
@Json(name = "FolderWiadomosci")
val folder: String,
@Json(name = "Nieprzeczytane")
val unread: String?,
@Json(name = "Przeczytane")
val read: String?
)

View file

@ -1,24 +0,0 @@
package io.github.wulkanowy.sdk.mobile.messages
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import io.github.wulkanowy.sdk.mobile.ApiRequest
@JsonClass(generateAdapter = true)
data class MessageStatusChangeRequest(
@Json(name = "WiadomoscId")
val messageId: Int,
@Json(name = "FolderWiadomosci")
val folder: String,
@Json(name = "Status")
val status: String,
@Json(name = "LoginId")
val loginId: Int,
@Json(name = "IdUczen")
val studentId: Int
) : ApiRequest()

View file

@ -1,21 +0,0 @@
package io.github.wulkanowy.sdk.mobile.messages
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import io.github.wulkanowy.sdk.mobile.ApiRequest
@JsonClass(generateAdapter = true)
data class MessagesRequest(
@Json(name = "DataPoczatkowa")
val startDate: String,
@Json(name = "DataKoncowa")
val endDate: String,
@Json(name = "LoginId")
val loginId: Int,
@Json(name = "IdUczen")
val studentId: Int
) : ApiRequest()

View file

@ -1,14 +0,0 @@
package io.github.wulkanowy.sdk.mobile.messages
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class Recipient(
@Json(name = "LoginId")
val loginId: Int,
@Json(name = "Nazwa")
val name: String
)

View file

@ -1,26 +0,0 @@
package io.github.wulkanowy.sdk.mobile.messages
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class SendMessageRequest(
@Json(name = "NadawcaWiadomosci")
val sender: String,
@Json(name = "Tytul")
val subject: String,
@Json(name = "Tresc")
val content: String,
@Json(name = "Adresaci")
val recipients: List<Recipient>,
@Json(name = "LoginId")
val loginId: Int,
@Json(name = "IdUczen")
val studentId: Int
)

View file

@ -1,50 +0,0 @@
package io.github.wulkanowy.sdk.mobile.notes
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class Note(
@Json(name = "Id")
val id: Int,
@Json(name = "IdKategoriaUwag")
val noteCategoryId: Int,
@Json(name = "IdUczen")
val studentId: Int,
@Json(name = "UczenImie")
val studentName: String,
@Json(name = "UczenNazwisko")
val studentSurname: String,
@Json(name = "IdPracownik")
val employeeId: Int,
@Json(name = "PracownikImie")
val employeeName: String,
@Json(name = "PracownikNazwisko")
val employeeSurname: String,
@Json(name = "DataWpisu")
val entryDate: Long,
@Json(name = "DataWpisuTekst")
val entryDateText: String,
@Json(name = "DataModyfikacji")
val modificationDate: Long?,
@Json(name = "DataModyfikacjiTekst")
val modificationDateText: String?,
@Json(name = "UwagaKey")
val noteKey: String,
@Json(name = "TrescUwagi")
val content: String
)

View file

@ -1,15 +0,0 @@
package io.github.wulkanowy.sdk.mobile.notes
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import io.github.wulkanowy.sdk.mobile.ApiRequest
@JsonClass(generateAdapter = true)
data class NotesRequest(
@Json(name = "IdOkresKlasyfikacyjny")
val classificationPeriodId: Int,
@Json(name = "IdUczen")
val studentId: Int
) : ApiRequest()

View file

@ -1,41 +0,0 @@
package io.github.wulkanowy.sdk.mobile.register
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import io.github.wulkanowy.sdk.mobile.ApiRequest
import java.util.UUID
@JsonClass(generateAdapter = true)
data class CertificateRequest(
@Json(name = "PIN")
val pin: String,
@Json(name = "TokenKey")
val tokenKey: String,
@Json(name = "AppVersion")
val appVersion: String = MOBILE_APP_VERSION,
@Json(name = "DeviceId")
val deviceId: String = UUID.randomUUID().toString(),
@Json(name = "DeviceName")
val deviceName: String,
@Json(name = "DeviceNameUser")
val deviceNameUser: String = "",
@Json(name = "DeviceDescription")
val deviceDescription: String = "",
@Json(name = "DeviceSystemType")
val deviceSystemType: String = "Android",
@Json(name = "DeviceSystemVersion")
val deviceSystemVersion: String = "8.1.0",
@Json(name = "FirebaseTokenKey")
val firebaseToken: String
) : ApiRequest()

View file

@ -1,26 +0,0 @@
package io.github.wulkanowy.sdk.mobile.register
import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
@JsonClass(generateAdapter = true)
data class CertificateResponse(
@Json(name = "IsError")
val isError: Boolean,
@Json(name = "IsMessageForUser")
val isMessageForUser: Boolean,
@Json(name = "Message")
val message: String?,
@Json(name = "TokenKey")
val tokenKey: String?,
@Json(name = "TokenStatus")
val tokenStatus: String?,
@Json(name = "TokenCert")
val tokenCert: TokenCert?
)

Some files were not shown because too many files have changed in this diff Show more