The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Merge branch 'main' into link-folders
Steven Teybc935d84db1e
diff --cc apps/web/lib/api/links/get-links-for-workspace.tsindex d2f5c3f9e0,3f48d9da66..9dd9c712ba--- a/apps/web/lib/api/links/get-links-for-workspace.ts+++ b/apps/web/lib/api/links/get-links-for-workspace.ts@@@ -16,9 -16,9 +16,10 @@@ export async function getLinksForWorkspuserId,showArchived,withTags,- includeUser,+ folderId,+ linkIds,+ includeUser,+ includeWebhooks,- linkIds,}: z.infer<typeof getLinksQuerySchemaExtended> & {workspaceId: string;}) {@@@ -63,10 -63,8 +64,9 @@@: {}),...(userId && { userId }),...(linkIds && { id: { in: linkIds } }),+ folderId: folderId ?? null,},include: {- user: includeUser,tags: {include: {tag: {diff --cc apps/web/lib/api/links/process-link.tsindex 2af794df5d,2a3a52ad63..d858c67a4e--- a/apps/web/lib/api/links/process-link.ts+++ b/apps/web/lib/api/links/process-link.ts@@@ -73,9 -71,9 +73,10 @@@ export async function processLink<T extgeo,doIndex,tagNames,+ folderId,externalId,identifier,+ webhookIds,} = payload;let expiresAt: string | Date | null | undefined = payload.expiresAt;diff --cc apps/web/lib/zod/schemas/links.tsindex f711663b65,a2246e26c1..40b3982c93--- a/apps/web/lib/zod/schemas/links.ts+++ b/apps/web/lib/zod/schemas/links.ts@@@ -497,10 -491,11 +504,15 @@@ export const LinkSchema =tags: TagSchema.array().nullable().describe("The tags assigned to the short link."),+ folderId: z+ .string()+ .nullable()+ .describe("The unique ID of the folder assigned to the short link."),+ webhookIds: z+ .array(z.string())+ .describe(+ "The IDs of the webhooks that the short link is associated with.",+ ),comments: z.string().nullable()diff --cc apps/web/tests/links/create-link.test.tsindex 3cf4074dc4,1cc151b58b..08f3c65f57--- a/apps/web/tests/links/create-link.test.ts+++ b/apps/web/tests/links/create-link.test.ts@@@ -6,12 -4,10 +6,12 @@@ import { IntegrationHarnessOld } from "import { afterAll, describe, expect, test } from "vitest";import { randomId } from "../utils/helpers";import { IntegrationHarness } from "../utils/integration";- import { link } from "../utils/resource";+ import { E2E_LINK, E2E_WEBHOOK_ID } from "../utils/resource";import { expectedLink } from "../utils/schema";+type FolderRecord = z.infer<typeof folderSchema>;+- const { domain, url } = link;+ const { domain, url } = E2E_LINK;describe.sequential("POST /links", async () => {const h = new IntegrationHarness();