Explorer

definy.get-project-branches

description
The RPC GetProjectBranches: the branches of every project (core.project-branches) with the creator, the number of snapshots, the latest event and the status of the branches other than main (status: in_progress, review or done. core.branch-status-of). The browser knows the branches without reading every event
type
Fn(request: @definy.json) -> @definy.service-io
expression
fn(request$0) =>
  @definy.read-snapshot-summary-list(
    then: fn(commits$1) =>
      @definy.read-branch-status-records(
        then: fn(records$2) =>
          let branches$3 = @core.project-branches(
              commits: @core.list-map(
                T: @definy.event-snapshot,
                U: @core.snapshot-summary,
                f: fn(item$4) =>
                  @definy.snapshot-summary-of(commit: $4),
                xs: $1
              )
            );
          @definy.store-read-events(
            event_hashes: @definy.branch-latest-event-hashes(branches: $3, index: 0),
            then: fn(events$5) =>
              @definy.json-response(
                status: 200,
                body: #object<@definy.json>([
                  {
                    key: "branches",
                    value: #array<@definy.json>(@definy.branch-items-json(branches: $3, events: $5, index: 0, records: $2, merges: @definy.branch-merges(commits: $1)))
                  }
                ])
              )
          )
      )
  )
visibility
public
definy.get-project-branches (project definy, branch release-time-compare, snapshot JJrRgQW_LZN6tN8CbYr1dN7HosqNTuIWWYx7ACbt1n0)
id: ecnM9d0Iaq7cxcfUBllRynm84xQlSaV1HsepqdQFWi0
content hash: JWcZh6MDElaQJl6m8RXZGzzgJ43VfkAREgtAG2Lnus0