rivetkit 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schemas/actor-persist/v1.ts +0 -6
- package/dist/tsup/actor-router-consts-B3Lu87yJ.d.cts +28 -0
- package/dist/tsup/actor-router-consts-B3Lu87yJ.d.ts +28 -0
- package/dist/tsup/{chunk-7OUKNSTU.js → chunk-2NL3KGJ7.js} +17 -14
- package/dist/tsup/chunk-2NL3KGJ7.js.map +1 -0
- package/dist/tsup/{chunk-6P6RA47N.cjs → chunk-3ALZ7EGX.cjs} +14 -10
- package/dist/tsup/chunk-3ALZ7EGX.cjs.map +1 -0
- package/dist/tsup/chunk-4EXJ4ITR.cjs +102 -0
- package/dist/tsup/chunk-4EXJ4ITR.cjs.map +1 -0
- package/dist/tsup/{chunk-ZYLTS2EM.js → chunk-54MAHBLL.js} +2 -2
- package/dist/tsup/{chunk-NTCUGYSD.cjs → chunk-7OOBMCQI.cjs} +34 -31
- package/dist/tsup/chunk-7OOBMCQI.cjs.map +1 -0
- package/dist/tsup/{chunk-VCEHU56K.js → chunk-B6N6VM37.js} +2 -2
- package/dist/tsup/{chunk-VPV4MWXR.js → chunk-DIHKN7NM.js} +3 -3
- package/dist/tsup/{chunk-MRRT2CZD.cjs → chunk-ETDWYT2P.cjs} +7 -7
- package/dist/tsup/{chunk-MRRT2CZD.cjs.map → chunk-ETDWYT2P.cjs.map} +1 -1
- package/dist/tsup/{chunk-TWGATZ3X.cjs → chunk-F7YL5G7Q.cjs} +922 -872
- package/dist/tsup/chunk-F7YL5G7Q.cjs.map +1 -0
- package/dist/tsup/{chunk-UTI5NCES.cjs → chunk-GWJTWY3G.cjs} +6 -6
- package/dist/tsup/{chunk-UTI5NCES.cjs.map → chunk-GWJTWY3G.cjs.map} +1 -1
- package/dist/tsup/{chunk-W6LN7AF5.js → chunk-KHRZPP5T.js} +866 -816
- package/dist/tsup/chunk-KHRZPP5T.js.map +1 -0
- package/dist/tsup/{chunk-5JBFVV4C.cjs → chunk-LXAVET4A.cjs} +21 -7
- package/dist/tsup/chunk-LXAVET4A.cjs.map +1 -0
- package/dist/tsup/{chunk-TCUI5JFE.cjs → chunk-NDCVQZBS.cjs} +45 -18
- package/dist/tsup/chunk-NDCVQZBS.cjs.map +1 -0
- package/dist/tsup/{chunk-4CKHQRXG.js → chunk-NII4KKHD.js} +515 -240
- package/dist/tsup/chunk-NII4KKHD.js.map +1 -0
- package/dist/tsup/{chunk-2K3JMDAN.js → chunk-NRELKXIX.js} +40 -13
- package/dist/tsup/chunk-NRELKXIX.js.map +1 -0
- package/dist/tsup/{chunk-UFWAK3X2.cjs → chunk-NUA6LOOJ.cjs} +660 -385
- package/dist/tsup/chunk-NUA6LOOJ.cjs.map +1 -0
- package/dist/tsup/{chunk-DIAYNQTE.cjs → chunk-OSK2VSJF.cjs} +12 -12
- package/dist/tsup/{chunk-DIAYNQTE.cjs.map → chunk-OSK2VSJF.cjs.map} +1 -1
- package/dist/tsup/chunk-PD6HCAJE.js +102 -0
- package/dist/tsup/chunk-PD6HCAJE.js.map +1 -0
- package/dist/tsup/{chunk-RGQR2J7S.js → chunk-RLBM6D4L.js} +20 -6
- package/dist/tsup/chunk-RLBM6D4L.js.map +1 -0
- package/dist/tsup/{chunk-KG3C7MKR.cjs → chunk-VAF63BEI.cjs} +3 -3
- package/dist/tsup/{chunk-KG3C7MKR.cjs.map → chunk-VAF63BEI.cjs.map} +1 -1
- package/dist/tsup/{chunk-G75SVQON.js → chunk-WAT5AE7S.js} +9 -5
- package/dist/tsup/chunk-WAT5AE7S.js.map +1 -0
- package/dist/tsup/{chunk-WC2PSJWN.js → chunk-YL4VZMMT.js} +2 -2
- package/dist/tsup/client/mod.cjs +9 -9
- package/dist/tsup/client/mod.d.cts +7 -8
- package/dist/tsup/client/mod.d.ts +7 -8
- package/dist/tsup/client/mod.js +8 -8
- package/dist/tsup/common/log.cjs +3 -3
- package/dist/tsup/common/log.js +2 -2
- package/dist/tsup/common/websocket.cjs +4 -4
- package/dist/tsup/common/websocket.js +3 -3
- package/dist/tsup/{connection-BLemxi4f.d.ts → conn-DCSQgIlw.d.ts} +1605 -1353
- package/dist/tsup/{connection-CpDIydXf.d.cts → conn-DdzHTm2E.d.cts} +1605 -1353
- package/dist/tsup/driver-helpers/mod.cjs +31 -5
- package/dist/tsup/driver-helpers/mod.cjs.map +1 -1
- package/dist/tsup/driver-helpers/mod.d.cts +7 -8
- package/dist/tsup/driver-helpers/mod.d.ts +7 -8
- package/dist/tsup/driver-helpers/mod.js +33 -7
- package/dist/tsup/driver-test-suite/mod.cjs +317 -222
- package/dist/tsup/driver-test-suite/mod.cjs.map +1 -1
- package/dist/tsup/driver-test-suite/mod.d.cts +7 -7
- package/dist/tsup/driver-test-suite/mod.d.ts +7 -7
- package/dist/tsup/driver-test-suite/mod.js +582 -487
- package/dist/tsup/driver-test-suite/mod.js.map +1 -1
- package/dist/tsup/inspector/mod.cjs +16 -6
- package/dist/tsup/inspector/mod.cjs.map +1 -1
- package/dist/tsup/inspector/mod.d.cts +34 -7
- package/dist/tsup/inspector/mod.d.ts +34 -7
- package/dist/tsup/inspector/mod.js +17 -7
- package/dist/tsup/mod.cjs +10 -20
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +9 -7
- package/dist/tsup/mod.d.ts +9 -7
- package/dist/tsup/mod.js +9 -19
- package/dist/tsup/test/mod.cjs +11 -11
- package/dist/tsup/test/mod.d.cts +6 -7
- package/dist/tsup/test/mod.d.ts +6 -7
- package/dist/tsup/test/mod.js +10 -10
- package/dist/tsup/utils.cjs +4 -2
- package/dist/tsup/utils.cjs.map +1 -1
- package/dist/tsup/utils.d.cts +11 -1
- package/dist/tsup/utils.d.ts +11 -1
- package/dist/tsup/utils.js +3 -1
- package/package.json +8 -4
- package/src/actor/action.ts +1 -1
- package/src/actor/config.ts +1 -1
- package/src/actor/conn-drivers.ts +205 -0
- package/src/actor/conn-socket.ts +6 -0
- package/src/actor/{connection.ts → conn.ts} +78 -84
- package/src/actor/context.ts +1 -1
- package/src/actor/driver.ts +4 -43
- package/src/actor/instance.ts +162 -86
- package/src/actor/mod.ts +1 -11
- package/src/actor/persisted.ts +2 -5
- package/src/actor/protocol/old.ts +1 -1
- package/src/actor/router-endpoints.ts +142 -106
- package/src/actor/router.ts +81 -45
- package/src/actor/utils.ts +5 -1
- package/src/client/actor-conn.ts +154 -23
- package/src/client/client.ts +1 -1
- package/src/client/config.ts +7 -0
- package/src/common/actor-router-consts.ts +29 -8
- package/src/common/router.ts +2 -1
- package/src/common/versioned-data.ts +5 -5
- package/src/driver-helpers/mod.ts +14 -1
- package/src/driver-test-suite/mod.ts +11 -2
- package/src/driver-test-suite/test-inline-client-driver.ts +36 -18
- package/src/driver-test-suite/tests/actor-conn-state.ts +66 -22
- package/src/driver-test-suite/tests/actor-conn.ts +65 -126
- package/src/driver-test-suite/tests/actor-reconnect.ts +160 -0
- package/src/driver-test-suite/tests/actor-sleep.ts +0 -1
- package/src/driver-test-suite/tests/raw-websocket.ts +0 -35
- package/src/driver-test-suite/utils.ts +3 -3
- package/src/drivers/default.ts +8 -7
- package/src/drivers/engine/actor-driver.ts +53 -31
- package/src/drivers/engine/config.ts +4 -0
- package/src/drivers/file-system/actor.ts +0 -6
- package/src/drivers/file-system/global-state.ts +3 -14
- package/src/drivers/file-system/manager.ts +12 -8
- package/src/inspector/actor.ts +4 -3
- package/src/inspector/config.ts +10 -1
- package/src/inspector/mod.ts +1 -0
- package/src/inspector/utils.ts +23 -4
- package/src/manager/driver.ts +11 -1
- package/src/manager/gateway.ts +407 -0
- package/src/manager/router.ts +269 -468
- package/src/manager-api/actors.ts +61 -0
- package/src/manager-api/common.ts +4 -0
- package/src/mod.ts +1 -1
- package/src/registry/mod.ts +119 -10
- package/src/remote-manager-driver/actor-http-client.ts +30 -19
- package/src/remote-manager-driver/actor-websocket-client.ts +43 -16
- package/src/remote-manager-driver/api-endpoints.ts +19 -21
- package/src/remote-manager-driver/api-utils.ts +10 -1
- package/src/remote-manager-driver/mod.ts +51 -48
- package/src/remote-manager-driver/ws-proxy.ts +2 -9
- package/src/test/mod.ts +6 -2
- package/src/utils.ts +21 -2
- package/dist/tsup/actor-router-consts-BK6arfy8.d.cts +0 -17
- package/dist/tsup/actor-router-consts-BK6arfy8.d.ts +0 -17
- package/dist/tsup/chunk-2K3JMDAN.js.map +0 -1
- package/dist/tsup/chunk-42I3OZ3Q.js +0 -15
- package/dist/tsup/chunk-42I3OZ3Q.js.map +0 -1
- package/dist/tsup/chunk-4CKHQRXG.js.map +0 -1
- package/dist/tsup/chunk-5JBFVV4C.cjs.map +0 -1
- package/dist/tsup/chunk-6P6RA47N.cjs.map +0 -1
- package/dist/tsup/chunk-7OUKNSTU.js.map +0 -1
- package/dist/tsup/chunk-G75SVQON.js.map +0 -1
- package/dist/tsup/chunk-KUPQZYUQ.cjs +0 -15
- package/dist/tsup/chunk-KUPQZYUQ.cjs.map +0 -1
- package/dist/tsup/chunk-NTCUGYSD.cjs.map +0 -1
- package/dist/tsup/chunk-RGQR2J7S.js.map +0 -1
- package/dist/tsup/chunk-TCUI5JFE.cjs.map +0 -1
- package/dist/tsup/chunk-TWGATZ3X.cjs.map +0 -1
- package/dist/tsup/chunk-UFWAK3X2.cjs.map +0 -1
- package/dist/tsup/chunk-W6LN7AF5.js.map +0 -1
- package/dist/tsup/common-CXCe7s6i.d.cts +0 -218
- package/dist/tsup/common-CXCe7s6i.d.ts +0 -218
- package/src/actor/generic-conn-driver.ts +0 -246
- package/src/common/fake-event-source.ts +0 -267
- package/src/manager-api/routes/actors-create.ts +0 -16
- package/src/manager-api/routes/actors-delete.ts +0 -4
- package/src/manager-api/routes/actors-get-by-id.ts +0 -7
- package/src/manager-api/routes/actors-get-or-create-by-id.ts +0 -29
- package/src/manager-api/routes/actors-get.ts +0 -7
- package/src/manager-api/routes/common.ts +0 -18
- /package/dist/tsup/{chunk-ZYLTS2EM.js.map → chunk-54MAHBLL.js.map} +0 -0
- /package/dist/tsup/{chunk-VCEHU56K.js.map → chunk-B6N6VM37.js.map} +0 -0
- /package/dist/tsup/{chunk-VPV4MWXR.js.map → chunk-DIHKN7NM.js.map} +0 -0
- /package/dist/tsup/{chunk-WC2PSJWN.js.map → chunk-YL4VZMMT.js.map} +0 -0
|
@@ -1,267 +0,0 @@
|
|
|
1
|
-
import type { EventListener } from "eventsource";
|
|
2
|
-
import type { SSEStreamingApi } from "hono/streaming";
|
|
3
|
-
import { getLogger } from "@/common//log";
|
|
4
|
-
import type {
|
|
5
|
-
UniversalEvent,
|
|
6
|
-
UniversalEventSource,
|
|
7
|
-
UniversalMessageEvent,
|
|
8
|
-
} from "@/common/eventsource-interface";
|
|
9
|
-
|
|
10
|
-
export function logger() {
|
|
11
|
-
return getLogger("fake-event-source");
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* FakeEventSource provides a minimal implementation of an SSE stream
|
|
16
|
-
* that handles events for the inline client driver
|
|
17
|
-
*/
|
|
18
|
-
export class FakeEventSource implements UniversalEventSource {
|
|
19
|
-
// EventSource readyState values
|
|
20
|
-
readonly CONNECTING = 0 as const;
|
|
21
|
-
readonly OPEN = 1 as const;
|
|
22
|
-
readonly CLOSED = 2 as const;
|
|
23
|
-
|
|
24
|
-
url = "http://internal-sse-endpoint";
|
|
25
|
-
readyState: 0 | 1 | 2 = 1; // OPEN
|
|
26
|
-
withCredentials = false;
|
|
27
|
-
|
|
28
|
-
// Event handlers
|
|
29
|
-
onopen: ((event: UniversalEvent) => void) | null = null;
|
|
30
|
-
onmessage: ((event: UniversalMessageEvent) => void) | null = null;
|
|
31
|
-
onerror: ((event: UniversalEvent) => void) | null = null;
|
|
32
|
-
|
|
33
|
-
// Private event listeners
|
|
34
|
-
#listeners: Record<string, Set<EventListener>> = {
|
|
35
|
-
open: new Set(),
|
|
36
|
-
message: new Set(),
|
|
37
|
-
error: new Set(),
|
|
38
|
-
close: new Set(),
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// Stream that will be passed to the handler
|
|
42
|
-
#stream: SSEStreamingApi;
|
|
43
|
-
#onCloseCallback: () => Promise<void>;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Creates a new FakeEventSource
|
|
47
|
-
*/
|
|
48
|
-
constructor(onCloseCallback: () => Promise<void>) {
|
|
49
|
-
this.#onCloseCallback = onCloseCallback;
|
|
50
|
-
|
|
51
|
-
this.#stream = this.#createStreamApi();
|
|
52
|
-
|
|
53
|
-
// Trigger open event on next tick
|
|
54
|
-
setTimeout(() => {
|
|
55
|
-
if (this.readyState === 1) {
|
|
56
|
-
this.#dispatchEvent("open");
|
|
57
|
-
}
|
|
58
|
-
}, 0);
|
|
59
|
-
|
|
60
|
-
logger().debug("FakeEventSource created");
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Creates the SSE streaming API implementation
|
|
64
|
-
#createStreamApi(): SSEStreamingApi {
|
|
65
|
-
// Create self-reference for closures
|
|
66
|
-
const self = this;
|
|
67
|
-
|
|
68
|
-
const streamApi: SSEStreamingApi = {
|
|
69
|
-
write: async (input) => {
|
|
70
|
-
const data =
|
|
71
|
-
typeof input === "string" ? input : new TextDecoder().decode(input);
|
|
72
|
-
self.#dispatchEvent("message", { data });
|
|
73
|
-
return streamApi;
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
writeln: async (input: string) => {
|
|
77
|
-
await streamApi.write(input + "\n");
|
|
78
|
-
return streamApi;
|
|
79
|
-
},
|
|
80
|
-
|
|
81
|
-
writeSSE: async (message: {
|
|
82
|
-
data: string | Promise<string>;
|
|
83
|
-
event?: string;
|
|
84
|
-
id?: string;
|
|
85
|
-
retry?: number;
|
|
86
|
-
}): Promise<void> => {
|
|
87
|
-
const data = await message.data;
|
|
88
|
-
|
|
89
|
-
if (message.event) {
|
|
90
|
-
self.#dispatchEvent(message.event, { data });
|
|
91
|
-
} else {
|
|
92
|
-
self.#dispatchEvent("message", { data });
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
sleep: async (ms: number) => {
|
|
97
|
-
await new Promise((resolve) => setTimeout(resolve, ms));
|
|
98
|
-
return streamApi;
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
close: async () => {
|
|
102
|
-
self.close();
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
pipe: async (_body: ReadableStream) => {
|
|
106
|
-
// No-op implementation
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
onAbort: async (cb: () => void) => {
|
|
110
|
-
self.addEventListener("error", () => {
|
|
111
|
-
cb();
|
|
112
|
-
});
|
|
113
|
-
return streamApi;
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
abort: async () => {
|
|
117
|
-
self.#dispatchEvent("error");
|
|
118
|
-
return streamApi;
|
|
119
|
-
},
|
|
120
|
-
|
|
121
|
-
// Additional required properties
|
|
122
|
-
get responseReadable() {
|
|
123
|
-
return null as unknown as ReadableStream;
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
-
get aborted() {
|
|
127
|
-
return self.readyState === 2; // CLOSED
|
|
128
|
-
},
|
|
129
|
-
|
|
130
|
-
get closed() {
|
|
131
|
-
return self.readyState === 2; // CLOSED
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
return streamApi;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Closes the connection
|
|
140
|
-
*/
|
|
141
|
-
close(): void {
|
|
142
|
-
if (this.readyState === 2) {
|
|
143
|
-
// CLOSED
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
logger().debug({ msg: "closing FakeEventSource" });
|
|
148
|
-
this.readyState = 2; // CLOSED
|
|
149
|
-
|
|
150
|
-
// Call the close callback
|
|
151
|
-
this.#onCloseCallback().catch((err) => {
|
|
152
|
-
logger().error({ msg: "error in onClose callback", error: err });
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
// Dispatch close event
|
|
156
|
-
this.#dispatchEvent("close");
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Get the stream API to pass to the handler
|
|
161
|
-
*/
|
|
162
|
-
getStream(): SSEStreamingApi {
|
|
163
|
-
return this.#stream;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// Implementation of EventTarget-like interface
|
|
167
|
-
addEventListener(type: string, listener: EventListener): void {
|
|
168
|
-
if (!this.#listeners[type]) {
|
|
169
|
-
this.#listeners[type] = new Set();
|
|
170
|
-
}
|
|
171
|
-
this.#listeners[type].add(listener);
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
removeEventListener(type: string, listener: EventListener): void {
|
|
175
|
-
if (this.#listeners[type]) {
|
|
176
|
-
this.#listeners[type].delete(listener);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
dispatchEvent(event: UniversalEvent): boolean {
|
|
181
|
-
this.#dispatchEvent(event.type, event);
|
|
182
|
-
return true;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
// Internal method to dispatch events
|
|
186
|
-
#dispatchEvent(type: string, detail?: Record<string, any>): void {
|
|
187
|
-
// Create appropriate event object
|
|
188
|
-
let event: any;
|
|
189
|
-
if (type === "message") {
|
|
190
|
-
event = {
|
|
191
|
-
type: "message",
|
|
192
|
-
target: this,
|
|
193
|
-
data: detail?.data || "",
|
|
194
|
-
origin: "",
|
|
195
|
-
lastEventId: "",
|
|
196
|
-
};
|
|
197
|
-
} else if (type === "close") {
|
|
198
|
-
event = {
|
|
199
|
-
type: "close",
|
|
200
|
-
target: this,
|
|
201
|
-
code: detail?.code || 1000,
|
|
202
|
-
reason: detail?.reason || "",
|
|
203
|
-
wasClean: detail?.wasClean ?? true,
|
|
204
|
-
};
|
|
205
|
-
} else if (type === "error") {
|
|
206
|
-
event = {
|
|
207
|
-
type: "error",
|
|
208
|
-
target: this,
|
|
209
|
-
error: detail?.error,
|
|
210
|
-
};
|
|
211
|
-
} else {
|
|
212
|
-
event = {
|
|
213
|
-
type: type,
|
|
214
|
-
target: this,
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// Call all listeners first
|
|
219
|
-
if (this.#listeners[type]) {
|
|
220
|
-
for (const listener of this.#listeners[type]) {
|
|
221
|
-
try {
|
|
222
|
-
listener.call(this, event);
|
|
223
|
-
} catch (err) {
|
|
224
|
-
logger().error({
|
|
225
|
-
msg: `error in ${type} event listener`,
|
|
226
|
-
error: err,
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
// Then call specific handler
|
|
233
|
-
switch (type) {
|
|
234
|
-
case "open":
|
|
235
|
-
if (this.onopen) {
|
|
236
|
-
try {
|
|
237
|
-
this.onopen.call(this as any, event);
|
|
238
|
-
} catch (err) {
|
|
239
|
-
logger().error({ msg: "error in onopen handler", error: err });
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
break;
|
|
243
|
-
case "message":
|
|
244
|
-
if (this.onmessage) {
|
|
245
|
-
try {
|
|
246
|
-
this.onmessage.call(this as any, event);
|
|
247
|
-
} catch (err) {
|
|
248
|
-
logger().error({ msg: "error in onmessage handler", error: err });
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
break;
|
|
252
|
-
case "error":
|
|
253
|
-
if (this.onerror) {
|
|
254
|
-
try {
|
|
255
|
-
this.onerror.call(this as any, event);
|
|
256
|
-
} catch (err) {
|
|
257
|
-
logger().error({ msg: "error in onerror handler", error: err });
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
break;
|
|
261
|
-
case "close":
|
|
262
|
-
// Note: EventSource doesn't have onclose in the standard API
|
|
263
|
-
// but we handle it here for consistency
|
|
264
|
-
break;
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { ActorSchema } from "./common";
|
|
3
|
-
|
|
4
|
-
export const ActorsCreateRequestSchema = z.object({
|
|
5
|
-
name: z.string(),
|
|
6
|
-
runner_name_selector: z.string(),
|
|
7
|
-
crash_policy: z.string(),
|
|
8
|
-
key: z.string().nullable().optional(),
|
|
9
|
-
input: z.string().nullable().optional(),
|
|
10
|
-
});
|
|
11
|
-
export type ActorsCreateRequest = z.infer<typeof ActorsCreateRequestSchema>;
|
|
12
|
-
|
|
13
|
-
export const ActorsCreateResponseSchema = z.object({
|
|
14
|
-
actor: ActorSchema,
|
|
15
|
-
});
|
|
16
|
-
export type ActorsCreateResponse = z.infer<typeof ActorsCreateResponseSchema>;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { ActorSchema, RivetIdSchema } from "./common";
|
|
3
|
-
|
|
4
|
-
export const ActorsGetOrCreateResponseSchema = z.object({
|
|
5
|
-
actor: ActorSchema,
|
|
6
|
-
created: z.boolean(),
|
|
7
|
-
});
|
|
8
|
-
export type ActorsGetOrCreateResponse = z.infer<
|
|
9
|
-
typeof ActorsGetOrCreateResponseSchema
|
|
10
|
-
>;
|
|
11
|
-
|
|
12
|
-
export const ActorsGetOrCreateByIdResponseSchema = z.object({
|
|
13
|
-
actor_id: RivetIdSchema,
|
|
14
|
-
created: z.boolean(),
|
|
15
|
-
});
|
|
16
|
-
export type ActorsGetOrCreateByIdResponse = z.infer<
|
|
17
|
-
typeof ActorsGetOrCreateByIdResponseSchema
|
|
18
|
-
>;
|
|
19
|
-
|
|
20
|
-
export const ActorsGetOrCreateByIdRequestSchema = z.object({
|
|
21
|
-
name: z.string(),
|
|
22
|
-
key: z.string(),
|
|
23
|
-
runner_name_selector: z.string(),
|
|
24
|
-
crash_policy: z.string(),
|
|
25
|
-
input: z.string().nullable().optional(),
|
|
26
|
-
});
|
|
27
|
-
export type ActorsGetOrCreateByIdRequest = z.infer<
|
|
28
|
-
typeof ActorsGetOrCreateByIdRequestSchema
|
|
29
|
-
>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const RivetIdSchema = z.string();
|
|
4
|
-
export type RivetId = z.infer<typeof RivetIdSchema>;
|
|
5
|
-
|
|
6
|
-
export const ActorSchema = z.object({
|
|
7
|
-
actor_id: RivetIdSchema,
|
|
8
|
-
name: z.string(),
|
|
9
|
-
key: z.string(),
|
|
10
|
-
namespace_id: RivetIdSchema,
|
|
11
|
-
runner_name_selector: z.string(),
|
|
12
|
-
create_ts: z.number(),
|
|
13
|
-
connectable_ts: z.number().nullable().optional(),
|
|
14
|
-
destroy_ts: z.number().nullable().optional(),
|
|
15
|
-
sleep_ts: z.number().nullable().optional(),
|
|
16
|
-
start_ts: z.number().nullable().optional(),
|
|
17
|
-
});
|
|
18
|
-
export type Actor = z.infer<typeof ActorSchema>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|