rivetkit 0.0.0-stack-chore-sync-engine-changes-from-enterprise-mszropyy.677d526 → 0.0.0-sync-sqlite.0ed739a
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/browser/client.d.ts +25 -0
- package/dist/browser/client.js +17 -5
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +1 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/agent-os/index.cjs +145 -3
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +40 -2
- package/dist/tsup/agent-os/index.d.ts +40 -2
- package/dist/tsup/agent-os/index.js +144 -2
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-FSD52J3H.cjs → chunk-24PL45D7.cjs} +3 -3
- package/dist/tsup/{chunk-FSD52J3H.cjs.map → chunk-24PL45D7.cjs.map} +1 -1
- package/dist/tsup/{chunk-7ZPRFCTV.cjs → chunk-3TNKROAF.cjs} +156 -144
- package/dist/tsup/chunk-3TNKROAF.cjs.map +1 -0
- package/dist/tsup/{chunk-ZYHZOZUQ.js → chunk-75H2CLHI.js} +2 -2
- package/dist/tsup/{chunk-OWSXJF7Z.js → chunk-BERJKIW5.js} +22 -10
- package/dist/tsup/chunk-BERJKIW5.js.map +1 -0
- package/dist/tsup/{chunk-XPT7SGBW.js → chunk-BZOI63CT.js} +4 -4
- package/dist/tsup/{chunk-M4RSGECU.js → chunk-EHAGZJ34.js} +2 -2
- package/dist/tsup/{chunk-VXJ26VPL.cjs → chunk-FZIA3IQ2.cjs} +10 -10
- package/dist/tsup/{chunk-VXJ26VPL.cjs.map → chunk-FZIA3IQ2.cjs.map} +1 -1
- package/dist/tsup/{chunk-LHT3TRDM.js → chunk-J7WM3KL5.js} +115 -4
- package/dist/tsup/chunk-J7WM3KL5.js.map +1 -0
- package/dist/tsup/{chunk-XNLSA7TO.cjs → chunk-JJMBATG7.cjs} +4 -4
- package/dist/tsup/{chunk-XNLSA7TO.cjs.map → chunk-JJMBATG7.cjs.map} +1 -1
- package/dist/tsup/{chunk-ZXV3CG4Y.cjs → chunk-K3DXAJQ2.cjs} +7 -7
- package/dist/tsup/{chunk-ZXV3CG4Y.cjs.map → chunk-K3DXAJQ2.cjs.map} +1 -1
- package/dist/tsup/{chunk-YHYNYVNZ.js → chunk-M7FOORLQ.js} +3 -3
- package/dist/tsup/{chunk-2TAUHMAC.cjs → chunk-MRFLWAPE.cjs} +2 -2
- package/dist/tsup/chunk-MRFLWAPE.cjs.map +1 -0
- package/dist/tsup/{chunk-GPD77M3M.js → chunk-NNPIJLBE.js} +2 -2
- package/dist/tsup/chunk-NNPIJLBE.js.map +1 -0
- package/dist/tsup/{chunk-TFACXNOP.cjs → chunk-R75W2PPM.cjs} +121 -10
- package/dist/tsup/chunk-R75W2PPM.cjs.map +1 -0
- package/dist/tsup/{chunk-UBGN2UE2.cjs → chunk-SHAZSNYB.cjs} +3 -3
- package/dist/tsup/{chunk-UBGN2UE2.cjs.map → chunk-SHAZSNYB.cjs.map} +1 -1
- package/dist/tsup/{chunk-L6DNN72S.js → chunk-SLAKWYOH.js} +2 -2
- package/dist/tsup/{chunk-JTHHCZCZ.js → chunk-WCEJTJHO.js} +34 -1
- package/dist/tsup/chunk-WCEJTJHO.js.map +1 -0
- package/dist/tsup/{chunk-KVFIONKQ.cjs → chunk-XMNL3AE2.cjs} +35 -2
- package/dist/tsup/chunk-XMNL3AE2.cjs.map +1 -0
- package/dist/tsup/client/mod.cjs +6 -6
- package/dist/tsup/client/mod.d.cts +3 -3
- package/dist/tsup/client/mod.d.ts +3 -3
- package/dist/tsup/client/mod.js +5 -5
- package/dist/tsup/common/log.cjs +2 -2
- package/dist/tsup/common/log.js +1 -1
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/{config-ey2I2zz5.d.cts → config-B0q37XhG.d.cts} +31 -1
- package/dist/tsup/{config-ey2I2zz5.d.ts → config-B0q37XhG.d.ts} +31 -1
- package/dist/tsup/{config-BGTanB_3.d.ts → config-BPJQ0mDo.d.ts} +9 -1
- package/dist/tsup/{config-NHz6oMb9.d.cts → config-CGUJyT5L.d.cts} +9 -1
- package/dist/tsup/{context-SHomdVV8.d.ts → context-DZ_lu12i.d.ts} +2 -2
- package/dist/tsup/{context-DB8zG_Ib.d.cts → context-WLBsDXrQ.d.cts} +2 -2
- package/dist/tsup/db/drizzle.cjs +113 -10
- package/dist/tsup/db/drizzle.cjs.map +1 -1
- package/dist/tsup/db/drizzle.d.cts +2 -2
- package/dist/tsup/db/drizzle.d.ts +2 -2
- package/dist/tsup/db/drizzle.js +106 -3
- package/dist/tsup/db/drizzle.js.map +1 -1
- package/dist/tsup/db/mod.cjs +4 -4
- package/dist/tsup/db/mod.d.cts +4 -4
- package/dist/tsup/db/mod.d.ts +4 -4
- package/dist/tsup/db/mod.js +3 -3
- package/dist/tsup/dynamic/mod.d.cts +2 -2
- package/dist/tsup/dynamic/mod.d.ts +2 -2
- package/dist/tsup/inspector/mod.cjs +5 -5
- package/dist/tsup/inspector/mod.js +4 -4
- package/dist/tsup/inspector/workflow.cjs +4 -4
- package/dist/tsup/inspector/workflow.js +3 -3
- package/dist/tsup/inspector-tab/mod.d.cts +3 -3
- package/dist/tsup/inspector-tab/mod.d.ts +3 -3
- package/dist/tsup/mod.cjs +296 -88
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +4 -4
- package/dist/tsup/mod.d.ts +4 -4
- package/dist/tsup/mod.js +225 -17
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +7 -7
- package/dist/tsup/test/mod.d.cts +2 -2
- package/dist/tsup/test/mod.d.ts +2 -2
- package/dist/tsup/test/mod.js +5 -5
- package/dist/tsup/unstable/migrations.d.cts +1 -1
- package/dist/tsup/unstable/migrations.d.ts +1 -1
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +7 -7
- package/dist/tsup/workflow/mod.d.cts +4 -4
- package/dist/tsup/workflow/mod.d.ts +4 -4
- package/dist/tsup/workflow/mod.js +4 -4
- package/package.json +9 -9
- package/src/agent-os/actor/index.ts +6 -3
- package/src/agent-os/actor/preview.ts +5 -2
- package/src/client/actor-handle.ts +15 -8
- package/src/client/raw-utils.ts +14 -0
- package/src/common/database/config.ts +54 -0
- package/src/common/database/mod.test.ts +162 -1
- package/src/common/database/mod.ts +154 -6
- package/src/common/database/native-database.test.ts +81 -2
- package/src/common/database/native-database.ts +172 -3
- package/src/common/database/shared.ts +49 -1
- package/src/db/drizzle.test.ts +82 -1
- package/src/db/drizzle.ts +136 -6
- package/src/db/mod.ts +2 -0
- package/src/registry/napi-runtime.ts +71 -0
- package/src/registry/native.ts +48 -14
- package/src/registry/runtime.ts +46 -0
- package/src/registry/wasm-runtime.ts +63 -0
- package/dist/tsup/chunk-2TAUHMAC.cjs.map +0 -1
- package/dist/tsup/chunk-7ZPRFCTV.cjs.map +0 -1
- package/dist/tsup/chunk-GPD77M3M.js.map +0 -1
- package/dist/tsup/chunk-JTHHCZCZ.js.map +0 -1
- package/dist/tsup/chunk-KVFIONKQ.cjs.map +0 -1
- package/dist/tsup/chunk-LHT3TRDM.js.map +0 -1
- package/dist/tsup/chunk-OWSXJF7Z.js.map +0 -1
- package/dist/tsup/chunk-TFACXNOP.cjs.map +0 -1
- /package/dist/tsup/{chunk-ZYHZOZUQ.js.map → chunk-75H2CLHI.js.map} +0 -0
- /package/dist/tsup/{chunk-XPT7SGBW.js.map → chunk-BZOI63CT.js.map} +0 -0
- /package/dist/tsup/{chunk-M4RSGECU.js.map → chunk-EHAGZJ34.js.map} +0 -0
- /package/dist/tsup/{chunk-YHYNYVNZ.js.map → chunk-M7FOORLQ.js.map} +0 -0
- /package/dist/tsup/{chunk-L6DNN72S.js.map → chunk-SLAKWYOH.js.map} +0 -0
package/dist/tsup/mod.d.cts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-
|
|
2
|
-
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as Actions, n as ActorConfig, o as ActorConfigInput, p as ActorConfigSchema, q as ActorContext, r as ActorContextOf, s as ActorCron, t as ActorCronEveryOptions, u as ActorCronSetOptions, v as ActorDefinition, w as ActorInspectorConfig, x as ActorInspectorConfigSchema, y as ActorKey, z as ActorKv, F as ActorLogger, G as ActorOptions, H as ActorOptionsInput, I as ActorOptionsSchema, J as ActorQuery, K as ActorQueue, L as ActorRun, N as ActorSchedule, O as ActorTypes, P as ActorsSchema, T as AnyActorInstance, U as AnyClient, V as AnyConn, X as AnyStaticActorDefinition, Y as AnyStaticActorInstance, Z as AuthIntent, _ as BUILTIN_INSPECTOR_TAB_IDS, $ as BaseActorInstance, a0 as BuiltinInspectorTabIdSchema, a1 as CONN_DRIVER_SYMBOL, a2 as CONN_STATE_MANAGER_SYMBOL, a3 as Client, a4 as Conn, a5 as CronFire, a6 as CronJobInfo, a7 as CustomInspectorTabEntrySchema, a8 as DEFAULT_SLEEP_GRACE_PERIOD, a9 as DefineRunHandlerOptions, aa as DocActorConfigSchema, ab as DocActorOptionsSchema, ac as DocConfigurePoolSchema, ad as DocEnvoyConfigSchema, ae as DocRegistryConfigSchema, af as DocServerlessConfigSchema, ag as DocSqliteConfigSchema, ah as FetchHandler, ai as GlobalActorOptions, aj as GlobalActorOptionsInput, ak as GlobalActorOptionsSchema, al as HideInspectorTabEntrySchema, am as InferEventArgs, an as InferSchemaMap, ao as InspectorTabEntrySchema, ap as InspectorUnsubscribe, aq as InstanceActorOptions, ar as InstanceActorOptionsInput, as as InstanceActorOptionsSchema, at as QueueEnqueueAndWaitOptions, au as QueueFilterName, av as QueueIterOptions, aw as QueueMessageOf, ax as QueueName, ay as QueueNextBatchOptions, az as QueueNextOptions, aA as QueueResultMessageForName, aB as QueueTryNextBatchOptions, aC as QueueTryNextOptions, aD as QueueWaitOptions, aE as RAW_STATE_SYMBOL, aF as Registry, aG as RegistryActors, aH as RegistryApplication, aI as RegistryConfig, aJ as RegistryConfigInput, aK as RegistryConfigSchema, aL as RegistryDeps, aM as RegistryListenOptions, aN as RegistryRoutes, aO as RunConfig, aP as RunConfigSchema, aQ as RunControl, aR as RunInspectorConfig, aS as RunInspectorFactoryContext, aT as RunInspectorFactoryResult, aU as RunInspectorKind, aV as RunWithInactiveOptions, aW as RuntimeKind, aX as RuntimeKindSchema, aY as ScheduledEventInfo, aZ as ScheduledFireInfo, a_ as ServerlessHandler, a$ as SqliteBackend, b0 as SqliteBackendSchema, b1 as SqliteConfig, b2 as SqliteConfigSchema, b3 as TestConfig, b4 as TestConfigSchema, b5 as Type, b6 as WasmRuntimeBindings, b7 as WasmRuntimeConfig, b8 as WasmRuntimeConfigSchema, b9 as WasmRuntimeInitInput, ba as WorkflowInspectorConfig, bb as actor, bc as buildActorNames, bd as createClientWithDriver, be as defineRunHandler, bf as disposeRunInspector, bg as event, bh as getRunFunction, bi as getRunInspectorConfig, bj as getRunMetadata, bk as isStaticActorDefinition, bl as isStaticActorInstance, bm as lookupInRegistry, bn as queue, bo as setup, bp as test } from './config-
|
|
1
|
+
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-CGUJyT5L.cjs';
|
|
2
|
+
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as Actions, n as ActorConfig, o as ActorConfigInput, p as ActorConfigSchema, q as ActorContext, r as ActorContextOf, s as ActorCron, t as ActorCronEveryOptions, u as ActorCronSetOptions, v as ActorDefinition, w as ActorInspectorConfig, x as ActorInspectorConfigSchema, y as ActorKey, z as ActorKv, F as ActorLogger, G as ActorOptions, H as ActorOptionsInput, I as ActorOptionsSchema, J as ActorQuery, K as ActorQueue, L as ActorRun, N as ActorSchedule, O as ActorTypes, P as ActorsSchema, T as AnyActorInstance, U as AnyClient, V as AnyConn, X as AnyStaticActorDefinition, Y as AnyStaticActorInstance, Z as AuthIntent, _ as BUILTIN_INSPECTOR_TAB_IDS, $ as BaseActorInstance, a0 as BuiltinInspectorTabIdSchema, a1 as CONN_DRIVER_SYMBOL, a2 as CONN_STATE_MANAGER_SYMBOL, a3 as Client, a4 as Conn, a5 as CronFire, a6 as CronJobInfo, a7 as CustomInspectorTabEntrySchema, a8 as DEFAULT_SLEEP_GRACE_PERIOD, a9 as DefineRunHandlerOptions, aa as DocActorConfigSchema, ab as DocActorOptionsSchema, ac as DocConfigurePoolSchema, ad as DocEnvoyConfigSchema, ae as DocRegistryConfigSchema, af as DocServerlessConfigSchema, ag as DocSqliteConfigSchema, ah as FetchHandler, ai as GlobalActorOptions, aj as GlobalActorOptionsInput, ak as GlobalActorOptionsSchema, al as HideInspectorTabEntrySchema, am as InferEventArgs, an as InferSchemaMap, ao as InspectorTabEntrySchema, ap as InspectorUnsubscribe, aq as InstanceActorOptions, ar as InstanceActorOptionsInput, as as InstanceActorOptionsSchema, at as QueueEnqueueAndWaitOptions, au as QueueFilterName, av as QueueIterOptions, aw as QueueMessageOf, ax as QueueName, ay as QueueNextBatchOptions, az as QueueNextOptions, aA as QueueResultMessageForName, aB as QueueTryNextBatchOptions, aC as QueueTryNextOptions, aD as QueueWaitOptions, aE as RAW_STATE_SYMBOL, aF as Registry, aG as RegistryActors, aH as RegistryApplication, aI as RegistryConfig, aJ as RegistryConfigInput, aK as RegistryConfigSchema, aL as RegistryDeps, aM as RegistryListenOptions, aN as RegistryRoutes, aO as RunConfig, aP as RunConfigSchema, aQ as RunControl, aR as RunInspectorConfig, aS as RunInspectorFactoryContext, aT as RunInspectorFactoryResult, aU as RunInspectorKind, aV as RunWithInactiveOptions, aW as RuntimeKind, aX as RuntimeKindSchema, aY as ScheduledEventInfo, aZ as ScheduledFireInfo, a_ as ServerlessHandler, a$ as SqliteBackend, b0 as SqliteBackendSchema, b1 as SqliteConfig, b2 as SqliteConfigSchema, b3 as TestConfig, b4 as TestConfigSchema, b5 as Type, b6 as WasmRuntimeBindings, b7 as WasmRuntimeConfig, b8 as WasmRuntimeConfigSchema, b9 as WasmRuntimeInitInput, ba as WorkflowInspectorConfig, bb as actor, bc as buildActorNames, bd as createClientWithDriver, be as defineRunHandler, bf as disposeRunInspector, bg as event, bh as getRunFunction, bi as getRunInspectorConfig, bj as getRunMetadata, bk as isStaticActorDefinition, bl as isStaticActorInstance, bm as lookupInRegistry, bn as queue, bo as setup, bp as test } from './config-CGUJyT5L.cjs';
|
|
3
3
|
export { E as Encoding, t as toUint8Array } from './utils-Bbz-3411.cjs';
|
|
4
4
|
import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
5
5
|
export { RivetCloseEvent, RivetEvent, RivetMessageEvent, UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
6
|
-
import { A as AnyDatabaseProvider } from './config-
|
|
6
|
+
import { A as AnyDatabaseProvider } from './config-B0q37XhG.cjs';
|
|
7
7
|
export { R as ActorError, R as RivetError, a as RivetErrorLike, b as RivetErrorOptions, U as UserError, c as UserErrorOptions, n as noopNext } from './utils-vvJQyygr.cjs';
|
|
8
8
|
import { WSContext } from 'hono/ws';
|
|
9
|
-
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-
|
|
9
|
+
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-WLBsDXrQ.cjs';
|
|
10
10
|
import 'zod/v4';
|
|
11
11
|
import '@rivetkit/rivetkit-wasm';
|
|
12
12
|
import 'zod';
|
package/dist/tsup/mod.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-
|
|
2
|
-
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as Actions, n as ActorConfig, o as ActorConfigInput, p as ActorConfigSchema, q as ActorContext, r as ActorContextOf, s as ActorCron, t as ActorCronEveryOptions, u as ActorCronSetOptions, v as ActorDefinition, w as ActorInspectorConfig, x as ActorInspectorConfigSchema, y as ActorKey, z as ActorKv, F as ActorLogger, G as ActorOptions, H as ActorOptionsInput, I as ActorOptionsSchema, J as ActorQuery, K as ActorQueue, L as ActorRun, N as ActorSchedule, O as ActorTypes, P as ActorsSchema, T as AnyActorInstance, U as AnyClient, V as AnyConn, X as AnyStaticActorDefinition, Y as AnyStaticActorInstance, Z as AuthIntent, _ as BUILTIN_INSPECTOR_TAB_IDS, $ as BaseActorInstance, a0 as BuiltinInspectorTabIdSchema, a1 as CONN_DRIVER_SYMBOL, a2 as CONN_STATE_MANAGER_SYMBOL, a3 as Client, a4 as Conn, a5 as CronFire, a6 as CronJobInfo, a7 as CustomInspectorTabEntrySchema, a8 as DEFAULT_SLEEP_GRACE_PERIOD, a9 as DefineRunHandlerOptions, aa as DocActorConfigSchema, ab as DocActorOptionsSchema, ac as DocConfigurePoolSchema, ad as DocEnvoyConfigSchema, ae as DocRegistryConfigSchema, af as DocServerlessConfigSchema, ag as DocSqliteConfigSchema, ah as FetchHandler, ai as GlobalActorOptions, aj as GlobalActorOptionsInput, ak as GlobalActorOptionsSchema, al as HideInspectorTabEntrySchema, am as InferEventArgs, an as InferSchemaMap, ao as InspectorTabEntrySchema, ap as InspectorUnsubscribe, aq as InstanceActorOptions, ar as InstanceActorOptionsInput, as as InstanceActorOptionsSchema, at as QueueEnqueueAndWaitOptions, au as QueueFilterName, av as QueueIterOptions, aw as QueueMessageOf, ax as QueueName, ay as QueueNextBatchOptions, az as QueueNextOptions, aA as QueueResultMessageForName, aB as QueueTryNextBatchOptions, aC as QueueTryNextOptions, aD as QueueWaitOptions, aE as RAW_STATE_SYMBOL, aF as Registry, aG as RegistryActors, aH as RegistryApplication, aI as RegistryConfig, aJ as RegistryConfigInput, aK as RegistryConfigSchema, aL as RegistryDeps, aM as RegistryListenOptions, aN as RegistryRoutes, aO as RunConfig, aP as RunConfigSchema, aQ as RunControl, aR as RunInspectorConfig, aS as RunInspectorFactoryContext, aT as RunInspectorFactoryResult, aU as RunInspectorKind, aV as RunWithInactiveOptions, aW as RuntimeKind, aX as RuntimeKindSchema, aY as ScheduledEventInfo, aZ as ScheduledFireInfo, a_ as ServerlessHandler, a$ as SqliteBackend, b0 as SqliteBackendSchema, b1 as SqliteConfig, b2 as SqliteConfigSchema, b3 as TestConfig, b4 as TestConfigSchema, b5 as Type, b6 as WasmRuntimeBindings, b7 as WasmRuntimeConfig, b8 as WasmRuntimeConfigSchema, b9 as WasmRuntimeInitInput, ba as WorkflowInspectorConfig, bb as actor, bc as buildActorNames, bd as createClientWithDriver, be as defineRunHandler, bf as disposeRunInspector, bg as event, bh as getRunFunction, bi as getRunInspectorConfig, bj as getRunMetadata, bk as isStaticActorDefinition, bl as isStaticActorInstance, bm as lookupInRegistry, bn as queue, bo as setup, bp as test } from './config-
|
|
1
|
+
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, a as ActionContext, b as BeforeActionResponseContext, c as BeforeConnectContext, C as ConnectContext, d as CreateConnStateContext, e as CreateContext, f as CreateVarsContext, D as DestroyContext, g as DisconnectContext, M as MigrateContext, R as RequestContext, h as RunContext, S as SleepContext, i as StateChangeContext, W as WakeContext, j as WebSocketContext } from './config-BPJQ0mDo.js';
|
|
2
|
+
export { k as ACTOR_CONTEXT_INTERNAL_SYMBOL, l as ActionInputSchemas, m as Actions, n as ActorConfig, o as ActorConfigInput, p as ActorConfigSchema, q as ActorContext, r as ActorContextOf, s as ActorCron, t as ActorCronEveryOptions, u as ActorCronSetOptions, v as ActorDefinition, w as ActorInspectorConfig, x as ActorInspectorConfigSchema, y as ActorKey, z as ActorKv, F as ActorLogger, G as ActorOptions, H as ActorOptionsInput, I as ActorOptionsSchema, J as ActorQuery, K as ActorQueue, L as ActorRun, N as ActorSchedule, O as ActorTypes, P as ActorsSchema, T as AnyActorInstance, U as AnyClient, V as AnyConn, X as AnyStaticActorDefinition, Y as AnyStaticActorInstance, Z as AuthIntent, _ as BUILTIN_INSPECTOR_TAB_IDS, $ as BaseActorInstance, a0 as BuiltinInspectorTabIdSchema, a1 as CONN_DRIVER_SYMBOL, a2 as CONN_STATE_MANAGER_SYMBOL, a3 as Client, a4 as Conn, a5 as CronFire, a6 as CronJobInfo, a7 as CustomInspectorTabEntrySchema, a8 as DEFAULT_SLEEP_GRACE_PERIOD, a9 as DefineRunHandlerOptions, aa as DocActorConfigSchema, ab as DocActorOptionsSchema, ac as DocConfigurePoolSchema, ad as DocEnvoyConfigSchema, ae as DocRegistryConfigSchema, af as DocServerlessConfigSchema, ag as DocSqliteConfigSchema, ah as FetchHandler, ai as GlobalActorOptions, aj as GlobalActorOptionsInput, ak as GlobalActorOptionsSchema, al as HideInspectorTabEntrySchema, am as InferEventArgs, an as InferSchemaMap, ao as InspectorTabEntrySchema, ap as InspectorUnsubscribe, aq as InstanceActorOptions, ar as InstanceActorOptionsInput, as as InstanceActorOptionsSchema, at as QueueEnqueueAndWaitOptions, au as QueueFilterName, av as QueueIterOptions, aw as QueueMessageOf, ax as QueueName, ay as QueueNextBatchOptions, az as QueueNextOptions, aA as QueueResultMessageForName, aB as QueueTryNextBatchOptions, aC as QueueTryNextOptions, aD as QueueWaitOptions, aE as RAW_STATE_SYMBOL, aF as Registry, aG as RegistryActors, aH as RegistryApplication, aI as RegistryConfig, aJ as RegistryConfigInput, aK as RegistryConfigSchema, aL as RegistryDeps, aM as RegistryListenOptions, aN as RegistryRoutes, aO as RunConfig, aP as RunConfigSchema, aQ as RunControl, aR as RunInspectorConfig, aS as RunInspectorFactoryContext, aT as RunInspectorFactoryResult, aU as RunInspectorKind, aV as RunWithInactiveOptions, aW as RuntimeKind, aX as RuntimeKindSchema, aY as ScheduledEventInfo, aZ as ScheduledFireInfo, a_ as ServerlessHandler, a$ as SqliteBackend, b0 as SqliteBackendSchema, b1 as SqliteConfig, b2 as SqliteConfigSchema, b3 as TestConfig, b4 as TestConfigSchema, b5 as Type, b6 as WasmRuntimeBindings, b7 as WasmRuntimeConfig, b8 as WasmRuntimeConfigSchema, b9 as WasmRuntimeInitInput, ba as WorkflowInspectorConfig, bb as actor, bc as buildActorNames, bd as createClientWithDriver, be as defineRunHandler, bf as disposeRunInspector, bg as event, bh as getRunFunction, bi as getRunInspectorConfig, bj as getRunMetadata, bk as isStaticActorDefinition, bl as isStaticActorInstance, bm as lookupInRegistry, bn as queue, bo as setup, bp as test } from './config-BPJQ0mDo.js';
|
|
3
3
|
export { E as Encoding, t as toUint8Array } from './utils-BqdWVlzm.js';
|
|
4
4
|
import { UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
5
5
|
export { RivetCloseEvent, RivetEvent, RivetMessageEvent, UniversalWebSocket } from '@rivetkit/virtual-websocket';
|
|
6
|
-
import { A as AnyDatabaseProvider } from './config-
|
|
6
|
+
import { A as AnyDatabaseProvider } from './config-B0q37XhG.js';
|
|
7
7
|
export { R as ActorError, R as RivetError, a as RivetErrorLike, b as RivetErrorOptions, U as UserError, c as UserErrorOptions, n as noopNext } from './utils-vvJQyygr.js';
|
|
8
8
|
import { WSContext } from 'hono/ws';
|
|
9
|
-
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-
|
|
9
|
+
export { W as WorkflowBranchContextOf, a as WorkflowContextOf, b as WorkflowLoopContextOf, c as WorkflowStepContextOf } from './context-DZ_lu12i.js';
|
|
10
10
|
import 'zod/v4';
|
|
11
11
|
import '@rivetkit/rivetkit-wasm';
|
|
12
12
|
import 'zod';
|
package/dist/tsup/mod.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
decodeWorkflowHistoryTransport
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EHAGZJ34.js";
|
|
4
4
|
import {
|
|
5
5
|
ACTOR_CONTEXT_INTERNAL_SYMBOL,
|
|
6
6
|
ActorConfigSchema,
|
|
@@ -28,18 +28,18 @@ import {
|
|
|
28
28
|
isResponseLike,
|
|
29
29
|
tryParseEndpoint,
|
|
30
30
|
updateRunnerConfig
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-BERJKIW5.js";
|
|
32
32
|
import {
|
|
33
33
|
makePrefixedKey,
|
|
34
34
|
removePrefixFromKey
|
|
35
35
|
} from "./chunk-JI6GZ2C2.js";
|
|
36
|
-
import "./chunk-L6DNN72S.js";
|
|
37
36
|
import {
|
|
38
37
|
bindNativeStateTransactionContext,
|
|
39
38
|
db,
|
|
40
39
|
registerNativeStateTransactionOpener
|
|
41
|
-
} from "./chunk-
|
|
42
|
-
import "./chunk-
|
|
40
|
+
} from "./chunk-J7WM3KL5.js";
|
|
41
|
+
import "./chunk-WCEJTJHO.js";
|
|
42
|
+
import "./chunk-SLAKWYOH.js";
|
|
43
43
|
import {
|
|
44
44
|
LogLevelSchema,
|
|
45
45
|
VERSION,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
parsePortEnv,
|
|
74
74
|
stringifyError,
|
|
75
75
|
toUint8Array
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-NNPIJLBE.js";
|
|
77
77
|
import {
|
|
78
78
|
INTERNAL_ERROR_CODE,
|
|
79
79
|
RivetError,
|
|
@@ -969,6 +969,10 @@ var DocRegistryConfigSchema = z3.object({
|
|
|
969
969
|
import { VirtualWebSocket as VirtualWebSocket2 } from "@rivetkit/virtual-websocket";
|
|
970
970
|
|
|
971
971
|
// src/common/database/native-database.ts
|
|
972
|
+
function isSynchronousTransaction(transaction) {
|
|
973
|
+
const candidate = transaction;
|
|
974
|
+
return typeof candidate.commitSync === "function" && typeof candidate.rollbackSync === "function";
|
|
975
|
+
}
|
|
972
976
|
function shouldAttachNativeKvError(message) {
|
|
973
977
|
return /i\/o error|unable to open database file/i.test(message);
|
|
974
978
|
}
|
|
@@ -1156,6 +1160,30 @@ function wrapJsNativeDatabase(database) {
|
|
|
1156
1160
|
release();
|
|
1157
1161
|
}
|
|
1158
1162
|
};
|
|
1163
|
+
const executeNativeSync = (sql, params) => {
|
|
1164
|
+
const lastInsertRowIdColumn = lastInsertRowIdColumnName(sql);
|
|
1165
|
+
if (lastInsertRowIdColumn) {
|
|
1166
|
+
return {
|
|
1167
|
+
columns: [lastInsertRowIdColumn],
|
|
1168
|
+
rows: [[lastInsertRowId ?? 0]],
|
|
1169
|
+
changes: 0,
|
|
1170
|
+
lastInsertRowId
|
|
1171
|
+
};
|
|
1172
|
+
}
|
|
1173
|
+
const release = gate.enter();
|
|
1174
|
+
try {
|
|
1175
|
+
const nativeParams = toNativeBindings(sql, params);
|
|
1176
|
+
const result = database.executeSync(sql, nativeParams);
|
|
1177
|
+
if (result.lastInsertRowId !== void 0) {
|
|
1178
|
+
lastInsertRowId = result.lastInsertRowId;
|
|
1179
|
+
}
|
|
1180
|
+
return result;
|
|
1181
|
+
} catch (error) {
|
|
1182
|
+
enrichNativeDatabaseError(database, error);
|
|
1183
|
+
} finally {
|
|
1184
|
+
release();
|
|
1185
|
+
}
|
|
1186
|
+
};
|
|
1159
1187
|
return {
|
|
1160
1188
|
async exec(sql, callback) {
|
|
1161
1189
|
const release = gate.enter();
|
|
@@ -1174,9 +1202,28 @@ function wrapJsNativeDatabase(database) {
|
|
|
1174
1202
|
callback(row, result.columns);
|
|
1175
1203
|
}
|
|
1176
1204
|
},
|
|
1205
|
+
execSync(sql, callback) {
|
|
1206
|
+
const release = gate.enter();
|
|
1207
|
+
let result;
|
|
1208
|
+
try {
|
|
1209
|
+
result = database.execSync(sql);
|
|
1210
|
+
} catch (error) {
|
|
1211
|
+
enrichNativeDatabaseError(database, error);
|
|
1212
|
+
} finally {
|
|
1213
|
+
release();
|
|
1214
|
+
}
|
|
1215
|
+
if (callback) {
|
|
1216
|
+
for (const row of result.rows) {
|
|
1217
|
+
callback(row, result.columns);
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
},
|
|
1177
1221
|
async execute(sql, params) {
|
|
1178
1222
|
return await executeNative(sql, params);
|
|
1179
1223
|
},
|
|
1224
|
+
executeSync(sql, params) {
|
|
1225
|
+
return executeNativeSync(sql, params);
|
|
1226
|
+
},
|
|
1180
1227
|
async executeBatch(statements) {
|
|
1181
1228
|
const nativeStatements = statements.map(toNativeBatchStatement);
|
|
1182
1229
|
const release = gate.enter();
|
|
@@ -1231,6 +1278,22 @@ function wrapJsNativeDatabase(database) {
|
|
|
1231
1278
|
}
|
|
1232
1279
|
});
|
|
1233
1280
|
},
|
|
1281
|
+
beginTransactionSync(timeoutMs, name) {
|
|
1282
|
+
const release = gate.enter();
|
|
1283
|
+
let transaction;
|
|
1284
|
+
try {
|
|
1285
|
+
transaction = database.beginTransactionSync(timeoutMs, name);
|
|
1286
|
+
} catch (error) {
|
|
1287
|
+
enrichNativeDatabaseError(database, error);
|
|
1288
|
+
} finally {
|
|
1289
|
+
release();
|
|
1290
|
+
}
|
|
1291
|
+
return wrapTransaction(database, transaction, gate, (result) => {
|
|
1292
|
+
if (result.lastInsertRowId !== void 0) {
|
|
1293
|
+
lastInsertRowId = result.lastInsertRowId;
|
|
1294
|
+
}
|
|
1295
|
+
});
|
|
1296
|
+
},
|
|
1234
1297
|
async beginStateTransaction(timeoutMs, context) {
|
|
1235
1298
|
if (!database.beginStateTransaction) {
|
|
1236
1299
|
throw new Error("actor state transactions are not configured");
|
|
@@ -1271,7 +1334,7 @@ function wrapJsNativeDatabase(database) {
|
|
|
1271
1334
|
};
|
|
1272
1335
|
}
|
|
1273
1336
|
function wrapTransaction(database, transaction, gate, onExecute) {
|
|
1274
|
-
|
|
1337
|
+
const wrapped = {
|
|
1275
1338
|
async exec(sql, callback) {
|
|
1276
1339
|
const release = gate.enter();
|
|
1277
1340
|
let result;
|
|
@@ -1286,6 +1349,20 @@ function wrapTransaction(database, transaction, gate, onExecute) {
|
|
|
1286
1349
|
for (const row of result.rows) callback(row, result.columns);
|
|
1287
1350
|
}
|
|
1288
1351
|
},
|
|
1352
|
+
execSync(sql, callback) {
|
|
1353
|
+
const release = gate.enter();
|
|
1354
|
+
let result;
|
|
1355
|
+
try {
|
|
1356
|
+
result = transaction.execSync(sql);
|
|
1357
|
+
} catch (error) {
|
|
1358
|
+
enrichNativeDatabaseError(database, error);
|
|
1359
|
+
} finally {
|
|
1360
|
+
release();
|
|
1361
|
+
}
|
|
1362
|
+
if (callback) {
|
|
1363
|
+
for (const row of result.rows) callback(row, result.columns);
|
|
1364
|
+
}
|
|
1365
|
+
},
|
|
1289
1366
|
async execute(sql, params) {
|
|
1290
1367
|
const release = gate.enter();
|
|
1291
1368
|
try {
|
|
@@ -1301,6 +1378,21 @@ function wrapTransaction(database, transaction, gate, onExecute) {
|
|
|
1301
1378
|
release();
|
|
1302
1379
|
}
|
|
1303
1380
|
},
|
|
1381
|
+
executeSync(sql, params) {
|
|
1382
|
+
const release = gate.enter();
|
|
1383
|
+
try {
|
|
1384
|
+
const result = transaction.executeSync(
|
|
1385
|
+
sql,
|
|
1386
|
+
toNativeBindings(sql, params)
|
|
1387
|
+
);
|
|
1388
|
+
onExecute(result);
|
|
1389
|
+
return result;
|
|
1390
|
+
} catch (error) {
|
|
1391
|
+
enrichNativeDatabaseError(database, error);
|
|
1392
|
+
} finally {
|
|
1393
|
+
release();
|
|
1394
|
+
}
|
|
1395
|
+
},
|
|
1304
1396
|
async commit() {
|
|
1305
1397
|
const release = gate.enter();
|
|
1306
1398
|
try {
|
|
@@ -1322,6 +1414,31 @@ function wrapTransaction(database, transaction, gate, onExecute) {
|
|
|
1322
1414
|
}
|
|
1323
1415
|
}
|
|
1324
1416
|
};
|
|
1417
|
+
if (isSynchronousTransaction(transaction)) {
|
|
1418
|
+
return Object.assign(wrapped, {
|
|
1419
|
+
commitSync() {
|
|
1420
|
+
const release = gate.enter();
|
|
1421
|
+
try {
|
|
1422
|
+
transaction.commitSync();
|
|
1423
|
+
} catch (error) {
|
|
1424
|
+
enrichNativeDatabaseError(database, error);
|
|
1425
|
+
} finally {
|
|
1426
|
+
release();
|
|
1427
|
+
}
|
|
1428
|
+
},
|
|
1429
|
+
rollbackSync() {
|
|
1430
|
+
const release = gate.enter();
|
|
1431
|
+
try {
|
|
1432
|
+
transaction.rollbackSync();
|
|
1433
|
+
} catch (error) {
|
|
1434
|
+
enrichNativeDatabaseError(database, error);
|
|
1435
|
+
} finally {
|
|
1436
|
+
release();
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
});
|
|
1440
|
+
}
|
|
1441
|
+
return wrapped;
|
|
1325
1442
|
}
|
|
1326
1443
|
function lastInsertRowIdColumnName(sql) {
|
|
1327
1444
|
const match = sql.match(
|
|
@@ -1822,6 +1939,9 @@ var NapiCoreRuntime = class {
|
|
|
1822
1939
|
async actorSqlExec(ctx, sql) {
|
|
1823
1940
|
return await this.#actorSql(ctx).exec(sql);
|
|
1824
1941
|
}
|
|
1942
|
+
actorSqlExecSync(ctx, sql) {
|
|
1943
|
+
return this.#actorSql(ctx).execSync(sql);
|
|
1944
|
+
}
|
|
1825
1945
|
async actorSqlExecute(ctx, sql, params) {
|
|
1826
1946
|
const result = await this.#actorSql(ctx).execute(
|
|
1827
1947
|
sql,
|
|
@@ -1829,6 +1949,13 @@ var NapiCoreRuntime = class {
|
|
|
1829
1949
|
);
|
|
1830
1950
|
return normalizeRuntimeSqlExecuteResult(result);
|
|
1831
1951
|
}
|
|
1952
|
+
actorSqlExecuteSync(ctx, sql, params) {
|
|
1953
|
+
const result = this.#actorSql(ctx).executeSync(
|
|
1954
|
+
sql,
|
|
1955
|
+
toNapiSqlBindParams(params)
|
|
1956
|
+
);
|
|
1957
|
+
return normalizeRuntimeSqlExecuteResult(result);
|
|
1958
|
+
}
|
|
1832
1959
|
async actorSqlExecuteBatch(ctx, statements) {
|
|
1833
1960
|
const results = await this.#actorSql(ctx).executeBatch(
|
|
1834
1961
|
statements.map(toNapiSqlBatchStatement)
|
|
@@ -1841,9 +1968,18 @@ var NapiCoreRuntime = class {
|
|
|
1841
1968
|
name
|
|
1842
1969
|
);
|
|
1843
1970
|
}
|
|
1971
|
+
actorSqlBeginTransactionSync(ctx, timeoutMs, name) {
|
|
1972
|
+
return this.#actorSql(ctx).beginTransactionSync(
|
|
1973
|
+
timeoutMs,
|
|
1974
|
+
name
|
|
1975
|
+
);
|
|
1976
|
+
}
|
|
1844
1977
|
async actorSqlTransactionExec(transaction, sql) {
|
|
1845
1978
|
return await asNativeSqlTransaction(transaction).exec(sql);
|
|
1846
1979
|
}
|
|
1980
|
+
actorSqlTransactionExecSync(transaction, sql) {
|
|
1981
|
+
return asNativeSqlTransaction(transaction).execSync(sql);
|
|
1982
|
+
}
|
|
1847
1983
|
async actorSqlTransactionExecute(transaction, sql, params) {
|
|
1848
1984
|
const result = await asNativeSqlTransaction(transaction).execute(
|
|
1849
1985
|
sql,
|
|
@@ -1851,12 +1987,25 @@ var NapiCoreRuntime = class {
|
|
|
1851
1987
|
);
|
|
1852
1988
|
return normalizeRuntimeSqlExecuteResult(result);
|
|
1853
1989
|
}
|
|
1990
|
+
actorSqlTransactionExecuteSync(transaction, sql, params) {
|
|
1991
|
+
const result = asNativeSqlTransaction(transaction).executeSync(
|
|
1992
|
+
sql,
|
|
1993
|
+
toNapiSqlBindParams(params)
|
|
1994
|
+
);
|
|
1995
|
+
return normalizeRuntimeSqlExecuteResult(result);
|
|
1996
|
+
}
|
|
1854
1997
|
async actorSqlTransactionCommit(transaction) {
|
|
1855
1998
|
await asNativeSqlTransaction(transaction).commit();
|
|
1856
1999
|
}
|
|
2000
|
+
actorSqlTransactionCommitSync(transaction) {
|
|
2001
|
+
asNativeSqlTransaction(transaction).commitSync();
|
|
2002
|
+
}
|
|
1857
2003
|
async actorSqlTransactionRollback(transaction) {
|
|
1858
2004
|
await asNativeSqlTransaction(transaction).rollback();
|
|
1859
2005
|
}
|
|
2006
|
+
actorSqlTransactionRollbackSync(transaction) {
|
|
2007
|
+
asNativeSqlTransaction(transaction).rollbackSync();
|
|
2008
|
+
}
|
|
1860
2009
|
async actorBeginStateTransaction(ctx, timeoutMs) {
|
|
1861
2010
|
return await asNativeActorContext(ctx).beginStateTransaction(
|
|
1862
2011
|
timeoutMs
|
|
@@ -1869,6 +2018,13 @@ var NapiCoreRuntime = class {
|
|
|
1869
2018
|
);
|
|
1870
2019
|
return normalizeRuntimeSqlExecuteResult(result);
|
|
1871
2020
|
}
|
|
2021
|
+
actorStateTransactionExecuteSync(transaction, sql, params) {
|
|
2022
|
+
const result = asNativeActorStateTransaction(transaction).executeSync(
|
|
2023
|
+
sql,
|
|
2024
|
+
toNapiSqlBindParams(params)
|
|
2025
|
+
);
|
|
2026
|
+
return normalizeRuntimeSqlExecuteResult(result);
|
|
2027
|
+
}
|
|
1872
2028
|
async actorStateTransactionCommit(transaction, payload) {
|
|
1873
2029
|
await asNativeActorStateTransaction(transaction).commit(
|
|
1874
2030
|
toNapiStateDeltaPayload(payload)
|
|
@@ -2476,6 +2632,11 @@ function optionalWasmNumber(value) {
|
|
|
2476
2632
|
function wasmNumber(value) {
|
|
2477
2633
|
return typeof value === "bigint" ? Number(value) : value;
|
|
2478
2634
|
}
|
|
2635
|
+
function synchronousSqliteUnavailable() {
|
|
2636
|
+
throw new Error(
|
|
2637
|
+
"Synchronous SQLite operations are only available in the Node.js native runtime."
|
|
2638
|
+
);
|
|
2639
|
+
}
|
|
2479
2640
|
function normalizeKvEntry(entry) {
|
|
2480
2641
|
return {
|
|
2481
2642
|
key: toBytes(entry.key),
|
|
@@ -2879,12 +3040,18 @@ var WasmCoreRuntime = class {
|
|
|
2879
3040
|
async actorSqlExec(ctx, sql) {
|
|
2880
3041
|
return await callWasm(() => this.#actorSql(ctx).exec(sql));
|
|
2881
3042
|
}
|
|
3043
|
+
actorSqlExecSync(_ctx, _sql) {
|
|
3044
|
+
return synchronousSqliteUnavailable();
|
|
3045
|
+
}
|
|
2882
3046
|
async actorSqlExecute(ctx, sql, params) {
|
|
2883
3047
|
const result = await callWasm(
|
|
2884
3048
|
() => this.#actorSql(ctx).execute(sql, params)
|
|
2885
3049
|
);
|
|
2886
3050
|
return normalizeRuntimeSqlExecuteResult(result);
|
|
2887
3051
|
}
|
|
3052
|
+
actorSqlExecuteSync(_ctx, _sql, _params) {
|
|
3053
|
+
return synchronousSqliteUnavailable();
|
|
3054
|
+
}
|
|
2888
3055
|
async actorSqlExecuteBatch(ctx, statements) {
|
|
2889
3056
|
const results = await callWasm(
|
|
2890
3057
|
() => this.#actorSql(ctx).executeBatch(statements)
|
|
@@ -2896,27 +3063,42 @@ var WasmCoreRuntime = class {
|
|
|
2896
3063
|
() => this.#actorSql(ctx).beginTransaction(timeoutMs, name)
|
|
2897
3064
|
);
|
|
2898
3065
|
}
|
|
3066
|
+
actorSqlBeginTransactionSync(_ctx, _timeoutMs, _name) {
|
|
3067
|
+
return synchronousSqliteUnavailable();
|
|
3068
|
+
}
|
|
2899
3069
|
async actorSqlTransactionExec(transaction, sql) {
|
|
2900
3070
|
return await callWasm(
|
|
2901
3071
|
() => transaction.exec(sql)
|
|
2902
3072
|
);
|
|
2903
3073
|
}
|
|
3074
|
+
actorSqlTransactionExecSync(_transaction, _sql) {
|
|
3075
|
+
return synchronousSqliteUnavailable();
|
|
3076
|
+
}
|
|
2904
3077
|
async actorSqlTransactionExecute(transaction, sql, params) {
|
|
2905
3078
|
const result = await callWasm(
|
|
2906
3079
|
() => transaction.execute(sql, params)
|
|
2907
3080
|
);
|
|
2908
3081
|
return normalizeRuntimeSqlExecuteResult(result);
|
|
2909
3082
|
}
|
|
3083
|
+
actorSqlTransactionExecuteSync(_transaction, _sql, _params) {
|
|
3084
|
+
return synchronousSqliteUnavailable();
|
|
3085
|
+
}
|
|
2910
3086
|
async actorSqlTransactionCommit(transaction) {
|
|
2911
3087
|
await callWasm(
|
|
2912
3088
|
() => transaction.commit()
|
|
2913
3089
|
);
|
|
2914
3090
|
}
|
|
3091
|
+
actorSqlTransactionCommitSync(_transaction) {
|
|
3092
|
+
synchronousSqliteUnavailable();
|
|
3093
|
+
}
|
|
2915
3094
|
async actorSqlTransactionRollback(transaction) {
|
|
2916
3095
|
await callWasm(
|
|
2917
3096
|
() => transaction.rollback()
|
|
2918
3097
|
);
|
|
2919
3098
|
}
|
|
3099
|
+
actorSqlTransactionRollbackSync(_transaction) {
|
|
3100
|
+
synchronousSqliteUnavailable();
|
|
3101
|
+
}
|
|
2920
3102
|
async actorBeginStateTransaction(ctx, timeoutMs) {
|
|
2921
3103
|
return await callWasm(
|
|
2922
3104
|
() => asWasmActorContext(ctx).beginStateTransaction(timeoutMs)
|
|
@@ -2928,6 +3110,9 @@ var WasmCoreRuntime = class {
|
|
|
2928
3110
|
);
|
|
2929
3111
|
return normalizeRuntimeSqlExecuteResult(result);
|
|
2930
3112
|
}
|
|
3113
|
+
actorStateTransactionExecuteSync(_transaction, _sql, _params) {
|
|
3114
|
+
return synchronousSqliteUnavailable();
|
|
3115
|
+
}
|
|
2931
3116
|
async actorStateTransactionCommit(transaction, payload) {
|
|
2932
3117
|
await callWasm(
|
|
2933
3118
|
() => transaction.commit(payload)
|
|
@@ -3567,6 +3752,18 @@ async function closeNativeDatabaseClient(runtime, ctx) {
|
|
|
3567
3752
|
await entry.client.close();
|
|
3568
3753
|
}
|
|
3569
3754
|
}
|
|
3755
|
+
function createNativeSqlTransaction(runtime, transaction) {
|
|
3756
|
+
return {
|
|
3757
|
+
exec: (sql) => runtime.actorSqlTransactionExec(transaction, sql),
|
|
3758
|
+
execSync: (sql) => runtime.actorSqlTransactionExecSync(transaction, sql),
|
|
3759
|
+
execute: (sql, params) => runtime.actorSqlTransactionExecute(transaction, sql, params),
|
|
3760
|
+
executeSync: (sql, params) => runtime.actorSqlTransactionExecuteSync(transaction, sql, params),
|
|
3761
|
+
commit: () => runtime.actorSqlTransactionCommit(transaction),
|
|
3762
|
+
commitSync: () => runtime.actorSqlTransactionCommitSync(transaction),
|
|
3763
|
+
rollback: () => runtime.actorSqlTransactionRollback(transaction),
|
|
3764
|
+
rollbackSync: () => runtime.actorSqlTransactionRollbackSync(transaction)
|
|
3765
|
+
};
|
|
3766
|
+
}
|
|
3570
3767
|
function getOrCreateNativeSqlDatabase(runtime, ctx) {
|
|
3571
3768
|
const runtimeState = getNativeRuntimeState(runtime, ctx);
|
|
3572
3769
|
const cachedDatabase = runtimeState.sql;
|
|
@@ -3575,7 +3772,9 @@ function getOrCreateNativeSqlDatabase(runtime, ctx) {
|
|
|
3575
3772
|
}
|
|
3576
3773
|
const database = wrapJsNativeDatabase({
|
|
3577
3774
|
exec: (sql) => runtime.actorSqlExec(ctx, sql),
|
|
3775
|
+
execSync: (sql) => runtime.actorSqlExecSync(ctx, sql),
|
|
3578
3776
|
execute: (sql, params) => runtime.actorSqlExecute(ctx, sql, params),
|
|
3777
|
+
executeSync: (sql, params) => runtime.actorSqlExecuteSync(ctx, sql, params),
|
|
3579
3778
|
executeBatch: (statements) => runtime.actorSqlExecuteBatch(ctx, statements),
|
|
3580
3779
|
beginTransaction: async (timeoutMs, name) => {
|
|
3581
3780
|
const transaction = await runtime.actorSqlBeginTransaction(
|
|
@@ -3583,16 +3782,15 @@ function getOrCreateNativeSqlDatabase(runtime, ctx) {
|
|
|
3583
3782
|
timeoutMs,
|
|
3584
3783
|
name
|
|
3585
3784
|
);
|
|
3586
|
-
return
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
};
|
|
3785
|
+
return createNativeSqlTransaction(runtime, transaction);
|
|
3786
|
+
},
|
|
3787
|
+
beginTransactionSync: (timeoutMs, name) => {
|
|
3788
|
+
const transaction = runtime.actorSqlBeginTransactionSync(
|
|
3789
|
+
ctx,
|
|
3790
|
+
timeoutMs,
|
|
3791
|
+
name
|
|
3792
|
+
);
|
|
3793
|
+
return createNativeSqlTransaction(runtime, transaction);
|
|
3596
3794
|
},
|
|
3597
3795
|
beginStateTransaction: async (timeoutMs, context) => {
|
|
3598
3796
|
const scope = context;
|
|
@@ -3611,11 +3809,21 @@ function getOrCreateNativeSqlDatabase(runtime, ctx) {
|
|
|
3611
3809
|
"actor state transactions only support single-statement execute calls"
|
|
3612
3810
|
);
|
|
3613
3811
|
},
|
|
3812
|
+
execSync: () => {
|
|
3813
|
+
throw new Error(
|
|
3814
|
+
"actor state transactions only support single-statement execute calls"
|
|
3815
|
+
);
|
|
3816
|
+
},
|
|
3614
3817
|
execute: (sql, params) => runtime.actorStateTransactionExecute(
|
|
3615
3818
|
transaction,
|
|
3616
3819
|
sql,
|
|
3617
3820
|
params
|
|
3618
3821
|
),
|
|
3822
|
+
executeSync: (sql, params) => runtime.actorStateTransactionExecuteSync(
|
|
3823
|
+
transaction,
|
|
3824
|
+
sql,
|
|
3825
|
+
params
|
|
3826
|
+
),
|
|
3619
3827
|
commit: async () => {
|
|
3620
3828
|
await runtime.actorStateTransactionCommit(
|
|
3621
3829
|
transaction,
|