Skip to content

Commit 7947ac9

Browse files
committed
feat: rewrite project in typescript and support cjs and esm
1 parent 479c60b commit 7947ac9

File tree

112 files changed

+14121
-42704
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+14121
-42704
lines changed

.jsdoc.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

.npmignore

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ test.mjs
33
.gitignore
44
.git
55
.idea/
6-
docs/
76
.DS_Store
87
.DS_store
9-
linkDocs.js
10-
.jsdoc.json
118
.env
129
test2.js
13-
.vscode
10+
.vscode
11+
typedoc.json
12+
test.js
13+
jest.config.js
14+
__tests__

Base64.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

License

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1-
Copyright 2019 Nils Bergmann
1+
MIT License
22

3-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3+
Copyright (c) 2022 Nils Bergmann
44

5-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
611

7-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Readme.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# WebUntis API
1+
# Base API
22

3-
This is a NodeJS Wrapper for the JSON RPC WebUntis API.
3+
This is a NodeJS Wrapper for the JSON RPC Base API.
44

55
The Documentation is available at [https://webuntis.noim.me/](https://webuntis.noim.me/)
66

@@ -11,9 +11,9 @@ In case you need the Untis API Spec (pdf) where those JSON responses are explain
1111
### User/Password Login
1212

1313
```javascript
14-
const WebUntis = require('webuntis');
14+
const Base = require('webuntis');
1515

16-
const untis = new WebUntis('school', 'username', 'password', 'xyz.webuntis.com');
16+
const untis = new Base('school', 'username', 'password', 'xyz.webuntis.com');
1717

1818
untis
1919
.login()
@@ -98,13 +98,3 @@ npm i webuntis --save
9898
### Notice
9999

100100
I am not affiliated with Untis GmbH. Use this at your own risk.
101-
102-
### License
103-
104-
Copyright 2019 Nils Bergmann
105-
106-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
107-
108-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
109-
110-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

__tests__/index.test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const MockAdapter = require('axios-mock-adapter');
22
const axios = require('axios');
33
const cases = require('jest-in-case');
4-
const WebUntis = require('../index');
4+
const { WebUntis } = require('../dist/webuntis.js');
55

66
const mockAxios = new MockAdapter(axios);
77
const mockResponse = {
@@ -652,8 +652,7 @@ cases(
652652
cases(
653653
'should convertDateToUntis converted date',
654654
({ date, result }) => {
655-
const untis = createInstance();
656-
expect(untis.convertDateToUntis(new Date(date))).toBe(result);
655+
expect(WebUntis.convertDateToUntis(new Date(date))).toBe(result);
657656
},
658657
[
659658
{ name: 'default', date: '11/13/2019', result: '20191113' },

0 commit comments

Comments
 (0)