Skip to content

Commit e1fc3bf

Browse files
committed
Merge branch 'main' into combine-link-method
2 parents 2c6c26a + 61e3dfc commit e1fc3bf

13 files changed

Lines changed: 58 additions & 40 deletions

File tree

apps/docs/sdks/typescript/domains/add.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ await dub.domains.add({
6060

6161
```ts
6262
{
63+
id: "clvcep2sn87jh8nf808x00005",
6364
slug: "acme.com",
6465
verified: false,
6566
primary: true,

apps/docs/sdks/typescript/domains/list.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ await dub.domains.list({});
2727
```ts
2828
[
2929
{
30+
id: "clvcep2sn87jh8nf808x00005",
3031
slug: "acme.com",
3132
verified: false,
3233
primary: true,

apps/docs/sdks/typescript/domains/set-primary.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ await dub.domains.setPrimary("acme.com");
2828

2929
```ts
3030
{
31+
id: "clvcep2sn87jh8nf808x00005",
3132
slug: "acme.com",
3233
verified: false,
3334
primary: true,

apps/docs/sdks/typescript/domains/transfer.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ await dub.domains.transfer("acme.com", {
3434

3535
```ts
3636
{
37+
id: "clvcep2sn87jh8nf808x00005",
3738
slug: "acme.com",
3839
verified: false,
3940
primary: true,

apps/docs/sdks/typescript/domains/update.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ await dub.domains.update("acme.com", {
6262

6363
```ts
6464
{
65+
id: "clvcep2sn87jh8nf808x00005",
6566
slug: "acme.com",
6667
verified: false,
6768
primary: true,

apps/docs/snippets/domain-response.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
<ParamField body="id" type="string" required>
2+
The unique identifier of the domain.
3+
</ParamField>
4+
15
<ParamField body="slug" type="string" required>
26
The domain name.
37
</ParamField>

apps/web/.env.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,4 +106,8 @@ ANTHROPIC_API_KEY=
106106
NEXT_PUBLIC_IS_DUB=
107107

108108
# For cron jobs
109-
CRON_SECRET=
109+
CRON_SECRET=
110+
111+
# Pangea - Retrieve reputation for a domain.
112+
# Get your Pange API Key here: https://pangea.cloud/docs/admin-guide/tokens/
113+
PANGEA_API_KEY=

apps/web/app/api/ai/completion/route.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ export async function POST(req: NextRequest) {
2626
const { workspaceId } = searchParams;
2727
const workspace = await getWorkspaceViaEdge(workspaceId);
2828

29+
if (!anthropic) {
30+
console.error("Anthropic is not configured. Skipping the request.");
31+
return new Response(null, { status: 200 });
32+
}
33+
2934
if (!workspace) {
3035
return new Response("Workspace not found", { status: 404 });
3136
}

apps/web/app/api/ai/generate-support-title/route.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ import { NextRequest } from "next/server";
88
export const runtime = "edge";
99

1010
export async function POST(req: NextRequest) {
11+
if (!anthropic) {
12+
console.error("Anthropic is not configured. Skipping the request.");
13+
return new Response(null, { status: 200 });
14+
}
15+
1116
try {
1217
const session = await getToken({
1318
req,

apps/web/app/api/domains/route.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { exceededLimitError } from "@/lib/api/errors";
77
import { parseRequestBody } from "@/lib/api/utils";
88
import { withWorkspace } from "@/lib/auth";
99
import prisma from "@/lib/prisma";
10+
import z from "@/lib/zod";
1011
import { DomainSchema, addDomainBodySchema } from "@/lib/zod/schemas";
1112
import { NextResponse } from "next/server";
1213

@@ -16,19 +17,9 @@ export const GET = withWorkspace(async ({ workspace }) => {
1617
where: {
1718
projectId: workspace.id,
1819
},
19-
select: {
20-
slug: true,
21-
verified: true,
22-
primary: true,
23-
archived: true,
24-
target: true,
25-
type: true,
26-
placeholder: true,
27-
clicks: true,
28-
expiredUrl: true,
29-
},
3020
});
31-
return NextResponse.json(domains);
21+
22+
return NextResponse.json(z.array(DomainSchema).parse(domains));
3223
});
3324

3425
// POST /api/domains - add a domain

0 commit comments

Comments
 (0)