Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit 04f8cee

Browse files
NathanFlurryjog1t
authored andcommitted
chore: update zod dependency to v3.25.67 and code formatting
1 parent 5ddb7b0 commit 04f8cee

File tree

113 files changed

+1313
-1573
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+1313
-1573
lines changed

examples/trpc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dependencies": {
1818
"@trpc/client": "^11.3.1",
1919
"@trpc/server": "^11.4.2",
20-
"zod": "^3.24.1"
20+
"zod": "^3.25.67"
2121
},
2222
"stableVersion": "0.8.0"
2323
}

packages/core/fixtures/driver-test-suite/action-inputs.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,3 @@ export const inputActor = actor({
2828
},
2929
},
3030
});
31-

packages/core/fixtures/driver-test-suite/action-timeout.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,3 @@ export const syncTimeoutActor = actor({
6666
},
6767
},
6868
});
69-
70-

packages/core/fixtures/driver-test-suite/action-types.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { actor, UserError } from "@rivetkit/core";
1+
import { UserError, actor } from "@rivetkit/core";
22

33
// Actor with synchronous actions
44
export const syncActionActor = actor({
55
onAuth: () => {},
66
state: { value: 0 },
77
actions: {
88
// Simple synchronous action that returns a value directly
9-
increment: (c, amount: number = 1) => {
9+
increment: (c, amount = 1) => {
1010
c.state.value += amount;
1111
return c.state.value;
1212
},
@@ -30,7 +30,7 @@ export const asyncActionActor = actor({
3030
state: { value: 0, data: null as any },
3131
actions: {
3232
// Async action with a delay
33-
delayedIncrement: async (c, amount: number = 1) => {
33+
delayedIncrement: async (c, amount = 1) => {
3434
await Promise.resolve();
3535
c.state.value += amount;
3636
return c.state.value;
@@ -83,4 +83,3 @@ export const promiseActor = actor({
8383
},
8484
},
8585
});
86-

packages/core/fixtures/driver-test-suite/auth.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { actor, UserError } from "@rivetkit/core";
1+
import { UserError, actor } from "@rivetkit/core";
22

33
// Basic auth actor - requires API key
44
export const authActor = actor({
@@ -9,11 +9,11 @@ export const authActor = actor({
99
if (!apiKey) {
1010
throw new UserError("API key required", { code: "missing_auth" });
1111
}
12-
12+
1313
if (apiKey !== "valid-api-key") {
1414
throw new UserError("Invalid API key", { code: "invalid_auth" });
1515
}
16-
16+
1717
return { userId: "user123", token: apiKey };
1818
},
1919
actions: {
@@ -30,17 +30,21 @@ export const intentAuthActor = actor({
3030
state: { value: 0 },
3131
onAuth: (opts) => {
3232
const { req, intents, params } = opts;
33-
console.log('intents', intents, params);
33+
console.log("intents", intents, params);
3434
const role = (params as any)?.role;
35-
35+
3636
if (intents.has("create") && role !== "admin") {
37-
throw new UserError("Admin role required for create operations", { code: "insufficient_permissions" });
37+
throw new UserError("Admin role required for create operations", {
38+
code: "insufficient_permissions",
39+
});
3840
}
39-
41+
4042
if (intents.has("action") && !["admin", "user"].includes(role || "")) {
41-
throw new UserError("User or admin role required for actions", { code: "insufficient_permissions" });
43+
throw new UserError("User or admin role required for actions", {
44+
code: "insufficient_permissions",
45+
});
4246
}
43-
47+
4448
return { role, timestamp: Date.now() };
4549
},
4650
actions: {
@@ -79,20 +83,18 @@ export const noAuthActor = actor({
7983
export const asyncAuthActor = actor({
8084
state: { count: 0 },
8185
onAuth: async (opts) => {
82-
const { req, intents, params } = opts;
83-
// Simulate async auth check (e.g., database lookup)
84-
await new Promise(resolve => setTimeout(resolve, 10));
85-
86+
const { params } = opts;
87+
8688
const token = (params as any)?.token;
8789
if (!token) {
8890
throw new UserError("Token required", { code: "missing_token" });
8991
}
90-
92+
9193
// Simulate token validation
9294
if (token === "invalid") {
9395
throw new UserError("Token is invalid", { code: "invalid_token" });
9496
}
95-
97+
9698
return { userId: `user-${token}`, validated: true };
9799
},
98100
actions: {

packages/core/fixtures/driver-test-suite/conn-params.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ export const counterWithParams = actor({
2626
},
2727
},
2828
});
29-

packages/core/fixtures/driver-test-suite/conn-state.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ export const connStateActor = actor({
4343
},
4444
actions: {
4545
// Action to increment the connection's counter
46-
incrementConnCounter: (c, amount: number = 1) => {
46+
incrementConnCounter: (c, amount = 1) => {
4747
c.conn.state.counter += amount;
4848
},
4949

5050
// Action to increment the shared counter
51-
incrementSharedCounter: (c, amount: number = 1) => {
51+
incrementSharedCounter: (c, amount = 1) => {
5252
c.state.sharedCounter += amount;
5353
return c.state.sharedCounter;
5454
},
@@ -70,13 +70,18 @@ export const connStateActor = actor({
7070

7171
// Get all active connection states
7272
getAllConnectionStates: (c) => {
73-
return c.conns.entries().map(([id, conn]) => ({ id, ...conn.state })).toArray();
73+
return c.conns
74+
.entries()
75+
.map(([id, conn]) => ({ id, ...conn.state }))
76+
.toArray();
7477
},
7578

7679
// Send message to a specific connection with matching ID
7780
sendToConnection: (c, targetId: string, message: string) => {
7881
if (c.conns.has(targetId)) {
79-
c.conns.get(targetId)!.send("directMessage", { from: c.conn.id, message });
82+
c.conns
83+
.get(targetId)!
84+
.send("directMessage", { from: c.conn.id, message });
8085
return true;
8186
} else {
8287
return false;
@@ -90,8 +95,7 @@ export const connStateActor = actor({
9095
) => {
9196
if (updates.username) c.conn.state.username = updates.username;
9297
if (updates.role) c.conn.state.role = updates.role;
93-
return c.conn.state;
98+
return c.conn.state;
9499
},
95100
},
96101
});
97-

packages/core/fixtures/driver-test-suite/error-handling.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { actor, UserError } from "@rivetkit/core";
1+
import { UserError, actor } from "@rivetkit/core";
22

33
export const errorHandlingActor = actor({
44
onAuth: () => {},
@@ -95,4 +95,3 @@ export const customTimeoutActor = actor({
9595
},
9696
},
9797
});
98-

packages/core/fixtures/driver-test-suite/lifecycle.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ export const counterWithLifecycle = actor({
3434
},
3535
},
3636
});
37-

packages/core/fixtures/driver-test-suite/metadata.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,3 @@ export const metadataActor = actor({
7474
},
7575
},
7676
});
77-
78-

0 commit comments

Comments
 (0)