Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export async function queryActor(
key: query.getOrCreateForKey.key,
input: query.getOrCreateForKey.input,
region: query.getOrCreateForKey.region,
runner: query.getOrCreateForKey.runner,
});
actorOutput = {
actorId: getOrCreateOutput.actorId,
Expand All @@ -54,6 +55,7 @@ export async function queryActor(
key: query.create.key,
input: query.create.input,
region: query.create.region,
runner: query.create.runner,
});
actorOutput = {
actorId: createOutput.actorId,
Expand Down
5 changes: 5 additions & 0 deletions rivetkit-typescript/packages/rivetkit/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ export interface GetOrCreateOptions extends QueryOptions {
createInRegion?: string;
/** Input data to pass to the actor. */
createWithInput?: unknown;
/** Runner name to create the actor on. Overrides the client's default runner. */
createOnRunner?: string;
}

/**
Expand All @@ -124,6 +126,8 @@ export interface CreateOptions extends QueryOptions {
region?: string;
/** Input data to pass to the actor. */
input?: unknown;
/** Runner name to create the actor on. Overrides the client's default runner. */
runner?: string;
}

/**
Expand Down Expand Up @@ -270,6 +274,7 @@ export class ClientRaw {
key: keyArray,
input: opts?.createWithInput,
region: opts?.createInRegion,
runner: opts?.createOnRunner,
},
};

Expand Down
2 changes: 2 additions & 0 deletions rivetkit-typescript/packages/rivetkit/src/manager/driver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export interface GetOrCreateWithKeyInput<E extends Env = any> {
key: ActorKey;
input?: unknown;
region?: string;
runner?: string;
}

export interface CreateInput<E extends Env = any> {
Expand All @@ -84,6 +85,7 @@ export interface CreateInput<E extends Env = any> {
key: ActorKey;
input?: unknown;
region?: string;
runner?: string;
}

export interface ListActorsInput<E extends Env = any> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const CreateRequestSchema = z.object({
key: ActorKeySchema,
input: z.unknown().optional(),
region: z.string().optional(),
runner: z.string().optional(),
});

export const GetForKeyRequestSchema = z.object({
Expand All @@ -33,6 +34,7 @@ export const GetOrCreateRequestSchema = z.object({
key: ActorKeySchema,
input: z.unknown().optional(),
region: z.string().optional(),
runner: z.string().optional(),
});

export const ActorQuerySchema = z.union([
Expand Down
Loading