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

Function joinOrg

e2e/cloud/spec-update-convergence.test.ts:137–147  ·  view source on GitHub ↗
(target: TargetShape, admin: Identity, member: Identity)

Source from the content-addressed store, hash-verified

135
136/** Invite `member` into `admin`'s org and accept — the real invite flow. */
137const joinOrg = (target: TargetShape, admin: Identity, member: Identity) =>
138 Effect.gen(function* () {
139 const inviteResponse = yield* postJson(target, "/api/account/members/invite", admin, {
140 email: member.credentials?.email,
141 });
142 const invitation = (yield* Effect.promise(() => inviteResponse.json())) as { id: string };
143 const acceptResponse = yield* postJson(target, "/api/auth/accept-invitation", member, {
144 invitationId: invitation.id,
145 });
146 return withRefreshedSession(member, acceptResponse);
147 });
148
149const apiKeyTemplate = [
150 {

Callers 1

Calls 3

postJsonFunction · 0.70
withRefreshedSessionFunction · 0.70
jsonMethod · 0.65

Tested by

no test coverage detected