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.

wip

Kiran K511ef73070b6
diff --git a/apps/docs/mint.json b/apps/docs/mint.json
index 78ed778a58..b31ba7f888 100644
--- a/apps/docs/mint.json
+++ b/apps/docs/mint.json
@@ -30,7 +30,7 @@
"name": "Dashboard",
"url": "https://app.dub.co"
},
- "openapi": "https://api.dub.co",
+ "openapi": "http://api.localhost:8888",
"tabs": [
{
"name": "API Reference",
diff --git a/apps/web/lib/openapi/index.ts b/apps/web/lib/openapi/index.ts
index ad584bf4e5..a510bc25a6 100644
--- a/apps/web/lib/openapi/index.ts
+++ b/apps/web/lib/openapi/index.ts
@@ -34,7 +34,7 @@ export const document = createDocument({
},
servers: [
{
- url: API_DOMAIN,
+ url: "https://3102-103-177-27-64.ngrok-free.app/api",
description: "Production API",
},
],
diff --git a/apps/web/lib/openapi/links/get-link-info.ts b/apps/web/lib/openapi/links/get-link-info.ts
index 00f8788aab..da10e337e6 100644
--- a/apps/web/lib/openapi/links/get-link-info.ts
+++ b/apps/web/lib/openapi/links/get-link-info.ts
@@ -1,4 +1,5 @@
import { openApiErrorResponses } from "@/lib/openapi/responses";
+import z from "@/lib/zod";
import { domainKeySchema, LinkSchema } from "@/lib/zod/schemas";
import { ZodOpenApiOperationObject } from "zod-openapi";
import { workspaceParamsSchema } from "../request";
@@ -7,9 +8,23 @@ export const getLinkInfo: ZodOpenApiOperationObject = {
operationId: "getLinkInfo",
"x-speakeasy-name-override": "get",
summary: "Retrieve a link",
- description: "Retrieve the info for a link from their domain and key.",
+ description:
+ "Retrieve the info for a link. You can fetch the link by `domain` and `key`, `linkId`, or `externalId`.",
requestParams: {
- query: workspaceParamsSchema.merge(domainKeySchema),
+ 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.",
+ ),
+ }),
+ ),
},
responses: {
"200": {