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.

Rename variables

Kiran K844f214a31e9
diff --git a/apps/web/app/api/links/[linkId]/route.ts b/apps/web/app/api/links/[linkId]/route.ts
index edf8c80f10..7144f9fd1a 100644
--- a/apps/web/app/api/links/[linkId]/route.ts
+++ b/apps/web/app/api/links/[linkId]/route.ts
@@ -4,7 +4,7 @@ import { NextResponse } from "next/server";
import { APP_DOMAIN_WITH_NGROK } from "@dub/utils";
import { qstash } from "@/lib/cron";
import { DubApiError, handleAndReturnErrorResponse } from "@/lib/errors";
-import { CreateLinkBodySchema } from "@/lib/zod/schemas/links";
+import { createLinkBodySchema } from "@/lib/zod/schemas/links";
// GET /api/links/[linkId] – get a link
export const GET = withAuth(async ({ headers, link }) => {
@@ -17,7 +17,7 @@ export const GET = withAuth(async ({ headers, link }) => {
// PUT /api/links/[linkId] – update a link
export const PUT = withAuth(async ({ req, headers, project, link }) => {
try {
- const body = CreateLinkBodySchema.parse(await req.json());
+ const body = createLinkBodySchema.parse(await req.json());
const updatedLink = {
...link,
diff --git a/apps/web/app/api/links/bulk/route.ts b/apps/web/app/api/links/bulk/route.ts
index 340cd24638..2d90dc5dda 100644
--- a/apps/web/app/api/links/bulk/route.ts
+++ b/apps/web/app/api/links/bulk/route.ts
@@ -3,7 +3,7 @@ import { withAuth } from "@/lib/auth";
import { NextResponse } from "next/server";
import { exceededLimitError } from "@/lib/api/errors";
import { DubApiError, handleAndReturnErrorResponse } from "@/lib/errors";
-import { BulkCreateLinksBodySchema } from "@/lib/zod/schemas/links";
+import { bulkCreateLinksBodySchema } from "@/lib/zod/schemas/links";
// POST /api/links/bulk – bulk create up to 100 links
export const POST = withAuth(
@@ -17,7 +17,7 @@ export const POST = withAuth(
// );
// }
- const links = BulkCreateLinksBodySchema.parse(await req.json());
+ const links = bulkCreateLinksBodySchema.parse(await req.json());
if (
project.linksUsage + links.length > project.linksLimit &&
diff --git a/apps/web/app/api/links/count/route.ts b/apps/web/app/api/links/count/route.ts
index ae46357942..43fc832803 100644
--- a/apps/web/app/api/links/count/route.ts
+++ b/apps/web/app/api/links/count/route.ts
@@ -1,13 +1,13 @@
import { getLinksCount } from "@/lib/api/links";
import { withAuth } from "@/lib/auth";
import { handleAndReturnErrorResponse } from "@/lib/errors";
-import { GetLinksCountParamsSchema } from "@/lib/zod";
+import { getLinksCountParamsSchema } from "@/lib/zod";
import { NextResponse } from "next/server";
// GET /api/links/count – get the number of links for a project
export const GET = withAuth(async ({ headers, searchParams, project }) => {
try {
- const { userId, ...params } = GetLinksCountParamsSchema.parse(searchParams);
+ const { userId, ...params } = getLinksCountParamsSchema.parse(searchParams);
const count = await getLinksCount({
searchParams: params,
diff --git a/apps/web/app/api/links/exists/route.ts b/apps/web/app/api/links/exists/route.ts
index 33d489d080..34a3b9b62a 100644
--- a/apps/web/app/api/links/exists/route.ts
+++ b/apps/web/app/api/links/exists/route.ts
@@ -2,13 +2,13 @@ import { withAuth } from "@/lib/auth";
import { checkIfKeyExists } from "@/lib/api/links";
import { NextResponse } from "next/server";
import { handleAndReturnErrorResponse } from "@/lib/errors";
-import { DomainKeySchema } from "@/lib/zod";
+import { domainKeySchema } from "@/lib/zod";
// GET /api/links/exists – check if a link exists
export const GET = withAuth(
async ({ headers, searchParams }) => {
try {
- const { domain, key } = DomainKeySchema.parse(searchParams);
+ const { domain, key } = domainKeySchema.parse(searchParams);
const response = await checkIfKeyExists(domain, key);
return NextResponse.json(response, {
headers,
diff --git a/apps/web/app/api/links/info/route.ts b/apps/web/app/api/links/info/route.ts
index 90e7934c5b..0edfbb1a5b 100644
--- a/apps/web/app/api/links/info/route.ts
+++ b/apps/web/app/api/links/info/route.ts
@@ -2,13 +2,13 @@ import { withAuth } from "@/lib/auth";
import prisma from "@/lib/prisma";
import { linkConstructor } from "@dub/utils";
import { NextResponse } from "next/server";
-import { GetLinkInfoQuerySchema } from "@/lib/zod/schemas/links";
+import { getLinkInfoQuerySchema } from "@/lib/zod/schemas/links";
import { handleAndReturnErrorResponse } from "@/lib/errors";
// GET /api/links/info – get the info for a link
export const GET = withAuth(async ({ headers, searchParams }) => {
try {
- const { domain, key } = GetLinkInfoQuerySchema.parse(searchParams);
+ const { domain, key } = getLinkInfoQuerySchema.parse(searchParams);
const response = await prisma.link.findUniqueOrThrow({
where: {
diff --git a/apps/web/app/api/links/route.ts b/apps/web/app/api/links/route.ts
index ad7da5111e..46cc145f3a 100644
--- a/apps/web/app/api/links/route.ts
+++ b/apps/web/app/api/links/route.ts
@@ -4,8 +4,8 @@ import { qstash } from "@/lib/cron";
import { DubApiError, handleAndReturnErrorResponse } from "@/lib/errors";
import { ratelimit } from "@/lib/upstash";
import {
- CreateLinkBodySchema,
- GetLinksQuerySchema,
+ createLinkBodySchema,
+ getLinksQuerySchema,
} from "@/lib/zod/schemas/links";
import { APP_DOMAIN_WITH_NGROK, LOCALHOST_IP } from "@dub/utils";
import { NextResponse } from "next/server";
@@ -13,7 +13,7 @@ import { NextResponse } from "next/server";
// GET /api/links – get all user links
export const GET = withAuth(async ({ headers, searchParams, project }) => {
try {
- const parsed = GetLinksQuerySchema.parse(searchParams);
+ const parsed = getLinksQuerySchema.parse(searchParams);
const { domain, tagId, search, sort, page, userId, showArchived } = parsed;
const response = await getLinksForProject({
@@ -38,7 +38,7 @@ export const GET = withAuth(async ({ headers, searchParams, project }) => {
export const POST = withAuth(
async ({ req, headers, session, project }) => {
try {
- const payload = CreateLinkBodySchema.parse(await req.json());
+ const payload = createLinkBodySchema.parse(await req.json());
if (!session) {
const ip = req.headers.get("x-forwarded-for") || LOCALHOST_IP;
diff --git a/apps/web/app/api/projects/[slug]/tags/route.ts b/apps/web/app/api/projects/[slug]/tags/route.ts
index b9f9b630ca..eaaca090d2 100644
--- a/apps/web/app/api/projects/[slug]/tags/route.ts
+++ b/apps/web/app/api/projects/[slug]/tags/route.ts
@@ -4,7 +4,7 @@ import prisma from "@/lib/prisma";
import { randomBadgeColor } from "@/ui/links/tag-badge";
import { NextResponse } from "next/server";
import { DubApiError, handleAndReturnErrorResponse } from "@/lib/errors";
-import { CreateTagBodySchema } from "@/lib/zod/schemas/tags";
+import { createTagBodySchema } from "@/lib/zod/schemas/tags";
// GET /api/projects/[slug]/tags - get all tags for a project
export const GET = withAuth(async ({ project, headers }) => {
@@ -48,7 +48,7 @@ export const POST = withAuth(async ({ req, project, headers }) => {
});
}
- const { tag } = CreateTagBodySchema.parse(await req.json());
+ const { tag } = createTagBodySchema.parse(await req.json());
const existingTag = await prisma.tag.findFirst({
where: {
diff --git a/apps/web/app/api/route.ts b/apps/web/app/api/route.ts
index 776a2237e8..c97d1a7233 100644
--- a/apps/web/app/api/route.ts
+++ b/apps/web/app/api/route.ts
@@ -1,12 +1,8 @@
import { NextResponse } from "next/server";
-import { openAPIDocument } from "@/lib/openapi";
-import { oas31 } from "openapi3-ts";
export const runtime = "edge";
-export function GET(): NextResponse<oas31.OpenAPIObject> {
- // return NextResponse.json(openAPIDocument);
-
+export function GET() {
// TODO: Remove this once we have all the paths
return NextResponse.json({
openapi: "3.0.3",
diff --git a/apps/web/app/api/stats/route.ts b/apps/web/app/api/stats/route.ts
index 878c72df13..abe6bdaaac 100644
--- a/apps/web/app/api/stats/route.ts
+++ b/apps/web/app/api/stats/route.ts
@@ -1,13 +1,13 @@
import { withAuth } from "@/lib/auth";
import { handleAndReturnErrorResponse } from "@/lib/errors";
import prisma from "@/lib/prisma";
-import { DomainKeySchema } from "@/lib/zod";
+import { domainKeySchema } from "@/lib/zod";
import { NextResponse } from "next/server";
// GET /api/stats – get the publicStats setting for a link
export const GET = withAuth(async ({ searchParams }) => {
try {
- const { domain, key } = DomainKeySchema.parse(searchParams);
+ const { domain, key } = domainKeySchema.parse(searchParams);
const response = await prisma.link.findUnique({
where: {
@@ -29,7 +29,7 @@ export const GET = withAuth(async ({ searchParams }) => {
// PUT /api/stats – update the publicStats setting for a link
export const PUT = withAuth(async ({ req, searchParams }) => {
try {
- const { domain, key } = DomainKeySchema.parse(searchParams);
+ const { domain, key } = domainKeySchema.parse(searchParams);
const { publicStats } = await req.json();
const response = await prisma.link.update({
diff --git a/apps/web/lib/openapi/index.ts b/apps/web/lib/openapi/index.ts
index 70d1cf19c0..e8b343fbe0 100644
--- a/apps/web/lib/openapi/index.ts
+++ b/apps/web/lib/openapi/index.ts
@@ -4,8 +4,8 @@ import { linksPaths } from "./links";
import { tagsPaths } from "./tags";
import { projectsPaths } from "./projects";
import { LinkSchema } from "@/lib/zod/schemas/links";
-import { TagSchema } from "@/lib/zod/schemas/tags";
-import { ProjectSchema } from "@/lib/zod/schemas/projects";
+import { tagSchema } from "@/lib/zod/schemas/tags";
+import { projectSchema } from "@/lib/zod/schemas/projects";
export const openApiObject: ZodOpenApiObject = {
openapi: "3.0.3",
@@ -38,8 +38,8 @@ export const openApiObject: ZodOpenApiObject = {
components: {
schemas: {
LinkSchema,
- ProjectSchema,
- TagSchema,
+ projectSchema,
+ tagSchema,
},
securitySchemes: {
bearerToken: {
diff --git a/apps/web/lib/openapi/links/create-bulk-link.ts b/apps/web/lib/openapi/links/create-bulk-link.ts
index cbc8a2ac1b..49a9a7783d 100644
--- a/apps/web/lib/openapi/links/create-bulk-link.ts
+++ b/apps/web/lib/openapi/links/create-bulk-link.ts
@@ -1,9 +1,9 @@
import { ZodOpenApiOperationObject } from "zod-openapi";
import {
- CreateLinkBodySchema,
+ createLinkBodySchema,
LinkSchema,
- GetLinkInfoQuerySchema,
+ getLinkInfoQuerySchema,
} from "@/lib/zod/schemas/links";
import z from "@/lib/zod";
import { openApiErrorResponses } from "@/lib/openapi/responses";
@@ -13,12 +13,12 @@ export const createBulkLink: ZodOpenApiOperationObject = {
summary: "Bulk create links",
description: "Bulk create up to 100 links for the authenticated project.",
requestParams: {
- query: GetLinkInfoQuerySchema.pick({ projectSlug: true }),
+ query: getLinkInfoQuerySchema.pick({ projectSlug: true }),
},
requestBody: {
content: {
"application/json": {
- schema: z.array(CreateLinkBodySchema),
+ schema: z.array(createLinkBodySchema),
},
},
},
diff --git a/apps/web/lib/openapi/links/create-link.ts b/apps/web/lib/openapi/links/create-link.ts
index 38782b6697..e65c1449d8 100644
--- a/apps/web/lib/openapi/links/create-link.ts
+++ b/apps/web/lib/openapi/links/create-link.ts
@@ -1,9 +1,9 @@
import { ZodOpenApiOperationObject } from "zod-openapi";
import {
- CreateLinkBodySchema,
+ createLinkBodySchema,
LinkSchema,
- GetLinkInfoQuerySchema,
+ getLinkInfoQuerySchema,
} from "@/lib/zod/schemas/links";
import { openApiErrorResponses } from "@/lib/openapi/responses";
@@ -12,12 +12,12 @@ export const createLink: ZodOpenApiOperationObject = {
summary: "Create a new link",
description: "Create a new link for the authenticated project.",
requestParams: {
- query: GetLinkInfoQuerySchema.pick({ projectSlug: true }),
+ query: getLinkInfoQuerySchema.pick({ projectSlug: true }),
},
requestBody: {
content: {
"application/json": {
- schema: CreateLinkBodySchema,
+ schema: createLinkBodySchema,
},
},
},
diff --git a/apps/web/lib/openapi/links/delete-link.ts b/apps/web/lib/openapi/links/delete-link.ts
index 0037f0b401..566c1dd47f 100644
--- a/apps/web/lib/openapi/links/delete-link.ts
+++ b/apps/web/lib/openapi/links/delete-link.ts
@@ -1,7 +1,7 @@
import { ZodOpenApiOperationObject } from "zod-openapi";
import z from "@/lib/zod";
-import { GetLinksQuerySchema, LinkSchema } from "@/lib/zod/schemas/links";
+import { getLinksQuerySchema, LinkSchema } from "@/lib/zod/schemas/links";
import { openApiErrorResponses } from "@/lib/openapi/responses";
export const deleteLink: ZodOpenApiOperationObject = {
@@ -9,7 +9,7 @@ export const deleteLink: ZodOpenApiOperationObject = {
summary: "Delete a link",
description: "Delete a link for the authenticated project.",
requestParams: {
- query: GetLinksQuerySchema.pick({ projectSlug: true }),
+ query: getLinksQuerySchema.pick({ projectSlug: true }),
path: z.object({
linkId: z.string().openapi({
description:
diff --git a/apps/web/lib/openapi/links/edit-link.ts b/apps/web/lib/openapi/links/edit-link.ts
index 22dc0df6c1..18d1dddec9 100644
--- a/apps/web/lib/openapi/links/edit-link.ts
+++ b/apps/web/lib/openapi/links/edit-link.ts
@@ -1,9 +1,9 @@
import { ZodOpenApiOperationObject } from "zod-openapi";
import {
- CreateLinkBodySchema,
+ createLinkBodySchema,
LinkSchema,
- GetLinkInfoQuerySchema,
+ getLinkInfoQuerySchema,
} from "@/lib/zod/schemas/links";
import z from "@/lib/zod";
import { openApiErrorResponses } from "@/lib/openapi/responses";
@@ -13,7 +13,7 @@ export const editLink: ZodOpenApiOperationObject = {
summary: "Edit a link",
description: "Edit a link for the authenticated project.",
requestParams: {
- query: GetLinkInfoQuerySchema.pick({ projectSlug: true }),
+ query: getLinkInfoQuerySchema.pick({ projectSlug: true }),
path: z.object({
linkId: z.string().openapi({
description:
@@ -24,7 +24,7 @@ export const editLink: ZodOpenApiOperationObject = {
requestBody: {
content: {
"application/json": {
- schema: CreateLinkBodySchema,
+ schema: createLinkBodySchema,
},
},
},
diff --git a/apps/web/lib/openapi/links/get-link-info.ts b/apps/web/lib/openapi/links/get-link-info.ts
index ef81668428..2c010863d6 100644
--- a/apps/web/lib/openapi/links/get-link-info.ts
+++ b/apps/web/lib/openapi/links/get-link-info.ts
@@ -1,6 +1,6 @@
import { ZodOpenApiOperationObject } from "zod-openapi";
-import { GetLinkInfoQuerySchema, LinkSchema } from "@/lib/zod/schemas/links";
+import { getLinkInfoQuerySchema, LinkSchema } from "@/lib/zod/schemas/links";
import { openApiErrorResponses } from "@/lib/openapi/responses";
export const getLinkInfo: ZodOpenApiOperationObject = {
@@ -8,7 +8,7 @@ export const getLinkInfo: ZodOpenApiOperationObject = {
summary: "Retrieve a link",
description: "Retrieve the info for a link from their domain and key.",
requestParams: {
- query: GetLinkInfoQuerySchema,
+ query: getLinkInfoQuerySchema,
},
responses: {
"200": {
diff --git a/apps/web/lib/openapi/links/get-links.ts b/apps/web/lib/openapi/links/get-links.ts
index 220692c710..77f21476a0 100644
--- a/apps/web/lib/openapi/links/get-links.ts
+++ b/apps/web/lib/openapi/links/get-links.ts
@@ -1,7 +1,7 @@
import { ZodOpenApiOperationObject } from "zod-openapi";
import z from "@/lib/zod";
-import { GetLinksQuerySchema, LinkSchema } from "@/lib/zod/schemas/links";
+import { getLinksQuerySchema, LinkSchema } from "@/lib/zod/schemas/links";
import { openApiErrorResponses } from "@/lib/openapi/responses";
export const getLinks: ZodOpenApiOperationObject = {
@@ -10,7 +10,7 @@ export const getLinks: ZodOpenApiOperationObject = {
description:
"Retrieve a list of links for the authenticated project. The list will be paginated and the provided query parameters allow filtering the returned links.",
requestParams: {
- query: GetLinksQuerySchema,
+ query: getLinksQuerySchema,
},
responses: {
"200": {
diff --git a/apps/web/lib/openapi/links/get-qr.ts b/apps/web/lib/openapi/links/get-qr.ts
index a19d9e73fa..9b14779167 100644
--- a/apps/web/lib/openapi/links/get-qr.ts
+++ b/apps/web/lib/openapi/links/get-qr.ts
@@ -1,7 +1,7 @@
import { ZodOpenApiOperationObject } from "zod-openapi";
import z from "@/lib/zod";
-import { GetQRCodeQuerySchema } from "@/lib/zod/schemas/qr";
+import { getQRCodeQuerySchema } from "@/lib/zod/schemas/qr";
import { openApiErrorResponses } from "@/lib/openapi/responses";
export const getQRCode: ZodOpenApiOperationObject = {
@@ -9,7 +9,7 @@ export const getQRCode: ZodOpenApiOperationObject = {
summary: "Retrieve a QR code",
description: "Retrieve a QR code for a link.",
requestParams: {
- query: GetQRCodeQuerySchema,
+ query: getQRCodeQuerySchema,
},
responses: {
"200": {
diff --git a/apps/web/lib/openapi/projects/get-project-info.ts b/apps/web/lib/openapi/projects/get-project-info.ts
index 65a6133f76..cc3bd9a588 100644
--- a/apps/web/lib/openapi/projects/get-project-info.ts
+++ b/apps/web/lib/openapi/projects/get-project-info.ts
@@ -1,7 +1,7 @@
import { ZodOpenApiOperationObject } from "zod-openapi";
import z from "@/lib/zod";
-import { ProjectSchema } from "@/lib/zod/schemas/projects";
+import { projectSchema } from "@/lib/zod/schemas/projects";
import { openApiErrorResponses } from "@/lib/openapi/responses";
export const getProjectInfo: ZodOpenApiOperationObject = {
@@ -22,7 +22,7 @@ export const getProjectInfo: ZodOpenApiOperationObject = {
description: "The retrieved project",
content: {
"application/json": {
- schema: ProjectSchema,
+ schema: projectSchema,
},
},
},
diff --git a/apps/web/lib/openapi/projects/get-projects.ts b/apps/web/lib/openapi/projects/get-projects.ts
index 9ff008dda2..959fbbff0e 100644
--- a/apps/web/lib/openapi/projects/get-projects.ts
+++ b/apps/web/lib/openapi/projects/get-projects.ts
@@ -1,7 +1,7 @@
import { ZodOpenApiOperationObject } from "zod-openapi";
import z from "@/lib/zod";
-import { ProjectSchema } from "@/lib/zod/schemas/projects";
+import { projectSchema } from "@/lib/zod/schemas/projects";
import { openApiErrorResponses } from "@/lib/openapi/responses";
export const getProjects: ZodOpenApiOperationObject = {
@@ -13,7 +13,7 @@ export const getProjects: ZodOpenApiOperationObject = {
description: "A list of projects",
content: {
"application/json": {
- schema: z.array(ProjectSchema),
+ schema: z.array(projectSchema),
},
},
},
diff --git a/apps/web/lib/openapi/tags/create-tag.ts b/apps/web/lib/openapi/tags/create-tag.ts
index 0869308d36..848eef5003 100644
--- a/apps/web/lib/openapi/tags/create-tag.ts
+++ b/apps/web/lib/openapi/tags/create-tag.ts
@@ -1,7 +1,7 @@
import { ZodOpenApiOperationObject } from "zod-openapi";
import z from "@/lib/zod";
-import { CreateTagBodySchema, TagSchema } from "@/lib/zod/schemas/tags";
+import { createTagBodySchema, tagSchema } from "@/lib/zod/schemas/tags";
import { openApiErrorResponses } from "@/lib/openapi/responses";
export const createTag: ZodOpenApiOperationObject = {
@@ -20,7 +20,7 @@ export const createTag: ZodOpenApiOperationObject = {
requestBody: {
content: {
"application/json": {
- schema: CreateTagBodySchema,
+ schema: createTagBodySchema,
},
},
},
@@ -29,7 +29,7 @@ export const createTag: ZodOpenApiOperationObject = {
description: "The created tag",
content: {
"application/json": {
- schema: TagSchema
+ schema: tagSchema
},
},
},
diff --git a/apps/web/lib/openapi/tags/get-tags.ts b/apps/web/lib/openapi/tags/get-tags.ts
index 9bf9e84613..4719d2cfec 100644
--- a/apps/web/lib/openapi/tags/get-tags.ts
+++ b/apps/web/lib/openapi/tags/get-tags.ts
@@ -1,7 +1,7 @@
import { ZodOpenApiOperationObject } from "zod-openapi";
import z from "@/lib/zod";
-import { TagSchema } from "@/lib/zod/schemas/tags";
+import { tagSchema } from "@/lib/zod/schemas/tags";
import { openApiErrorResponses } from "@/lib/openapi/responses";
export const getTags: ZodOpenApiOperationObject = {
@@ -22,7 +22,7 @@ export const getTags: ZodOpenApiOperationObject = {
description: "A list of tags",
content: {
"application/json": {
- schema: z.array(TagSchema),
+ schema: z.array(tagSchema),
},
},
},
diff --git a/apps/web/lib/types.ts b/apps/web/lib/types.ts
index e8b1e0dc6b..520f8d7e91 100644
--- a/apps/web/lib/types.ts
+++ b/apps/web/lib/types.ts
@@ -1,7 +1,7 @@
import { DirectorySyncProviders } from "@boxyhq/saml-jackson";
import z from "@/lib/zod";
-import { CreateLinkBodySchema } from "./zod/schemas/links";
+import { createLinkBodySchema } from "./zod/schemas/links";
import { PlanSchema } from "prisma/zod";
export { type Link as LinkProps } from "@prisma/client";
@@ -143,4 +143,4 @@ export interface SAMLProviderProps {
};
}
-export type NewLinkProps = z.infer<typeof CreateLinkBodySchema>;
+export type NewLinkProps = z.infer<typeof createLinkBodySchema>;
diff --git a/apps/web/lib/zod/index.ts b/apps/web/lib/zod/index.ts
index 90d8aea12b..620ef72294 100644
--- a/apps/web/lib/zod/index.ts
+++ b/apps/web/lib/zod/index.ts
@@ -5,7 +5,7 @@ extendZodWithOpenApi(z);
export default z;
-export const GetLinksCountParamsSchema = z.object({
+export const getLinksCountParamsSchema = z.object({
userId: z.string().optional(),
tagId: z.string().optional(),
domain: z.string().optional(),
@@ -14,9 +14,9 @@ export const GetLinksCountParamsSchema = z.object({
groupBy: z.union([z.literal("domain"), z.literal("tagId")]).optional(),
});
-export const DomainKeySchema = z.object({
+export const domainKeySchema = z.object({
domain: z.string().min(1),
key: z.string().min(1),
});
-export type GetLinksCountParams = z.infer<typeof GetLinksCountParamsSchema>;
+export type GetLinksCountParams = z.infer<typeof getLinksCountParamsSchema>;
diff --git a/apps/web/lib/zod/schemas/links.ts b/apps/web/lib/zod/schemas/links.ts
index cdc16c3efd..e091892d60 100644
--- a/apps/web/lib/zod/schemas/links.ts
+++ b/apps/web/lib/zod/schemas/links.ts
@@ -1,7 +1,7 @@
import z from "@/lib/zod";
import { LinkSchema as Link } from "prisma/zod";
-export const GetLinksQuerySchema = z.object({
+export const getLinksQuerySchema = z.object({
projectSlug: z
.string()
.describe(
@@ -41,7 +41,7 @@ export const GetLinksQuerySchema = z.object({
),
});
-export const GetLinkInfoQuerySchema = z.object({
+export const getLinkInfoQuerySchema = z.object({
projectSlug: z
.string()
.describe(
@@ -59,7 +59,7 @@ export const GetLinkInfoQuerySchema = z.object({
),
});
-export const CreateLinkBodySchema = z.object({
+export const createLinkBodySchema = z.object({
domain: z
.string()
.optional()
@@ -159,8 +159,8 @@ export const CreateLinkBodySchema = z.object({
comments: z.string().nullish().describe("The comments for the short link."),
});
-export const BulkCreateLinksBodySchema = z
- .array(CreateLinkBodySchema)
+export const bulkCreateLinksBodySchema = z
+ .array(createLinkBodySchema)
.max(100, "You can only create up to 100 links at a time.");
// TODO: Add description for each field
diff --git a/apps/web/lib/zod/schemas/projects.ts b/apps/web/lib/zod/schemas/projects.ts
index 09448245bf..268f34035b 100644
--- a/apps/web/lib/zod/schemas/projects.ts
+++ b/apps/web/lib/zod/schemas/projects.ts
@@ -1,7 +1,7 @@
import z from "@/lib/zod";
import { RoleSchema, PlanSchema } from "prisma/zod";
-export const ProjectSchema = z
+export const projectSchema = z
.object({
id: z.string().describe("The unique ID of the project."),
name: z.string().describe("The name of the project."),
diff --git a/apps/web/lib/zod/schemas/qr.ts b/apps/web/lib/zod/schemas/qr.ts
index 9948281359..506e7395e8 100644
--- a/apps/web/lib/zod/schemas/qr.ts
+++ b/apps/web/lib/zod/schemas/qr.ts
@@ -1,6 +1,6 @@
import z from "@/lib/zod";
-export const GetQRCodeQuerySchema = z.object({
+export const getQRCodeQuerySchema = z.object({
url: z
.string()
.url()
diff --git a/apps/web/lib/zod/schemas/tags.ts b/apps/web/lib/zod/schemas/tags.ts
index 1ecf239dae..26e0cc8ab6 100644
--- a/apps/web/lib/zod/schemas/tags.ts
+++ b/apps/web/lib/zod/schemas/tags.ts
@@ -1,10 +1,10 @@
import z from "@/lib/zod";
-export const CreateTagBodySchema = z.object({
+export const createTagBodySchema = z.object({
tag: z.string().min(1).describe("The name of the tag to create."),
});
-export const TagSchema = z
+export const tagSchema = z
.object({
id: z.string().describe("The unique ID of the tag."),
name: z.string().describe("The name of the tag."),