mirror of
https://github.com/classchartsapi/classcharts-api-js.git
synced 2026-05-14 11:58:13 +00:00
feat: format using biomejs
This commit is contained in:
parent
602529171f
commit
778e5e3fe4
16 changed files with 1077 additions and 1000 deletions
33
.devcontainer/devcontainer.json
Normal file
33
.devcontainer/devcontainer.json
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
|
||||
{
|
||||
"name": "Node.js & TypeScript",
|
||||
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
||||
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
|
||||
"features": {
|
||||
"ghcr.io/devcontainers-contrib/features/deno:1": {}
|
||||
},
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
"biomejs.biome",
|
||||
"denoland.vscode-deno"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||
// "features": {},
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
// "forwardPorts": [],
|
||||
|
||||
// Use 'postCreateCommand' to run commands after the container is created.
|
||||
// "postCreateCommand": "yarn install",
|
||||
|
||||
// Configure tool-specific properties.
|
||||
// "customizations": {},
|
||||
|
||||
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||
// "remoteUser": "root"
|
||||
}
|
||||
4
.vscode/extensions.json
vendored
4
.vscode/extensions.json
vendored
|
|
@ -1,5 +1,3 @@
|
|||
{
|
||||
"recommendations": [
|
||||
"denoland.vscode-deno"
|
||||
]
|
||||
"recommendations": ["denoland.vscode-deno", "biomejs.biome"]
|
||||
}
|
||||
|
|
|
|||
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
|
@ -1,4 +1,4 @@
|
|||
{
|
||||
"deno.enable": true,
|
||||
"deno.lint": true
|
||||
"deno.lint": false
|
||||
}
|
||||
|
|
|
|||
15
biome.json
Normal file
15
biome.json
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.4.0/schema.json",
|
||||
"organizeImports": {
|
||||
"enabled": true
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true
|
||||
}
|
||||
},
|
||||
"files": {
|
||||
"ignore": [".devcontainer/*", "npm/*", "deno.lock"]
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
{
|
||||
"tasks": {
|
||||
"npm": "deno run -A scripts/build_npm.ts"
|
||||
"npm": "deno run -A scripts/build_npm.ts",
|
||||
"format": "deno run -A npm:@biomejs/biome format . --write",
|
||||
"lint": "deno run -A npm:@biomejs/biome lint ."
|
||||
},
|
||||
"exclude": ["npm"]
|
||||
}
|
||||
|
|
|
|||
44
deno.lock
generated
44
deno.lock
generated
|
|
@ -1,5 +1,47 @@
|
|||
{
|
||||
"version": "2",
|
||||
"version": "3",
|
||||
"packages": {
|
||||
"specifiers": {
|
||||
"npm:@biomejs/biome": "npm:@biomejs/biome@1.4.0"
|
||||
},
|
||||
"npm": {
|
||||
"@biomejs/biome@1.4.0": {
|
||||
"integrity": "sha512-/rDlao6ra38nhxo4IYCqWCzfTJcpMk4YHjSVBI9yN/ifdhnzSwirL25xDVH7G9hZdNhpF9g78FaPJhFa9DX0Cw==",
|
||||
"dependencies": {
|
||||
"@biomejs/cli-darwin-arm64": "@biomejs/cli-darwin-arm64@1.4.0",
|
||||
"@biomejs/cli-darwin-x64": "@biomejs/cli-darwin-x64@1.4.0",
|
||||
"@biomejs/cli-linux-arm64": "@biomejs/cli-linux-arm64@1.4.0",
|
||||
"@biomejs/cli-linux-x64": "@biomejs/cli-linux-x64@1.4.0",
|
||||
"@biomejs/cli-win32-arm64": "@biomejs/cli-win32-arm64@1.4.0",
|
||||
"@biomejs/cli-win32-x64": "@biomejs/cli-win32-x64@1.4.0"
|
||||
}
|
||||
},
|
||||
"@biomejs/cli-darwin-arm64@1.4.0": {
|
||||
"integrity": "sha512-nBrtVRwr4IlTtxLOHwBwLv1sWvggf9/DnT5/ALIANJZOpoING6u8jHWipods69wK8kGa8Ld7iwHm3W5BrJJFFQ==",
|
||||
"dependencies": {}
|
||||
},
|
||||
"@biomejs/cli-darwin-x64@1.4.0": {
|
||||
"integrity": "sha512-nny0VgOj3ksUGzU5GblgtQEvrAZFgFe1IJBoYOP978OQdDrg7BpS+GX5udfof87Dl4ZlHPRBU951ceHOxF7BTg==",
|
||||
"dependencies": {}
|
||||
},
|
||||
"@biomejs/cli-linux-arm64@1.4.0": {
|
||||
"integrity": "sha512-gyLkT/Yh9xfW1T9yjQs/2txkCeG0e+LRs0adLugMwN0ptcNTRyusBvUoiHnpB+9rS6hWu9ZCedGMNmKQ8v2GSw==",
|
||||
"dependencies": {}
|
||||
},
|
||||
"@biomejs/cli-linux-x64@1.4.0": {
|
||||
"integrity": "sha512-LIxTuU2zSbIHM9XDYjQphJ5UU8h2eS7yR8uIvGYSba7Qt9AKqfbenyVJTsVnoj1CXxxgKNVSc/wVmlOlGz5DBQ==",
|
||||
"dependencies": {}
|
||||
},
|
||||
"@biomejs/cli-win32-arm64@1.4.0": {
|
||||
"integrity": "sha512-U2jT1/0wZLJIRqnU8qHAfi/A/+yUwlL3sYJgqs+wO0BbR22WGQZlj03u5FdpEoyLXdsLv1pbeIcjNp+V0NYXWA==",
|
||||
"dependencies": {}
|
||||
},
|
||||
"@biomejs/cli-win32-x64@1.4.0": {
|
||||
"integrity": "sha512-gN6DgyyBxIwoCovAUFJHFWVallb0cLosayDRtNyxU3MDv/atZxSXOWQezfVKBIbgmFPxYWJObd+awvbPYXwwww==",
|
||||
"dependencies": {}
|
||||
}
|
||||
}
|
||||
},
|
||||
"remote": {
|
||||
"https://deno.land/std@0.140.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74",
|
||||
"https://deno.land/std@0.140.0/_util/os.ts": "3b4c6e27febd119d36a416d7a97bd3b0251b77c88942c8f16ee5953ea13e2e49",
|
||||
|
|
|
|||
|
|
@ -6,13 +6,16 @@ if (!Deno.args[0]) throw new Error("No version specified");
|
|||
await emptyDir("./npm");
|
||||
|
||||
await build({
|
||||
entryPoints: [{
|
||||
entryPoints: [
|
||||
{
|
||||
name: ".",
|
||||
path: "./mod.ts",
|
||||
}, {
|
||||
},
|
||||
{
|
||||
name: "./types",
|
||||
path: "./src/types.ts",
|
||||
}],
|
||||
},
|
||||
],
|
||||
outDir: "./npm",
|
||||
importMap: "./deno.jsonc",
|
||||
shims: {
|
||||
|
|
|
|||
|
|
@ -287,11 +287,7 @@ export class BaseClient {
|
|||
options?.from && params.append("from", options?.from);
|
||||
options?.to && params.append("to", options?.to);
|
||||
return await this.makeAuthedRequest(
|
||||
this.API_BASE +
|
||||
"/attendance/" +
|
||||
this.studentId +
|
||||
"?" +
|
||||
params.toString(),
|
||||
this.API_BASE + "/attendance/" + this.studentId + "?" + params.toString(),
|
||||
{
|
||||
method: "GET",
|
||||
},
|
||||
|
|
|
|||
|
|
@ -102,17 +102,12 @@ export class ParentClient extends BaseClient {
|
|||
formData.append("current", currentPassword);
|
||||
formData.append("new", newPassword);
|
||||
formData.append("repeat", newPassword);
|
||||
return (
|
||||
await this.makeAuthedRequest(
|
||||
this.API_BASE + "/password",
|
||||
{
|
||||
return await this.makeAuthedRequest(this.API_BASE + "/password", {
|
||||
method: "POST",
|
||||
body: formData,
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded",
|
||||
},
|
||||
},
|
||||
)
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,13 +70,11 @@ export class StudentClient extends BaseClient {
|
|||
* @returns Array of purchasable items
|
||||
*/
|
||||
async getRewards(): Promise<RewardsResponse> {
|
||||
return (
|
||||
await this.makeAuthedRequest(
|
||||
return await this.makeAuthedRequest(
|
||||
this.API_BASE + "/rewards/" + this.studentId,
|
||||
{
|
||||
method: "GET",
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -86,15 +84,10 @@ export class StudentClient extends BaseClient {
|
|||
* @returns An object containing the current student's balance and item ID purchased
|
||||
*/
|
||||
async purchaseReward(itemId: number): Promise<RewardPurchaseResponse> {
|
||||
return (
|
||||
await this.makeAuthedRequest(
|
||||
this.API_BASE + "/purchase/" + itemId,
|
||||
{
|
||||
return await this.makeAuthedRequest(this.API_BASE + "/purchase/" + itemId, {
|
||||
method: "POST",
|
||||
body: `pupil_id=${this.studentId}`,
|
||||
},
|
||||
)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue