forked from dubinc/dub
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request dubinc#771 from dubinc/eng-249
Add Zod to `/domains` endpoints and document in Mintlify
- Loading branch information
Showing
30 changed files
with
452 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
openapi: post /domains | ||
og:title: "Add a domain to the workspace with the Dub.co API - API Reference" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
openapi: delete /domains/{slug} | ||
og:title: "Delete a domain from the workspace with the Dub.co API - API Reference" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
openapi: patch /domains/{slug} | ||
og:title: "Edit a domain with the Dub.co API - API Reference" | ||
--- |
4 changes: 4 additions & 0 deletions
4
apps/docs/api-reference/endpoint/retrieve-a-list-of-domains.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
openapi: get /domains | ||
og:title: "Get list of domains associated with the workspace with the Dub.co API - API Reference" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
openapi: post /domains/{slug}/primary | ||
og:title: "Set a domain as primary for a workspace with the Dub.co API - API Reference" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
openapi: post /domains/{slug}/transfer | ||
og:title: "Transfer a domain to the another workspace with the Dub.co API - API Reference" | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { DubApiError } from "./errors"; | ||
|
||
// TODO: | ||
// Move this to a proper place | ||
export const parseRequestBody = async (req: Request) => { | ||
try { | ||
return await req.json(); | ||
} catch (e) { | ||
throw new DubApiError({ | ||
code: "bad_request", | ||
message: | ||
"Invalid JSON format in request body. Please ensure the request body is a valid JSON object.", | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { openApiErrorResponses } from "@/lib/openapi/responses"; | ||
import { DomainSchema, addDomainBodySchema } from "@/lib/zod/schemas"; | ||
import { ZodOpenApiOperationObject } from "zod-openapi"; | ||
import { workspaceParamsSchema } from "../request"; | ||
|
||
export const addDomain: ZodOpenApiOperationObject = { | ||
operationId: "addDomain", | ||
"x-speakeasy-name-override": "add", | ||
summary: "Add a domain", | ||
description: "Add a domain to the authenticated workspace.", | ||
requestParams: { | ||
query: workspaceParamsSchema, | ||
}, | ||
requestBody: { | ||
content: { | ||
"application/json": { | ||
schema: addDomainBodySchema, | ||
}, | ||
}, | ||
}, | ||
responses: { | ||
"200": { | ||
description: "The domain was added.", | ||
content: { | ||
"application/json": { | ||
schema: DomainSchema, | ||
}, | ||
}, | ||
}, | ||
...openApiErrorResponses, | ||
}, | ||
tags: ["Domains"], | ||
security: [{ token: [] }], | ||
}; |
Oops, something went wrong.