Skip to content

Commit e835a00

Browse files
committed
docs: add summaries to various API endpoints for improved documentation
1 parent 586441e commit e835a00

File tree

15 files changed

+123
-1
lines changed

15 files changed

+123
-1
lines changed

src/server/trpc/routers/ai.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export const aiRouter = router({
116116
buildAIOpenapi({
117117
method: 'POST',
118118
path: '/classifySurvey',
119+
summary: 'Classify survey',
119120
description: 'classify survey',
120121
})
121122
)
@@ -162,6 +163,7 @@ export const aiRouter = router({
162163
buildAIOpenapi({
163164
method: 'POST',
164165
path: '/translateSurvey',
166+
summary: 'Translate survey',
165167
description: 'translate survey',
166168
})
167169
)

src/server/trpc/routers/aiGateway.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const aiGatewayRouter = router({
4040
path: '/workspace/{workspaceId}/aiGateway/all',
4141
tags: [OPENAPI_TAG.AI_GATEWAY],
4242
protect: true,
43+
summary: 'Get all gateways',
4344
},
4445
})
4546
.output(z.array(AIGatewayModelSchema))
@@ -70,6 +71,7 @@ export const aiGatewayRouter = router({
7071
buildAIGatewayOpenapi({
7172
method: 'GET',
7273
path: '/info',
74+
summary: 'Get gateway info',
7375
})
7476
)
7577
.input(
@@ -109,6 +111,7 @@ export const aiGatewayRouter = router({
109111
path: '/workspace/{workspaceId}/aiGateway/create',
110112
tags: [OPENAPI_TAG.APPLICATION],
111113
protect: true,
114+
summary: 'Create gateway',
112115
},
113116
})
114117
.input(aiGatewayCreateSchema)
@@ -152,6 +155,7 @@ export const aiGatewayRouter = router({
152155
buildAIGatewayOpenapi({
153156
method: 'PATCH',
154157
path: '/update',
158+
summary: 'Update gateway',
155159
})
156160
)
157161
.input(
@@ -207,6 +211,7 @@ export const aiGatewayRouter = router({
207211
buildAIGatewayOpenapi({
208212
method: 'DELETE',
209213
path: '/delete',
214+
summary: 'Delete gateway',
210215
})
211216
)
212217
.input(
@@ -242,6 +247,7 @@ export const aiGatewayRouter = router({
242247
buildAIGatewayOpenapi({
243248
method: 'GET',
244249
path: '/logs',
250+
summary: 'Get gateway logs',
245251
})
246252
)
247253
.input(
@@ -296,6 +302,7 @@ export const aiGatewayRouter = router({
296302
buildAIGatewayOpenapi({
297303
method: 'GET',
298304
path: '/model-pricing',
305+
summary: 'Get model pricing',
299306
})
300307
)
301308
.input(
@@ -432,6 +439,7 @@ export const aiGatewayRouter = router({
432439
buildAIGatewayOpenapi({
433440
method: 'GET',
434441
path: '/quota-alert',
442+
summary: 'Get quota alert',
435443
})
436444
)
437445
.input(
@@ -484,6 +492,7 @@ export const aiGatewayRouter = router({
484492
buildAIGatewayOpenapi({
485493
method: 'POST',
486494
path: '/quota-alert/upsert',
495+
summary: 'Upsert quota alert',
487496
})
488497
)
489498
.input(
@@ -543,6 +552,7 @@ export const aiGatewayRouter = router({
543552
buildAIGatewayOpenapi({
544553
method: 'DELETE',
545554
path: '/quota-alert/delete',
555+
summary: 'Delete quota alert',
546556
})
547557
)
548558
.input(

src/server/trpc/routers/application.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const applicationRouter = router({
3737
path: '/workspace/{workspaceId}/application/all',
3838
tags: [OPENAPI_TAG.APPLICATION],
3939
protect: true,
40+
summary: 'Get all applications',
4041
},
4142
})
4243
.output(z.array(ApplicationModelSchema))
@@ -61,6 +62,7 @@ export const applicationRouter = router({
6162
buildApplicationOpenapi({
6263
method: 'GET',
6364
path: '/info',
65+
summary: 'Get application info',
6466
})
6567
)
6668
.input(
@@ -99,6 +101,7 @@ export const applicationRouter = router({
99101
path: '/workspace/{workspaceId}/application/create',
100102
tags: [OPENAPI_TAG.APPLICATION],
101103
protect: true,
104+
summary: 'Create application',
102105
},
103106
})
104107
.input(applicationCreateSchema)
@@ -135,6 +138,7 @@ export const applicationRouter = router({
135138
buildApplicationOpenapi({
136139
method: 'PATCH',
137140
path: '/update',
141+
summary: 'Update application',
138142
})
139143
)
140144
.input(
@@ -182,6 +186,7 @@ export const applicationRouter = router({
182186
buildApplicationOpenapi({
183187
method: 'DELETE',
184188
path: '/delete',
189+
summary: 'Delete application',
185190
})
186191
)
187192
.input(
@@ -218,6 +223,7 @@ export const applicationRouter = router({
218223
protect: true,
219224
method: 'GET',
220225
path: `/application/storeAppSearch`,
226+
summary: 'Search store apps',
221227
},
222228
})
223229
.input(
@@ -246,6 +252,7 @@ export const applicationRouter = router({
246252
buildApplicationOpenapi({
247253
method: 'GET',
248254
path: '/storeInfoHistory',
255+
summary: 'Get store info history',
249256
})
250257
)
251258
.input(
@@ -299,6 +306,7 @@ export const applicationRouter = router({
299306
buildApplicationOpenapi({
300307
method: 'GET',
301308
path: '/eventStats',
309+
summary: 'Get event stats',
302310
})
303311
)
304312
.input(

src/server/trpc/routers/auditLog.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const auditLogRouter = router({
1717
buildAuditLogOpenapi({
1818
method: 'GET',
1919
path: '/fetchByCursor',
20+
summary: 'Fetch audit log',
2021
description: 'Fetch workspace audit log',
2122
})
2223
)
@@ -56,6 +57,7 @@ export const auditLogRouter = router({
5657
buildAuditLogOpenapi({
5758
method: 'DELETE',
5859
path: '/clear',
60+
summary: 'Clear audit log',
5961
description: 'clear all workspace audit log',
6062
})
6163
)

src/server/trpc/routers/billing.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const billingRouter = router({
3737
buildBillingOpenapi({
3838
method: 'GET',
3939
path: '/usage',
40+
summary: 'Get usage',
4041
description: 'get workspace usage',
4142
})
4243
)
@@ -65,6 +66,7 @@ export const billingRouter = router({
6566
buildBillingOpenapi({
6667
method: 'GET',
6768
path: '/limit',
69+
summary: 'Get limit',
6870
description: 'get workspace subscription limit',
6971
})
7072
)
@@ -80,6 +82,7 @@ export const billingRouter = router({
8082
buildBillingOpenapi({
8183
method: 'GET',
8284
path: '/currentTier',
85+
summary: 'Get current tier',
8386
description: 'get workspace current tier',
8487
})
8588
)
@@ -94,6 +97,7 @@ export const billingRouter = router({
9497
buildBillingOpenapi({
9598
method: 'GET',
9699
path: '/currentSubscription',
100+
summary: 'Get subscription',
97101
description: 'get workspace current subscription',
98102
})
99103
)
@@ -175,6 +179,7 @@ export const billingRouter = router({
175179
buildBillingOpenapi({
176180
method: 'GET',
177181
path: '/credit',
182+
summary: 'Get credit',
178183
description: 'get workspace credit balance',
179184
})
180185
)
@@ -194,6 +199,7 @@ export const billingRouter = router({
194199
buildBillingOpenapi({
195200
method: 'GET',
196201
path: '/credit/bills',
202+
summary: 'Get credit bills',
197203
description: 'list workspace credit bills',
198204
})
199205
)
@@ -228,6 +234,7 @@ export const billingRouter = router({
228234
buildBillingOpenapi({
229235
method: 'GET',
230236
path: '/credit/packs',
237+
summary: 'Get credit packs',
231238
description: 'list available credit packs',
232239
})
233240
)
@@ -256,6 +263,7 @@ export const billingRouter = router({
256263
buildBillingOpenapi({
257264
method: 'POST',
258265
path: '/credit/checkout',
266+
summary: 'Checkout credit',
259267
description: 'create credit checkout session',
260268
})
261269
)

src/server/trpc/routers/feed/index.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const feedRouter = router({
3737
buildFeedOpenapi({
3838
method: 'GET',
3939
path: '/channels',
40+
summary: 'Get all channels',
4041
})
4142
)
4243
.output(
@@ -77,6 +78,7 @@ export const feedRouter = router({
7778
buildFeedOpenapi({
7879
method: 'GET',
7980
path: '/{channelId}/info',
81+
summary: 'Get channel info',
8082
})
8183
)
8284
.input(
@@ -123,6 +125,7 @@ export const feedRouter = router({
123125
buildFeedOpenapi({
124126
method: 'POST',
125127
path: '/{channelId}/update',
128+
summary: 'Update channel',
126129
})
127130
)
128131
.input(
@@ -187,6 +190,7 @@ export const feedRouter = router({
187190
buildFeedOpenapi({
188191
method: 'GET',
189192
path: '/{channelId}/fetchEventsByCursor',
193+
summary: 'Fetch events',
190194
description: 'Fetch workspace feed channel events',
191195
})
192196
)
@@ -344,6 +348,7 @@ export const feedRouter = router({
344348
buildFeedOpenapi({
345349
method: 'POST',
346350
path: '/createChannel',
351+
summary: 'Create channel',
347352
})
348353
)
349354
.input(
@@ -410,6 +415,7 @@ export const feedRouter = router({
410415
buildFeedOpenapi({
411416
method: 'POST',
412417
path: '/{channelId}/refreshPublicShare',
418+
summary: 'Refresh public share',
413419
description: 'Regenerate public share id for feed channel',
414420
})
415421
)
@@ -446,6 +452,7 @@ export const feedRouter = router({
446452
buildFeedOpenapi({
447453
method: 'POST',
448454
path: '/{channelId}/disablePublicShare',
455+
summary: 'Disable public share',
449456
description: 'Disable public share for feed channel',
450457
})
451458
)
@@ -482,6 +489,7 @@ export const feedRouter = router({
482489
buildFeedOpenapi({
483490
method: 'DELETE',
484491
path: '/{channelId}/del',
492+
summary: 'Delete channel',
485493
})
486494
)
487495
.input(

src/server/trpc/routers/feed/state.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const feedStateRouter = router({
2222
buildFeedOpenapi({
2323
method: 'GET',
2424
path: '/state/all',
25+
summary: 'Get all states',
2526
})
2627
)
2728
.input(
@@ -116,6 +117,7 @@ export const feedStateRouter = router({
116117
buildFeedOpenapi({
117118
method: 'POST',
118119
path: '/{channelId}/state/resolve',
120+
summary: 'Resolve state',
119121
})
120122
)
121123
.input(

src/server/trpc/routers/global.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const globalRouter = router({
1111
method: 'GET',
1212
path: '/global/config',
1313
tags: [OPENAPI_TAG.GLOBAL],
14+
summary: 'Get global config',
1415
description: 'Get Tianji system global config',
1516
},
1617
})

0 commit comments

Comments
 (0)