rivetkit 2.0.2 → 2.0.3
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 +228 -0
- package/dist/schemas/client-protocol/v1.ts +429 -0
- package/dist/schemas/file-system-driver/v1.ts +102 -0
- package/dist/tsup/actor/errors.cjs +69 -0
- package/dist/tsup/actor/errors.cjs.map +1 -0
- package/dist/tsup/actor/errors.d.cts +143 -0
- package/dist/tsup/actor/errors.d.ts +143 -0
- package/dist/tsup/actor/errors.js +69 -0
- package/dist/tsup/actor/errors.js.map +1 -0
- package/dist/tsup/chunk-2CRLFV6Z.cjs +202 -0
- package/dist/tsup/chunk-2CRLFV6Z.cjs.map +1 -0
- package/dist/tsup/chunk-3H7O2A7I.js +525 -0
- package/dist/tsup/chunk-3H7O2A7I.js.map +1 -0
- package/dist/tsup/chunk-42I3OZ3Q.js +15 -0
- package/dist/tsup/chunk-42I3OZ3Q.js.map +1 -0
- package/dist/tsup/chunk-4NSUQZ2H.js +1790 -0
- package/dist/tsup/chunk-4NSUQZ2H.js.map +1 -0
- package/dist/tsup/chunk-6PDXBYI5.js +132 -0
- package/dist/tsup/chunk-6PDXBYI5.js.map +1 -0
- package/dist/tsup/chunk-6WKQDDUD.cjs +1790 -0
- package/dist/tsup/chunk-6WKQDDUD.cjs.map +1 -0
- package/dist/tsup/chunk-CTBOSFUH.cjs +116 -0
- package/dist/tsup/chunk-CTBOSFUH.cjs.map +1 -0
- package/dist/tsup/chunk-EGVZZFE2.js +2857 -0
- package/dist/tsup/chunk-EGVZZFE2.js.map +1 -0
- package/dist/tsup/chunk-FCCPJNMA.cjs +132 -0
- package/dist/tsup/chunk-FCCPJNMA.cjs.map +1 -0
- package/dist/tsup/chunk-FLMTTN27.js +244 -0
- package/dist/tsup/chunk-FLMTTN27.js.map +1 -0
- package/dist/tsup/chunk-GIR3AFFI.cjs +315 -0
- package/dist/tsup/chunk-GIR3AFFI.cjs.map +1 -0
- package/dist/tsup/chunk-INGJP237.js +315 -0
- package/dist/tsup/chunk-INGJP237.js.map +1 -0
- package/dist/tsup/chunk-KJCJLKRM.js +116 -0
- package/dist/tsup/chunk-KJCJLKRM.js.map +1 -0
- package/dist/tsup/chunk-KUPQZYUQ.cjs +15 -0
- package/dist/tsup/chunk-KUPQZYUQ.cjs.map +1 -0
- package/dist/tsup/chunk-O2MBYIXO.cjs +2857 -0
- package/dist/tsup/chunk-O2MBYIXO.cjs.map +1 -0
- package/dist/tsup/chunk-OGAPU3UG.cjs +525 -0
- package/dist/tsup/chunk-OGAPU3UG.cjs.map +1 -0
- package/dist/tsup/chunk-OV6AYD4S.js +4406 -0
- package/dist/tsup/chunk-OV6AYD4S.js.map +1 -0
- package/dist/tsup/chunk-PO4VLDWA.js +47 -0
- package/dist/tsup/chunk-PO4VLDWA.js.map +1 -0
- package/dist/tsup/chunk-R2OPSKIV.cjs +244 -0
- package/dist/tsup/chunk-R2OPSKIV.cjs.map +1 -0
- package/dist/tsup/chunk-TZJKSBUQ.cjs +47 -0
- package/dist/tsup/chunk-TZJKSBUQ.cjs.map +1 -0
- package/dist/tsup/chunk-UBUC5C3G.cjs +189 -0
- package/dist/tsup/chunk-UBUC5C3G.cjs.map +1 -0
- package/dist/tsup/chunk-UIM22YJL.cjs +4406 -0
- package/dist/tsup/chunk-UIM22YJL.cjs.map +1 -0
- package/dist/tsup/chunk-URVFQMYI.cjs +230 -0
- package/dist/tsup/chunk-URVFQMYI.cjs.map +1 -0
- package/dist/tsup/chunk-UVUPOS46.js +230 -0
- package/dist/tsup/chunk-UVUPOS46.js.map +1 -0
- package/dist/tsup/chunk-VRRHBNJC.js +189 -0
- package/dist/tsup/chunk-VRRHBNJC.js.map +1 -0
- package/dist/tsup/chunk-XFSS33EQ.js +202 -0
- package/dist/tsup/chunk-XFSS33EQ.js.map +1 -0
- package/dist/tsup/client/mod.cjs +32 -0
- package/dist/tsup/client/mod.cjs.map +1 -0
- package/dist/tsup/client/mod.d.cts +26 -0
- package/dist/tsup/client/mod.d.ts +26 -0
- package/dist/tsup/client/mod.js +32 -0
- package/dist/tsup/client/mod.js.map +1 -0
- package/dist/tsup/common/log.cjs +13 -0
- package/dist/tsup/common/log.cjs.map +1 -0
- package/dist/tsup/common/log.d.cts +20 -0
- package/dist/tsup/common/log.d.ts +20 -0
- package/dist/tsup/common/log.js +13 -0
- package/dist/tsup/common/log.js.map +1 -0
- package/dist/tsup/common/websocket.cjs +10 -0
- package/dist/tsup/common/websocket.cjs.map +1 -0
- package/dist/tsup/common/websocket.d.cts +3 -0
- package/dist/tsup/common/websocket.d.ts +3 -0
- package/dist/tsup/common/websocket.js +10 -0
- package/dist/tsup/common/websocket.js.map +1 -0
- package/dist/tsup/common-CpqORuCq.d.cts +218 -0
- package/dist/tsup/common-CpqORuCq.d.ts +218 -0
- package/dist/tsup/connection-BR_Ve4ku.d.cts +2117 -0
- package/dist/tsup/connection-BwUMoe6n.d.ts +2117 -0
- package/dist/tsup/driver-helpers/mod.cjs +33 -0
- package/dist/tsup/driver-helpers/mod.cjs.map +1 -0
- package/dist/tsup/driver-helpers/mod.d.cts +18 -0
- package/dist/tsup/driver-helpers/mod.d.ts +18 -0
- package/dist/tsup/driver-helpers/mod.js +33 -0
- package/dist/tsup/driver-helpers/mod.js.map +1 -0
- package/dist/tsup/driver-test-suite/mod.cjs +4619 -0
- package/dist/tsup/driver-test-suite/mod.cjs.map +1 -0
- package/dist/tsup/driver-test-suite/mod.d.cts +57 -0
- package/dist/tsup/driver-test-suite/mod.d.ts +57 -0
- package/dist/tsup/driver-test-suite/mod.js +4619 -0
- package/dist/tsup/driver-test-suite/mod.js.map +1 -0
- package/dist/tsup/inspector/mod.cjs +53 -0
- package/dist/tsup/inspector/mod.cjs.map +1 -0
- package/dist/tsup/inspector/mod.d.cts +408 -0
- package/dist/tsup/inspector/mod.d.ts +408 -0
- package/dist/tsup/inspector/mod.js +53 -0
- package/dist/tsup/inspector/mod.js.map +1 -0
- package/dist/tsup/mod.cjs +73 -0
- package/dist/tsup/mod.cjs.map +1 -0
- package/dist/tsup/mod.d.cts +100 -0
- package/dist/tsup/mod.d.ts +100 -0
- package/dist/tsup/mod.js +73 -0
- package/dist/tsup/mod.js.map +1 -0
- package/dist/tsup/router-endpoints-AYkXG8Tl.d.cts +66 -0
- package/dist/tsup/router-endpoints-DAbqVFx2.d.ts +66 -0
- package/dist/tsup/test/mod.cjs +21 -0
- package/dist/tsup/test/mod.cjs.map +1 -0
- package/dist/tsup/test/mod.d.cts +27 -0
- package/dist/tsup/test/mod.d.ts +27 -0
- package/dist/tsup/test/mod.js +21 -0
- package/dist/tsup/test/mod.js.map +1 -0
- package/dist/tsup/utils-CT0cv4jd.d.cts +17 -0
- package/dist/tsup/utils-CT0cv4jd.d.ts +17 -0
- package/dist/tsup/utils.cjs +26 -0
- package/dist/tsup/utils.cjs.map +1 -0
- package/dist/tsup/utils.d.cts +36 -0
- package/dist/tsup/utils.d.ts +36 -0
- package/dist/tsup/utils.js +26 -0
- package/dist/tsup/utils.js.map +1 -0
- package/package.json +208 -5
- package/src/actor/action.ts +182 -0
- package/src/actor/config.ts +765 -0
- package/src/actor/connection.ts +260 -0
- package/src/actor/context.ts +171 -0
- package/src/actor/database.ts +23 -0
- package/src/actor/definition.ts +86 -0
- package/src/actor/driver.ts +84 -0
- package/src/actor/errors.ts +360 -0
- package/src/actor/generic-conn-driver.ts +234 -0
- package/src/actor/instance.ts +1800 -0
- package/src/actor/log.ts +15 -0
- package/src/actor/mod.ts +113 -0
- package/src/actor/persisted.ts +42 -0
- package/src/actor/protocol/old.ts +281 -0
- package/src/actor/protocol/serde.ts +131 -0
- package/src/actor/router-endpoints.ts +685 -0
- package/src/actor/router.ts +263 -0
- package/src/actor/schedule.ts +17 -0
- package/src/actor/unstable-react.ts +110 -0
- package/src/actor/utils.ts +98 -0
- package/src/client/actor-common.ts +30 -0
- package/src/client/actor-conn.ts +804 -0
- package/src/client/actor-handle.ts +208 -0
- package/src/client/client.ts +623 -0
- package/src/client/errors.ts +41 -0
- package/src/client/http-client-driver.ts +326 -0
- package/src/client/log.ts +7 -0
- package/src/client/mod.ts +56 -0
- package/src/client/raw-utils.ts +92 -0
- package/src/client/test.ts +44 -0
- package/src/client/utils.ts +150 -0
- package/src/common/eventsource-interface.ts +47 -0
- package/src/common/eventsource.ts +80 -0
- package/src/common/fake-event-source.ts +266 -0
- package/src/common/inline-websocket-adapter2.ts +445 -0
- package/src/common/log-levels.ts +27 -0
- package/src/common/log.ts +139 -0
- package/src/common/logfmt.ts +228 -0
- package/src/common/network.ts +2 -0
- package/src/common/router.ts +87 -0
- package/src/common/utils.ts +322 -0
- package/src/common/versioned-data.ts +95 -0
- package/src/common/websocket-interface.ts +49 -0
- package/src/common/websocket.ts +43 -0
- package/src/driver-helpers/mod.ts +22 -0
- package/src/driver-helpers/utils.ts +17 -0
- package/src/driver-test-suite/log.ts +7 -0
- package/src/driver-test-suite/mod.ts +213 -0
- package/src/driver-test-suite/test-inline-client-driver.ts +402 -0
- package/src/driver-test-suite/tests/action-features.ts +136 -0
- package/src/driver-test-suite/tests/actor-auth.ts +591 -0
- package/src/driver-test-suite/tests/actor-conn-state.ts +249 -0
- package/src/driver-test-suite/tests/actor-conn.ts +349 -0
- package/src/driver-test-suite/tests/actor-driver.ts +25 -0
- package/src/driver-test-suite/tests/actor-error-handling.ts +158 -0
- package/src/driver-test-suite/tests/actor-handle.ts +259 -0
- package/src/driver-test-suite/tests/actor-inline-client.ts +152 -0
- package/src/driver-test-suite/tests/actor-inspector.ts +570 -0
- package/src/driver-test-suite/tests/actor-metadata.ts +116 -0
- package/src/driver-test-suite/tests/actor-onstatechange.ts +95 -0
- package/src/driver-test-suite/tests/actor-schedule.ts +108 -0
- package/src/driver-test-suite/tests/actor-sleep.ts +413 -0
- package/src/driver-test-suite/tests/actor-state.ts +54 -0
- package/src/driver-test-suite/tests/actor-vars.ts +93 -0
- package/src/driver-test-suite/tests/manager-driver.ts +365 -0
- package/src/driver-test-suite/tests/raw-http-direct-registry.ts +226 -0
- package/src/driver-test-suite/tests/raw-http-request-properties.ts +414 -0
- package/src/driver-test-suite/tests/raw-http.ts +347 -0
- package/src/driver-test-suite/tests/raw-websocket-direct-registry.ts +392 -0
- package/src/driver-test-suite/tests/raw-websocket.ts +484 -0
- package/src/driver-test-suite/tests/request-access.ts +244 -0
- package/src/driver-test-suite/utils.ts +68 -0
- package/src/drivers/default.ts +31 -0
- package/src/drivers/engine/actor-driver.ts +360 -0
- package/src/drivers/engine/api-endpoints.ts +128 -0
- package/src/drivers/engine/api-utils.ts +70 -0
- package/src/drivers/engine/config.ts +39 -0
- package/src/drivers/engine/keys.test.ts +266 -0
- package/src/drivers/engine/keys.ts +89 -0
- package/src/drivers/engine/kv.ts +3 -0
- package/src/drivers/engine/log.ts +7 -0
- package/src/drivers/engine/manager-driver.ts +391 -0
- package/src/drivers/engine/mod.ts +36 -0
- package/src/drivers/engine/ws-proxy.ts +170 -0
- package/src/drivers/file-system/actor.ts +91 -0
- package/src/drivers/file-system/global-state.ts +673 -0
- package/src/drivers/file-system/log.ts +7 -0
- package/src/drivers/file-system/manager.ts +306 -0
- package/src/drivers/file-system/mod.ts +48 -0
- package/src/drivers/file-system/utils.ts +109 -0
- package/src/globals.d.ts +6 -0
- package/src/inline-client-driver/log.ts +7 -0
- package/src/inline-client-driver/mod.ts +385 -0
- package/src/inspector/actor.ts +298 -0
- package/src/inspector/config.ts +83 -0
- package/src/inspector/log.ts +5 -0
- package/src/inspector/manager.ts +86 -0
- package/src/inspector/mod.ts +2 -0
- package/src/inspector/protocol/actor.ts +10 -0
- package/src/inspector/protocol/common.ts +196 -0
- package/src/inspector/protocol/manager.ts +10 -0
- package/src/inspector/protocol/mod.ts +2 -0
- package/src/inspector/utils.ts +76 -0
- package/src/manager/auth.ts +121 -0
- package/src/manager/driver.ts +80 -0
- package/src/manager/hono-websocket-adapter.ts +333 -0
- package/src/manager/log.ts +7 -0
- package/src/manager/mod.ts +2 -0
- package/src/manager/protocol/mod.ts +24 -0
- package/src/manager/protocol/query.ts +89 -0
- package/src/manager/router.ts +1792 -0
- package/src/mod.ts +20 -0
- package/src/registry/config.ts +32 -0
- package/src/registry/log.ts +7 -0
- package/src/registry/mod.ts +124 -0
- package/src/registry/run-config.ts +54 -0
- package/src/registry/serve.ts +53 -0
- package/src/schemas/actor-persist/mod.ts +1 -0
- package/src/schemas/actor-persist/versioned.ts +25 -0
- package/src/schemas/client-protocol/mod.ts +1 -0
- package/src/schemas/client-protocol/versioned.ts +63 -0
- package/src/schemas/file-system-driver/mod.ts +1 -0
- package/src/schemas/file-system-driver/versioned.ts +28 -0
- package/src/serde.ts +84 -0
- package/src/test/config.ts +16 -0
- package/src/test/log.ts +7 -0
- package/src/test/mod.ts +153 -0
- package/src/utils.ts +172 -0
- package/README.md +0 -13
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as bare from "@bare-ts/lib"
|
|
2
|
+
|
|
3
|
+
const config = /* @__PURE__ */ bare.Config({})
|
|
4
|
+
|
|
5
|
+
export type u64 = bigint
|
|
6
|
+
export type uint = bigint
|
|
7
|
+
|
|
8
|
+
function read0(bc: bare.ByteCursor): readonly string[] {
|
|
9
|
+
const len = bare.readUintSafe(bc)
|
|
10
|
+
if (len === 0) { return [] }
|
|
11
|
+
const result = [bare.readString(bc)]
|
|
12
|
+
for (let i = 1; i < len; i++) {
|
|
13
|
+
result[i] = bare.readString(bc)
|
|
14
|
+
}
|
|
15
|
+
return result
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function write0(bc: bare.ByteCursor, x: readonly string[]): void {
|
|
19
|
+
bare.writeUintSafe(bc, x.length)
|
|
20
|
+
for (let i = 0; i < x.length; i++) {
|
|
21
|
+
bare.writeString(bc, x[i])
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type ActorState = {
|
|
26
|
+
readonly actorId: string,
|
|
27
|
+
readonly name: string,
|
|
28
|
+
readonly key: readonly string[],
|
|
29
|
+
readonly persistedData: ArrayBuffer,
|
|
30
|
+
readonly createdAt: u64,
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function readActorState(bc: bare.ByteCursor): ActorState {
|
|
34
|
+
return {
|
|
35
|
+
actorId: bare.readString(bc),
|
|
36
|
+
name: bare.readString(bc),
|
|
37
|
+
key: read0(bc),
|
|
38
|
+
persistedData: bare.readData(bc),
|
|
39
|
+
createdAt: bare.readU64(bc),
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function writeActorState(bc: bare.ByteCursor, x: ActorState): void {
|
|
44
|
+
bare.writeString(bc, x.actorId)
|
|
45
|
+
bare.writeString(bc, x.name)
|
|
46
|
+
write0(bc, x.key)
|
|
47
|
+
bare.writeData(bc, x.persistedData)
|
|
48
|
+
bare.writeU64(bc, x.createdAt)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function encodeActorState(x: ActorState): Uint8Array {
|
|
52
|
+
const bc = new bare.ByteCursor(
|
|
53
|
+
new Uint8Array(config.initialBufferLength),
|
|
54
|
+
config
|
|
55
|
+
)
|
|
56
|
+
writeActorState(bc, x)
|
|
57
|
+
return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function decodeActorState(bytes: Uint8Array): ActorState {
|
|
61
|
+
const bc = new bare.ByteCursor(bytes, config)
|
|
62
|
+
const result = readActorState(bc)
|
|
63
|
+
if (bc.offset < bc.view.byteLength) {
|
|
64
|
+
throw new bare.BareError(bc.offset, "remaining bytes")
|
|
65
|
+
}
|
|
66
|
+
return result
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type ActorAlarm = {
|
|
70
|
+
readonly actorId: string,
|
|
71
|
+
readonly timestamp: uint,
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function readActorAlarm(bc: bare.ByteCursor): ActorAlarm {
|
|
75
|
+
return {
|
|
76
|
+
actorId: bare.readString(bc),
|
|
77
|
+
timestamp: bare.readUint(bc),
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function writeActorAlarm(bc: bare.ByteCursor, x: ActorAlarm): void {
|
|
82
|
+
bare.writeString(bc, x.actorId)
|
|
83
|
+
bare.writeUint(bc, x.timestamp)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function encodeActorAlarm(x: ActorAlarm): Uint8Array {
|
|
87
|
+
const bc = new bare.ByteCursor(
|
|
88
|
+
new Uint8Array(config.initialBufferLength),
|
|
89
|
+
config
|
|
90
|
+
)
|
|
91
|
+
writeActorAlarm(bc, x)
|
|
92
|
+
return new Uint8Array(bc.view.buffer, bc.view.byteOffset, bc.offset)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function decodeActorAlarm(bytes: Uint8Array): ActorAlarm {
|
|
96
|
+
const bc = new bare.ByteCursor(bytes, config)
|
|
97
|
+
const result = readActorAlarm(bc)
|
|
98
|
+
if (bc.offset < bc.view.byteLength) {
|
|
99
|
+
throw new bare.BareError(bc.offset, "remaining bytes")
|
|
100
|
+
}
|
|
101
|
+
return result
|
|
102
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
var _chunkGIR3AFFIcjs = require('../chunk-GIR3AFFI.cjs');
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
exports.ActionNotFound = _chunkGIR3AFFIcjs.ActionNotFound; exports.ActionTimedOut = _chunkGIR3AFFIcjs.ActionTimedOut; exports.ActorAlreadyExists = _chunkGIR3AFFIcjs.ActorAlreadyExists; exports.ActorError = _chunkGIR3AFFIcjs.ActorError; exports.ActorNotFound = _chunkGIR3AFFIcjs.ActorNotFound; exports.ConnNotFound = _chunkGIR3AFFIcjs.ConnNotFound; exports.ConnStateNotEnabled = _chunkGIR3AFFIcjs.ConnStateNotEnabled; exports.DatabaseNotEnabled = _chunkGIR3AFFIcjs.DatabaseNotEnabled; exports.FetchHandlerNotDefined = _chunkGIR3AFFIcjs.FetchHandlerNotDefined; exports.Forbidden = _chunkGIR3AFFIcjs.Forbidden; exports.INTERNAL_ERROR_CODE = _chunkGIR3AFFIcjs.INTERNAL_ERROR_CODE; exports.INTERNAL_ERROR_DESCRIPTION = _chunkGIR3AFFIcjs.INTERNAL_ERROR_DESCRIPTION; exports.IncorrectConnToken = _chunkGIR3AFFIcjs.IncorrectConnToken; exports.InternalError = _chunkGIR3AFFIcjs.InternalError; exports.InvalidActionRequest = _chunkGIR3AFFIcjs.InvalidActionRequest; exports.InvalidEncoding = _chunkGIR3AFFIcjs.InvalidEncoding; exports.InvalidFetchResponse = _chunkGIR3AFFIcjs.InvalidFetchResponse; exports.InvalidParams = _chunkGIR3AFFIcjs.InvalidParams; exports.InvalidQueryJSON = _chunkGIR3AFFIcjs.InvalidQueryJSON; exports.InvalidRequest = _chunkGIR3AFFIcjs.InvalidRequest; exports.InvalidStateType = _chunkGIR3AFFIcjs.InvalidStateType; exports.MalformedMessage = _chunkGIR3AFFIcjs.MalformedMessage; exports.MessageTooLong = _chunkGIR3AFFIcjs.MessageTooLong; exports.ProxyError = _chunkGIR3AFFIcjs.ProxyError; exports.StateNotEnabled = _chunkGIR3AFFIcjs.StateNotEnabled; exports.USER_ERROR_CODE = _chunkGIR3AFFIcjs.USER_ERROR_CODE; exports.Unauthorized = _chunkGIR3AFFIcjs.Unauthorized; exports.Unreachable = _chunkGIR3AFFIcjs.Unreachable; exports.Unsupported = _chunkGIR3AFFIcjs.Unsupported; exports.UserError = _chunkGIR3AFFIcjs.UserError; exports.VarsNotEnabled = _chunkGIR3AFFIcjs.VarsNotEnabled; exports.WebSocketHandlerNotDefined = _chunkGIR3AFFIcjs.WebSocketHandlerNotDefined;
|
|
69
|
+
//# sourceMappingURL=errors.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/Users/nathan/rivetkit/packages/rivetkit/dist/tsup/actor/errors.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,u7DAAC","file":"/Users/nathan/rivetkit/packages/rivetkit/dist/tsup/actor/errors.cjs"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { D as DeconstructedError } from '../utils-CT0cv4jd.cjs';
|
|
2
|
+
import 'hono';
|
|
3
|
+
import 'hono/utils/http-status';
|
|
4
|
+
|
|
5
|
+
declare const INTERNAL_ERROR_CODE = "internal_error";
|
|
6
|
+
declare const INTERNAL_ERROR_DESCRIPTION = "Internal error. Read the server logs for more details.";
|
|
7
|
+
type InternalErrorMetadata = {};
|
|
8
|
+
declare const USER_ERROR_CODE = "user_error";
|
|
9
|
+
interface ActorErrorOptions extends ErrorOptions {
|
|
10
|
+
/** Error data can safely be serialized in a response to the client. */
|
|
11
|
+
public?: boolean;
|
|
12
|
+
/** Metadata associated with this error. This will be sent to clients. */
|
|
13
|
+
metadata?: unknown;
|
|
14
|
+
}
|
|
15
|
+
declare class ActorError extends Error {
|
|
16
|
+
readonly code: string;
|
|
17
|
+
__type: string;
|
|
18
|
+
public: boolean;
|
|
19
|
+
metadata?: unknown;
|
|
20
|
+
statusCode: number;
|
|
21
|
+
static isActorError(error: unknown): error is ActorError | DeconstructedError;
|
|
22
|
+
constructor(code: string, message: string, opts?: ActorErrorOptions);
|
|
23
|
+
toString(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Serialize error for HTTP response
|
|
26
|
+
*/
|
|
27
|
+
serializeForHttp(): {
|
|
28
|
+
type: string;
|
|
29
|
+
message: string;
|
|
30
|
+
metadata: unknown;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
declare class InternalError extends ActorError {
|
|
34
|
+
constructor(message: string);
|
|
35
|
+
}
|
|
36
|
+
declare class Unreachable extends InternalError {
|
|
37
|
+
constructor(x: never);
|
|
38
|
+
}
|
|
39
|
+
declare class StateNotEnabled extends ActorError {
|
|
40
|
+
constructor();
|
|
41
|
+
}
|
|
42
|
+
declare class ConnStateNotEnabled extends ActorError {
|
|
43
|
+
constructor();
|
|
44
|
+
}
|
|
45
|
+
declare class VarsNotEnabled extends ActorError {
|
|
46
|
+
constructor();
|
|
47
|
+
}
|
|
48
|
+
declare class ActionTimedOut extends ActorError {
|
|
49
|
+
constructor();
|
|
50
|
+
}
|
|
51
|
+
declare class ActionNotFound extends ActorError {
|
|
52
|
+
constructor(name: string);
|
|
53
|
+
}
|
|
54
|
+
declare class InvalidEncoding extends ActorError {
|
|
55
|
+
constructor(format?: string);
|
|
56
|
+
}
|
|
57
|
+
declare class ConnNotFound extends ActorError {
|
|
58
|
+
constructor(id?: string);
|
|
59
|
+
}
|
|
60
|
+
declare class IncorrectConnToken extends ActorError {
|
|
61
|
+
constructor();
|
|
62
|
+
}
|
|
63
|
+
declare class MessageTooLong extends ActorError {
|
|
64
|
+
constructor();
|
|
65
|
+
}
|
|
66
|
+
declare class MalformedMessage extends ActorError {
|
|
67
|
+
constructor(cause?: unknown);
|
|
68
|
+
}
|
|
69
|
+
interface InvalidStateTypeOptions {
|
|
70
|
+
path?: unknown;
|
|
71
|
+
}
|
|
72
|
+
declare class InvalidStateType extends ActorError {
|
|
73
|
+
constructor(opts?: InvalidStateTypeOptions);
|
|
74
|
+
}
|
|
75
|
+
declare class Unsupported extends ActorError {
|
|
76
|
+
constructor(feature: string);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Options for the UserError class.
|
|
80
|
+
*/
|
|
81
|
+
interface UserErrorOptions extends ErrorOptions {
|
|
82
|
+
/**
|
|
83
|
+
* Machine readable code for this error. Useful for catching different types of errors in try-catch.
|
|
84
|
+
*/
|
|
85
|
+
code?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Additional metadata related to the error. Useful for understanding context about the error.
|
|
88
|
+
*/
|
|
89
|
+
metadata?: unknown;
|
|
90
|
+
}
|
|
91
|
+
/** Error that can be safely returned to the user. */
|
|
92
|
+
declare class UserError extends ActorError {
|
|
93
|
+
/**
|
|
94
|
+
* Constructs a new UserError instance.
|
|
95
|
+
*
|
|
96
|
+
* @param message - The error message to be displayed.
|
|
97
|
+
* @param opts - Optional parameters for the error, including a machine-readable code and additional metadata.
|
|
98
|
+
*/
|
|
99
|
+
constructor(message: string, opts?: UserErrorOptions);
|
|
100
|
+
}
|
|
101
|
+
declare class InvalidQueryJSON extends ActorError {
|
|
102
|
+
constructor(error?: unknown);
|
|
103
|
+
}
|
|
104
|
+
declare class InvalidRequest extends ActorError {
|
|
105
|
+
constructor(error?: unknown);
|
|
106
|
+
}
|
|
107
|
+
declare class ActorNotFound extends ActorError {
|
|
108
|
+
constructor(identifier?: string);
|
|
109
|
+
}
|
|
110
|
+
declare class ActorAlreadyExists extends ActorError {
|
|
111
|
+
constructor(name: string, key: string[]);
|
|
112
|
+
}
|
|
113
|
+
declare class ProxyError extends ActorError {
|
|
114
|
+
constructor(operation: string, error?: unknown);
|
|
115
|
+
}
|
|
116
|
+
declare class InvalidActionRequest extends ActorError {
|
|
117
|
+
constructor(message: string);
|
|
118
|
+
}
|
|
119
|
+
declare class InvalidParams extends ActorError {
|
|
120
|
+
constructor(message: string);
|
|
121
|
+
}
|
|
122
|
+
declare class Unauthorized extends ActorError {
|
|
123
|
+
constructor(message?: string);
|
|
124
|
+
}
|
|
125
|
+
declare class Forbidden extends ActorError {
|
|
126
|
+
constructor(message?: string, opts?: {
|
|
127
|
+
metadata?: unknown;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
declare class DatabaseNotEnabled extends ActorError {
|
|
131
|
+
constructor();
|
|
132
|
+
}
|
|
133
|
+
declare class FetchHandlerNotDefined extends ActorError {
|
|
134
|
+
constructor();
|
|
135
|
+
}
|
|
136
|
+
declare class WebSocketHandlerNotDefined extends ActorError {
|
|
137
|
+
constructor();
|
|
138
|
+
}
|
|
139
|
+
declare class InvalidFetchResponse extends ActorError {
|
|
140
|
+
constructor();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export { ActionNotFound, ActionTimedOut, ActorAlreadyExists, ActorError, ActorNotFound, ConnNotFound, ConnStateNotEnabled, DatabaseNotEnabled, FetchHandlerNotDefined, Forbidden, INTERNAL_ERROR_CODE, INTERNAL_ERROR_DESCRIPTION, IncorrectConnToken, InternalError, type InternalErrorMetadata, InvalidActionRequest, InvalidEncoding, InvalidFetchResponse, InvalidParams, InvalidQueryJSON, InvalidRequest, InvalidStateType, type InvalidStateTypeOptions, MalformedMessage, MessageTooLong, ProxyError, StateNotEnabled, USER_ERROR_CODE, Unauthorized, Unreachable, Unsupported, UserError, type UserErrorOptions, VarsNotEnabled, WebSocketHandlerNotDefined };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { D as DeconstructedError } from '../utils-CT0cv4jd.js';
|
|
2
|
+
import 'hono';
|
|
3
|
+
import 'hono/utils/http-status';
|
|
4
|
+
|
|
5
|
+
declare const INTERNAL_ERROR_CODE = "internal_error";
|
|
6
|
+
declare const INTERNAL_ERROR_DESCRIPTION = "Internal error. Read the server logs for more details.";
|
|
7
|
+
type InternalErrorMetadata = {};
|
|
8
|
+
declare const USER_ERROR_CODE = "user_error";
|
|
9
|
+
interface ActorErrorOptions extends ErrorOptions {
|
|
10
|
+
/** Error data can safely be serialized in a response to the client. */
|
|
11
|
+
public?: boolean;
|
|
12
|
+
/** Metadata associated with this error. This will be sent to clients. */
|
|
13
|
+
metadata?: unknown;
|
|
14
|
+
}
|
|
15
|
+
declare class ActorError extends Error {
|
|
16
|
+
readonly code: string;
|
|
17
|
+
__type: string;
|
|
18
|
+
public: boolean;
|
|
19
|
+
metadata?: unknown;
|
|
20
|
+
statusCode: number;
|
|
21
|
+
static isActorError(error: unknown): error is ActorError | DeconstructedError;
|
|
22
|
+
constructor(code: string, message: string, opts?: ActorErrorOptions);
|
|
23
|
+
toString(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Serialize error for HTTP response
|
|
26
|
+
*/
|
|
27
|
+
serializeForHttp(): {
|
|
28
|
+
type: string;
|
|
29
|
+
message: string;
|
|
30
|
+
metadata: unknown;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
declare class InternalError extends ActorError {
|
|
34
|
+
constructor(message: string);
|
|
35
|
+
}
|
|
36
|
+
declare class Unreachable extends InternalError {
|
|
37
|
+
constructor(x: never);
|
|
38
|
+
}
|
|
39
|
+
declare class StateNotEnabled extends ActorError {
|
|
40
|
+
constructor();
|
|
41
|
+
}
|
|
42
|
+
declare class ConnStateNotEnabled extends ActorError {
|
|
43
|
+
constructor();
|
|
44
|
+
}
|
|
45
|
+
declare class VarsNotEnabled extends ActorError {
|
|
46
|
+
constructor();
|
|
47
|
+
}
|
|
48
|
+
declare class ActionTimedOut extends ActorError {
|
|
49
|
+
constructor();
|
|
50
|
+
}
|
|
51
|
+
declare class ActionNotFound extends ActorError {
|
|
52
|
+
constructor(name: string);
|
|
53
|
+
}
|
|
54
|
+
declare class InvalidEncoding extends ActorError {
|
|
55
|
+
constructor(format?: string);
|
|
56
|
+
}
|
|
57
|
+
declare class ConnNotFound extends ActorError {
|
|
58
|
+
constructor(id?: string);
|
|
59
|
+
}
|
|
60
|
+
declare class IncorrectConnToken extends ActorError {
|
|
61
|
+
constructor();
|
|
62
|
+
}
|
|
63
|
+
declare class MessageTooLong extends ActorError {
|
|
64
|
+
constructor();
|
|
65
|
+
}
|
|
66
|
+
declare class MalformedMessage extends ActorError {
|
|
67
|
+
constructor(cause?: unknown);
|
|
68
|
+
}
|
|
69
|
+
interface InvalidStateTypeOptions {
|
|
70
|
+
path?: unknown;
|
|
71
|
+
}
|
|
72
|
+
declare class InvalidStateType extends ActorError {
|
|
73
|
+
constructor(opts?: InvalidStateTypeOptions);
|
|
74
|
+
}
|
|
75
|
+
declare class Unsupported extends ActorError {
|
|
76
|
+
constructor(feature: string);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Options for the UserError class.
|
|
80
|
+
*/
|
|
81
|
+
interface UserErrorOptions extends ErrorOptions {
|
|
82
|
+
/**
|
|
83
|
+
* Machine readable code for this error. Useful for catching different types of errors in try-catch.
|
|
84
|
+
*/
|
|
85
|
+
code?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Additional metadata related to the error. Useful for understanding context about the error.
|
|
88
|
+
*/
|
|
89
|
+
metadata?: unknown;
|
|
90
|
+
}
|
|
91
|
+
/** Error that can be safely returned to the user. */
|
|
92
|
+
declare class UserError extends ActorError {
|
|
93
|
+
/**
|
|
94
|
+
* Constructs a new UserError instance.
|
|
95
|
+
*
|
|
96
|
+
* @param message - The error message to be displayed.
|
|
97
|
+
* @param opts - Optional parameters for the error, including a machine-readable code and additional metadata.
|
|
98
|
+
*/
|
|
99
|
+
constructor(message: string, opts?: UserErrorOptions);
|
|
100
|
+
}
|
|
101
|
+
declare class InvalidQueryJSON extends ActorError {
|
|
102
|
+
constructor(error?: unknown);
|
|
103
|
+
}
|
|
104
|
+
declare class InvalidRequest extends ActorError {
|
|
105
|
+
constructor(error?: unknown);
|
|
106
|
+
}
|
|
107
|
+
declare class ActorNotFound extends ActorError {
|
|
108
|
+
constructor(identifier?: string);
|
|
109
|
+
}
|
|
110
|
+
declare class ActorAlreadyExists extends ActorError {
|
|
111
|
+
constructor(name: string, key: string[]);
|
|
112
|
+
}
|
|
113
|
+
declare class ProxyError extends ActorError {
|
|
114
|
+
constructor(operation: string, error?: unknown);
|
|
115
|
+
}
|
|
116
|
+
declare class InvalidActionRequest extends ActorError {
|
|
117
|
+
constructor(message: string);
|
|
118
|
+
}
|
|
119
|
+
declare class InvalidParams extends ActorError {
|
|
120
|
+
constructor(message: string);
|
|
121
|
+
}
|
|
122
|
+
declare class Unauthorized extends ActorError {
|
|
123
|
+
constructor(message?: string);
|
|
124
|
+
}
|
|
125
|
+
declare class Forbidden extends ActorError {
|
|
126
|
+
constructor(message?: string, opts?: {
|
|
127
|
+
metadata?: unknown;
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
declare class DatabaseNotEnabled extends ActorError {
|
|
131
|
+
constructor();
|
|
132
|
+
}
|
|
133
|
+
declare class FetchHandlerNotDefined extends ActorError {
|
|
134
|
+
constructor();
|
|
135
|
+
}
|
|
136
|
+
declare class WebSocketHandlerNotDefined extends ActorError {
|
|
137
|
+
constructor();
|
|
138
|
+
}
|
|
139
|
+
declare class InvalidFetchResponse extends ActorError {
|
|
140
|
+
constructor();
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export { ActionNotFound, ActionTimedOut, ActorAlreadyExists, ActorError, ActorNotFound, ConnNotFound, ConnStateNotEnabled, DatabaseNotEnabled, FetchHandlerNotDefined, Forbidden, INTERNAL_ERROR_CODE, INTERNAL_ERROR_DESCRIPTION, IncorrectConnToken, InternalError, type InternalErrorMetadata, InvalidActionRequest, InvalidEncoding, InvalidFetchResponse, InvalidParams, InvalidQueryJSON, InvalidRequest, InvalidStateType, type InvalidStateTypeOptions, MalformedMessage, MessageTooLong, ProxyError, StateNotEnabled, USER_ERROR_CODE, Unauthorized, Unreachable, Unsupported, UserError, type UserErrorOptions, VarsNotEnabled, WebSocketHandlerNotDefined };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ActionNotFound,
|
|
3
|
+
ActionTimedOut,
|
|
4
|
+
ActorAlreadyExists,
|
|
5
|
+
ActorError,
|
|
6
|
+
ActorNotFound,
|
|
7
|
+
ConnNotFound,
|
|
8
|
+
ConnStateNotEnabled,
|
|
9
|
+
DatabaseNotEnabled,
|
|
10
|
+
FetchHandlerNotDefined,
|
|
11
|
+
Forbidden,
|
|
12
|
+
INTERNAL_ERROR_CODE,
|
|
13
|
+
INTERNAL_ERROR_DESCRIPTION,
|
|
14
|
+
IncorrectConnToken,
|
|
15
|
+
InternalError,
|
|
16
|
+
InvalidActionRequest,
|
|
17
|
+
InvalidEncoding,
|
|
18
|
+
InvalidFetchResponse,
|
|
19
|
+
InvalidParams,
|
|
20
|
+
InvalidQueryJSON,
|
|
21
|
+
InvalidRequest,
|
|
22
|
+
InvalidStateType,
|
|
23
|
+
MalformedMessage,
|
|
24
|
+
MessageTooLong,
|
|
25
|
+
ProxyError,
|
|
26
|
+
StateNotEnabled,
|
|
27
|
+
USER_ERROR_CODE,
|
|
28
|
+
Unauthorized,
|
|
29
|
+
Unreachable,
|
|
30
|
+
Unsupported,
|
|
31
|
+
UserError,
|
|
32
|
+
VarsNotEnabled,
|
|
33
|
+
WebSocketHandlerNotDefined
|
|
34
|
+
} from "../chunk-INGJP237.js";
|
|
35
|
+
export {
|
|
36
|
+
ActionNotFound,
|
|
37
|
+
ActionTimedOut,
|
|
38
|
+
ActorAlreadyExists,
|
|
39
|
+
ActorError,
|
|
40
|
+
ActorNotFound,
|
|
41
|
+
ConnNotFound,
|
|
42
|
+
ConnStateNotEnabled,
|
|
43
|
+
DatabaseNotEnabled,
|
|
44
|
+
FetchHandlerNotDefined,
|
|
45
|
+
Forbidden,
|
|
46
|
+
INTERNAL_ERROR_CODE,
|
|
47
|
+
INTERNAL_ERROR_DESCRIPTION,
|
|
48
|
+
IncorrectConnToken,
|
|
49
|
+
InternalError,
|
|
50
|
+
InvalidActionRequest,
|
|
51
|
+
InvalidEncoding,
|
|
52
|
+
InvalidFetchResponse,
|
|
53
|
+
InvalidParams,
|
|
54
|
+
InvalidQueryJSON,
|
|
55
|
+
InvalidRequest,
|
|
56
|
+
InvalidStateType,
|
|
57
|
+
MalformedMessage,
|
|
58
|
+
MessageTooLong,
|
|
59
|
+
ProxyError,
|
|
60
|
+
StateNotEnabled,
|
|
61
|
+
USER_ERROR_CODE,
|
|
62
|
+
Unauthorized,
|
|
63
|
+
Unreachable,
|
|
64
|
+
Unsupported,
|
|
65
|
+
UserError,
|
|
66
|
+
VarsNotEnabled,
|
|
67
|
+
WebSocketHandlerNotDefined
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|