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

Function listSubjectConnections

packages/core/sdk/src/executor.ts:7143–7157  ·  view source on GitHub ↗
(
        externalId: string,
      )

Source from the content-addressed store, hash-verified

7141 .pipe(Effect.map((row) => (row === null ? null : rowToAdminSubject(row))));
7142
7143 const listSubjectConnections = (
7144 externalId: string,
7145 ): Effect.Effect<readonly AdminConnection[], StorageFailure> =>
7146 platformCore
7147 .findMany("connection", {
7148 // `owner: "user"` explicitly: an org connection's `subject` is the
7149 // empty-string sentinel, and attributing those to a user would be
7150 // a lie in every host that has one.
7151 where: (b: AnyCb) => b.and(b("owner", "=", "user"), b("subject", "=", externalId)),
7152 orderBy: [
7153 ["integration", "asc"],
7154 ["name", "asc"],
7155 ],
7156 })
7157 .pipe(Effect.map((rows) => rows.map(rowToAdminConnection)));
7158
7159 // ONE connection query for the whole page, not one per subject. The
7160 // per-subject form was an N+1: a default page issued 100 sequential

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected