chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import type { TypedResponse } from "@remix-run/server-runtime";
|
||||
import { json } from "@remix-run/server-runtime";
|
||||
import type { WorkerApiConnectResponseBody } from "@trigger.dev/core/v3/workers";
|
||||
import { WorkerApiConnectRequestBody } from "@trigger.dev/core/v3/workers";
|
||||
import { createActionWorkerApiRoute } from "~/services/routeBuilders/apiBuilder.server";
|
||||
|
||||
export const action = createActionWorkerApiRoute(
|
||||
{
|
||||
body: WorkerApiConnectRequestBody,
|
||||
},
|
||||
async ({ authenticatedWorker, body }): Promise<TypedResponse<WorkerApiConnectResponseBody>> => {
|
||||
await authenticatedWorker.connect(body.metadata);
|
||||
return json({
|
||||
ok: true,
|
||||
workerGroup: {
|
||||
type: authenticatedWorker.type,
|
||||
name: authenticatedWorker.name,
|
||||
},
|
||||
});
|
||||
}
|
||||
);
|
||||
Reference in New Issue
Block a user