Initialize Aidoit v0.1 monorepo
CI / frontend (push) Canceled after 0s
CI / api (push) Canceled after 0s

This commit is contained in:
Pavel Kerndl
2026-07-27 18:27:37 +02:00
commit c0b013f067
65 changed files with 1323 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
{
"name": "@aidoit/sdk",
"version": "0.1.0",
"private": true,
"type": "module",
"exports": {
".": "./src/index.ts"
},
"scripts": {
"build": "tsc --noEmit",
"lint": "tsc --noEmit",
"typecheck": "tsc --noEmit",
"test": "echo \"No SDK tests yet\""
},
"dependencies": {
"@aidoit/contracts": "workspace:*"
},
"devDependencies": {
"@aidoit/config": "workspace:*",
"typescript": "^5.8.0"
}
}
+36
View File
@@ -0,0 +1,36 @@
import type { CreateProjectRequest, Project } from "@aidoit/contracts";
export class AidoitClient {
public constructor(
private readonly baseUrl: string,
private readonly token?: string,
) {}
private async request<T>(path: string, init?: RequestInit): Promise<T> {
const response = await fetch(`${this.baseUrl}${path}`, {
...init,
headers: {
"Content-Type": "application/json",
...(this.token ? { Authorization: `Bearer ${this.token}` } : {}),
...init?.headers,
},
});
if (!response.ok) {
throw new Error(`Aidoit API request failed: ${response.status}`);
}
return response.json() as Promise<T>;
}
public listProjects(): Promise<Project[]> {
return this.request<Project[]>("/api/v1/projects");
}
public createProject(payload: CreateProjectRequest): Promise<Project> {
return this.request<Project>("/api/v1/projects", {
method: "POST",
body: JSON.stringify(payload),
});
}
}
+4
View File
@@ -0,0 +1,4 @@
{
"extends": "@aidoit/config/base.json",
"include": ["src"]
}