@rivetkit/rivetkit-napi 0.0.0-pr.4702.d108c6a → 0.0.0-pr.4711.a8b8acd

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.
Files changed (3) hide show
  1. package/index.d.ts +25 -5
  2. package/index.js +1 -5
  3. package/package.json +9 -9
package/index.d.ts CHANGED
@@ -73,10 +73,6 @@ export interface JsActorConfig {
73
73
  preloadMaxWorkflowBytes?: number
74
74
  preloadMaxConnectionsBytes?: number
75
75
  }
76
- export declare function pollCancelToken(id: bigint): boolean
77
- export declare function registerNativeCancelToken(): bigint
78
- export declare function cancelNativeCancelToken(id: bigint): void
79
- export declare function dropNativeCancelToken(id: bigint): void
80
76
  export interface JsBindParam {
81
77
  kind: string
82
78
  intValue?: number
@@ -134,6 +130,28 @@ export interface JsServeConfig {
134
130
  poolName: string
135
131
  engineBinaryPath?: string
136
132
  handleInspectorHttpInRuntime?: boolean
133
+ serverlessBasePath?: string
134
+ serverlessPackageVersion: string
135
+ serverlessClientEndpoint?: string
136
+ serverlessClientNamespace?: string
137
+ serverlessClientToken?: string
138
+ serverlessValidateEndpoint: boolean
139
+ serverlessMaxStartPayloadBytes: number
140
+ }
141
+ export interface JsServerlessRequest {
142
+ method: string
143
+ url: string
144
+ headers: Record<string, string>
145
+ body: Buffer
146
+ }
147
+ export interface JsServerlessResponseHead {
148
+ status: number
149
+ headers: Record<string, string>
150
+ }
151
+ export interface JsServerlessStreamError {
152
+ group: string
153
+ code: string
154
+ message: string
137
155
  }
138
156
  /** Options for KV list operations. */
139
157
  export interface JsKvListOptions {
@@ -194,6 +212,7 @@ export declare class ActorContext {
194
212
  broadcast(name: string, args: Buffer): void
195
213
  waitUntil(promise: Promise<any>): Promise<void>
196
214
  registerTask(promise: Promise<any>): void
215
+ runtimeState(): object
197
216
  }
198
217
  export declare class NapiActorFactory {
199
218
  constructor(callbacks: object, config?: JsActorConfig | undefined | null)
@@ -236,7 +255,7 @@ export declare class Queue {
236
255
  send(name: string, body: Buffer): Promise<QueueMessage>
237
256
  next(options?: JsQueueNextOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<QueueMessage | null>
238
257
  nextBatch(options?: JsQueueNextBatchOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<Array<QueueMessage>>
239
- waitForNames(names: Array<string>, options?: JsQueueWaitOptions | undefined | null, cancelTokenId?: bigint | undefined | null): Promise<QueueMessage>
258
+ waitForNames(names: Array<string>, options?: JsQueueWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<QueueMessage>
240
259
  waitForNamesAvailable(names: Array<string>, options?: JsQueueWaitOptions | undefined | null): Promise<void>
241
260
  enqueueAndWait(name: string, body: Buffer, options?: JsQueueEnqueueAndWaitOptions | undefined | null, signal?: CancellationToken | undefined | null): Promise<Buffer | null>
242
261
  tryNext(options?: JsQueueTryNextOptions | undefined | null): QueueMessage | null
@@ -254,6 +273,7 @@ export declare class CoreRegistry {
254
273
  constructor()
255
274
  register(name: string, factory: NapiActorFactory): void
256
275
  serve(config: JsServeConfig): Promise<void>
276
+ handleServerlessRequest(req: JsServerlessRequest, onStreamEvent: (...args: any[]) => any, cancelToken: CancellationToken, config: JsServeConfig): Promise<JsServerlessResponseHead>
257
277
  }
258
278
  export declare class Schedule {
259
279
  after(durationMs: number, actionName: string, args: Buffer): void
package/index.js CHANGED
@@ -310,14 +310,10 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { ActorContext, NapiActorFactory, pollCancelToken, registerNativeCancelToken, cancelNativeCancelToken, dropNativeCancelToken, CancellationToken, ConnHandle, JsNativeDatabase, Kv, Queue, QueueMessage, CoreRegistry, Schedule, WebSocket } = nativeBinding
313
+ const { ActorContext, NapiActorFactory, CancellationToken, ConnHandle, JsNativeDatabase, Kv, Queue, QueueMessage, CoreRegistry, Schedule, WebSocket } = nativeBinding
314
314
 
315
315
  module.exports.ActorContext = ActorContext
316
316
  module.exports.NapiActorFactory = NapiActorFactory
317
- module.exports.pollCancelToken = pollCancelToken
318
- module.exports.registerNativeCancelToken = registerNativeCancelToken
319
- module.exports.cancelNativeCancelToken = cancelNativeCancelToken
320
- module.exports.dropNativeCancelToken = dropNativeCancelToken
321
317
  module.exports.CancellationToken = CancellationToken
322
318
  module.exports.ConnHandle = ConnHandle
323
319
  module.exports.JsNativeDatabase = JsNativeDatabase
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivetkit/rivetkit-napi",
3
- "version": "0.0.0-pr.4702.d108c6a",
3
+ "version": "0.0.0-pr.4711.a8b8acd",
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,15 +43,15 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "@napi-rs/cli": "^2.18.4",
46
- "@rivetkit/engine-envoy-protocol": "0.0.0-pr.4702.d108c6a"
46
+ "@rivetkit/engine-envoy-protocol": "0.0.0-pr.4711.a8b8acd"
47
47
  },
48
48
  "optionalDependencies": {
49
- "@rivetkit/rivetkit-napi-darwin-arm64": "0.0.0-pr.4702.d108c6a",
50
- "@rivetkit/rivetkit-napi-darwin-x64": "0.0.0-pr.4702.d108c6a",
51
- "@rivetkit/rivetkit-napi-linux-arm64-gnu": "0.0.0-pr.4702.d108c6a",
52
- "@rivetkit/rivetkit-napi-linux-arm64-musl": "0.0.0-pr.4702.d108c6a",
53
- "@rivetkit/rivetkit-napi-linux-x64-gnu": "0.0.0-pr.4702.d108c6a",
54
- "@rivetkit/rivetkit-napi-linux-x64-musl": "0.0.0-pr.4702.d108c6a",
55
- "@rivetkit/rivetkit-napi-win32-x64-msvc": "0.0.0-pr.4702.d108c6a"
49
+ "@rivetkit/rivetkit-napi-darwin-arm64": "0.0.0-pr.4711.a8b8acd",
50
+ "@rivetkit/rivetkit-napi-darwin-x64": "0.0.0-pr.4711.a8b8acd",
51
+ "@rivetkit/rivetkit-napi-linux-arm64-gnu": "0.0.0-pr.4711.a8b8acd",
52
+ "@rivetkit/rivetkit-napi-linux-arm64-musl": "0.0.0-pr.4711.a8b8acd",
53
+ "@rivetkit/rivetkit-napi-linux-x64-gnu": "0.0.0-pr.4711.a8b8acd",
54
+ "@rivetkit/rivetkit-napi-linux-x64-musl": "0.0.0-pr.4711.a8b8acd",
55
+ "@rivetkit/rivetkit-napi-win32-x64-msvc": "0.0.0-pr.4711.a8b8acd"
56
56
  }
57
57
  }