mirror of
https://github.com/classchartsapi/classcharts-api-js.git
synced 2026-05-14 11:58:13 +00:00
chore: pnpm
This commit is contained in:
parent
18c80a13b9
commit
67fe788090
4 changed files with 33 additions and 87 deletions
66
package-lock.json
generated
66
package-lock.json
generated
|
|
@ -1,66 +0,0 @@
|
||||||
{
|
|
||||||
"name": "classcharts-api",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"lockfileVersion": 2,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {
|
|
||||||
"": {
|
|
||||||
"name": "classcharts-api",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"undici": "^4.9.1"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "^16.11.6",
|
|
||||||
"typescript": "^4.4.4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@types/node": {
|
|
||||||
"version": "16.11.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz",
|
|
||||||
"integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"node_modules/typescript": {
|
|
||||||
"version": "4.4.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz",
|
|
||||||
"integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==",
|
|
||||||
"dev": true,
|
|
||||||
"bin": {
|
|
||||||
"tsc": "bin/tsc",
|
|
||||||
"tsserver": "bin/tsserver"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=4.2.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/undici": {
|
|
||||||
"version": "4.9.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/undici/-/undici-4.9.1.tgz",
|
|
||||||
"integrity": "sha512-2idBVoUuxp5ByT15DDs3BjmU278D9gr6gDh3tNwOMw8TiHfueq+qHdhHHj8vNIi1UTTmn1cxL2VF3ONry+eS2w==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12.18"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@types/node": {
|
|
||||||
"version": "16.11.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.6.tgz",
|
|
||||||
"integrity": "sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"typescript": {
|
|
||||||
"version": "4.4.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz",
|
|
||||||
"integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==",
|
|
||||||
"dev": true
|
|
||||||
},
|
|
||||||
"undici": {
|
|
||||||
"version": "4.9.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/undici/-/undici-4.9.1.tgz",
|
|
||||||
"integrity": "sha512-2idBVoUuxp5ByT15DDs3BjmU278D9gr6gDh3tNwOMw8TiHfueq+qHdhHHj8vNIi1UTTmn1cxL2VF3ONry+eS2w=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -7,13 +7,12 @@
|
||||||
},
|
},
|
||||||
"main": "./index.js",
|
"main": "./index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"prepublishOnly": "pnpm tsc && node dist/release.js"
|
||||||
"prepublishOnly": "npx tsc && node dist/release.js"
|
|
||||||
},
|
},
|
||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici": "^4.9.1"
|
"undici": "^4.9.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^16.11.6",
|
"@types/node": "^16.11.6",
|
||||||
|
|
|
||||||
30
pnpm-lock.yaml
generated
Normal file
30
pnpm-lock.yaml
generated
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
lockfileVersion: 5.3
|
||||||
|
|
||||||
|
specifiers:
|
||||||
|
'@types/node': ^16.11.6
|
||||||
|
typescript: ^4.4.4
|
||||||
|
undici: ^4.9.2
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
undici: 4.9.2
|
||||||
|
|
||||||
|
devDependencies:
|
||||||
|
'@types/node': 16.11.6
|
||||||
|
typescript: 4.4.4
|
||||||
|
|
||||||
|
packages:
|
||||||
|
|
||||||
|
/@types/node/16.11.6:
|
||||||
|
resolution: {integrity: sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==}
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/typescript/4.4.4:
|
||||||
|
resolution: {integrity: sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==}
|
||||||
|
engines: {node: '>=4.2.0'}
|
||||||
|
hasBin: true
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/undici/4.9.2:
|
||||||
|
resolution: {integrity: sha512-O8D4fp0cT7/bOMe7XE2oc0PaBCyc0GsahzQ+nMSeWW0o0+EB2ykXYNhU0kY2nKP589zzS91pLj979NtJrBRwFQ==}
|
||||||
|
engines: {node: '>=12.18'}
|
||||||
|
dev: false
|
||||||
|
|
@ -82,11 +82,6 @@ export class ClasschartsClient {
|
||||||
this.studentId = user.id
|
this.studentId = user.id
|
||||||
this.studentName = user.name
|
this.studentName = user.name
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @returns {Promise<Student>}
|
|
||||||
*/
|
|
||||||
async getStudentInfo(): Promise<Student> {
|
async getStudentInfo(): Promise<Student> {
|
||||||
if (!this.authCookies) throw new Error('Not authenticated')
|
if (!this.authCookies) throw new Error('Not authenticated')
|
||||||
const data = await this.makeAuthedRequest(API_BASE + '/ping', {
|
const data = await this.makeAuthedRequest(API_BASE + '/ping', {
|
||||||
|
|
@ -122,13 +117,6 @@ export class ClasschartsClient {
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Gets all the homework from
|
|
||||||
* @param displayDate {DisplayDate}
|
|
||||||
* @param fromDate
|
|
||||||
* @param toDate
|
|
||||||
* @returns {Promise<Array<Homework>>}
|
|
||||||
*/
|
|
||||||
async listHomeworks(
|
async listHomeworks(
|
||||||
options: GetHomeworkOptions | null
|
options: GetHomeworkOptions | null
|
||||||
): Promise<HomeworksResponse> {
|
): Promise<HomeworksResponse> {
|
||||||
|
|
@ -154,11 +142,6 @@ export class ClasschartsClient {
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param date
|
|
||||||
* @returns {Promise<LessonsResponse>}
|
|
||||||
*/
|
|
||||||
async getLessons(options: GetLessonsOptions): Promise<LessonsResponse> {
|
async getLessons(options: GetLessonsOptions): Promise<LessonsResponse> {
|
||||||
if (!this.authCookies) throw new Error('Not authenticated')
|
if (!this.authCookies) throw new Error('Not authenticated')
|
||||||
if (!options?.date) throw new Error('No date specified')
|
if (!options?.date) throw new Error('No date specified')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue