Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

chore: remove @multica/fetch package

Naiyuan Qinga62ac2e07539
diff --git a/packages/fetch/package.json b/packages/fetch/package.json
deleted file mode 100644
index d5bd69713f..0000000000
--- a/packages/fetch/package.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "name": "@multica/fetch",
- "version": "0.1.0",
- "private": true,
- "type": "module",
- "exports": {
- ".": "./src/index.ts",
- "./*": "./src/*.ts"
- },
- "devDependencies": {
- "typescript": "catalog:"
- }
-}
diff --git a/packages/fetch/src/config.ts b/packages/fetch/src/config.ts
deleted file mode 100644
index ff2abde9e2..0000000000
--- a/packages/fetch/src/config.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-let consoleUrl = "http://localhost:4000"
-let gatewayUrl = "http://localhost:3000"
-
-export function setConfig(config: { consoleUrl?: string; gatewayUrl?: string }) {
- if (config.consoleUrl) consoleUrl = config.consoleUrl
- if (config.gatewayUrl) gatewayUrl = config.gatewayUrl
-}
-
-export function getConsoleUrl(): string {
- return consoleUrl
-}
-
-export function getGatewayUrl(): string {
- return gatewayUrl
-}
diff --git a/packages/fetch/src/http-client.ts b/packages/fetch/src/http-client.ts
deleted file mode 100644
index e9564d09c4..0000000000
--- a/packages/fetch/src/http-client.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { getConsoleUrl } from "./config"
-
-export class HttpError extends Error {
- constructor(
- public status: number,
- public statusText: string,
- ) {
- super(`HTTP ${status}: ${statusText}`)
- }
-}
-
-async function request<T>(method: string, path: string, body?: unknown): Promise<T> {
- const res = await fetch(`${getConsoleUrl()}${path}`, {
- method,
- headers: body ? { "Content-Type": "application/json" } : undefined,
- body: body ? JSON.stringify(body) : undefined,
- })
- if (!res.ok) throw new HttpError(res.status, res.statusText)
- return res.json()
-}
-
-/** Console REST API */
-export const consoleApi = {
- get: <T>(path: string) => request<T>("GET", path),
- post: <T>(path: string, body?: unknown) => request<T>("POST", path, body),
- put: <T>(path: string, body: unknown) => request<T>("PUT", path, body),
- delete: <T>(path: string) => request<T>("DELETE", path),
-}
diff --git a/packages/fetch/src/index.ts b/packages/fetch/src/index.ts
deleted file mode 100644
index 8500fa0484..0000000000
--- a/packages/fetch/src/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-export { setConfig, getConsoleUrl, getGatewayUrl } from "./config"
-export { consoleApi, HttpError } from "./http-client"
diff --git a/packages/fetch/tsconfig.json b/packages/fetch/tsconfig.json
deleted file mode 100644
index c110321005..0000000000
--- a/packages/fetch/tsconfig.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "compilerOptions": {
- "target": "ESNext",
- "module": "ESNext",
- "moduleResolution": "bundler",
- "strict": true,
- "esModuleInterop": true,
- "skipLibCheck": true,
- "declaration": true,
- "outDir": "./dist",
- "rootDir": "./src"
- },
- "include": ["src"]
-}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index c576814f56..0fc53dafaa 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -258,12 +258,6 @@ importers:
specifier: 'catalog:'
version: 5.9.3
- packages/fetch:
- devDependencies:
- typescript:
- specifier: 'catalog:'
- version: 5.9.3
-
packages/sdk:
dependencies:
socket.io-client: