rivetkit 3.0.5 → 3.0.7
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 +34 -28
- package/dist/browser/client.js +2 -2
- 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/{chunk-WIL6MWU4.cjs → chunk-5A2KUC5L.cjs} +10 -10
- package/dist/tsup/{chunk-WIL6MWU4.cjs.map → chunk-5A2KUC5L.cjs.map} +1 -1
- package/dist/tsup/{chunk-NEGCEZM6.js → chunk-7OXC5BQF.js} +2 -2
- package/dist/tsup/{chunk-NEGCEZM6.js.map → chunk-7OXC5BQF.js.map} +1 -1
- package/dist/tsup/{chunk-NNKSJSMR.js → chunk-AY25XAXA.js} +3 -3
- package/dist/tsup/{chunk-NSDT2GWM.cjs → chunk-HKD7AH4Z.cjs} +145 -145
- package/dist/tsup/chunk-HKD7AH4Z.cjs.map +1 -0
- package/dist/tsup/{chunk-NHB4KDZL.cjs → chunk-K6WETGBW.cjs} +3 -3
- package/dist/tsup/{chunk-NHB4KDZL.cjs.map → chunk-K6WETGBW.cjs.map} +1 -1
- package/dist/tsup/{chunk-MVJLQPWC.js → chunk-NMLZDHH2.js} +2 -2
- package/dist/tsup/{chunk-STFQQWYY.cjs → chunk-OEOODXVI.cjs} +4 -4
- package/dist/tsup/{chunk-STFQQWYY.cjs.map → chunk-OEOODXVI.cjs.map} +1 -1
- package/dist/tsup/{chunk-A7Q5DJ2P.js → chunk-PBIQPYE5.js} +12 -15
- package/dist/tsup/chunk-PBIQPYE5.js.map +1 -0
- package/dist/tsup/{chunk-EC72YM63.js → chunk-QTCX5KN3.js} +2 -2
- package/dist/tsup/{chunk-VJROJMLX.js → chunk-RFJ4NNO3.js} +4 -4
- package/dist/tsup/{chunk-YPAJANQG.js → chunk-S6ZMUE7Q.js} +2 -2
- package/dist/tsup/{chunk-4QY3LBN6.cjs → chunk-U3CMQVMS.cjs} +3 -3
- package/dist/tsup/{chunk-4QY3LBN6.cjs.map → chunk-U3CMQVMS.cjs.map} +1 -1
- package/dist/tsup/{chunk-DL7PKMEP.cjs → chunk-VM4SXQOC.cjs} +3 -3
- package/dist/tsup/{chunk-DL7PKMEP.cjs.map → chunk-VM4SXQOC.cjs.map} +1 -1
- package/dist/tsup/{chunk-BY6YFH2K.cjs → chunk-WBUHPDDM.cjs} +2 -2
- package/dist/tsup/{chunk-BY6YFH2K.cjs.map → chunk-WBUHPDDM.cjs.map} +1 -1
- package/dist/tsup/{chunk-XILB6EBK.js → chunk-YMCG4FCB.js} +7 -7
- package/dist/tsup/chunk-YMCG4FCB.js.map +1 -0
- package/dist/tsup/{chunk-WNURZU2P.js → chunk-YO4TJ56P.js} +2 -2
- package/dist/tsup/{chunk-D3VCNACM.cjs → chunk-YTELGNB3.cjs} +7 -7
- package/dist/tsup/{chunk-D3VCNACM.cjs.map → chunk-YTELGNB3.cjs.map} +1 -1
- package/dist/tsup/{chunk-INFADXXI.cjs → chunk-YWWDUC6D.cjs} +12 -15
- package/dist/tsup/chunk-YWWDUC6D.cjs.map +1 -0
- package/dist/tsup/client/mod.cjs +5 -5
- package/dist/tsup/client/mod.d.cts +2 -2
- package/dist/tsup/client/mod.d.ts +2 -2
- package/dist/tsup/client/mod.js +4 -4
- 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-CM_AlRlT.d.cts → config-BDJltifk.d.cts} +36 -32
- package/dist/tsup/{config-DcUqgwcz.d.ts → config-DXC7qzme.d.ts} +36 -32
- package/dist/tsup/{context-Bws3ikEx.d.ts → context-DgPsVbw6.d.ts} +4 -1
- package/dist/tsup/{context-1BFHhiTs.d.cts → context-osC4Q1ax.d.cts} +4 -1
- package/dist/tsup/db/drizzle.cjs +2 -2
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +3 -3
- package/dist/tsup/db/mod.js +2 -2
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.d.cts +1 -1
- package/dist/tsup/dynamic/mod.d.ts +1 -1
- package/dist/tsup/dynamic/mod.js +1 -1
- 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.cjs +2 -2
- package/dist/tsup/inspector-tab/mod.d.cts +2 -2
- package/dist/tsup/inspector-tab/mod.d.ts +2 -2
- package/dist/tsup/inspector-tab/mod.js +1 -1
- package/dist/tsup/mod.cjs +129 -134
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +5 -3
- package/dist/tsup/mod.d.ts +5 -3
- package/dist/tsup/mod.js +26 -31
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +6 -6
- package/dist/tsup/test/mod.d.cts +1 -1
- package/dist/tsup/test/mod.d.ts +1 -1
- package/dist/tsup/test/mod.js +4 -4
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +13 -10
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +3 -3
- package/dist/tsup/workflow/mod.d.ts +3 -3
- package/dist/tsup/workflow/mod.js +8 -5
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +9 -9
- package/src/actor/config.ts +35 -37
- package/src/actor/contexts/index.ts +2 -0
- package/src/actor/definition.ts +33 -1
- package/src/actor/schema.ts +4 -0
- package/src/client/actor-common.ts +4 -0
- package/src/client/actor-conn.ts +2 -0
- package/src/client/actor-handle.ts +2 -0
- package/src/client/config.ts +1 -1
- package/src/client/queue.ts +2 -0
- package/src/registry/napi-runtime.ts +0 -4
- package/src/registry/native.ts +4 -11
- package/src/registry/runtime.ts +0 -8
- package/src/registry/wasm-runtime.ts +0 -14
- package/src/workflow/context.ts +3 -0
- package/dist/tsup/chunk-A7Q5DJ2P.js.map +0 -1
- package/dist/tsup/chunk-INFADXXI.cjs.map +0 -1
- package/dist/tsup/chunk-NSDT2GWM.cjs.map +0 -1
- package/dist/tsup/chunk-XILB6EBK.js.map +0 -1
- package/src/common/bare/generated/actor-runtime-socket-protocol/v1.ts +0 -848
- /package/dist/tsup/{chunk-NNKSJSMR.js.map → chunk-AY25XAXA.js.map} +0 -0
- /package/dist/tsup/{chunk-MVJLQPWC.js.map → chunk-NMLZDHH2.js.map} +0 -0
- /package/dist/tsup/{chunk-EC72YM63.js.map → chunk-QTCX5KN3.js.map} +0 -0
- /package/dist/tsup/{chunk-VJROJMLX.js.map → chunk-RFJ4NNO3.js.map} +0 -0
- /package/dist/tsup/{chunk-YPAJANQG.js.map → chunk-S6ZMUE7Q.js.map} +0 -0
- /package/dist/tsup/{chunk-WNURZU2P.js.map → chunk-YO4TJ56P.js.map} +0 -0
|
@@ -420,6 +420,7 @@ interface EventTypeToken<T, TContext = any> {
|
|
|
420
420
|
interface QueueTypeToken<TMessage, TComplete = never, TContext = any> {
|
|
421
421
|
readonly _queueMessage?: TMessage;
|
|
422
422
|
readonly _queueComplete?: TComplete;
|
|
423
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
423
424
|
readonly canPublish?: SchemaHook<TContext>;
|
|
424
425
|
readonly message?: PrimitiveSchema;
|
|
425
426
|
readonly complete?: PrimitiveSchema;
|
|
@@ -431,11 +432,13 @@ interface EventOptions<TContext = any> {
|
|
|
431
432
|
schema?: PrimitiveSchema;
|
|
432
433
|
}
|
|
433
434
|
interface QueueOptions<TContext = any> {
|
|
435
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
434
436
|
canPublish?: SchemaHook<TContext>;
|
|
435
437
|
message?: PrimitiveSchema;
|
|
436
438
|
complete?: PrimitiveSchema;
|
|
437
439
|
}
|
|
438
440
|
declare function event<T, TContext = any>(options?: EventOptions<TContext>): EventTypeToken<T, TContext>;
|
|
441
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
439
442
|
declare function queue<TMessage, TComplete = never, TContext = any>(options?: QueueOptions<TContext>): QueueTypeToken<TMessage, TComplete, TContext>;
|
|
440
443
|
type PrimitiveSchema = StandardSchemaV1 | EventTypeToken<unknown, any>;
|
|
441
444
|
interface EventSchemaDefinition<TContext = any> {
|
|
@@ -445,6 +448,7 @@ interface EventSchemaDefinition<TContext = any> {
|
|
|
445
448
|
interface QueueSchemaDefinition<TContext = any> {
|
|
446
449
|
message: PrimitiveSchema;
|
|
447
450
|
complete?: PrimitiveSchema;
|
|
451
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
448
452
|
canPublish?: SchemaHook<TContext>;
|
|
449
453
|
}
|
|
450
454
|
type EventSchema<TContext = any> = PrimitiveSchema | EventSchemaDefinition<TContext>;
|
|
@@ -786,9 +790,6 @@ type RuntimeSqlBindParam = ({
|
|
|
786
790
|
blobValue: RuntimeBytes;
|
|
787
791
|
};
|
|
788
792
|
type RuntimeSqlBindParams = RuntimeSqlBindParam[] | null;
|
|
789
|
-
interface RuntimeActorRuntimeSocketEndpointInfo {
|
|
790
|
-
path: string;
|
|
791
|
-
}
|
|
792
793
|
interface RuntimeSqlQueryResult {
|
|
793
794
|
columns: string[];
|
|
794
795
|
rows: unknown[][];
|
|
@@ -818,7 +819,6 @@ interface RuntimeActorConfig {
|
|
|
818
819
|
remoteSqlite?: boolean;
|
|
819
820
|
sqliteProfiling?: SqliteProfilingOptions;
|
|
820
821
|
tracing?: RuntimeActorTracingConfig;
|
|
821
|
-
enableActorRuntimeSocket?: boolean;
|
|
822
822
|
hasState?: boolean;
|
|
823
823
|
canHibernateWebsocket?: boolean;
|
|
824
824
|
stateSaveIntervalMs?: number;
|
|
@@ -1060,7 +1060,6 @@ interface CoreRuntime {
|
|
|
1060
1060
|
actorSqlMetrics(ctx: ActorContextHandle): SqliteNativeMetrics | null;
|
|
1061
1061
|
actorSqlTakeLastKvError(ctx: ActorContextHandle): string | null;
|
|
1062
1062
|
actorSqlClose(ctx: ActorContextHandle): Promise<void>;
|
|
1063
|
-
actorRuntimeSocketProvision(ctx: ActorContextHandle): Promise<RuntimeActorRuntimeSocketEndpointInfo>;
|
|
1064
1063
|
actorQueueSend(ctx: ActorContextHandle, name: string, body: RuntimeBytes): Promise<RuntimeQueueMessage>;
|
|
1065
1064
|
actorQueueNextBatch(ctx: ActorContextHandle, options?: RuntimeQueueNextBatchOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage[]>;
|
|
1066
1065
|
actorQueueWaitForNames(ctx: ActorContextHandle, names: string[], options?: RuntimeQueueWaitOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage>;
|
|
@@ -1285,9 +1284,13 @@ type ActorWebSocketOptions = ActorGatewayOptions;
|
|
|
1285
1284
|
*/
|
|
1286
1285
|
type ActorDefinitionActions<AD extends AnyActorDefinition> = IsAny<AD> extends true ? Record<string, ActorActionFunction<any[], any>> : ActorActionMap<ActionsOf<AD>>;
|
|
1287
1286
|
type ActorQueueSend<TQueues extends QueueSchemaConfig> = {
|
|
1287
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1288
1288
|
<K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K], options: QueueSendWaitOptions): Promise<QueueSendResult<InferQueueCompleteMap<TQueues>[K]>>;
|
|
1289
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1289
1290
|
<K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K], options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1291
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1290
1292
|
(name: keyof TQueues extends never ? string : never, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
|
|
1293
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1291
1294
|
(name: keyof TQueues extends never ? string : never, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1292
1295
|
};
|
|
1293
1296
|
type ActorEventSubscribe<TEvents extends EventSchemaConfig> = {
|
|
@@ -1371,7 +1374,9 @@ declare class ActorConnRaw {
|
|
|
1371
1374
|
* @protected
|
|
1372
1375
|
*/
|
|
1373
1376
|
constructor(client: ClientRaw, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, currentActorInvocation?: CurrentActorInvocation);
|
|
1377
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1374
1378
|
send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
|
|
1379
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1375
1380
|
send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1376
1381
|
/**
|
|
1377
1382
|
* Call a raw action connection. See {@link ActorConn} for type-safe action calls.
|
|
@@ -1528,7 +1533,9 @@ declare class ActorHandleRaw {
|
|
|
1528
1533
|
* @protected
|
|
1529
1534
|
*/
|
|
1530
1535
|
constructor(client: any, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, signal?: AbortSignal, currentActorInvocation?: CurrentActorInvocation, startCallSpan?: StartCallSpan, retryBudget?: RetryBudget);
|
|
1536
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1531
1537
|
send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
|
|
1538
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1532
1539
|
send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1533
1540
|
/**
|
|
1534
1541
|
* Call a raw action. This method sends an HTTP request to invoke the named action.
|
|
@@ -1882,10 +1889,7 @@ type ActorKvListOptions<T extends ActorKvValueType = "text", K extends ActorKvKe
|
|
|
1882
1889
|
limit?: number;
|
|
1883
1890
|
};
|
|
1884
1891
|
type ActorClientFor<T> = T extends Registry<any> ? Client<T> : T;
|
|
1885
|
-
/**
|
|
1886
|
-
* @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`)
|
|
1887
|
-
* or actor state instead.
|
|
1888
|
-
*/
|
|
1892
|
+
/** @deprecated Actor KV was deprecated in 3.0 and will be removed in a future version. Store data in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/kv */
|
|
1889
1893
|
interface ActorKv {
|
|
1890
1894
|
get<T extends ActorKvValueType = "text">(key: Uint8Array | string, options?: ActorKvValueOptions<T>): Promise<ActorKvValueTypeMap[T] | null>;
|
|
1891
1895
|
put<T extends ActorKvValueType = "text">(key: Uint8Array | string, value: Uint8Array | string | ArrayBuffer, options?: ActorKvValueOptions<T>): Promise<void>;
|
|
@@ -2030,6 +2034,7 @@ interface QueueIterOptions<TName extends string = string, TCompletable extends b
|
|
|
2030
2034
|
signal?: AbortSignal;
|
|
2031
2035
|
completable?: TCompletable;
|
|
2032
2036
|
}
|
|
2037
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
2033
2038
|
interface ActorQueue<TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
2034
2039
|
send<TName extends QueueFilterName<TQueues>>(name: TName, body: QueueMessageForName<TQueues, TName>["body"]): Promise<any>;
|
|
2035
2040
|
next<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(opts?: QueueNextOptions<TName, TCompletable>): Promise<any>;
|
|
@@ -2051,7 +2056,7 @@ interface ActorQueue<TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
|
2051
2056
|
interface Conn<_TState = unknown, TConnParams = unknown, TConnState = unknown, _TVars = unknown, _TInput = unknown, _TDatabase extends AnyDatabaseProvider = AnyDatabaseProvider, _TEvents extends EventSchemaConfig = Record<never, never>, _TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
2052
2057
|
id: string;
|
|
2053
2058
|
params: TConnParams;
|
|
2054
|
-
/** @deprecated Connection state
|
|
2059
|
+
/** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
|
|
2055
2060
|
state: TConnState;
|
|
2056
2061
|
isHibernatable: boolean;
|
|
2057
2062
|
send(name: string, ...args: any[]): void;
|
|
@@ -2063,17 +2068,15 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
2063
2068
|
[ACTOR_CONTEXT_INTERNAL_SYMBOL]?: unknown;
|
|
2064
2069
|
/** Returns the raw unwrapped state without the write-through proxy. */
|
|
2065
2070
|
[RAW_STATE_SYMBOL](): TState;
|
|
2066
|
-
/** @deprecated Actor state
|
|
2071
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2067
2072
|
state: TState;
|
|
2068
2073
|
vars: TVars;
|
|
2069
|
-
/**
|
|
2070
|
-
* @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`)
|
|
2071
|
-
* or actor state instead.
|
|
2072
|
-
*/
|
|
2074
|
+
/** @deprecated Actor KV was deprecated in 3.0 and will be removed in a future version. Store data in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/kv */
|
|
2073
2075
|
readonly kv: ActorKv;
|
|
2074
2076
|
readonly db: InferDatabaseClient<TDatabase>;
|
|
2075
2077
|
readonly schedule: ActorSchedule;
|
|
2076
2078
|
readonly cron: ActorCron;
|
|
2079
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
2077
2080
|
readonly queue: ActorQueue<TQueues>;
|
|
2078
2081
|
/** @experimental */
|
|
2079
2082
|
readonly run: ActorRun;
|
|
@@ -2081,26 +2084,22 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
2081
2084
|
readonly name: string;
|
|
2082
2085
|
readonly key: string[];
|
|
2083
2086
|
readonly region: string;
|
|
2084
|
-
/** Provisions the experimental Actor Runtime Socket for this actor generation. */
|
|
2085
|
-
actorRuntimeSocket(): Promise<{
|
|
2086
|
-
path: string;
|
|
2087
|
-
}>;
|
|
2088
2087
|
readonly conns: Map<string, Conn<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>>;
|
|
2089
2088
|
readonly log: ActorLogger;
|
|
2090
2089
|
readonly abortSignal: AbortSignal;
|
|
2091
2090
|
readonly aborted: boolean;
|
|
2092
2091
|
readonly request?: Request;
|
|
2093
|
-
/** @deprecated
|
|
2092
|
+
/** @deprecated `preventSleep` was deprecated in 3.0 and will be removed in a future version. It is a no-op that always returns `false`. Use `c.keepAwake(promise)` or `c.waitUntil(promise)`. See https://rivet.dev/actors/docs/deprecated/prevent-sleep */
|
|
2094
2093
|
readonly preventSleep: boolean;
|
|
2095
2094
|
broadcast(name: string, ...args: any[]): void;
|
|
2096
|
-
/** @deprecated Actor state
|
|
2095
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2097
2096
|
saveState(opts?: {
|
|
2098
2097
|
immediate?: boolean;
|
|
2099
2098
|
maxWait?: number;
|
|
2100
2099
|
}): Promise<void>;
|
|
2101
2100
|
keepAwake<T>(promise: Promise<T>): Promise<T>;
|
|
2102
2101
|
waitUntil(promise: Promise<unknown>): void;
|
|
2103
|
-
/** @deprecated
|
|
2102
|
+
/** @deprecated `setPreventSleep` was deprecated in 3.0 and will be removed in a future version. It is a no-op. Use `c.keepAwake(promise)` or `c.waitUntil(promise)`. See https://rivet.dev/actors/docs/deprecated/prevent-sleep */
|
|
2104
2103
|
setPreventSleep(preventSleep: boolean): void;
|
|
2105
2104
|
sleep(): void;
|
|
2106
2105
|
destroy(): void;
|
|
@@ -2152,6 +2151,7 @@ type ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase ext
|
|
|
2152
2151
|
type BeforeActionResponseContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2153
2152
|
type BeforeConnectContext<TState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, unknown, unknown, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2154
2153
|
type ConnectContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2154
|
+
/** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
|
|
2155
2155
|
type CreateConnStateContext<TState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, unknown, unknown, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2156
2156
|
type CreateContext<TState, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, unknown, unknown, unknown, TInput, TDatabase, TEvents, TQueues>;
|
|
2157
2157
|
type CreateVarsContext<TState, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = CreateContext<TState, TInput, TDatabase, TEvents, TQueues>;
|
|
@@ -2160,6 +2160,7 @@ type DisconnectContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
2160
2160
|
type RequestContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2161
2161
|
type RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2162
2162
|
type SleepContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2163
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2163
2164
|
type StateChangeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2164
2165
|
type WakeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2165
2166
|
type MigrateContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = WakeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
@@ -2343,7 +2344,6 @@ declare function disposeRunInspector(run: ((...args: any[]) => any) | AnyRunConf
|
|
|
2343
2344
|
declare const GlobalActorOptionsSchema: z.ZodPrefault<z.ZodObject<{
|
|
2344
2345
|
name: z.ZodOptional<z.ZodString>;
|
|
2345
2346
|
icon: z.ZodOptional<z.ZodString>;
|
|
2346
|
-
enableActorRuntimeSocket: z.ZodDefault<z.ZodBoolean>;
|
|
2347
2347
|
canHibernateWebSocket: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
|
|
2348
2348
|
}, z.core.$strict>>;
|
|
2349
2349
|
type GlobalActorOptions = z.infer<typeof GlobalActorOptionsSchema>;
|
|
@@ -2374,7 +2374,6 @@ type InstanceActorOptionsInput = z.input<typeof InstanceActorOptionsSchema>;
|
|
|
2374
2374
|
declare const ActorOptionsSchema: z.ZodPrefault<z.ZodObject<{
|
|
2375
2375
|
name: z.ZodOptional<z.ZodString>;
|
|
2376
2376
|
icon: z.ZodOptional<z.ZodString>;
|
|
2377
|
-
enableActorRuntimeSocket: z.ZodDefault<z.ZodBoolean>;
|
|
2378
2377
|
canHibernateWebSocket: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
|
|
2379
2378
|
createVarsTimeout: z.ZodDefault<z.ZodNumber>;
|
|
2380
2379
|
createConnStateTimeout: z.ZodDefault<z.ZodNumber>;
|
|
@@ -2443,7 +2442,6 @@ declare const ActorConfigSchema: z.ZodObject<{
|
|
|
2443
2442
|
options: z.ZodPrefault<z.ZodObject<{
|
|
2444
2443
|
name: z.ZodOptional<z.ZodString>;
|
|
2445
2444
|
icon: z.ZodOptional<z.ZodString>;
|
|
2446
|
-
enableActorRuntimeSocket: z.ZodDefault<z.ZodBoolean>;
|
|
2447
2445
|
canHibernateWebSocket: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
|
|
2448
2446
|
createVarsTimeout: z.ZodDefault<z.ZodNumber>;
|
|
2449
2447
|
createConnStateTimeout: z.ZodDefault<z.ZodNumber>;
|
|
@@ -2487,17 +2485,17 @@ declare const ActorConfigSchema: z.ZodObject<{
|
|
|
2487
2485
|
}, z.core.$strict>>;
|
|
2488
2486
|
}, z.core.$strict>;
|
|
2489
2487
|
type CreateState<TState, _TConnParams, _TConnState, _TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
|
|
2490
|
-
/** @deprecated Actor state
|
|
2488
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2491
2489
|
state: TState;
|
|
2492
2490
|
} | {
|
|
2493
|
-
/** @deprecated Actor state
|
|
2491
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2494
2492
|
createState: (c: CreateContext<TState, TInput, TDatabase, TEvents, TQueues>, input: TInput) => TState | Promise<TState>;
|
|
2495
2493
|
} | Record<never, never>;
|
|
2496
2494
|
type CreateConnState<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
|
|
2497
|
-
/** @deprecated Connection state
|
|
2495
|
+
/** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
|
|
2498
2496
|
connState: TConnState;
|
|
2499
2497
|
} | {
|
|
2500
|
-
/** @deprecated Connection state
|
|
2498
|
+
/** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
|
|
2501
2499
|
createConnState: (c: CreateConnStateContext<TState, TVars, TInput, TDatabase, TEvents, TQueues>, params: TConnParams) => TConnState | Promise<TConnState>;
|
|
2502
2500
|
} | Record<never, never>;
|
|
2503
2501
|
/**
|
|
@@ -2588,6 +2586,12 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
|
|
|
2588
2586
|
*
|
|
2589
2587
|
* Can be either a function or a RunConfig object with optional name/icon metadata.
|
|
2590
2588
|
*
|
|
2589
|
+
* Passing a plain function was deprecated in 3.0 and will be removed in a
|
|
2590
|
+
* future version; it logs a warning at startup. Start background work from
|
|
2591
|
+
* `onWake` with `c.keepAwake` and track it in `c.vars` instead.
|
|
2592
|
+
* `run: workflow(...)` is not deprecated. See
|
|
2593
|
+
* https://rivet.dev/actors/docs/deprecated/run
|
|
2594
|
+
*
|
|
2591
2595
|
* @returns Void or a Promise.
|
|
2592
2596
|
*/
|
|
2593
2597
|
run?: ((c: RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>) => void | Promise<void>) | RunConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
@@ -2601,7 +2605,7 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
|
|
|
2601
2605
|
* another onStateChange call, preventing infinite recursion.
|
|
2602
2606
|
*
|
|
2603
2607
|
* @param newState The updated state
|
|
2604
|
-
* @deprecated Actor state
|
|
2608
|
+
* @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state
|
|
2605
2609
|
*/
|
|
2606
2610
|
onStateChange?: (c: StateChangeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, newState: TState) => void;
|
|
2607
2611
|
/**
|
|
@@ -2694,6 +2698,8 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
|
|
|
2694
2698
|
events?: TEvents;
|
|
2695
2699
|
/**
|
|
2696
2700
|
* Schema map for queue payloads sent by this actor.
|
|
2701
|
+
*
|
|
2702
|
+
* @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues
|
|
2697
2703
|
*/
|
|
2698
2704
|
queues?: TQueues;
|
|
2699
2705
|
}
|
|
@@ -2711,7 +2717,6 @@ declare function test<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
2711
2717
|
declare const DocActorOptionsSchema: z.ZodObject<{
|
|
2712
2718
|
name: z.ZodOptional<z.ZodString>;
|
|
2713
2719
|
icon: z.ZodOptional<z.ZodString>;
|
|
2714
|
-
enableActorRuntimeSocket: z.ZodOptional<z.ZodBoolean>;
|
|
2715
2720
|
createVarsTimeout: z.ZodOptional<z.ZodNumber>;
|
|
2716
2721
|
createConnStateTimeout: z.ZodOptional<z.ZodNumber>;
|
|
2717
2722
|
onMigrateTimeout: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2761,7 +2766,6 @@ declare const DocActorConfigSchema: z.ZodObject<{
|
|
|
2761
2766
|
options: z.ZodOptional<z.ZodObject<{
|
|
2762
2767
|
name: z.ZodOptional<z.ZodString>;
|
|
2763
2768
|
icon: z.ZodOptional<z.ZodString>;
|
|
2764
|
-
enableActorRuntimeSocket: z.ZodOptional<z.ZodBoolean>;
|
|
2765
2769
|
createVarsTimeout: z.ZodOptional<z.ZodNumber>;
|
|
2766
2770
|
createConnStateTimeout: z.ZodOptional<z.ZodNumber>;
|
|
2767
2771
|
onMigrateTimeout: z.ZodOptional<z.ZodNumber>;
|
|
@@ -420,6 +420,7 @@ interface EventTypeToken<T, TContext = any> {
|
|
|
420
420
|
interface QueueTypeToken<TMessage, TComplete = never, TContext = any> {
|
|
421
421
|
readonly _queueMessage?: TMessage;
|
|
422
422
|
readonly _queueComplete?: TComplete;
|
|
423
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
423
424
|
readonly canPublish?: SchemaHook<TContext>;
|
|
424
425
|
readonly message?: PrimitiveSchema;
|
|
425
426
|
readonly complete?: PrimitiveSchema;
|
|
@@ -431,11 +432,13 @@ interface EventOptions<TContext = any> {
|
|
|
431
432
|
schema?: PrimitiveSchema;
|
|
432
433
|
}
|
|
433
434
|
interface QueueOptions<TContext = any> {
|
|
435
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
434
436
|
canPublish?: SchemaHook<TContext>;
|
|
435
437
|
message?: PrimitiveSchema;
|
|
436
438
|
complete?: PrimitiveSchema;
|
|
437
439
|
}
|
|
438
440
|
declare function event<T, TContext = any>(options?: EventOptions<TContext>): EventTypeToken<T, TContext>;
|
|
441
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
439
442
|
declare function queue<TMessage, TComplete = never, TContext = any>(options?: QueueOptions<TContext>): QueueTypeToken<TMessage, TComplete, TContext>;
|
|
440
443
|
type PrimitiveSchema = StandardSchemaV1 | EventTypeToken<unknown, any>;
|
|
441
444
|
interface EventSchemaDefinition<TContext = any> {
|
|
@@ -445,6 +448,7 @@ interface EventSchemaDefinition<TContext = any> {
|
|
|
445
448
|
interface QueueSchemaDefinition<TContext = any> {
|
|
446
449
|
message: PrimitiveSchema;
|
|
447
450
|
complete?: PrimitiveSchema;
|
|
451
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
448
452
|
canPublish?: SchemaHook<TContext>;
|
|
449
453
|
}
|
|
450
454
|
type EventSchema<TContext = any> = PrimitiveSchema | EventSchemaDefinition<TContext>;
|
|
@@ -786,9 +790,6 @@ type RuntimeSqlBindParam = ({
|
|
|
786
790
|
blobValue: RuntimeBytes;
|
|
787
791
|
};
|
|
788
792
|
type RuntimeSqlBindParams = RuntimeSqlBindParam[] | null;
|
|
789
|
-
interface RuntimeActorRuntimeSocketEndpointInfo {
|
|
790
|
-
path: string;
|
|
791
|
-
}
|
|
792
793
|
interface RuntimeSqlQueryResult {
|
|
793
794
|
columns: string[];
|
|
794
795
|
rows: unknown[][];
|
|
@@ -818,7 +819,6 @@ interface RuntimeActorConfig {
|
|
|
818
819
|
remoteSqlite?: boolean;
|
|
819
820
|
sqliteProfiling?: SqliteProfilingOptions;
|
|
820
821
|
tracing?: RuntimeActorTracingConfig;
|
|
821
|
-
enableActorRuntimeSocket?: boolean;
|
|
822
822
|
hasState?: boolean;
|
|
823
823
|
canHibernateWebsocket?: boolean;
|
|
824
824
|
stateSaveIntervalMs?: number;
|
|
@@ -1060,7 +1060,6 @@ interface CoreRuntime {
|
|
|
1060
1060
|
actorSqlMetrics(ctx: ActorContextHandle): SqliteNativeMetrics | null;
|
|
1061
1061
|
actorSqlTakeLastKvError(ctx: ActorContextHandle): string | null;
|
|
1062
1062
|
actorSqlClose(ctx: ActorContextHandle): Promise<void>;
|
|
1063
|
-
actorRuntimeSocketProvision(ctx: ActorContextHandle): Promise<RuntimeActorRuntimeSocketEndpointInfo>;
|
|
1064
1063
|
actorQueueSend(ctx: ActorContextHandle, name: string, body: RuntimeBytes): Promise<RuntimeQueueMessage>;
|
|
1065
1064
|
actorQueueNextBatch(ctx: ActorContextHandle, options?: RuntimeQueueNextBatchOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage[]>;
|
|
1066
1065
|
actorQueueWaitForNames(ctx: ActorContextHandle, names: string[], options?: RuntimeQueueWaitOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage>;
|
|
@@ -1285,9 +1284,13 @@ type ActorWebSocketOptions = ActorGatewayOptions;
|
|
|
1285
1284
|
*/
|
|
1286
1285
|
type ActorDefinitionActions<AD extends AnyActorDefinition> = IsAny<AD> extends true ? Record<string, ActorActionFunction<any[], any>> : ActorActionMap<ActionsOf<AD>>;
|
|
1287
1286
|
type ActorQueueSend<TQueues extends QueueSchemaConfig> = {
|
|
1287
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1288
1288
|
<K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K], options: QueueSendWaitOptions): Promise<QueueSendResult<InferQueueCompleteMap<TQueues>[K]>>;
|
|
1289
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1289
1290
|
<K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K], options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1291
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1290
1292
|
(name: keyof TQueues extends never ? string : never, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
|
|
1293
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1291
1294
|
(name: keyof TQueues extends never ? string : never, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1292
1295
|
};
|
|
1293
1296
|
type ActorEventSubscribe<TEvents extends EventSchemaConfig> = {
|
|
@@ -1371,7 +1374,9 @@ declare class ActorConnRaw {
|
|
|
1371
1374
|
* @protected
|
|
1372
1375
|
*/
|
|
1373
1376
|
constructor(client: ClientRaw, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, currentActorInvocation?: CurrentActorInvocation);
|
|
1377
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1374
1378
|
send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
|
|
1379
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1375
1380
|
send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1376
1381
|
/**
|
|
1377
1382
|
* Call a raw action connection. See {@link ActorConn} for type-safe action calls.
|
|
@@ -1528,7 +1533,9 @@ declare class ActorHandleRaw {
|
|
|
1528
1533
|
* @protected
|
|
1529
1534
|
*/
|
|
1530
1535
|
constructor(client: any, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, signal?: AbortSignal, currentActorInvocation?: CurrentActorInvocation, startCallSpan?: StartCallSpan, retryBudget?: RetryBudget);
|
|
1536
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1531
1537
|
send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
|
|
1538
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
1532
1539
|
send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1533
1540
|
/**
|
|
1534
1541
|
* Call a raw action. This method sends an HTTP request to invoke the named action.
|
|
@@ -1882,10 +1889,7 @@ type ActorKvListOptions<T extends ActorKvValueType = "text", K extends ActorKvKe
|
|
|
1882
1889
|
limit?: number;
|
|
1883
1890
|
};
|
|
1884
1891
|
type ActorClientFor<T> = T extends Registry<any> ? Client<T> : T;
|
|
1885
|
-
/**
|
|
1886
|
-
* @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`)
|
|
1887
|
-
* or actor state instead.
|
|
1888
|
-
*/
|
|
1892
|
+
/** @deprecated Actor KV was deprecated in 3.0 and will be removed in a future version. Store data in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/kv */
|
|
1889
1893
|
interface ActorKv {
|
|
1890
1894
|
get<T extends ActorKvValueType = "text">(key: Uint8Array | string, options?: ActorKvValueOptions<T>): Promise<ActorKvValueTypeMap[T] | null>;
|
|
1891
1895
|
put<T extends ActorKvValueType = "text">(key: Uint8Array | string, value: Uint8Array | string | ArrayBuffer, options?: ActorKvValueOptions<T>): Promise<void>;
|
|
@@ -2030,6 +2034,7 @@ interface QueueIterOptions<TName extends string = string, TCompletable extends b
|
|
|
2030
2034
|
signal?: AbortSignal;
|
|
2031
2035
|
completable?: TCompletable;
|
|
2032
2036
|
}
|
|
2037
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
2033
2038
|
interface ActorQueue<TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
2034
2039
|
send<TName extends QueueFilterName<TQueues>>(name: TName, body: QueueMessageForName<TQueues, TName>["body"]): Promise<any>;
|
|
2035
2040
|
next<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(opts?: QueueNextOptions<TName, TCompletable>): Promise<any>;
|
|
@@ -2051,7 +2056,7 @@ interface ActorQueue<TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
|
2051
2056
|
interface Conn<_TState = unknown, TConnParams = unknown, TConnState = unknown, _TVars = unknown, _TInput = unknown, _TDatabase extends AnyDatabaseProvider = AnyDatabaseProvider, _TEvents extends EventSchemaConfig = Record<never, never>, _TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
2052
2057
|
id: string;
|
|
2053
2058
|
params: TConnParams;
|
|
2054
|
-
/** @deprecated Connection state
|
|
2059
|
+
/** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
|
|
2055
2060
|
state: TConnState;
|
|
2056
2061
|
isHibernatable: boolean;
|
|
2057
2062
|
send(name: string, ...args: any[]): void;
|
|
@@ -2063,17 +2068,15 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
2063
2068
|
[ACTOR_CONTEXT_INTERNAL_SYMBOL]?: unknown;
|
|
2064
2069
|
/** Returns the raw unwrapped state without the write-through proxy. */
|
|
2065
2070
|
[RAW_STATE_SYMBOL](): TState;
|
|
2066
|
-
/** @deprecated Actor state
|
|
2071
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2067
2072
|
state: TState;
|
|
2068
2073
|
vars: TVars;
|
|
2069
|
-
/**
|
|
2070
|
-
* @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`)
|
|
2071
|
-
* or actor state instead.
|
|
2072
|
-
*/
|
|
2074
|
+
/** @deprecated Actor KV was deprecated in 3.0 and will be removed in a future version. Store data in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/kv */
|
|
2073
2075
|
readonly kv: ActorKv;
|
|
2074
2076
|
readonly db: InferDatabaseClient<TDatabase>;
|
|
2075
2077
|
readonly schedule: ActorSchedule;
|
|
2076
2078
|
readonly cron: ActorCron;
|
|
2079
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
2077
2080
|
readonly queue: ActorQueue<TQueues>;
|
|
2078
2081
|
/** @experimental */
|
|
2079
2082
|
readonly run: ActorRun;
|
|
@@ -2081,26 +2084,22 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
2081
2084
|
readonly name: string;
|
|
2082
2085
|
readonly key: string[];
|
|
2083
2086
|
readonly region: string;
|
|
2084
|
-
/** Provisions the experimental Actor Runtime Socket for this actor generation. */
|
|
2085
|
-
actorRuntimeSocket(): Promise<{
|
|
2086
|
-
path: string;
|
|
2087
|
-
}>;
|
|
2088
2087
|
readonly conns: Map<string, Conn<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>>;
|
|
2089
2088
|
readonly log: ActorLogger;
|
|
2090
2089
|
readonly abortSignal: AbortSignal;
|
|
2091
2090
|
readonly aborted: boolean;
|
|
2092
2091
|
readonly request?: Request;
|
|
2093
|
-
/** @deprecated
|
|
2092
|
+
/** @deprecated `preventSleep` was deprecated in 3.0 and will be removed in a future version. It is a no-op that always returns `false`. Use `c.keepAwake(promise)` or `c.waitUntil(promise)`. See https://rivet.dev/actors/docs/deprecated/prevent-sleep */
|
|
2094
2093
|
readonly preventSleep: boolean;
|
|
2095
2094
|
broadcast(name: string, ...args: any[]): void;
|
|
2096
|
-
/** @deprecated Actor state
|
|
2095
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2097
2096
|
saveState(opts?: {
|
|
2098
2097
|
immediate?: boolean;
|
|
2099
2098
|
maxWait?: number;
|
|
2100
2099
|
}): Promise<void>;
|
|
2101
2100
|
keepAwake<T>(promise: Promise<T>): Promise<T>;
|
|
2102
2101
|
waitUntil(promise: Promise<unknown>): void;
|
|
2103
|
-
/** @deprecated
|
|
2102
|
+
/** @deprecated `setPreventSleep` was deprecated in 3.0 and will be removed in a future version. It is a no-op. Use `c.keepAwake(promise)` or `c.waitUntil(promise)`. See https://rivet.dev/actors/docs/deprecated/prevent-sleep */
|
|
2104
2103
|
setPreventSleep(preventSleep: boolean): void;
|
|
2105
2104
|
sleep(): void;
|
|
2106
2105
|
destroy(): void;
|
|
@@ -2152,6 +2151,7 @@ type ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase ext
|
|
|
2152
2151
|
type BeforeActionResponseContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2153
2152
|
type BeforeConnectContext<TState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, unknown, unknown, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2154
2153
|
type ConnectContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2154
|
+
/** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
|
|
2155
2155
|
type CreateConnStateContext<TState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, unknown, unknown, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2156
2156
|
type CreateContext<TState, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, unknown, unknown, unknown, TInput, TDatabase, TEvents, TQueues>;
|
|
2157
2157
|
type CreateVarsContext<TState, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = CreateContext<TState, TInput, TDatabase, TEvents, TQueues>;
|
|
@@ -2160,6 +2160,7 @@ type DisconnectContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
2160
2160
|
type RequestContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2161
2161
|
type RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2162
2162
|
type SleepContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2163
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2163
2164
|
type StateChangeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2164
2165
|
type WakeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
2165
2166
|
type MigrateContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig = Record<never, never>, TQueues extends QueueSchemaConfig = Record<never, never>> = WakeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
@@ -2343,7 +2344,6 @@ declare function disposeRunInspector(run: ((...args: any[]) => any) | AnyRunConf
|
|
|
2343
2344
|
declare const GlobalActorOptionsSchema: z.ZodPrefault<z.ZodObject<{
|
|
2344
2345
|
name: z.ZodOptional<z.ZodString>;
|
|
2345
2346
|
icon: z.ZodOptional<z.ZodString>;
|
|
2346
|
-
enableActorRuntimeSocket: z.ZodDefault<z.ZodBoolean>;
|
|
2347
2347
|
canHibernateWebSocket: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
|
|
2348
2348
|
}, z.core.$strict>>;
|
|
2349
2349
|
type GlobalActorOptions = z.infer<typeof GlobalActorOptionsSchema>;
|
|
@@ -2374,7 +2374,6 @@ type InstanceActorOptionsInput = z.input<typeof InstanceActorOptionsSchema>;
|
|
|
2374
2374
|
declare const ActorOptionsSchema: z.ZodPrefault<z.ZodObject<{
|
|
2375
2375
|
name: z.ZodOptional<z.ZodString>;
|
|
2376
2376
|
icon: z.ZodOptional<z.ZodString>;
|
|
2377
|
-
enableActorRuntimeSocket: z.ZodDefault<z.ZodBoolean>;
|
|
2378
2377
|
canHibernateWebSocket: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
|
|
2379
2378
|
createVarsTimeout: z.ZodDefault<z.ZodNumber>;
|
|
2380
2379
|
createConnStateTimeout: z.ZodDefault<z.ZodNumber>;
|
|
@@ -2443,7 +2442,6 @@ declare const ActorConfigSchema: z.ZodObject<{
|
|
|
2443
2442
|
options: z.ZodPrefault<z.ZodObject<{
|
|
2444
2443
|
name: z.ZodOptional<z.ZodString>;
|
|
2445
2444
|
icon: z.ZodOptional<z.ZodString>;
|
|
2446
|
-
enableActorRuntimeSocket: z.ZodDefault<z.ZodBoolean>;
|
|
2447
2445
|
canHibernateWebSocket: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
|
|
2448
2446
|
createVarsTimeout: z.ZodDefault<z.ZodNumber>;
|
|
2449
2447
|
createConnStateTimeout: z.ZodDefault<z.ZodNumber>;
|
|
@@ -2487,17 +2485,17 @@ declare const ActorConfigSchema: z.ZodObject<{
|
|
|
2487
2485
|
}, z.core.$strict>>;
|
|
2488
2486
|
}, z.core.$strict>;
|
|
2489
2487
|
type CreateState<TState, _TConnParams, _TConnState, _TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
|
|
2490
|
-
/** @deprecated Actor state
|
|
2488
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2491
2489
|
state: TState;
|
|
2492
2490
|
} | {
|
|
2493
|
-
/** @deprecated Actor state
|
|
2491
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2494
2492
|
createState: (c: CreateContext<TState, TInput, TDatabase, TEvents, TQueues>, input: TInput) => TState | Promise<TState>;
|
|
2495
2493
|
} | Record<never, never>;
|
|
2496
2494
|
type CreateConnState<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
|
|
2497
|
-
/** @deprecated Connection state
|
|
2495
|
+
/** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
|
|
2498
2496
|
connState: TConnState;
|
|
2499
2497
|
} | {
|
|
2500
|
-
/** @deprecated Connection state
|
|
2498
|
+
/** @deprecated Connection state was deprecated in 3.0 and will be removed in a future version. Track live connections in `c.vars` from `onConnect` and `onDisconnect`, and store durable per-connection data in SQLite. See https://rivet.dev/actors/docs/deprecated/state#connection-state */
|
|
2501
2499
|
createConnState: (c: CreateConnStateContext<TState, TVars, TInput, TDatabase, TEvents, TQueues>, params: TConnParams) => TConnState | Promise<TConnState>;
|
|
2502
2500
|
} | Record<never, never>;
|
|
2503
2501
|
/**
|
|
@@ -2588,6 +2586,12 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
|
|
|
2588
2586
|
*
|
|
2589
2587
|
* Can be either a function or a RunConfig object with optional name/icon metadata.
|
|
2590
2588
|
*
|
|
2589
|
+
* Passing a plain function was deprecated in 3.0 and will be removed in a
|
|
2590
|
+
* future version; it logs a warning at startup. Start background work from
|
|
2591
|
+
* `onWake` with `c.keepAwake` and track it in `c.vars` instead.
|
|
2592
|
+
* `run: workflow(...)` is not deprecated. See
|
|
2593
|
+
* https://rivet.dev/actors/docs/deprecated/run
|
|
2594
|
+
*
|
|
2591
2595
|
* @returns Void or a Promise.
|
|
2592
2596
|
*/
|
|
2593
2597
|
run?: ((c: RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>) => void | Promise<void>) | RunConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
@@ -2601,7 +2605,7 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
|
|
|
2601
2605
|
* another onStateChange call, preventing infinite recursion.
|
|
2602
2606
|
*
|
|
2603
2607
|
* @param newState The updated state
|
|
2604
|
-
* @deprecated Actor state
|
|
2608
|
+
* @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state
|
|
2605
2609
|
*/
|
|
2606
2610
|
onStateChange?: (c: StateChangeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, newState: TState) => void;
|
|
2607
2611
|
/**
|
|
@@ -2694,6 +2698,8 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
|
|
|
2694
2698
|
events?: TEvents;
|
|
2695
2699
|
/**
|
|
2696
2700
|
* Schema map for queue payloads sent by this actor.
|
|
2701
|
+
*
|
|
2702
|
+
* @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues
|
|
2697
2703
|
*/
|
|
2698
2704
|
queues?: TQueues;
|
|
2699
2705
|
}
|
|
@@ -2711,7 +2717,6 @@ declare function test<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
2711
2717
|
declare const DocActorOptionsSchema: z.ZodObject<{
|
|
2712
2718
|
name: z.ZodOptional<z.ZodString>;
|
|
2713
2719
|
icon: z.ZodOptional<z.ZodString>;
|
|
2714
|
-
enableActorRuntimeSocket: z.ZodOptional<z.ZodBoolean>;
|
|
2715
2720
|
createVarsTimeout: z.ZodOptional<z.ZodNumber>;
|
|
2716
2721
|
createConnStateTimeout: z.ZodOptional<z.ZodNumber>;
|
|
2717
2722
|
onMigrateTimeout: z.ZodOptional<z.ZodNumber>;
|
|
@@ -2761,7 +2766,6 @@ declare const DocActorConfigSchema: z.ZodObject<{
|
|
|
2761
2766
|
options: z.ZodOptional<z.ZodObject<{
|
|
2762
2767
|
name: z.ZodOptional<z.ZodString>;
|
|
2763
2768
|
icon: z.ZodOptional<z.ZodString>;
|
|
2764
|
-
enableActorRuntimeSocket: z.ZodOptional<z.ZodBoolean>;
|
|
2765
2769
|
createVarsTimeout: z.ZodOptional<z.ZodNumber>;
|
|
2766
2770
|
createConnStateTimeout: z.ZodOptional<z.ZodNumber>;
|
|
2767
2771
|
onMigrateTimeout: z.ZodOptional<z.ZodNumber>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, H as ActorLogger, ax as QueueFilterName, aC as QueueNextOptions, aD as QueueResultMessageForName, aB as QueueNextBatchOptions, aI as Registry, a6 as Client, ap as InferEventArgs, aq as InferSchemaMap } from './config-
|
|
1
|
+
import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, H as ActorLogger, ax as QueueFilterName, aC as QueueNextOptions, aD as QueueResultMessageForName, aB as QueueNextBatchOptions, aI as Registry, a6 as Client, ap as InferEventArgs, aq as InferSchemaMap } from './config-DXC7qzme.js';
|
|
2
2
|
import { WorkflowContextInterface, StepConfig, TryStepResult, TryStepConfig, TryBlockResult, TryBlockConfig, LoopResult, LoopConfig, BranchConfig, BranchOutput, EntryKindType } from '@rivetkit/workflow-engine';
|
|
3
3
|
import { A as AnyDatabaseProvider, I as InferDatabaseClient } from './config-CBTr4IhE.js';
|
|
4
4
|
|
|
@@ -42,12 +42,14 @@ declare class WorkflowStepContext<TState, TConnParams, TConnState, TVars, TInput
|
|
|
42
42
|
get key(): string[];
|
|
43
43
|
get log(): ActorLogger;
|
|
44
44
|
get abortSignal(): AbortSignal;
|
|
45
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. Store durable data in SQLite (`c.db`) and in-memory data in `c.vars`. See https://rivet.dev/actors/docs/deprecated/state */
|
|
45
46
|
get state(): TState extends never ? never : TState;
|
|
46
47
|
get vars(): TVars extends never ? never : TVars;
|
|
47
48
|
get db(): TDatabase extends never ? never : InferDatabaseClient<TDatabase>;
|
|
48
49
|
client<R extends Registry<any> = Registry<any>>(): Client<R>;
|
|
49
50
|
broadcast<K extends keyof TEvents & string>(name: K, ...args: InferEventArgs<InferSchemaMap<TEvents>[K]>): void;
|
|
50
51
|
broadcast(name: keyof TEvents extends never ? string : never, ...args: Array<unknown>): void;
|
|
52
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
51
53
|
get queue(): {
|
|
52
54
|
send: {
|
|
53
55
|
<K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K]): Promise<void>;
|
|
@@ -83,6 +85,7 @@ declare class WorkflowContext<TState, TConnParams, TConnState, TVars, TInput, TD
|
|
|
83
85
|
get name(): string;
|
|
84
86
|
get key(): string[];
|
|
85
87
|
get log(): ActorLogger;
|
|
88
|
+
/** @deprecated Queues were deprecated in 3.0 and will be removed in a future version. Use actions and store pending work in SQLite (`c.db`). See https://rivet.dev/actors/docs/deprecated/queues */
|
|
86
89
|
get queue(): {
|
|
87
90
|
next: {
|
|
88
91
|
<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(name: string, opts?: WorkflowActorQueueNextOptions<TName, TCompletable>): Promise<QueueResultMessageForName<TQueues, TName, TCompletable>>;
|