Skip to content

Commit ba7e82b

Browse files
committed
feat: add v1 public api
1 parent 9f83114 commit ba7e82b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1952
-275
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## 0.0.6 - 2026-01-07
4+
5+
### Added
6+
- API: v1 public REST endpoints with rate limits, raw file fetch, and OpenAPI spec.
7+
- Docs: `docs/api.md` and `DEPRECATIONS.md` for the v1 cutover plan.
8+
9+
### Changed
10+
- CLI: publish now uses single multipart `POST /api/v1/skills`.
11+
- Registry: legacy `/api/*` + `/api/cli/*` marked for deprecation (kept for now).
12+
313
## 0.0.5 - 2026-01-06
414

515
### Added

DEPRECATIONS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Deprecations
2+
3+
## Legacy /api routes (pre-v1)
4+
5+
- Deprecated: 2026-01-07
6+
- TODO: remove legacy `/api/*` and `/api/cli/*` routes after clients migrate to `/api/v1`.
7+
- Legacy handlers live in `convex/http.ts` and `convex/httpApi.ts`.

convex/_generated/api.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import type * as comments from "../comments.js";
1313
import type * as downloads from "../downloads.js";
1414
import type * as http from "../http.js";
1515
import type * as httpApi from "../httpApi.js";
16+
import type * as httpApiV1 from "../httpApiV1.js";
1617
import type * as lib_access from "../lib/access.js";
1718
import type * as lib_apiTokenAuth from "../lib/apiTokenAuth.js";
1819
import type * as lib_changelog from "../lib/changelog.js";
@@ -23,6 +24,7 @@ import type * as lib_skills from "../lib/skills.js";
2324
import type * as lib_tokens from "../lib/tokens.js";
2425
import type * as lib_webhooks from "../lib/webhooks.js";
2526
import type * as maintenance from "../maintenance.js";
27+
import type * as rateLimits from "../rateLimits.js";
2628
import type * as search from "../search.js";
2729
import type * as skills from "../skills.js";
2830
import type * as stars from "../stars.js";
@@ -44,6 +46,7 @@ declare const fullApi: ApiFromModules<{
4446
downloads: typeof downloads;
4547
http: typeof http;
4648
httpApi: typeof httpApi;
49+
httpApiV1: typeof httpApiV1;
4750
"lib/access": typeof lib_access;
4851
"lib/apiTokenAuth": typeof lib_apiTokenAuth;
4952
"lib/changelog": typeof lib_changelog;
@@ -54,6 +57,7 @@ declare const fullApi: ApiFromModules<{
5457
"lib/tokens": typeof lib_tokens;
5558
"lib/webhooks": typeof lib_webhooks;
5659
maintenance: typeof maintenance;
60+
rateLimits: typeof rateLimits;
5761
search: typeof search;
5862
skills: typeof skills;
5963
stars: typeof stars;

convex/http.ts

Lines changed: 73 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ApiRoutes } from 'clawdhub-schema'
1+
import { ApiRoutes, LegacyApiRoutes } from 'clawdhub-schema'
22
import { httpRouter } from 'convex/server'
33
import { auth } from './auth'
44
import { downloadZip } from './downloads'
@@ -13,6 +13,16 @@ import {
1313
resolveSkillVersionHttp,
1414
searchSkillsHttp,
1515
} from './httpApi'
16+
import {
17+
listSkillsV1Http,
18+
publishSkillV1Http,
19+
resolveSkillVersionV1Http,
20+
searchSkillsV1Http,
21+
skillsDeleteRouterV1Http,
22+
skillsGetRouterV1Http,
23+
skillsPostRouterV1Http,
24+
whoamiV1Http,
25+
} from './httpApiV1'
1626

1727
const http = httpRouter()
1828

@@ -27,53 +37,107 @@ http.route({
2737
http.route({
2838
path: ApiRoutes.search,
2939
method: 'GET',
40+
handler: searchSkillsV1Http,
41+
})
42+
43+
http.route({
44+
path: ApiRoutes.resolve,
45+
method: 'GET',
46+
handler: resolveSkillVersionV1Http,
47+
})
48+
49+
http.route({
50+
path: ApiRoutes.skills,
51+
method: 'GET',
52+
handler: listSkillsV1Http,
53+
})
54+
55+
http.route({
56+
pathPrefix: `${ApiRoutes.skills}/`,
57+
method: 'GET',
58+
handler: skillsGetRouterV1Http,
59+
})
60+
61+
http.route({
62+
path: ApiRoutes.skills,
63+
method: 'POST',
64+
handler: publishSkillV1Http,
65+
})
66+
67+
http.route({
68+
pathPrefix: `${ApiRoutes.skills}/`,
69+
method: 'POST',
70+
handler: skillsPostRouterV1Http,
71+
})
72+
73+
http.route({
74+
pathPrefix: `${ApiRoutes.skills}/`,
75+
method: 'DELETE',
76+
handler: skillsDeleteRouterV1Http,
77+
})
78+
79+
http.route({
80+
path: ApiRoutes.whoami,
81+
method: 'GET',
82+
handler: whoamiV1Http,
83+
})
84+
85+
// TODO: remove legacy /api routes after deprecation window.
86+
http.route({
87+
path: LegacyApiRoutes.download,
88+
method: 'GET',
89+
handler: downloadZip,
90+
})
91+
http.route({
92+
path: LegacyApiRoutes.search,
93+
method: 'GET',
3094
handler: searchSkillsHttp,
3195
})
3296

3397
http.route({
34-
path: ApiRoutes.skill,
98+
path: LegacyApiRoutes.skill,
3599
method: 'GET',
36100
handler: getSkillHttp,
37101
})
38102

39103
http.route({
40-
path: ApiRoutes.skillResolve,
104+
path: LegacyApiRoutes.skillResolve,
41105
method: 'GET',
42106
handler: resolveSkillVersionHttp,
43107
})
44108

45109
http.route({
46-
path: ApiRoutes.cliWhoami,
110+
path: LegacyApiRoutes.cliWhoami,
47111
method: 'GET',
48112
handler: cliWhoamiHttp,
49113
})
50114

51115
http.route({
52-
path: ApiRoutes.cliUploadUrl,
116+
path: LegacyApiRoutes.cliUploadUrl,
53117
method: 'POST',
54118
handler: cliUploadUrlHttp,
55119
})
56120

57121
http.route({
58-
path: ApiRoutes.cliPublish,
122+
path: LegacyApiRoutes.cliPublish,
59123
method: 'POST',
60124
handler: cliPublishHttp,
61125
})
62126

63127
http.route({
64-
path: ApiRoutes.cliTelemetrySync,
128+
path: LegacyApiRoutes.cliTelemetrySync,
65129
method: 'POST',
66130
handler: cliTelemetrySyncHttp,
67131
})
68132

69133
http.route({
70-
path: ApiRoutes.cliSkillDelete,
134+
path: LegacyApiRoutes.cliSkillDelete,
71135
method: 'POST',
72136
handler: cliSkillDeleteHttp,
73137
})
74138

75139
http.route({
76-
path: ApiRoutes.cliSkillUndelete,
140+
path: LegacyApiRoutes.cliSkillUndelete,
77141
method: 'POST',
78142
handler: cliSkillUndeleteHttp,
79143
})

0 commit comments

Comments
 (0)