@rivetkit/rivetkit-napi 0.0.0-sqlite-profiling-compat.4a9a623 → 0.0.0-sqlite-sync-3x-release.a00b07f
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 +232 -12
- package/index.js +13 -1
- package/package.json +12 -10
package/index.d.ts
CHANGED
|
@@ -8,6 +8,18 @@ export interface JsActorKeySegment {
|
|
|
8
8
|
stringValue?: string
|
|
9
9
|
numberValue?: number
|
|
10
10
|
}
|
|
11
|
+
/** Active actor invocation correlation exposed to the TypeScript runtime adapter. */
|
|
12
|
+
export interface JsActorInvocationTraceContext {
|
|
13
|
+
rayId?: string
|
|
14
|
+
span?: JsActorInvocationSpanContext
|
|
15
|
+
}
|
|
16
|
+
/** W3C span context of the current invocation span, present only when tracing is active. */
|
|
17
|
+
export interface JsActorInvocationSpanContext {
|
|
18
|
+
traceId: string
|
|
19
|
+
spanId: string
|
|
20
|
+
traceFlags: number
|
|
21
|
+
tracestate?: string
|
|
22
|
+
}
|
|
11
23
|
export interface JsHttpRequest {
|
|
12
24
|
method: string
|
|
13
25
|
uri: string
|
|
@@ -23,10 +35,16 @@ export interface StateDeltaPayload {
|
|
|
23
35
|
connHibernation: Array<StateDeltaConnHibernationEntry>
|
|
24
36
|
connHibernationRemoved: Array<string>
|
|
25
37
|
}
|
|
38
|
+
export interface WorkflowKvWritePayload {
|
|
39
|
+
key: Buffer
|
|
40
|
+
value: Buffer
|
|
41
|
+
}
|
|
26
42
|
export interface JsRequestSaveOpts {
|
|
27
43
|
immediate?: boolean
|
|
28
44
|
maxWaitMs?: number
|
|
29
45
|
}
|
|
46
|
+
export declare function decodeInspectorRequest(bytes: Buffer, advertisedVersion: number): Buffer
|
|
47
|
+
export declare function encodeInspectorResponse(bytes: Buffer, targetVersion: number): Buffer
|
|
30
48
|
export interface JsInspectorSnapshot {
|
|
31
49
|
stateRevision: number
|
|
32
50
|
connectionsRevision: number
|
|
@@ -35,10 +53,8 @@ export interface JsInspectorSnapshot {
|
|
|
35
53
|
queueSize: number
|
|
36
54
|
connectedClients: number
|
|
37
55
|
}
|
|
38
|
-
export interface
|
|
39
|
-
|
|
40
|
-
headers?: Record<string, string>
|
|
41
|
-
body?: Buffer
|
|
56
|
+
export interface JsActorRuntimeSocketEndpointInfo {
|
|
57
|
+
path: string
|
|
42
58
|
}
|
|
43
59
|
export interface JsQueueSendResult {
|
|
44
60
|
status: string
|
|
@@ -72,7 +88,8 @@ export interface JsInspectorTabEntry {
|
|
|
72
88
|
* surface is subject to change without notice.
|
|
73
89
|
*/
|
|
74
90
|
export interface JsSqliteProfilingConfig {
|
|
75
|
-
|
|
91
|
+
queries?: Array<string>
|
|
92
|
+
fingerprints?: Array<string>
|
|
76
93
|
maxTrackedStatementFingerprints?: number
|
|
77
94
|
maxTrackedTransactionFingerprints?: number
|
|
78
95
|
maxPrometheusSeries?: number
|
|
@@ -84,12 +101,22 @@ export interface JsSqliteProfilingConfig {
|
|
|
84
101
|
maxDiagnosticEventsPerMinute?: number
|
|
85
102
|
diagnosticEventQueueCapacity?: number
|
|
86
103
|
}
|
|
104
|
+
/** Per-actor trace sample rates, from 0 to 1. */
|
|
105
|
+
export interface JsActorTracingConfig {
|
|
106
|
+
sampler?: number
|
|
107
|
+
/** Keyed by flattened, dot-separated action name. */
|
|
108
|
+
actions?: Record<string, number>
|
|
109
|
+
}
|
|
87
110
|
export interface JsActorConfig {
|
|
88
111
|
name?: string
|
|
89
112
|
icon?: string
|
|
90
113
|
hasDatabase?: boolean
|
|
91
114
|
remoteSqlite?: boolean
|
|
115
|
+
/** Internal. Set by rivetkit when the actor's database provider opts into deferred commits. */
|
|
116
|
+
sqliteDeferredCommits?: boolean
|
|
92
117
|
sqliteProfiling?: JsSqliteProfilingConfig
|
|
118
|
+
tracing?: JsActorTracingConfig
|
|
119
|
+
enableActorRuntimeSocket?: boolean
|
|
93
120
|
hasState?: boolean
|
|
94
121
|
canHibernateWebsocket?: boolean
|
|
95
122
|
stateSaveIntervalMs?: number
|
|
@@ -110,11 +137,10 @@ export interface JsActorConfig {
|
|
|
110
137
|
connectionLivenessTimeoutMs?: number
|
|
111
138
|
connectionLivenessIntervalMs?: number
|
|
112
139
|
maxQueueSize?: number
|
|
140
|
+
maxSchedules?: number
|
|
113
141
|
maxQueueMessageSize?: number
|
|
114
142
|
maxIncomingMessageSize?: number
|
|
115
143
|
maxOutgoingMessageSize?: number
|
|
116
|
-
preloadMaxWorkflowBytes?: number
|
|
117
|
-
preloadMaxConnectionsBytes?: number
|
|
118
144
|
actions?: Array<JsActionDefinition>
|
|
119
145
|
inspectorTabs?: Array<JsInspectorTabEntry>
|
|
120
146
|
}
|
|
@@ -138,6 +164,10 @@ export interface NativeExecuteResult {
|
|
|
138
164
|
changes: number
|
|
139
165
|
lastInsertRowId?: number
|
|
140
166
|
}
|
|
167
|
+
export interface JsSqliteBatchStatement {
|
|
168
|
+
sql: string
|
|
169
|
+
params?: Array<JsBindParam>
|
|
170
|
+
}
|
|
141
171
|
export interface JsSqliteVfsMetrics {
|
|
142
172
|
requestBuildNs: number
|
|
143
173
|
serializeNs: number
|
|
@@ -151,6 +181,12 @@ export interface JsSqliteVfsMetrics {
|
|
|
151
181
|
writeBufferDirtyPages: number
|
|
152
182
|
dbSizePages: number
|
|
153
183
|
}
|
|
184
|
+
export interface JsHttpResponse {
|
|
185
|
+
status?: number
|
|
186
|
+
headers?: Record<string, string>
|
|
187
|
+
body?: Buffer
|
|
188
|
+
stream?: boolean
|
|
189
|
+
}
|
|
154
190
|
export interface JsQueueNextOptions {
|
|
155
191
|
names?: Array<string>
|
|
156
192
|
timeoutMs?: number
|
|
@@ -194,6 +230,9 @@ export interface JsServeConfig {
|
|
|
194
230
|
namespace: string
|
|
195
231
|
poolName: string
|
|
196
232
|
engineBinaryPath?: string
|
|
233
|
+
startServices?: boolean
|
|
234
|
+
servicesBinaryPath?: string
|
|
235
|
+
engineSpawn?: boolean
|
|
197
236
|
engineHost?: string
|
|
198
237
|
enginePort?: number
|
|
199
238
|
handleInspectorHttpInRuntime?: boolean
|
|
@@ -225,6 +264,12 @@ export interface JsServerlessResponseHead {
|
|
|
225
264
|
status: number
|
|
226
265
|
headers: Record<string, string>
|
|
227
266
|
}
|
|
267
|
+
export interface JsApplicationResponse {
|
|
268
|
+
status: number
|
|
269
|
+
headers: Record<string, string>
|
|
270
|
+
body?: Buffer
|
|
271
|
+
stream?: boolean
|
|
272
|
+
}
|
|
228
273
|
export interface JsRegistryRouteResponse {
|
|
229
274
|
status: number
|
|
230
275
|
headers: Record<string, string>
|
|
@@ -235,6 +280,38 @@ export interface JsServerlessStreamError {
|
|
|
235
280
|
code: string
|
|
236
281
|
message: string
|
|
237
282
|
}
|
|
283
|
+
export interface JsScheduledEventInfo {
|
|
284
|
+
id: string
|
|
285
|
+
action: string
|
|
286
|
+
args: Buffer
|
|
287
|
+
runAt: number
|
|
288
|
+
}
|
|
289
|
+
export interface JsCronJobInfo {
|
|
290
|
+
name: string
|
|
291
|
+
kind: string
|
|
292
|
+
action: string
|
|
293
|
+
args: Buffer
|
|
294
|
+
nextRunAt: number
|
|
295
|
+
lastRunAt?: number
|
|
296
|
+
expression?: string
|
|
297
|
+
timezone?: string
|
|
298
|
+
intervalMs?: number
|
|
299
|
+
maxHistory: number
|
|
300
|
+
}
|
|
301
|
+
export interface JsScheduleErrorInfo {
|
|
302
|
+
group: string
|
|
303
|
+
code: string
|
|
304
|
+
message: string
|
|
305
|
+
metadata?: any
|
|
306
|
+
}
|
|
307
|
+
export interface JsCronFire {
|
|
308
|
+
action: string
|
|
309
|
+
scheduledAt: number
|
|
310
|
+
firedAt: number
|
|
311
|
+
finishedAt?: number
|
|
312
|
+
result: string
|
|
313
|
+
error?: JsScheduleErrorInfo
|
|
314
|
+
}
|
|
238
315
|
/** Options for KV list operations. */
|
|
239
316
|
export interface JsKvListOptions {
|
|
240
317
|
reverse?: boolean
|
|
@@ -245,14 +322,37 @@ export interface JsKvEntry {
|
|
|
245
322
|
key: Buffer
|
|
246
323
|
value: Buffer
|
|
247
324
|
}
|
|
325
|
+
/**
|
|
326
|
+
* Routes the OpenTelemetry SDK's own warnings, such as dropped spans, to the
|
|
327
|
+
* JavaScript logger. Each call replaces the previous sink. The sink is
|
|
328
|
+
* released by `shutdownTelemetry`.
|
|
329
|
+
*/
|
|
330
|
+
export declare function setTelemetryLogSink(callback: (...args: any[]) => any): void
|
|
331
|
+
export declare function shutdownTelemetry(): Promise<void>
|
|
248
332
|
/** N-API wrapper around `rivetkit-core::ActorContext`. */
|
|
249
333
|
export declare class ActorContext {
|
|
250
|
-
constructor(actorId: string, name: string, region: string)
|
|
251
334
|
state(): Buffer
|
|
252
335
|
beginOnStateChange(): void
|
|
253
336
|
endOnStateChange(): void
|
|
254
337
|
kv(): Kv
|
|
255
338
|
sql(): JsNativeDatabase
|
|
339
|
+
sameActorInstance(other: ActorContext): boolean
|
|
340
|
+
/**
|
|
341
|
+
* Returns a handle for the same invocation whose Core spans parent to the
|
|
342
|
+
* application span active in JavaScript, given as W3C headers.
|
|
343
|
+
*/
|
|
344
|
+
withApplicationSpan(traceparent?: string | undefined | null, tracestate?: string | undefined | null): ActorContext
|
|
345
|
+
invocationTraceContext(): JsActorInvocationTraceContext | null
|
|
346
|
+
/**
|
|
347
|
+
* Opens the span covering one call out to another actor. Returns nothing
|
|
348
|
+
* when this handle serves no invocation or tracing is disabled, in which
|
|
349
|
+
* case the caller sends its own context as before.
|
|
350
|
+
*/
|
|
351
|
+
startCallSpan(actorName: string, actionName: string): OutboundCall | null
|
|
352
|
+
startWorkflowSpan(): Promise<WorkflowSpan>
|
|
353
|
+
/** Returns nothing outside a workflow run or when tracing is off. */
|
|
354
|
+
startWorkflowStepSpan(stepName: string, attempt: number): WorkflowStepSpan | null
|
|
355
|
+
provisionActorRuntimeSocket(): Promise<JsActorRuntimeSocketEndpointInfo>
|
|
256
356
|
schedule(): Schedule
|
|
257
357
|
queue(): Queue
|
|
258
358
|
setAlarm(timestampMs?: number | undefined | null): void
|
|
@@ -267,6 +367,8 @@ export declare class ActorContext {
|
|
|
267
367
|
takePendingHibernationChanges(): Array<string>
|
|
268
368
|
dirtyHibernatableConns(): Array<ConnHandle>
|
|
269
369
|
saveState(payload: StateDeltaPayload): Promise<void>
|
|
370
|
+
beginStateTransaction(timeoutMs?: number | undefined | null): Promise<JsActorStateTransaction>
|
|
371
|
+
saveStateAndWorkflowBatch(writes: Array<WorkflowKvWritePayload>): Promise<void>
|
|
270
372
|
actorId(): string
|
|
271
373
|
name(): string
|
|
272
374
|
key(): Array<JsActorKeySegment>
|
|
@@ -280,6 +382,7 @@ export declare class ActorContext {
|
|
|
280
382
|
aborted(): boolean
|
|
281
383
|
runHandlerActive(): boolean
|
|
282
384
|
restartRunHandler(): void
|
|
385
|
+
setRunWakeAt(timestampMs?: number | undefined | null): Promise<void>
|
|
283
386
|
beginKeepAwake(): number
|
|
284
387
|
endKeepAwake(regionId: number): void
|
|
285
388
|
keepAwake(promise: Promise<any>): void
|
|
@@ -298,6 +401,42 @@ export declare class ActorContext {
|
|
|
298
401
|
runtimeState(): object
|
|
299
402
|
clearRuntimeState(): void
|
|
300
403
|
}
|
|
404
|
+
/**
|
|
405
|
+
* One open call out to another actor.
|
|
406
|
+
*
|
|
407
|
+
* The call spans a request made by the host runtime, so it is opened and closed
|
|
408
|
+
* by two separate calls. Letting this be collected without finishing records
|
|
409
|
+
* the call as cancelled rather than silently losing it.
|
|
410
|
+
*/
|
|
411
|
+
export declare class OutboundCall {
|
|
412
|
+
/**
|
|
413
|
+
* W3C context of this call's span, to send to the callee so it parents to
|
|
414
|
+
* the call rather than to the invocation that made it.
|
|
415
|
+
*/
|
|
416
|
+
spanContext(): JsActorInvocationSpanContext | null
|
|
417
|
+
/**
|
|
418
|
+
* Records the call's outcome. `error` is the failure as the bridge encodes
|
|
419
|
+
* it, so a structured error keeps its group and code while anything else
|
|
420
|
+
* stays unstructured for Core to classify.
|
|
421
|
+
*/
|
|
422
|
+
finish(error?: string | undefined | null): void
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* One open workflow run. Collecting it without `finish` records the run as
|
|
426
|
+
* abandoned.
|
|
427
|
+
*/
|
|
428
|
+
export declare class WorkflowSpan {
|
|
429
|
+
/** The context workflow code runs under. */
|
|
430
|
+
ctx(): ActorContext
|
|
431
|
+
finish(outcome: string): Promise<void>
|
|
432
|
+
}
|
|
433
|
+
/** One open attempt at one workflow step. */
|
|
434
|
+
export declare class WorkflowStepSpan {
|
|
435
|
+
/** The context the step's callback runs under. */
|
|
436
|
+
ctx(): ActorContext
|
|
437
|
+
/** `error` is what the step threw, as the bridge encodes it. */
|
|
438
|
+
finish(outcome: string, error?: string | undefined | null): void
|
|
439
|
+
}
|
|
301
440
|
export declare class NapiActorFactory {
|
|
302
441
|
constructor(callbacks: object, config?: JsActorConfig | undefined | null)
|
|
303
442
|
}
|
|
@@ -305,7 +444,28 @@ export declare class CancellationToken {
|
|
|
305
444
|
constructor()
|
|
306
445
|
aborted(): boolean
|
|
307
446
|
cancel(): void
|
|
308
|
-
|
|
447
|
+
/**
|
|
448
|
+
* Calls `callback` once when the token is cancelled.
|
|
449
|
+
*
|
|
450
|
+
* The returned listener must be released when the caller stops caring
|
|
451
|
+
* about cancellation. Releasing ends the waiting task and frees the
|
|
452
|
+
* threadsafe function, which otherwise stays alive (with its libuv handle
|
|
453
|
+
* and JS closure) until the token is cancelled.
|
|
454
|
+
*/
|
|
455
|
+
onCancelled(callback: (...args: any[]) => any): CancellationListener
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Registration returned by `CancellationToken.onCancelled`.
|
|
459
|
+
*
|
|
460
|
+
* Dropping the JS object does not release the listener, because the callback
|
|
461
|
+
* must still fire if the caller keeps no reference to the registration.
|
|
462
|
+
*/
|
|
463
|
+
export declare class CancellationListener {
|
|
464
|
+
/**
|
|
465
|
+
* Stops waiting for cancellation without calling the callback.
|
|
466
|
+
* Idempotent, and a no-op after the callback has fired.
|
|
467
|
+
*/
|
|
468
|
+
release(): void
|
|
309
469
|
}
|
|
310
470
|
export declare class ConnHandle {
|
|
311
471
|
id(): string
|
|
@@ -322,8 +482,49 @@ export declare class JsNativeDatabase {
|
|
|
322
482
|
run(sql: string, params?: Array<JsBindParam> | undefined | null): Promise<ExecuteResult>
|
|
323
483
|
query(sql: string, params?: Array<JsBindParam> | undefined | null): Promise<QueryResult>
|
|
324
484
|
execute(sql: string, params?: Array<JsBindParam> | undefined | null): Promise<NativeExecuteResult>
|
|
485
|
+
executeBatch(statements: Array<JsSqliteBatchStatement>): Promise<Array<NativeExecuteResult>>
|
|
325
486
|
exec(sql: string): Promise<QueryResult>
|
|
326
487
|
close(): Promise<void>
|
|
488
|
+
beginTransaction(timeoutMs?: number | undefined | null, name?: string | undefined | null): Promise<JsSqliteTransaction>
|
|
489
|
+
/** Opens the database so later synchronous calls never fetch its first pages. */
|
|
490
|
+
open(): Promise<void>
|
|
491
|
+
executeSync(sql: string, params?: Array<JsBindParam> | undefined | null): NativeExecuteResult
|
|
492
|
+
execSync(sql: string): QueryResult
|
|
493
|
+
beginTransactionSync(timeoutMs?: number | undefined | null, name?: string | undefined | null): JsSqliteTransaction
|
|
494
|
+
/**
|
|
495
|
+
* Returns the latest local commit as a ticket. Tickets stay below 2^53 for any realistic
|
|
496
|
+
* generation, so they cross to JavaScript as numbers.
|
|
497
|
+
*/
|
|
498
|
+
commitTicket(): number
|
|
499
|
+
abortGeneration(reason: string): void
|
|
500
|
+
whenDurable(ticket: number): Promise<void>
|
|
501
|
+
}
|
|
502
|
+
export declare class JsSqliteTransaction {
|
|
503
|
+
execute(sql: string, params?: Array<JsBindParam> | undefined | null): Promise<NativeExecuteResult>
|
|
504
|
+
exec(sql: string): Promise<QueryResult>
|
|
505
|
+
commit(): Promise<void>
|
|
506
|
+
rollback(): Promise<void>
|
|
507
|
+
executeSync(sql: string, params?: Array<JsBindParam> | undefined | null): NativeExecuteResult
|
|
508
|
+
execSync(sql: string): QueryResult
|
|
509
|
+
commitSync(): void
|
|
510
|
+
rollbackSync(): void
|
|
511
|
+
}
|
|
512
|
+
export declare class JsActorStateTransaction {
|
|
513
|
+
execute(sql: string, params?: Array<JsBindParam> | undefined | null): Promise<NativeExecuteResult>
|
|
514
|
+
commit(payload: StateDeltaPayload): Promise<void>
|
|
515
|
+
rollback(): Promise<void>
|
|
516
|
+
}
|
|
517
|
+
/** JavaScript-facing writer for a streaming actor HTTP response. */
|
|
518
|
+
export declare class HttpResponseBodyStream {
|
|
519
|
+
cancelled(): Promise<void>
|
|
520
|
+
write(chunk: Buffer): Promise<void>
|
|
521
|
+
end(): Promise<void>
|
|
522
|
+
error(message: string): Promise<void>
|
|
523
|
+
}
|
|
524
|
+
/** JavaScript-facing reader for a streaming actor HTTP request. */
|
|
525
|
+
export declare class HttpRequestBodyStream {
|
|
526
|
+
read(): Promise<Buffer | null>
|
|
527
|
+
cancel(): Promise<void>
|
|
327
528
|
}
|
|
328
529
|
export declare class Kv {
|
|
329
530
|
get(key: Buffer): Promise<Buffer | null>
|
|
@@ -342,10 +543,12 @@ export declare class Queue {
|
|
|
342
543
|
nextBatch(options?: JsQueueNextBatchOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<Array<QueueMessage>>
|
|
343
544
|
waitForNames(names: Array<string>, options?: JsQueueWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<QueueMessage>
|
|
344
545
|
waitForNamesAvailable(names: Array<string>, options?: JsQueueWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<void>
|
|
546
|
+
completePersisted(messageId: bigint, expectedName: string, response?: Buffer | undefined | null): Promise<boolean>
|
|
345
547
|
enqueueAndWait(name: string, body: Buffer, options?: JsQueueEnqueueAndWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<Buffer | null>
|
|
346
548
|
tryNext(options?: JsQueueTryNextOptions | undefined | null): QueueMessage | null
|
|
347
549
|
tryNextBatch(options?: JsQueueTryNextBatchOptions | undefined | null): Array<QueueMessage>
|
|
348
550
|
maxSize(): number
|
|
551
|
+
reset(): Promise<void>
|
|
349
552
|
inspectMessages(): Promise<Array<JsQueueInspectMessage>>
|
|
350
553
|
}
|
|
351
554
|
export declare class QueueMessage {
|
|
@@ -360,6 +563,13 @@ export declare class CoreRegistry {
|
|
|
360
563
|
constructor()
|
|
361
564
|
register(name: string, factory: NapiActorFactory): void
|
|
362
565
|
serve(config: JsServeConfig): Promise<void>
|
|
566
|
+
/**
|
|
567
|
+
* Wait until the serverful envoy has completed its Engine registration.
|
|
568
|
+
*
|
|
569
|
+
* Readiness is the envoy client's `ToEnvoyInit` signal, not HTTP health or
|
|
570
|
+
* merely constructing the envoy handle.
|
|
571
|
+
*/
|
|
572
|
+
waitReady(): Promise<void>
|
|
363
573
|
/**
|
|
364
574
|
* Trip the shutdown token and tear down any live serverless runtime.
|
|
365
575
|
*
|
|
@@ -372,12 +582,22 @@ export declare class CoreRegistry {
|
|
|
372
582
|
health(): Promise<JsRegistryRouteResponse>
|
|
373
583
|
metadata(): JsRegistryRouteResponse
|
|
374
584
|
metrics(): JsRegistryRouteResponse
|
|
375
|
-
|
|
585
|
+
serveApplicationListener(listener: JsListenerConfig, application: (...args: any[]) => any, config: JsServeConfig): Promise<void>
|
|
586
|
+
serveListener(listener: JsListenerConfig, config: JsServeConfig, application?: (...args: any[]) => any | undefined | null): Promise<void>
|
|
376
587
|
handleServerlessRequest(req: JsServerlessRequest, onStreamEvent: (...args: any[]) => any, cancelToken: CancellationToken, config: JsServeConfig): Promise<JsServerlessResponseHead>
|
|
377
588
|
}
|
|
378
589
|
export declare class Schedule {
|
|
379
|
-
after(durationMs: number, actionName: string, args: Buffer):
|
|
380
|
-
at(timestampMs: number, actionName: string, args: Buffer):
|
|
590
|
+
after(durationMs: number, actionName: string, args: Buffer): Promise<string>
|
|
591
|
+
at(timestampMs: number, actionName: string, args: Buffer): Promise<string>
|
|
592
|
+
cancel(id: string): Promise<boolean>
|
|
593
|
+
get(id: string): Promise<JsScheduledEventInfo | null>
|
|
594
|
+
list(): Promise<Array<JsScheduledEventInfo>>
|
|
595
|
+
cronSet(name: string, expression: string, timezone: string | undefined | null, actionName: string, args: Buffer, maxHistory?: number | undefined | null): Promise<void>
|
|
596
|
+
cronEvery(name: string, intervalMs: number, actionName: string, args: Buffer, maxHistory?: number | undefined | null): Promise<void>
|
|
597
|
+
cronGet(name: string): Promise<JsCronJobInfo | null>
|
|
598
|
+
cronList(): Promise<Array<JsCronJobInfo>>
|
|
599
|
+
cronDelete(name: string): Promise<boolean>
|
|
600
|
+
cronHistory(name: string, limit?: number | undefined | null): Promise<Array<JsCronFire>>
|
|
381
601
|
}
|
|
382
602
|
export declare class WebSocket {
|
|
383
603
|
send(data: Buffer, binary: boolean): void
|
package/index.js
CHANGED
|
@@ -310,16 +310,28 @@ if (!nativeBinding) {
|
|
|
310
310
|
throw new Error(`Failed to load native binding`)
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
const { ActorContext, NapiActorFactory, CancellationToken, ConnHandle, JsNativeDatabase, Kv, Queue, QueueMessage, CoreRegistry, Schedule, WebSocket } = nativeBinding
|
|
313
|
+
const { ActorContext, decodeInspectorRequest, encodeInspectorResponse, OutboundCall, WorkflowSpan, WorkflowStepSpan, NapiActorFactory, CancellationToken, CancellationListener, ConnHandle, JsNativeDatabase, JsSqliteTransaction, JsActorStateTransaction, HttpResponseBodyStream, HttpRequestBodyStream, Kv, Queue, QueueMessage, CoreRegistry, Schedule, WebSocket, setTelemetryLogSink, shutdownTelemetry } = nativeBinding
|
|
314
314
|
|
|
315
315
|
module.exports.ActorContext = ActorContext
|
|
316
|
+
module.exports.decodeInspectorRequest = decodeInspectorRequest
|
|
317
|
+
module.exports.encodeInspectorResponse = encodeInspectorResponse
|
|
318
|
+
module.exports.OutboundCall = OutboundCall
|
|
319
|
+
module.exports.WorkflowSpan = WorkflowSpan
|
|
320
|
+
module.exports.WorkflowStepSpan = WorkflowStepSpan
|
|
316
321
|
module.exports.NapiActorFactory = NapiActorFactory
|
|
317
322
|
module.exports.CancellationToken = CancellationToken
|
|
323
|
+
module.exports.CancellationListener = CancellationListener
|
|
318
324
|
module.exports.ConnHandle = ConnHandle
|
|
319
325
|
module.exports.JsNativeDatabase = JsNativeDatabase
|
|
326
|
+
module.exports.JsSqliteTransaction = JsSqliteTransaction
|
|
327
|
+
module.exports.JsActorStateTransaction = JsActorStateTransaction
|
|
328
|
+
module.exports.HttpResponseBodyStream = HttpResponseBodyStream
|
|
329
|
+
module.exports.HttpRequestBodyStream = HttpRequestBodyStream
|
|
320
330
|
module.exports.Kv = Kv
|
|
321
331
|
module.exports.Queue = Queue
|
|
322
332
|
module.exports.QueueMessage = QueueMessage
|
|
323
333
|
module.exports.CoreRegistry = CoreRegistry
|
|
324
334
|
module.exports.Schedule = Schedule
|
|
325
335
|
module.exports.WebSocket = WebSocket
|
|
336
|
+
module.exports.setTelemetryLogSink = setTelemetryLogSink
|
|
337
|
+
module.exports.shutdownTelemetry = shutdownTelemetry
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivetkit/rivetkit-napi",
|
|
3
|
-
"version": "0.0.0-sqlite-
|
|
3
|
+
"version": "0.0.0-sqlite-sync-3x-release.a00b07f",
|
|
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",
|
|
@@ -43,20 +43,22 @@
|
|
|
43
43
|
"build:embed": "node scripts/build.mjs"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@
|
|
47
|
-
|
|
46
|
+
"@rivetkit/engine-envoy-protocol": "0.0.0-sqlite-sync-3x-release.a00b07f"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@napi-rs/cli": "^2.18.4"
|
|
48
50
|
},
|
|
49
51
|
"repository": {
|
|
50
52
|
"type": "git",
|
|
51
|
-
"url": "https://github.com/rivet-dev/
|
|
53
|
+
"url": "https://github.com/rivet-dev/rivet.git",
|
|
52
54
|
"directory": "rivetkit-typescript/packages/rivetkit-napi"
|
|
53
55
|
},
|
|
54
56
|
"optionalDependencies": {
|
|
55
|
-
"@rivetkit/rivetkit-napi-darwin-arm64": "0.0.0-sqlite-
|
|
56
|
-
"@rivetkit/rivetkit-napi-darwin-x64": "0.0.0-sqlite-
|
|
57
|
-
"@rivetkit/rivetkit-napi-linux-arm64-gnu": "0.0.0-sqlite-
|
|
58
|
-
"@rivetkit/rivetkit-napi-linux-arm64-musl": "0.0.0-sqlite-
|
|
59
|
-
"@rivetkit/rivetkit-napi-linux-x64-gnu": "0.0.0-sqlite-
|
|
60
|
-
"@rivetkit/rivetkit-napi-linux-x64-musl": "0.0.0-sqlite-
|
|
57
|
+
"@rivetkit/rivetkit-napi-darwin-arm64": "0.0.0-sqlite-sync-3x-release.a00b07f",
|
|
58
|
+
"@rivetkit/rivetkit-napi-darwin-x64": "0.0.0-sqlite-sync-3x-release.a00b07f",
|
|
59
|
+
"@rivetkit/rivetkit-napi-linux-arm64-gnu": "0.0.0-sqlite-sync-3x-release.a00b07f",
|
|
60
|
+
"@rivetkit/rivetkit-napi-linux-arm64-musl": "0.0.0-sqlite-sync-3x-release.a00b07f",
|
|
61
|
+
"@rivetkit/rivetkit-napi-linux-x64-gnu": "0.0.0-sqlite-sync-3x-release.a00b07f",
|
|
62
|
+
"@rivetkit/rivetkit-napi-linux-x64-musl": "0.0.0-sqlite-sync-3x-release.a00b07f"
|
|
61
63
|
}
|
|
62
64
|
}
|