Code Cleanup™

This commit is contained in:
2024-02-11 11:16:23 +01:00
parent 4b27eb76fe
commit 9fd8ddb9bd
62 changed files with 663 additions and 519 deletions

View File

@@ -18,12 +18,13 @@
*/
import {fetchWithToken, tokenStore} from "./repo.ts";
import type {SchematicCode, SchematicInfo, SchematicList} from "@type/schem.ts";
import {SchematicCodeSchema, SchematicInfoSchema, SchematicListSchema} from "@type/schem.ts";
import type {SchematicInfo, SchematicList} from "@type/schem.ts";
import {SchematicInfoSchema, SchematicListSchema} from "@type/schem.ts";
import {derived} from "svelte/store";
export class SchematicRepo {
constructor(private token: string) {}
constructor(private token: string) {
}
public async getRootSchematicList(): Promise<SchematicList> {
return await fetchWithToken(this.token, "/schem").then(value => value.json()).then(SchematicListSchema.parse);
@@ -42,8 +43,8 @@ export class SchematicRepo {
method: "POST",
body: JSON.stringify({
name,
content
})
content,
}),
});
}
}