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

Function createOrg

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

Source from the content-addressed store, hash-verified

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