rivetkit 3.0.5 → 3.0.6
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-MVJLQPWC.js → chunk-5FQNTE3U.js} +2 -2
- package/dist/tsup/{chunk-NSDT2GWM.cjs → chunk-6EH5WPVT.cjs} +144 -144
- package/dist/tsup/chunk-6EH5WPVT.cjs.map +1 -0
- package/dist/tsup/{chunk-STFQQWYY.cjs → chunk-6HXQONU5.cjs} +4 -4
- package/dist/tsup/{chunk-STFQQWYY.cjs.map → chunk-6HXQONU5.cjs.map} +1 -1
- package/dist/tsup/{chunk-YPAJANQG.js → chunk-AETY7X4G.js} +2 -2
- package/dist/tsup/{chunk-VJROJMLX.js → chunk-CJSADDKT.js} +4 -4
- package/dist/tsup/{chunk-NNKSJSMR.js → chunk-FERZDKVR.js} +3 -3
- package/dist/tsup/{chunk-DL7PKMEP.cjs → chunk-JU6RP3LW.cjs} +3 -3
- package/dist/tsup/{chunk-DL7PKMEP.cjs.map → chunk-JU6RP3LW.cjs.map} +1 -1
- package/dist/tsup/{chunk-NHB4KDZL.cjs → chunk-NPA2A53S.cjs} +3 -3
- package/dist/tsup/{chunk-NHB4KDZL.cjs.map → chunk-NPA2A53S.cjs.map} +1 -1
- package/dist/tsup/{chunk-D3VCNACM.cjs → chunk-NUCUZGIV.cjs} +7 -7
- package/dist/tsup/{chunk-D3VCNACM.cjs.map → chunk-NUCUZGIV.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-SAR7BMVU.js} +2 -2
- package/dist/tsup/{chunk-WNURZU2P.js → chunk-VNMBEXJH.js} +2 -2
- package/dist/tsup/{chunk-WIL6MWU4.cjs → chunk-WMAHPIFS.cjs} +10 -10
- package/dist/tsup/{chunk-WIL6MWU4.cjs.map → chunk-WMAHPIFS.cjs.map} +1 -1
- package/dist/tsup/{chunk-BY6YFH2K.cjs → chunk-YNVGOPSK.cjs} +2 -2
- package/dist/tsup/{chunk-BY6YFH2K.cjs.map → chunk-YNVGOPSK.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/{chunk-XILB6EBK.js → chunk-ZJ2UXLEE.js} +4 -4
- package/dist/tsup/chunk-ZJ2UXLEE.js.map +1 -0
- package/dist/tsup/{chunk-4QY3LBN6.cjs → chunk-ZPTATOYB.cjs} +3 -3
- package/dist/tsup/{chunk-4QY3LBN6.cjs.map → chunk-ZPTATOYB.cjs.map} +1 -1
- package/dist/tsup/{chunk-NEGCEZM6.js → chunk-ZWNTOFM3.js} +2 -2
- package/dist/tsup/{chunk-NEGCEZM6.js.map → chunk-ZWNTOFM3.js.map} +1 -1
- 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-MVJLQPWC.js.map → chunk-5FQNTE3U.js.map} +0 -0
- /package/dist/tsup/{chunk-YPAJANQG.js.map → chunk-AETY7X4G.js.map} +0 -0
- /package/dist/tsup/{chunk-VJROJMLX.js.map → chunk-CJSADDKT.js.map} +0 -0
- /package/dist/tsup/{chunk-NNKSJSMR.js.map → chunk-FERZDKVR.js.map} +0 -0
- /package/dist/tsup/{chunk-EC72YM63.js.map → chunk-SAR7BMVU.js.map} +0 -0
- /package/dist/tsup/{chunk-WNURZU2P.js.map → chunk-VNMBEXJH.js.map} +0 -0
package/dist/browser/client.d.ts
CHANGED
|
@@ -319,6 +319,7 @@ interface EventTypeToken<T, TContext = any> {
|
|
|
319
319
|
interface QueueTypeToken<TMessage, TComplete = never, TContext = any> {
|
|
320
320
|
readonly _queueMessage?: TMessage;
|
|
321
321
|
readonly _queueComplete?: TComplete;
|
|
322
|
+
/** @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 */
|
|
322
323
|
readonly canPublish?: SchemaHook<TContext>;
|
|
323
324
|
readonly message?: PrimitiveSchema;
|
|
324
325
|
readonly complete?: PrimitiveSchema;
|
|
@@ -331,6 +332,7 @@ interface EventSchemaDefinition<TContext = any> {
|
|
|
331
332
|
interface QueueSchemaDefinition<TContext = any> {
|
|
332
333
|
message: PrimitiveSchema;
|
|
333
334
|
complete?: PrimitiveSchema;
|
|
335
|
+
/** @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 */
|
|
334
336
|
canPublish?: SchemaHook<TContext>;
|
|
335
337
|
}
|
|
336
338
|
type EventSchema<TContext = any> = PrimitiveSchema | EventSchemaDefinition<TContext>;
|
|
@@ -714,9 +716,6 @@ type RuntimeSqlBindParam = ({
|
|
|
714
716
|
blobValue: RuntimeBytes;
|
|
715
717
|
};
|
|
716
718
|
type RuntimeSqlBindParams = RuntimeSqlBindParam[] | null;
|
|
717
|
-
interface RuntimeActorRuntimeSocketEndpointInfo {
|
|
718
|
-
path: string;
|
|
719
|
-
}
|
|
720
719
|
interface RuntimeSqlQueryResult {
|
|
721
720
|
columns: string[];
|
|
722
721
|
rows: unknown[][];
|
|
@@ -746,7 +745,6 @@ interface RuntimeActorConfig {
|
|
|
746
745
|
remoteSqlite?: boolean;
|
|
747
746
|
sqliteProfiling?: SqliteProfilingOptions;
|
|
748
747
|
tracing?: RuntimeActorTracingConfig;
|
|
749
|
-
enableActorRuntimeSocket?: boolean;
|
|
750
748
|
hasState?: boolean;
|
|
751
749
|
canHibernateWebsocket?: boolean;
|
|
752
750
|
stateSaveIntervalMs?: number;
|
|
@@ -988,7 +986,6 @@ interface CoreRuntime {
|
|
|
988
986
|
actorSqlMetrics(ctx: ActorContextHandle): SqliteNativeMetrics | null;
|
|
989
987
|
actorSqlTakeLastKvError(ctx: ActorContextHandle): string | null;
|
|
990
988
|
actorSqlClose(ctx: ActorContextHandle): Promise<void>;
|
|
991
|
-
actorRuntimeSocketProvision(ctx: ActorContextHandle): Promise<RuntimeActorRuntimeSocketEndpointInfo>;
|
|
992
989
|
actorQueueSend(ctx: ActorContextHandle, name: string, body: RuntimeBytes): Promise<RuntimeQueueMessage>;
|
|
993
990
|
actorQueueNextBatch(ctx: ActorContextHandle, options?: RuntimeQueueNextBatchOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage[]>;
|
|
994
991
|
actorQueueWaitForNames(ctx: ActorContextHandle, names: string[], options?: RuntimeQueueWaitOptions | undefined | null, signal?: CancellationTokenHandle | undefined | null): Promise<RuntimeQueueMessage>;
|
|
@@ -1069,9 +1066,13 @@ type ActorWebSocketOptions = ActorGatewayOptions;
|
|
|
1069
1066
|
*/
|
|
1070
1067
|
type ActorDefinitionActions<AD extends AnyActorDefinition> = IsAny<AD> extends true ? Record<string, ActorActionFunction<any[], any>> : ActorActionMap<ActionsOf<AD>>;
|
|
1071
1068
|
type ActorQueueSend<TQueues extends QueueSchemaConfig> = {
|
|
1069
|
+
/** @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 */
|
|
1072
1070
|
<K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K], options: QueueSendWaitOptions): Promise<QueueSendResult<InferQueueCompleteMap<TQueues>[K]>>;
|
|
1071
|
+
/** @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 */
|
|
1073
1072
|
<K extends keyof TQueues & string>(name: K, body: InferSchemaMap<TQueues>[K], options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1073
|
+
/** @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 */
|
|
1074
1074
|
(name: keyof TQueues extends never ? string : never, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
|
|
1075
|
+
/** @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 */
|
|
1075
1076
|
(name: keyof TQueues extends never ? string : never, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1076
1077
|
};
|
|
1077
1078
|
type ActorEventSubscribe<TEvents extends EventSchemaConfig> = {
|
|
@@ -1168,7 +1169,9 @@ declare class ActorConnRaw {
|
|
|
1168
1169
|
* @protected
|
|
1169
1170
|
*/
|
|
1170
1171
|
constructor(client: ClientRaw, driver: EngineControlClient, params: unknown, getParams: (() => Promise<unknown>) | undefined, encoding: Encoding, actorResolutionState: ActorResolutionState, gatewayOptions?: ActorGatewayOptions, currentActorInvocation?: CurrentActorInvocation);
|
|
1172
|
+
/** @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 */
|
|
1171
1173
|
send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
|
|
1174
|
+
/** @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 */
|
|
1172
1175
|
send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1173
1176
|
/**
|
|
1174
1177
|
* Call a raw action connection. See {@link ActorConn} for type-safe action calls.
|
|
@@ -1325,7 +1328,9 @@ declare class ActorHandleRaw {
|
|
|
1325
1328
|
* @protected
|
|
1326
1329
|
*/
|
|
1327
1330
|
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);
|
|
1331
|
+
/** @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 */
|
|
1328
1332
|
send(name: string, body: unknown, options: QueueSendWaitOptions): Promise<QueueSendResult>;
|
|
1333
|
+
/** @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 */
|
|
1329
1334
|
send(name: string, body: unknown, options?: QueueSendNoWaitOptions): Promise<void>;
|
|
1330
1335
|
/**
|
|
1331
1336
|
* Call a raw action. This method sends an HTTP request to invoke the named action.
|
|
@@ -1726,10 +1731,7 @@ type ActorKvListOptions<T extends ActorKvValueType = "text", K extends ActorKvKe
|
|
|
1726
1731
|
limit?: number;
|
|
1727
1732
|
};
|
|
1728
1733
|
type ActorClientFor<T> = T extends Registry<any> ? Client<T> : T;
|
|
1729
|
-
/**
|
|
1730
|
-
* @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`)
|
|
1731
|
-
* or actor state instead.
|
|
1732
|
-
*/
|
|
1734
|
+
/** @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 */
|
|
1733
1735
|
interface ActorKv {
|
|
1734
1736
|
get<T extends ActorKvValueType = "text">(key: Uint8Array | string, options?: ActorKvValueOptions<T>): Promise<ActorKvValueTypeMap[T] | null>;
|
|
1735
1737
|
put<T extends ActorKvValueType = "text">(key: Uint8Array | string, value: Uint8Array | string | ArrayBuffer, options?: ActorKvValueOptions<T>): Promise<void>;
|
|
@@ -1870,6 +1872,7 @@ interface QueueIterOptions<TName extends string = string, TCompletable extends b
|
|
|
1870
1872
|
signal?: AbortSignal;
|
|
1871
1873
|
completable?: TCompletable;
|
|
1872
1874
|
}
|
|
1875
|
+
/** @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 */
|
|
1873
1876
|
interface ActorQueue<TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
1874
1877
|
send<TName extends QueueFilterName<TQueues>>(name: TName, body: QueueMessageForName<TQueues, TName>["body"]): Promise<any>;
|
|
1875
1878
|
next<const TName extends QueueFilterName<TQueues>, const TCompletable extends boolean = false>(opts?: QueueNextOptions<TName, TCompletable>): Promise<any>;
|
|
@@ -1891,7 +1894,7 @@ interface ActorQueue<TQueues extends QueueSchemaConfig = Record<never, never>> {
|
|
|
1891
1894
|
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>> {
|
|
1892
1895
|
id: string;
|
|
1893
1896
|
params: TConnParams;
|
|
1894
|
-
/** @deprecated Connection state
|
|
1897
|
+
/** @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 */
|
|
1895
1898
|
state: TConnState;
|
|
1896
1899
|
isHibernatable: boolean;
|
|
1897
1900
|
send(name: string, ...args: any[]): void;
|
|
@@ -1902,17 +1905,15 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
1902
1905
|
[ACTOR_CONTEXT_INTERNAL_SYMBOL]?: unknown;
|
|
1903
1906
|
/** Returns the raw unwrapped state without the write-through proxy. */
|
|
1904
1907
|
[RAW_STATE_SYMBOL](): TState;
|
|
1905
|
-
/** @deprecated Actor state
|
|
1908
|
+
/** @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 */
|
|
1906
1909
|
state: TState;
|
|
1907
1910
|
vars: TVars;
|
|
1908
|
-
/**
|
|
1909
|
-
* @deprecated Actor KV is deprecated. Use embedded SQLite (`c.db`)
|
|
1910
|
-
* or actor state instead.
|
|
1911
|
-
*/
|
|
1911
|
+
/** @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 */
|
|
1912
1912
|
readonly kv: ActorKv;
|
|
1913
1913
|
readonly db: InferDatabaseClient<TDatabase>;
|
|
1914
1914
|
readonly schedule: ActorSchedule;
|
|
1915
1915
|
readonly cron: ActorCron;
|
|
1916
|
+
/** @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 */
|
|
1916
1917
|
readonly queue: ActorQueue<TQueues>;
|
|
1917
1918
|
/** @experimental */
|
|
1918
1919
|
readonly run: ActorRun;
|
|
@@ -1920,26 +1921,22 @@ interface ActorContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
1920
1921
|
readonly name: string;
|
|
1921
1922
|
readonly key: string[];
|
|
1922
1923
|
readonly region: string;
|
|
1923
|
-
/** Provisions the experimental Actor Runtime Socket for this actor generation. */
|
|
1924
|
-
actorRuntimeSocket(): Promise<{
|
|
1925
|
-
path: string;
|
|
1926
|
-
}>;
|
|
1927
1924
|
readonly conns: Map<string, Conn<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>>;
|
|
1928
1925
|
readonly log: ActorLogger;
|
|
1929
1926
|
readonly abortSignal: AbortSignal;
|
|
1930
1927
|
readonly aborted: boolean;
|
|
1931
1928
|
readonly request?: Request;
|
|
1932
|
-
/** @deprecated
|
|
1929
|
+
/** @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 */
|
|
1933
1930
|
readonly preventSleep: boolean;
|
|
1934
1931
|
broadcast(name: string, ...args: any[]): void;
|
|
1935
|
-
/** @deprecated Actor state
|
|
1932
|
+
/** @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 */
|
|
1936
1933
|
saveState(opts?: {
|
|
1937
1934
|
immediate?: boolean;
|
|
1938
1935
|
maxWait?: number;
|
|
1939
1936
|
}): Promise<void>;
|
|
1940
1937
|
keepAwake<T>(promise: Promise<T>): Promise<T>;
|
|
1941
1938
|
waitUntil(promise: Promise<unknown>): void;
|
|
1942
|
-
/** @deprecated
|
|
1939
|
+
/** @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 */
|
|
1943
1940
|
setPreventSleep(preventSleep: boolean): void;
|
|
1944
1941
|
sleep(): void;
|
|
1945
1942
|
destroy(): void;
|
|
@@ -1991,6 +1988,7 @@ type ActionContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase ext
|
|
|
1991
1988
|
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>;
|
|
1992
1989
|
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>;
|
|
1993
1990
|
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>;
|
|
1991
|
+
/** @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 */
|
|
1994
1992
|
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>;
|
|
1995
1993
|
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>;
|
|
1996
1994
|
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>;
|
|
@@ -1999,6 +1997,7 @@ type DisconnectContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase
|
|
|
1999
1997
|
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>;
|
|
2000
1998
|
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>;
|
|
2001
1999
|
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>;
|
|
2000
|
+
/** @deprecated Actor state was deprecated in 3.0 and will be removed in a future version. See https://rivet.dev/actors/docs/deprecated/state */
|
|
2002
2001
|
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>;
|
|
2003
2002
|
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>;
|
|
2004
2003
|
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>;
|
|
@@ -2066,7 +2065,6 @@ declare const ActorConfigSchema: z.ZodObject<{
|
|
|
2066
2065
|
options: z.ZodPrefault<z.ZodObject<{
|
|
2067
2066
|
name: z.ZodOptional<z.ZodString>;
|
|
2068
2067
|
icon: z.ZodOptional<z.ZodString>;
|
|
2069
|
-
enableActorRuntimeSocket: z.ZodDefault<z.ZodBoolean>;
|
|
2070
2068
|
canHibernateWebSocket: z.ZodDefault<z.ZodUnion<readonly [z.ZodBoolean, z.ZodCustom<(request: Request) => boolean, (request: Request) => boolean>]>>;
|
|
2071
2069
|
createVarsTimeout: z.ZodDefault<z.ZodNumber>;
|
|
2072
2070
|
createConnStateTimeout: z.ZodDefault<z.ZodNumber>;
|
|
@@ -2110,17 +2108,17 @@ declare const ActorConfigSchema: z.ZodObject<{
|
|
|
2110
2108
|
}, z.core.$strict>>;
|
|
2111
2109
|
}, z.core.$strict>;
|
|
2112
2110
|
type CreateState<TState, _TConnParams, _TConnState, _TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
|
|
2113
|
-
/** @deprecated Actor state
|
|
2111
|
+
/** @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 */
|
|
2114
2112
|
state: TState;
|
|
2115
2113
|
} | {
|
|
2116
|
-
/** @deprecated Actor state
|
|
2114
|
+
/** @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 */
|
|
2117
2115
|
createState: (c: CreateContext<TState, TInput, TDatabase, TEvents, TQueues>, input: TInput) => TState | Promise<TState>;
|
|
2118
2116
|
} | Record<never, never>;
|
|
2119
2117
|
type CreateConnState<TState, TConnParams, TConnState, TVars, TInput, TDatabase extends AnyDatabaseProvider, TEvents extends EventSchemaConfig, TQueues extends QueueSchemaConfig> = {
|
|
2120
|
-
/** @deprecated Connection state
|
|
2118
|
+
/** @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 */
|
|
2121
2119
|
connState: TConnState;
|
|
2122
2120
|
} | {
|
|
2123
|
-
/** @deprecated Connection state
|
|
2121
|
+
/** @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 */
|
|
2124
2122
|
createConnState: (c: CreateConnStateContext<TState, TVars, TInput, TDatabase, TEvents, TQueues>, params: TConnParams) => TConnState | Promise<TConnState>;
|
|
2125
2123
|
} | Record<never, never>;
|
|
2126
2124
|
/**
|
|
@@ -2207,6 +2205,12 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
|
|
|
2207
2205
|
*
|
|
2208
2206
|
* Can be either a function or a RunConfig object with optional name/icon metadata.
|
|
2209
2207
|
*
|
|
2208
|
+
* Passing a plain function was deprecated in 3.0 and will be removed in a
|
|
2209
|
+
* future version; it logs a warning at startup. Start background work from
|
|
2210
|
+
* `onWake` with `c.keepAwake` and track it in `c.vars` instead.
|
|
2211
|
+
* `run: workflow(...)` is not deprecated. See
|
|
2212
|
+
* https://rivet.dev/actors/docs/deprecated/run
|
|
2213
|
+
*
|
|
2210
2214
|
* @returns Void or a Promise.
|
|
2211
2215
|
*/
|
|
2212
2216
|
run?: ((c: RunContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>) => void | Promise<void>) | RunConfig<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>;
|
|
@@ -2220,7 +2224,7 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
|
|
|
2220
2224
|
* another onStateChange call, preventing infinite recursion.
|
|
2221
2225
|
*
|
|
2222
2226
|
* @param newState The updated state
|
|
2223
|
-
* @deprecated Actor state
|
|
2227
|
+
* @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
|
|
2224
2228
|
*/
|
|
2225
2229
|
onStateChange?: (c: StateChangeContext<TState, TConnParams, TConnState, TVars, TInput, TDatabase, TEvents, TQueues>, newState: TState) => void;
|
|
2226
2230
|
/**
|
|
@@ -2313,6 +2317,8 @@ interface BaseActorConfig<TState, TConnParams, TConnState, TVars, TInput, TDatab
|
|
|
2313
2317
|
events?: TEvents;
|
|
2314
2318
|
/**
|
|
2315
2319
|
* Schema map for queue payloads sent by this actor.
|
|
2320
|
+
*
|
|
2321
|
+
* @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
|
|
2316
2322
|
*/
|
|
2317
2323
|
queues?: TQueues;
|
|
2318
2324
|
}
|
package/dist/browser/client.js
CHANGED
|
@@ -230,7 +230,7 @@ function noopNext() {
|
|
|
230
230
|
// package.json
|
|
231
231
|
var package_default = {
|
|
232
232
|
name: "rivetkit",
|
|
233
|
-
version: "3.0.
|
|
233
|
+
version: "3.0.6",
|
|
234
234
|
description: "Lightweight libraries for building stateful actors on edge platforms",
|
|
235
235
|
license: "Apache-2.0",
|
|
236
236
|
keywords: [
|
|
@@ -1459,7 +1459,7 @@ var ClientConfigSchemaBase = z3.object({
|
|
|
1459
1459
|
if (!resolved && !hasWarnedMissingEndpoint) {
|
|
1460
1460
|
hasWarnedMissingEndpoint = true;
|
|
1461
1461
|
console.warn(
|
|
1462
|
-
`[rivetkit] No endpoint provided to client. Defaulting to ${DEFAULT_ENDPOINT}. Starting in
|
|
1462
|
+
`[rivetkit] No endpoint provided to client. Defaulting to ${DEFAULT_ENDPOINT}. Starting in 3.2.0, an explicit endpoint will be required. Pass an endpoint to createClient() or createRivetKit(), or set the RIVET_ENDPOINT environment variable.`
|
|
1463
1463
|
);
|
|
1464
1464
|
}
|
|
1465
1465
|
return resolved ?? DEFAULT_ENDPOINT;
|