MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / mintInviteCode

Function mintInviteCode

apps/host-selfhost/src/testing/mint-invite.ts:42–56  ·  view source on GitHub ↗
(
  handler: Handler,
  role: InviteRole = "member",
)

Source from the content-addressed store, hash-verified

40 );
41
42export const mintInviteCode = async (
43 handler: Handler,
44 role: InviteRole = "member",
45): Promise<string> => {
46 const token = await signInToken(
47 handler,
48 process.env.EXECUTOR_BOOTSTRAP_ADMIN_EMAIL!,
49 process.env.EXECUTOR_BOOTSTRAP_ADMIN_PASSWORD!,
50 );
51 return Effect.gen(function* () {
52 const client = yield* HttpApiClient.make(AdminHttpApi, { baseUrl: BASE });
53 const invite = yield* client.admin.createInvite({ payload: { role } });
54 return invite.code;
55 }).pipe(Effect.provide(clientLayer(handler, token)), Effect.runPromise);
56};

Callers 6

signUpFunction · 0.90
signUpFunction · 0.90
signUpFunction · 0.90

Calls 2

signInTokenFunction · 0.85
clientLayerFunction · 0.85

Tested by 3

signUpFunction · 0.72
signUpFunction · 0.72
signUpFunction · 0.72