@rivetkit/rivetkit-native 0.0.0-pr.4673.44d123b → 0.0.0-pr.4673.8cf118f
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/index.d.ts +57 -115
- package/package.json +9 -9
package/index.d.ts
CHANGED
|
@@ -4,54 +4,50 @@
|
|
|
4
4
|
/* auto-generated by NAPI-RS */
|
|
5
5
|
|
|
6
6
|
export interface JsBindParam {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
kind: string
|
|
8
|
+
intValue?: number
|
|
9
|
+
floatValue?: number
|
|
10
|
+
textValue?: string
|
|
11
|
+
blobValue?: Buffer
|
|
12
12
|
}
|
|
13
13
|
export interface ExecuteResult {
|
|
14
|
-
|
|
14
|
+
changes: number
|
|
15
15
|
}
|
|
16
16
|
export interface QueryResult {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
columns: Array<string>
|
|
18
|
+
rows: Array<Array<any>>
|
|
19
19
|
}
|
|
20
20
|
/** Open a native SQLite database backed by the envoy's KV channel. */
|
|
21
|
-
export declare function openDatabaseFromEnvoy(
|
|
22
|
-
jsHandle: JsEnvoyHandle,
|
|
23
|
-
actorId: string,
|
|
24
|
-
preloadedEntries?: Array<JsKvEntry> | undefined | null,
|
|
25
|
-
): Promise<JsNativeDatabase>;
|
|
21
|
+
export declare function openDatabaseFromEnvoy(jsHandle: JsEnvoyHandle, actorId: string, preloadedEntries?: Array<JsKvEntry> | undefined | null): Promise<JsNativeDatabase>
|
|
26
22
|
/** Configuration for starting the native envoy client. */
|
|
27
23
|
export interface JsEnvoyConfig {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
24
|
+
endpoint: string
|
|
25
|
+
token: string
|
|
26
|
+
namespace: string
|
|
27
|
+
poolName: string
|
|
28
|
+
version: number
|
|
29
|
+
metadata?: any
|
|
30
|
+
notGlobal: boolean
|
|
31
|
+
/**
|
|
32
|
+
* Log level for the Rust tracing subscriber (e.g. "trace", "debug", "info", "warn", "error").
|
|
33
|
+
* Falls back to RIVET_LOG_LEVEL, then LOG_LEVEL, then RUST_LOG env vars. Defaults to "warn".
|
|
34
|
+
*/
|
|
35
|
+
logLevel?: string
|
|
40
36
|
}
|
|
41
37
|
/** Options for KV list operations. */
|
|
42
38
|
export interface JsKvListOptions {
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
reverse?: boolean
|
|
40
|
+
limit?: number
|
|
45
41
|
}
|
|
46
42
|
/** A key-value entry returned from KV list operations. */
|
|
47
43
|
export interface JsKvEntry {
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
key: Buffer
|
|
45
|
+
value: Buffer
|
|
50
46
|
}
|
|
51
47
|
/** A single hibernating request entry. */
|
|
52
48
|
export interface HibernatingRequestEntry {
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
gatewayId: Buffer
|
|
50
|
+
requestId: Buffer
|
|
55
51
|
}
|
|
56
52
|
/**
|
|
57
53
|
* Start the native envoy client synchronously.
|
|
@@ -59,93 +55,39 @@ export interface HibernatingRequestEntry {
|
|
|
59
55
|
* Returns a handle immediately. The caller must call `await handle.started()`
|
|
60
56
|
* to wait for the connection to be ready.
|
|
61
57
|
*/
|
|
62
|
-
export declare function startEnvoySyncJs(
|
|
63
|
-
config: JsEnvoyConfig,
|
|
64
|
-
eventCallback: (event: any) => void,
|
|
65
|
-
): JsEnvoyHandle;
|
|
58
|
+
export declare function startEnvoySyncJs(config: JsEnvoyConfig, eventCallback: (event: any) => void): JsEnvoyHandle
|
|
66
59
|
/** Start the native envoy client asynchronously. */
|
|
67
|
-
export declare function startEnvoyJs(
|
|
68
|
-
config: JsEnvoyConfig,
|
|
69
|
-
eventCallback: (event: any) => void,
|
|
70
|
-
): JsEnvoyHandle;
|
|
71
|
-
/** Native SQLite database handle exposed to JavaScript. */
|
|
60
|
+
export declare function startEnvoyJs(config: JsEnvoyConfig, eventCallback: (event: any) => void): JsEnvoyHandle
|
|
72
61
|
export declare class JsNativeDatabase {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
query(
|
|
79
|
-
sql: string,
|
|
80
|
-
params?: Array<JsBindParam> | undefined | null,
|
|
81
|
-
): Promise<QueryResult>;
|
|
82
|
-
exec(sql: string): Promise<QueryResult>;
|
|
83
|
-
close(): Promise<void>;
|
|
62
|
+
takeLastKvError(): string | null
|
|
63
|
+
run(sql: string, params?: Array<JsBindParam> | undefined | null): Promise<ExecuteResult>
|
|
64
|
+
query(sql: string, params?: Array<JsBindParam> | undefined | null): Promise<QueryResult>
|
|
65
|
+
exec(sql: string): Promise<QueryResult>
|
|
66
|
+
close(): Promise<void>
|
|
84
67
|
}
|
|
85
68
|
/** Native envoy handle exposed to JavaScript via N-API. */
|
|
86
69
|
export declare class JsEnvoyHandle {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
actorId: string,
|
|
111
|
-
options?: JsKvListOptions | undefined | null,
|
|
112
|
-
): Promise<Array<JsKvEntry>>;
|
|
113
|
-
kvListRange(
|
|
114
|
-
actorId: string,
|
|
115
|
-
start: Buffer,
|
|
116
|
-
end: Buffer,
|
|
117
|
-
exclusive?: boolean | undefined | null,
|
|
118
|
-
options?: JsKvListOptions | undefined | null,
|
|
119
|
-
): Promise<Array<JsKvEntry>>;
|
|
120
|
-
kvListPrefix(
|
|
121
|
-
actorId: string,
|
|
122
|
-
prefix: Buffer,
|
|
123
|
-
options?: JsKvListOptions | undefined | null,
|
|
124
|
-
): Promise<Array<JsKvEntry>>;
|
|
125
|
-
kvDrop(actorId: string): Promise<void>;
|
|
126
|
-
restoreHibernatingRequests(
|
|
127
|
-
actorId: string,
|
|
128
|
-
requests: Array<HibernatingRequestEntry>,
|
|
129
|
-
): void;
|
|
130
|
-
sendHibernatableWebSocketMessageAck(
|
|
131
|
-
gatewayId: Buffer,
|
|
132
|
-
requestId: Buffer,
|
|
133
|
-
clientMessageIndex: number,
|
|
134
|
-
): void;
|
|
135
|
-
/** Send a message on an open WebSocket connection identified by messageIdHex. */
|
|
136
|
-
sendWsMessage(
|
|
137
|
-
gatewayId: Buffer,
|
|
138
|
-
requestId: Buffer,
|
|
139
|
-
data: Buffer,
|
|
140
|
-
binary: boolean,
|
|
141
|
-
): Promise<void>;
|
|
142
|
-
/** Close an open WebSocket connection. */
|
|
143
|
-
closeWebsocket(
|
|
144
|
-
gatewayId: Buffer,
|
|
145
|
-
requestId: Buffer,
|
|
146
|
-
code?: number | undefined | null,
|
|
147
|
-
reason?: string | undefined | null,
|
|
148
|
-
): Promise<void>;
|
|
149
|
-
startServerless(payload: Buffer): Promise<void>;
|
|
150
|
-
respondCallback(responseId: string, data: any): Promise<void>;
|
|
70
|
+
started(): Promise<void>
|
|
71
|
+
shutdown(immediate: boolean): void
|
|
72
|
+
get envoyKey(): string
|
|
73
|
+
sleepActor(actorId: string, generation?: number | undefined | null): void
|
|
74
|
+
stopActor(actorId: string, generation?: number | undefined | null, error?: string | undefined | null): void
|
|
75
|
+
destroyActor(actorId: string, generation?: number | undefined | null): void
|
|
76
|
+
setAlarm(actorId: string, alarmTs?: number | undefined | null, generation?: number | undefined | null): void
|
|
77
|
+
kvGet(actorId: string, keys: Array<Buffer>): Promise<Array<Buffer | undefined | null>>
|
|
78
|
+
kvPut(actorId: string, entries: Array<JsKvEntry>): Promise<void>
|
|
79
|
+
kvDelete(actorId: string, keys: Array<Buffer>): Promise<void>
|
|
80
|
+
kvDeleteRange(actorId: string, start: Buffer, end: Buffer): Promise<void>
|
|
81
|
+
kvListAll(actorId: string, options?: JsKvListOptions | undefined | null): Promise<Array<JsKvEntry>>
|
|
82
|
+
kvListRange(actorId: string, start: Buffer, end: Buffer, exclusive?: boolean | undefined | null, options?: JsKvListOptions | undefined | null): Promise<Array<JsKvEntry>>
|
|
83
|
+
kvListPrefix(actorId: string, prefix: Buffer, options?: JsKvListOptions | undefined | null): Promise<Array<JsKvEntry>>
|
|
84
|
+
kvDrop(actorId: string): Promise<void>
|
|
85
|
+
restoreHibernatingRequests(actorId: string, requests: Array<HibernatingRequestEntry>): void
|
|
86
|
+
sendHibernatableWebSocketMessageAck(gatewayId: Buffer, requestId: Buffer, clientMessageIndex: number): void
|
|
87
|
+
/** Send a message on an open WebSocket connection identified by messageIdHex. */
|
|
88
|
+
sendWsMessage(gatewayId: Buffer, requestId: Buffer, data: Buffer, binary: boolean): Promise<void>
|
|
89
|
+
/** Close an open WebSocket connection. */
|
|
90
|
+
closeWebsocket(gatewayId: Buffer, requestId: Buffer, code?: number | undefined | null, reason?: string | undefined | null): Promise<void>
|
|
91
|
+
startServerless(payload: Buffer): Promise<void>
|
|
92
|
+
respondCallback(responseId: string, data: any): Promise<void>
|
|
151
93
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivetkit/rivetkit-native",
|
|
3
|
-
"version": "0.0.0-pr.4673.
|
|
3
|
+
"version": "0.0.0-pr.4673.8cf118f",
|
|
4
4
|
"description": "Native N-API addon for RivetKit providing envoy client and SQLite access",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "index.js",
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@napi-rs/cli": "^2.18.4",
|
|
52
|
-
"@rivetkit/engine-envoy-protocol": "0.0.0-pr.4673.
|
|
52
|
+
"@rivetkit/engine-envoy-protocol": "0.0.0-pr.4673.8cf118f"
|
|
53
53
|
},
|
|
54
54
|
"optionalDependencies": {
|
|
55
|
-
"@rivetkit/rivetkit-native-darwin-arm64": "0.0.0-pr.4673.
|
|
56
|
-
"@rivetkit/rivetkit-native-darwin-x64": "0.0.0-pr.4673.
|
|
57
|
-
"@rivetkit/rivetkit-native-linux-arm64-gnu": "0.0.0-pr.4673.
|
|
58
|
-
"@rivetkit/rivetkit-native-linux-arm64-musl": "0.0.0-pr.4673.
|
|
59
|
-
"@rivetkit/rivetkit-native-linux-x64-gnu": "0.0.0-pr.4673.
|
|
60
|
-
"@rivetkit/rivetkit-native-linux-x64-musl": "0.0.0-pr.4673.
|
|
61
|
-
"@rivetkit/rivetkit-native-win32-x64-msvc": "0.0.0-pr.4673.
|
|
55
|
+
"@rivetkit/rivetkit-native-darwin-arm64": "0.0.0-pr.4673.8cf118f",
|
|
56
|
+
"@rivetkit/rivetkit-native-darwin-x64": "0.0.0-pr.4673.8cf118f",
|
|
57
|
+
"@rivetkit/rivetkit-native-linux-arm64-gnu": "0.0.0-pr.4673.8cf118f",
|
|
58
|
+
"@rivetkit/rivetkit-native-linux-arm64-musl": "0.0.0-pr.4673.8cf118f",
|
|
59
|
+
"@rivetkit/rivetkit-native-linux-x64-gnu": "0.0.0-pr.4673.8cf118f",
|
|
60
|
+
"@rivetkit/rivetkit-native-linux-x64-musl": "0.0.0-pr.4673.8cf118f",
|
|
61
|
+
"@rivetkit/rivetkit-native-win32-x64-msvc": "0.0.0-pr.4673.8cf118f"
|
|
62
62
|
}
|
|
63
63
|
}
|