Skip to content

Commit 00d428b

Browse files
committed
Typescript errors fixed
1 parent 4633b90 commit 00d428b

File tree

6 files changed

+20
-36
lines changed

6 files changed

+20
-36
lines changed

components/settings/integration-form-dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export function IntegrationFormDialog({
226226
<div className="flex items-center gap-2">
227227
<IntegrationIcon
228228
className="size-4"
229-
integration={type === "ai-gateway" ? "vercel" : type}
229+
integration={type}
230230
/>
231231
{getLabel(type)}
232232
</div>

components/settings/integrations-manager.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,7 @@ export function IntegrationsManager({
130130
<div className="flex items-center gap-3">
131131
<IntegrationIcon
132132
className="size-8"
133-
integration={
134-
integration.type === "ai-gateway"
135-
? "vercel"
136-
: integration.type
137-
}
133+
integration={integration.type}
138134
/>
139135
<div>
140136
<p className="font-medium text-sm">{integration.name}</p>

lib/api-client.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ export const userApi = {
377377
image: string | null;
378378
isAnonymous: boolean | null;
379379
providerId: string | null;
380+
walletAddress: string | null;
380381
}>("/api/user"),
381382

382383
update: (data: { name?: string; email?: string }) =>

lib/auth.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,14 @@ export const auth = betterAuth({
208208
// Get user's cryptographic share
209209
const userShare = await paraClient.getUserShare();
210210

211+
if (!userShare) {
212+
throw new Error("Failed to get user share from Para");
213+
}
214+
215+
if (!(wallet.id && wallet.address)) {
216+
throw new Error("Invalid wallet data from Para");
217+
}
218+
211219
// Store encrypted wallet in database
212220
await db.insert(paraWallets).values({
213221
userId: user.id,

lib/encryption.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import crypto from "node:crypto";
22

3-
const ENCRYPTION_KEY = process.env.WALLET_ENCRYPTION_KEY;
3+
const ENCRYPTION_KEY_ENV = process.env.WALLET_ENCRYPTION_KEY;
44
const ALGORITHM = "aes-256-gcm";
55

6-
if (!ENCRYPTION_KEY || ENCRYPTION_KEY.length !== 64) {
6+
if (!ENCRYPTION_KEY_ENV || ENCRYPTION_KEY_ENV.length !== 64) {
77
throw new Error(
88
"WALLET_ENCRYPTION_KEY must be a 32-byte hex string (64 characters)"
99
);
1010
}
1111

12+
// TypeScript now knows ENCRYPTION_KEY is definitely a string
13+
const ENCRYPTION_KEY: string = ENCRYPTION_KEY_ENV;
14+
1215
/**
1316
* Encrypt sensitive userShare before storing in database
1417
* Uses AES-256-GCM for authenticated encryption

lib/steps/index.ts

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44
* without code generation or eval()
55
*/
66

7-
import type { generateImageStep } from "../../plugins/ai-gateway/steps/generate-image";
8-
import type { generateTextStep } from "../../plugins/ai-gateway/steps/generate-text";
9-
import type { firecrawlScrapeStep } from "../../plugins/firecrawl/steps/scrape";
10-
import type { firecrawlSearchStep } from "../../plugins/firecrawl/steps/search";
11-
import type { createTicketStep } from "../../plugins/linear/steps/create-ticket";
127
import type { sendEmailStep } from "../../plugins/resend/steps/send-email";
138
import type { sendSlackMessageStep } from "../../plugins/slack/steps/send-slack-message";
9+
import type { transferFundsStep } from "../../plugins/web3/steps/transfer-funds";
1410
import type { conditionStep } from "./condition";
1511
import type { databaseQueryStep } from "./database-query";
1612
import type { httpRequestStep } from "./http-request";
@@ -40,29 +36,9 @@ export const stepRegistry: Record<string, StepFunction> = {
4036
(
4137
await import("../../plugins/slack/steps/send-slack-message")
4238
).sendSlackMessageStep(input as Parameters<typeof sendSlackMessageStep>[0]),
43-
"Create Ticket": async (input) =>
44-
(await import("../../plugins/linear/steps/create-ticket")).createTicketStep(
45-
input as Parameters<typeof createTicketStep>[0]
46-
),
47-
"Find Issues": async (input) =>
48-
(await import("../../plugins/linear/steps/create-ticket")).createTicketStep(
49-
input as Parameters<typeof createTicketStep>[0]
50-
), // TODO: Implement separate findIssuesStep
51-
"Generate Text": async (input) =>
52-
(
53-
await import("../../plugins/ai-gateway/steps/generate-text")
54-
).generateTextStep(input as Parameters<typeof generateTextStep>[0]),
55-
"Generate Image": async (input) =>
56-
(
57-
await import("../../plugins/ai-gateway/steps/generate-image")
58-
).generateImageStep(input as Parameters<typeof generateImageStep>[0]),
59-
Scrape: async (input) =>
60-
(await import("../../plugins/firecrawl/steps/scrape")).firecrawlScrapeStep(
61-
input as Parameters<typeof firecrawlScrapeStep>[0]
62-
),
63-
Search: async (input) =>
64-
(await import("../../plugins/firecrawl/steps/search")).firecrawlSearchStep(
65-
input as Parameters<typeof firecrawlSearchStep>[0]
39+
"Transfer Funds": async (input) =>
40+
(await import("../../plugins/web3/steps/transfer-funds")).transferFundsStep(
41+
input as Parameters<typeof transferFundsStep>[0]
6642
),
6743
};
6844

0 commit comments

Comments
 (0)