Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

add getLinkInfoQuerySchema

Kiran K7125a6909843
diff --git a/apps/web/lib/openapi/links/get-link-info.ts b/apps/web/lib/openapi/links/get-link-info.ts
index da10e337e6..4151f0c94d 100644
--- a/apps/web/lib/openapi/links/get-link-info.ts
+++ b/apps/web/lib/openapi/links/get-link-info.ts
@@ -1,6 +1,5 @@
import { openApiErrorResponses } from "@/lib/openapi/responses";
-import z from "@/lib/zod";
-import { domainKeySchema, LinkSchema } from "@/lib/zod/schemas";
+import { getLinkInfoQuerySchema, LinkSchema } from "@/lib/zod/schemas";
import { ZodOpenApiOperationObject } from "zod-openapi";
import { workspaceParamsSchema } from "../request";
@@ -8,23 +7,9 @@ export const getLinkInfo: ZodOpenApiOperationObject = {
operationId: "getLinkInfo",
"x-speakeasy-name-override": "get",
summary: "Retrieve a link",
- description:
- "Retrieve the info for a link. You can fetch the link by `domain` and `key`, `linkId`, or `externalId`.",
+ description: "Retrieve the info for a link.",
requestParams: {
- query: workspaceParamsSchema.merge(domainKeySchema.partial()).merge(
- z.object({
- linkId: z
- .string()
- .optional()
- .describe("The unique ID of the short link."),
- externalId: z
- .string()
- .optional()
- .describe(
- "This is the ID of the link in the your database. Must be prefixed with `ext_`. when provided.",
- ),
- }),
- ),
+ query: workspaceParamsSchema.merge(getLinkInfoQuerySchema),
},
responses: {
"200": {
diff --git a/apps/web/lib/zod/schemas/links.ts b/apps/web/lib/zod/schemas/links.ts
index 1bd8107bca..d534aad730 100644
--- a/apps/web/lib/zod/schemas/links.ts
+++ b/apps/web/lib/zod/schemas/links.ts
@@ -407,3 +407,20 @@ export const LinkSchema = z
.openapi({ deprecated: true }),
})
.openapi({ title: "Link" });
+
+export const getLinkInfoQuerySchema = domainKeySchema.partial().merge(
+ z.object({
+ linkId: z
+ .string()
+ .optional()
+ .describe("The unique ID of the short link.")
+ .openapi({ example: "clux0rgak00011..." }),
+ externalId: z
+ .string()
+ .optional()
+ .describe(
+ "This is the ID of the link in the your database. Must be prefixed with `ext_`. when provided.",
+ )
+ .openapi({ example: "ext_123456" }),
+ }),
+);