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

Function createOrg

e2e/cloud/support/session.ts:144–153  ·  view source on GitHub ↗
(
  target: TargetShape,
  identity: Identity,
  name: string,
)

Source from the content-addressed store, hash-verified

142
143/** Create another org for this account; returns the identity bound to it. */
144export const createOrg = (
145 target: TargetShape,
146 identity: Identity,
147 name: string,
148): Effect.Effect<Identity> =>
149 Effect.gen(function* () {
150 const response = yield* postJson(target, "/api/auth/create-organization", identity, { name });
151 const created = (yield* Effect.promise(() => response.clone().json())) as { id: string };
152 return withRefreshedSession(identity, response, created.id);
153 });
154
155/** This identity, scoped to `organizationId` for the requests it makes. */
156export const inOrg = (identity: Identity, organizationId: string): Identity => ({

Callers

nothing calls this directly

Calls 4

postJsonFunction · 0.70
withRefreshedSessionFunction · 0.70
jsonMethod · 0.65
cloneMethod · 0.65

Tested by

no test coverage detected