File tree Expand file tree Collapse file tree 6 files changed +33
-17
lines changed
Expand file tree Collapse file tree 6 files changed +33
-17
lines changed Original file line number Diff line number Diff line change @@ -3,15 +3,16 @@ import { z } from "zod";
33import { contextPlugin } from "../plugins/context-plugin" ;
44import { NotFoundHttpError } from "@aklinker1/zeta" ;
55import { HttpStatus } from "@aklinker1/zeta" ;
6- import { ExtensionStoreName } from "../enums" ;
6+ import { ExtensionStoreName , OpenApiTag } from "../enums" ;
77
8- export const extensionStoreApis = createApp ( )
8+ export const extensionStoreApis = createApp ( {
9+ tags : [ OpenApiTag . ExtensionStores ] ,
10+ } )
911 . use ( contextPlugin )
1012 . get (
1113 "/api/rest/:storeName/:id/screenshots/:index" ,
1214 {
1315 operationId : "redirectToScreenshot" ,
14- tags : [ "Chrome Extensions" ] ,
1516 description :
1617 "Redirect to a screenshot's URL from the Chrome Web Store listing" ,
1718 params : z . object ( {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { version } from "../../package.json";
44import { createGraphql } from "../graphql" ;
55import { z } from "zod" ;
66import dedent from "dedent" ;
7+ import { OpenApiTag } from "../enums" ;
78
89const PLAYGROUND_HTML = ( PLAYGROUND_HTML_TEMPLATE as any as string ) . replace (
910 "{{VERSION}}" ,
@@ -12,12 +13,13 @@ const PLAYGROUND_HTML = (PLAYGROUND_HTML_TEMPLATE as any as string).replace(
1213
1314const graphql = createGraphql ( ) ;
1415
15- export const graphqlApis = createApp ( )
16+ export const graphqlApis = createApp ( {
17+ tags : [ OpenApiTag . Graphql ] ,
18+ } )
1619 . post (
1720 "/api" ,
1821 {
1922 summary : "Send Query" ,
20- tags : [ "GraphQL" ] ,
2123 description :
2224 "Send a query to the GraphQL API. You can play around with queries on the [GraphiQL playground](/playground)." ,
2325 body : z
@@ -73,7 +75,6 @@ export const graphqlApis = createApp()
7375 "/playground" ,
7476 {
7577 operationId : "playground" ,
76- tags : [ "GraphQL" ] ,
7778 description : dedent `
7879 Open the GraphiQL playground. This is where you can interact and test out
7980 the GraphQL API. It also contains the GraphQL documentation explorer.
Original file line number Diff line number Diff line change @@ -2,12 +2,14 @@ import { createApp } from "@aklinker1/zeta";
22import z from "zod" ;
33import { version } from "../version" ;
44
5- export const systemApis = createApp ( )
5+ export const systemApis = createApp ( {
6+ tags : [ "System" ] ,
7+ } )
68 . get (
79 "/" ,
810 {
11+ operationId : "apiDocsRedirect" ,
912 summary : "API Docs Redirect" ,
10- tags : [ "System" ] ,
1113 description : "Redirect to the API reference when visiting the root URL." ,
1214 } ,
1315 ( { set } ) => {
@@ -18,8 +20,7 @@ export const systemApis = createApp()
1820 . get (
1921 "/api/health" ,
2022 {
21- summary : "Health Check" ,
22- tags : [ "System" ] ,
23+ operationId : "healthCheck" ,
2324 description : "Used to make sure the API is up and running." ,
2425 responses : z . object ( {
2526 status : z . literal ( "ok" ) ,
Original file line number Diff line number Diff line change 11export enum ExtensionStoreName {
2+ ChromeWebStore = "chrome-web-store" ,
3+ FirefoxAddonStore = "firefox-addon-store" ,
4+ EdgeAddonStore = "edge-addon-store" ,
5+
26 /** @deprecated Use {@link ChromeWebStore} instead. */
37 ChromeExtensions = "chrome-extensions" ,
4- ChromeWebStore = "chrome-web-store" ,
58 /** @deprecated Use {@link FirefoxAddonStore} instead. */
69 FirefoxExtensions = "firefox-extensions" ,
7- FirefoxAddonStore = "firefox-addon-store" ,
810 /** @deprecated Use {@link EdgeAddonStore} instead. */
911 EdgeExtensions = "edge-extensions" ,
10- EdgeAddonStore = "edge-addon-store" ,
12+ }
13+
14+ export enum OpenApiTag {
15+ System = "System" ,
16+ ExtensionStores = "Extension Stores" ,
17+ Graphql = "GraphQL" ,
1118}
Original file line number Diff line number Diff line change 1+ import z from "zod" ;
2+ import { ExtensionStoreName } from "./enums" ;
3+
4+ export const ExtensionStoreNameSchema = z
5+ . enum ( ExtensionStoreName )
6+ . meta ( { ref : "ExtensionStoreName" } ) ;
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { zodSchemaAdapter } from "@aklinker1/zeta/adapters/zod-schema-adapter";
77import { version } from "./version" ;
88import dedent from "dedent" ;
99import { systemApis } from "./apis/system-apis" ;
10+ import { OpenApiTag } from "./enums" ;
1011
1112const app = createApp ( {
1213 schemaAdapter : zodSchemaAdapter ,
@@ -35,15 +36,14 @@ const app = createApp({
3536 } ,
3637 tags : [
3738 {
38- name : "GraphQL" ,
39+ name : OpenApiTag . Graphql ,
3940 description : dedent `
4041 To play around with the GraphQL API, checkout the
4142 [GraphiQL Playground](/playground).
4243 ` ,
4344 } ,
44- { name : "Chrome Extensions" } ,
45- { name : "Firefox Addons" } ,
46- { name : "System" } ,
45+ { name : OpenApiTag . ExtensionStores } ,
46+ { name : OpenApiTag . System } ,
4747 ] ,
4848 } ,
4949} )
You can’t perform that action at this time.
0 commit comments