Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/drafts-cutover-remove-dao-routes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@anticapture/api": minor
"@anticapture/gateful": minor
Comment on lines +2 to +3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark removed REST routes as major

Because this commit removes /{dao}/proposal/drafts* from the DAO API and therefore from Gateful's OpenAPI surface, keeping @anticapture/api and @anticapture/gateful at minor lets release automation publish a non-breaking version even though REST clients calling those endpoints will fail after deploy. Please make these package changesets major as well; the generated client is already correctly marked major.

Useful? React with 👍 / 👎.

"@anticapture/client": major
---

Remove the draft-proposal endpoints from the DAO APIs — drafts now live in the User API (user-scoped, session-authenticated). The `/{dao}/proposal/drafts*` routes, their controller/service/repository/mappers, and the `general` Postgres schema wiring are gone from `@anticapture/api`; the gateway spec and the generated `@anticapture/client` SDK no longer expose any `Draft*` fetchers, hooks, MCP tools, or models (breaking for external SDK consumers). The physical `general.proposal_drafts` table is left intact in each DAO database for the one-shot migration into the User API; a follow-up drops it.
25 changes: 0 additions & 25 deletions apps/api/cmd/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { serve } from "@hono/node-server";
import { OpenAPIHono as Hono } from "@hono/zod-openapi";
import { HTTPException } from "hono/http-exception";
import { drizzle } from "drizzle-orm/node-postgres";
import { migrate } from "drizzle-orm/node-postgres/migrator";
import { createPublicClient, http } from "viem";
import { fromZodError } from "zod-validation-error";
import { DaoCache } from "@/cache/dao-cache";
Expand All @@ -17,7 +16,6 @@ import {
accountInteractions,
dao,
delegationPercentage,
draftProposals,
governanceActivity,
historicalBalances,
historicalVotingPower,
Expand All @@ -44,7 +42,6 @@ import {
health,
revenue,
} from "@/controllers";
import * as generalSchema from "@/database/general-schema";
import * as offchainSchema from "@/database/offchain-schema";
import * as schema from "@/database/schema";
import { docs } from "@/docs";
Expand All @@ -61,7 +58,6 @@ import {
AccountInteractionsRepository,
BalanceVariationsRepository,
DaoMetricsDayBucketRepository,
DraftProposalsRepository,
DrizzleProposalsActivityRepository,
DrizzleRepository,
HealthRepositoryImpl,
Expand Down Expand Up @@ -89,7 +85,6 @@ import {
CoingeckoService,
DaoService,
DelegationPercentageService,
DraftProposalsService,
HealthService,
HistoricalBalancesService,
NFTPriceService,
Expand Down Expand Up @@ -186,17 +181,6 @@ const pgClient = drizzle(env.DATABASE_URL, {
casing: "snake_case",
});

const pgGeneralClient = drizzle(env.DATABASE_URL, {
schema: generalSchema,
casing: "snake_case",
});

await migrate(pgGeneralClient, {
migrationsFolder: "./drizzle",
migrationsSchema: "general",
});
logger.info("database migrations completed");

health(app, new HealthService(new HealthRepositoryImpl(pgClient), daoClient));

const daoConfig = CONTRACT_ADDRESSES[env.DAO_ID];
Expand Down Expand Up @@ -363,15 +347,6 @@ votes(
),
);
dao(app, daoService);
draftProposals(
app,
wrapWithTracing(
new DraftProposalsService(
wrapWithTracing(new DraftProposalsRepository(pgGeneralClient)),
),
),
env.DAO_ID.toLowerCase(),
);
docs(app);
tokenMetrics(app, tokenMetricsService);

Expand Down
11 changes: 0 additions & 11 deletions apps/api/drizzle.config.ts

This file was deleted.

20 changes: 0 additions & 20 deletions apps/api/drizzle/0000_large_mac_gargan.sql

This file was deleted.

123 changes: 0 additions & 123 deletions apps/api/drizzle/meta/0000_snapshot.json

This file was deleted.

13 changes: 0 additions & 13 deletions apps/api/drizzle/meta/_journal.json

This file was deleted.

5 changes: 1 addition & 4 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
"build:watch": "tsc --watch",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"dev": "tsx watch cmd/index.ts",
"db:push": "drizzle-kit push",
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate"
"dev": "tsx watch cmd/index.ts"
},
"keywords": [],
"author": "",
Expand Down
Loading
Loading