A vibe coded tangled fork which supports pijul.
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
3package tangled
4
5// schema: sh.tangled.repo.changeList
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13const (
14 RepoChangeListNSID = "sh.tangled.repo.changeList"
15)
16
17// RepoChangeList_Author is a "author" in the sh.tangled.repo.changeList schema.
18type RepoChangeList_Author struct {
19 Email *string `json:"email,omitempty" cborgen:"email,omitempty"`
20 Name string `json:"name" cborgen:"name"`
21}
22
23// RepoChangeList_ChangeEntry is a "changeEntry" in the sh.tangled.repo.changeList schema.
24type RepoChangeList_ChangeEntry struct {
25 Authors []*RepoChangeList_Author `json:"authors" cborgen:"authors"`
26 // dependencies: Hashes of changes this change depends on
27 Dependencies []string `json:"dependencies,omitempty" cborgen:"dependencies,omitempty"`
28 // hash: Change hash (base32 encoded)
29 Hash string `json:"hash" cborgen:"hash"`
30 // message: Change description
31 Message string `json:"message" cborgen:"message"`
32 // timestamp: When the change was recorded
33 Timestamp *string `json:"timestamp,omitempty" cborgen:"timestamp,omitempty"`
34}
35
36// RepoChangeList_Output is the output of a sh.tangled.repo.changeList call.
37type RepoChangeList_Output struct {
38 Changes []*RepoChangeList_ChangeEntry `json:"changes" cborgen:"changes"`
39 Channel *string `json:"channel,omitempty" cborgen:"channel,omitempty"`
40 Page int64 `json:"page" cborgen:"page"`
41 Per_page int64 `json:"per_page" cborgen:"per_page"`
42 Total int64 `json:"total" cborgen:"total"`
43}
44
45// RepoChangeList calls the XRPC method "sh.tangled.repo.changeList".
46//
47// channel: Pijul channel name (defaults to main channel)
48// cursor: Pagination cursor (offset)
49// limit: Maximum number of changes to return
50// repo: Repository identifier in format 'did:plc:.../repoName'
51func RepoChangeList(ctx context.Context, c util.LexClient, channel string, cursor string, limit int64, repo string) (*RepoChangeList_Output, error) {
52 var out RepoChangeList_Output
53
54 params := map[string]interface{}{}
55 if channel != "" {
56 params["channel"] = channel
57 }
58 if cursor != "" {
59 params["cursor"] = cursor
60 }
61 if limit != 0 {
62 params["limit"] = limit
63 }
64 params["repo"] = repo
65 if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.changeList", params, nil, &out); err != nil {
66 return nil, err
67 }
68
69 return &out, nil
70}