diff --git a/api/tangled/accountbeginSignup.go b/api/org_tangled/accountbeginSignup.go similarity index 98% rename from api/tangled/accountbeginSignup.go rename to api/org_tangled/accountbeginSignup.go index f503b7e8b..5e535e4af 100644 --- a/api/tangled/accountbeginSignup.go +++ b/api/org_tangled/accountbeginSignup.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.account.beginSignup diff --git a/api/tangled/accountcompleteSignup.go b/api/org_tangled/accountcompleteSignup.go similarity index 98% rename from api/tangled/accountcompleteSignup.go rename to api/org_tangled/accountcompleteSignup.go index 57a11eda7..fc4253529 100644 --- a/api/tangled/accountcompleteSignup.go +++ b/api/org_tangled/accountcompleteSignup.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.account.completeSignup diff --git a/api/tangled/accountdeleteEmail.go b/api/org_tangled/accountdeleteEmail.go similarity index 97% rename from api/tangled/accountdeleteEmail.go rename to api/org_tangled/accountdeleteEmail.go index 35af9452e..35095738b 100644 --- a/api/tangled/accountdeleteEmail.go +++ b/api/org_tangled/accountdeleteEmail.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.account.deleteEmail diff --git a/api/tangled/accountdismissNewsletter.go b/api/org_tangled/accountdismissNewsletter.go similarity index 96% rename from api/tangled/accountdismissNewsletter.go rename to api/org_tangled/accountdismissNewsletter.go index 03f7bc326..fb216a763 100644 --- a/api/tangled/accountdismissNewsletter.go +++ b/api/org_tangled/accountdismissNewsletter.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.account.dismissNewsletter diff --git a/api/tangled/accountlistEmails.go b/api/org_tangled/accountlistEmails.go similarity index 98% rename from api/tangled/accountlistEmails.go rename to api/org_tangled/accountlistEmails.go index 45accf481..b826555fd 100644 --- a/api/tangled/accountlistEmails.go +++ b/api/org_tangled/accountlistEmails.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.account.listEmails diff --git a/api/tangled/accountsetPrimaryEmail.go b/api/org_tangled/accountsetPrimaryEmail.go similarity index 97% rename from api/tangled/accountsetPrimaryEmail.go rename to api/org_tangled/accountsetPrimaryEmail.go index ebf4d5588..39cfd07d3 100644 --- a/api/tangled/accountsetPrimaryEmail.go +++ b/api/org_tangled/accountsetPrimaryEmail.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.account.setPrimaryEmail diff --git a/api/tangled/accountsubscribeNewsletter.go b/api/org_tangled/accountsubscribeNewsletter.go similarity index 96% rename from api/tangled/accountsubscribeNewsletter.go rename to api/org_tangled/accountsubscribeNewsletter.go index 0732deee1..1176d72f0 100644 --- a/api/tangled/accountsubscribeNewsletter.go +++ b/api/org_tangled/accountsubscribeNewsletter.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.account.subscribeNewsletter diff --git a/api/org_tangled/cbor_gen.go b/api/org_tangled/cbor_gen.go new file mode 100644 index 000000000..6ada35ddd --- /dev/null +++ b/api/org_tangled/cbor_gen.go @@ -0,0 +1,446 @@ +// Code generated by github.com/whyrusleeping/cbor-gen. DO NOT EDIT. + +package org_tangled + +import ( + "fmt" + "io" + "math" + "sort" + + cid "github.com/ipfs/go-cid" + cbg "github.com/whyrusleeping/cbor-gen" + xerrors "golang.org/x/xerrors" +) + +var _ = xerrors.Errorf +var _ = cid.Undef +var _ = math.E +var _ = sort.Sort + +func (t *FeedSubscription) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write([]byte{163}); err != nil { + return err + } + + // t.LexiconTypeID (string) (string) + if len("$type") > 1000000 { + return xerrors.Errorf("Value in field \"$type\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { + return err + } + if _, err := cw.WriteString(string("$type")); err != nil { + return err + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.feed.subscription"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.feed.subscription")); err != nil { + return err + } + + // t.Subject (org_tangled.FeedSubscription_Subject) (struct) + if len("subject") > 1000000 { + return xerrors.Errorf("Value in field \"subject\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil { + return err + } + if _, err := cw.WriteString(string("subject")); err != nil { + return err + } + + if err := t.Subject.MarshalCBOR(cw); err != nil { + return err + } + + // t.CreatedAt (string) (string) + if len("createdAt") > 1000000 { + return xerrors.Errorf("Value in field \"createdAt\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { + return err + } + if _, err := cw.WriteString(string("createdAt")); err != nil { + return err + } + + if len(t.CreatedAt) > 1000000 { + return xerrors.Errorf("Value in field t.CreatedAt was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { + return err + } + return nil +} + +func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedSubscription{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajMap { + return fmt.Errorf("cbor input should be of type map") + } + + if extra > cbg.MaxLength { + return fmt.Errorf("FeedSubscription: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 9) + for i := uint64(0); i < n; i++ { + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) + if err != nil { + return err + } + + if !ok { + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { + return err + } + continue + } + + switch string(nameBuf[:nameLen]) { + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.Subject (org_tangled.FeedSubscription_Subject) (struct) + case "subject": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Subject = new(FeedSubscription_Subject) + if err := t.Subject.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Subject pointer: %w", err) + } + } + + } + // t.CreatedAt (string) (string) + case "createdAt": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.CreatedAt = string(sval) + } + + default: + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { + return err + } + } + } + + return nil +} +func (t *FeedSubscription_Record) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write([]byte{162}); err != nil { + return err + } + + // t.Uri (string) (string) + if len("uri") > 1000000 { + return xerrors.Errorf("Value in field \"uri\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("uri"))); err != nil { + return err + } + if _, err := cw.WriteString(string("uri")); err != nil { + return err + } + + if len(t.Uri) > 1000000 { + return xerrors.Errorf("Value in field t.Uri was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Uri))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Uri)); err != nil { + return err + } + + // t.LexiconTypeID (string) (string) + if len("$type") > 1000000 { + return xerrors.Errorf("Value in field \"$type\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { + return err + } + if _, err := cw.WriteString(string("$type")); err != nil { + return err + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.feed.subscription#record"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.feed.subscription#record")); err != nil { + return err + } + return nil +} + +func (t *FeedSubscription_Record) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedSubscription_Record{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajMap { + return fmt.Errorf("cbor input should be of type map") + } + + if extra > cbg.MaxLength { + return fmt.Errorf("FeedSubscription_Record: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 5) + for i := uint64(0); i < n; i++ { + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) + if err != nil { + return err + } + + if !ok { + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { + return err + } + continue + } + + switch string(nameBuf[:nameLen]) { + // t.Uri (string) (string) + case "uri": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Uri = string(sval) + } + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + + default: + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { + return err + } + } + } + + return nil +} +func (t *FeedSubscription_Repo) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write([]byte{162}); err != nil { + return err + } + + // t.Did (string) (string) + if len("did") > 1000000 { + return xerrors.Errorf("Value in field \"did\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("did"))); err != nil { + return err + } + if _, err := cw.WriteString(string("did")); err != nil { + return err + } + + if len(t.Did) > 1000000 { + return xerrors.Errorf("Value in field t.Did was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Did))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Did)); err != nil { + return err + } + + // t.LexiconTypeID (string) (string) + if len("$type") > 1000000 { + return xerrors.Errorf("Value in field \"$type\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { + return err + } + if _, err := cw.WriteString(string("$type")); err != nil { + return err + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.feed.subscription#repo"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.feed.subscription#repo")); err != nil { + return err + } + return nil +} + +func (t *FeedSubscription_Repo) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedSubscription_Repo{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajMap { + return fmt.Errorf("cbor input should be of type map") + } + + if extra > cbg.MaxLength { + return fmt.Errorf("FeedSubscription_Repo: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 5) + for i := uint64(0); i < n; i++ { + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) + if err != nil { + return err + } + + if !ok { + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { + return err + } + continue + } + + switch string(nameBuf[:nameLen]) { + // t.Did (string) (string) + case "did": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Did = string(sval) + } + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + + default: + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { + return err + } + } + } + + return nil +} diff --git a/api/tangled/feedsubscription.go b/api/org_tangled/feedsubscription.go similarity index 62% rename from api/tangled/feedsubscription.go rename to api/org_tangled/feedsubscription.go index 776e3d63b..8ccd828cb 100644 --- a/api/tangled/feedsubscription.go +++ b/api/org_tangled/feedsubscription.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.feed.subscription @@ -23,11 +23,17 @@ func init() { } // // RECORDTYPE: FeedSubscription type FeedSubscription struct { - LexiconTypeID string `json:"$type,const=org.tangled.feed.subscription" cborgen:"$type,const=org.tangled.feed.subscription"` - // collections: Optional collection NSIDs to filter which notifications are sent. Empty or absent means all collections. - Collections []string `json:"collections,omitempty" cborgen:"collections,omitempty"` - CreatedAt string `json:"createdAt" cborgen:"createdAt"` - Subject *FeedSubscription_Subject `json:"subject" cborgen:"subject"` + LexiconTypeID string `json:"$type,const=org.tangled.feed.subscription" cborgen:"$type,const=org.tangled.feed.subscription"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Subject *FeedSubscription_Subject `json:"subject" cborgen:"subject"` +} + +// FeedSubscription_Record is a "record" in the org.tangled.feed.subscription schema. +// +// RECORDTYPE: FeedSubscription_Record +type FeedSubscription_Record struct { + LexiconTypeID string `json:"$type,const=org.tangled.feed.subscription#record" cborgen:"$type,const=org.tangled.feed.subscription#record"` + Uri string `json:"uri" cborgen:"uri"` } // FeedSubscription_Repo is a "repo" in the org.tangled.feed.subscription schema. @@ -39,14 +45,14 @@ type FeedSubscription_Repo struct { } type FeedSubscription_Subject struct { - FeedSubscription_Uri *FeedSubscription_Uri - FeedSubscription_Repo *FeedSubscription_Repo + FeedSubscription_Record *FeedSubscription_Record + FeedSubscription_Repo *FeedSubscription_Repo } func (t *FeedSubscription_Subject) MarshalJSON() ([]byte, error) { - if t.FeedSubscription_Uri != nil { - t.FeedSubscription_Uri.LexiconTypeID = "org.tangled.feed.subscription#uri" - return json.Marshal(t.FeedSubscription_Uri) + if t.FeedSubscription_Record != nil { + t.FeedSubscription_Record.LexiconTypeID = "org.tangled.feed.subscription#record" + return json.Marshal(t.FeedSubscription_Record) } if t.FeedSubscription_Repo != nil { t.FeedSubscription_Repo.LexiconTypeID = "org.tangled.feed.subscription#repo" @@ -61,9 +67,9 @@ func (t *FeedSubscription_Subject) UnmarshalJSON(b []byte) error { } switch typ { - case "org.tangled.feed.subscription#uri": - t.FeedSubscription_Uri = new(FeedSubscription_Uri) - return json.Unmarshal(b, t.FeedSubscription_Uri) + case "org.tangled.feed.subscription#record": + t.FeedSubscription_Record = new(FeedSubscription_Record) + return json.Unmarshal(b, t.FeedSubscription_Record) case "org.tangled.feed.subscription#repo": t.FeedSubscription_Repo = new(FeedSubscription_Repo) return json.Unmarshal(b, t.FeedSubscription_Repo) @@ -79,8 +85,8 @@ func (t *FeedSubscription_Subject) MarshalCBOR(w io.Writer) error { _, err := w.Write(cbg.CborNull) return err } - if t.FeedSubscription_Uri != nil { - return t.FeedSubscription_Uri.MarshalCBOR(w) + if t.FeedSubscription_Record != nil { + return t.FeedSubscription_Record.MarshalCBOR(w) } if t.FeedSubscription_Repo != nil { return t.FeedSubscription_Repo.MarshalCBOR(w) @@ -94,9 +100,9 @@ func (t *FeedSubscription_Subject) UnmarshalCBOR(r io.Reader) error { } switch typ { - case "org.tangled.feed.subscription#uri": - t.FeedSubscription_Uri = new(FeedSubscription_Uri) - return t.FeedSubscription_Uri.UnmarshalCBOR(bytes.NewReader(b)) + case "org.tangled.feed.subscription#record": + t.FeedSubscription_Record = new(FeedSubscription_Record) + return t.FeedSubscription_Record.UnmarshalCBOR(bytes.NewReader(b)) case "org.tangled.feed.subscription#repo": t.FeedSubscription_Repo = new(FeedSubscription_Repo) return t.FeedSubscription_Repo.UnmarshalCBOR(bytes.NewReader(b)) @@ -105,11 +111,3 @@ func (t *FeedSubscription_Subject) UnmarshalCBOR(r io.Reader) error { return fmt.Errorf("closed enums must have a matching value") } } - -// FeedSubscription_Uri is a "uri" in the org.tangled.feed.subscription schema. -// -// RECORDTYPE: FeedSubscription_Uri -type FeedSubscription_Uri struct { - LexiconTypeID string `json:"$type,const=org.tangled.feed.subscription#uri" cborgen:"$type,const=org.tangled.feed.subscription#uri"` - Uri string `json:"uri" cborgen:"uri"` -} diff --git a/api/tangled/focusbeginSession.go b/api/org_tangled/focusbeginSession.go similarity index 98% rename from api/tangled/focusbeginSession.go rename to api/org_tangled/focusbeginSession.go index ea88d043e..b77afc839 100644 --- a/api/tangled/focusbeginSession.go +++ b/api/org_tangled/focusbeginSession.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.focus.beginSession diff --git a/api/tangled/focusendSession.go b/api/org_tangled/focusendSession.go similarity index 96% rename from api/tangled/focusendSession.go rename to api/org_tangled/focusendSession.go index 88f07d352..046caa3c5 100644 --- a/api/tangled/focusendSession.go +++ b/api/org_tangled/focusendSession.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.focus.endSession diff --git a/api/tangled/focusnextItem.go b/api/org_tangled/focusnextItem.go similarity index 98% rename from api/tangled/focusnextItem.go rename to api/org_tangled/focusnextItem.go index 1563ebe1c..5d64ab44a 100644 --- a/api/tangled/focusnextItem.go +++ b/api/org_tangled/focusnextItem.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.focus.nextItem diff --git a/api/org_tangled/modban.go b/api/org_tangled/modban.go new file mode 100644 index 000000000..c2023619b --- /dev/null +++ b/api/org_tangled/modban.go @@ -0,0 +1,30 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.mod.ban + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSpindleModBanNSID = "org.tangled.temp.spindle.mod.ban" +) + +// TempSpindleModBan_Input is the input argument to a org.tangled.temp.spindle.mod.ban call. +type TempSpindleModBan_Input struct { + // did: DID of the repository or account owner to ban + Did string `json:"did" cborgen:"did"` +} + +// TempSpindleModBan calls the XRPC method "org.tangled.temp.spindle.mod.ban". +func TempSpindleModBan(ctx context.Context, c util.LexClient, input *TempSpindleModBan_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.spindle.mod.ban", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/moddefs.go b/api/org_tangled/moddefs.go new file mode 100644 index 000000000..c21dea8d1 --- /dev/null +++ b/api/org_tangled/moddefs.go @@ -0,0 +1,17 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.mod.defs + +const () + +// TempSpindleModDefs_Ban is a "ban" in the org.tangled.temp.spindle.mod.defs schema. +// +// an active ban for a repository or account owner +type TempSpindleModDefs_Ban struct { + // createdAt: time at which the ban was created + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // did: DID of the banned subject, either a repository or its owner + Did string `json:"did" cborgen:"did"` +} diff --git a/api/org_tangled/modgetBan.go b/api/org_tangled/modgetBan.go new file mode 100644 index 000000000..9e4ab0182 --- /dev/null +++ b/api/org_tangled/modgetBan.go @@ -0,0 +1,36 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.mod.getBan + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSpindleModGetBanNSID = "org.tangled.temp.spindle.mod.getBan" +) + +// TempSpindleModGetBan_Output is the output of a org.tangled.temp.spindle.mod.getBan call. +type TempSpindleModGetBan_Output struct { + // ban: active ban matching the requested DID + Ban *TempSpindleModDefs_Ban `json:"ban" cborgen:"ban"` +} + +// TempSpindleModGetBan calls the XRPC method "org.tangled.temp.spindle.mod.getBan". +// +// did: DID of the repository or account owner to look up +func TempSpindleModGetBan(ctx context.Context, c util.LexClient, did string) (*TempSpindleModGetBan_Output, error) { + var out TempSpindleModGetBan_Output + + params := map[string]interface{}{} + params["did"] = did + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.spindle.mod.getBan", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/modlistBans.go b/api/org_tangled/modlistBans.go new file mode 100644 index 000000000..287ac9329 --- /dev/null +++ b/api/org_tangled/modlistBans.go @@ -0,0 +1,31 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.mod.listBans + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSpindleModListBansNSID = "org.tangled.temp.spindle.mod.listBans" +) + +// TempSpindleModListBans_Output is the output of a org.tangled.temp.spindle.mod.listBans call. +type TempSpindleModListBans_Output struct { + // bans: active bans ordered by subject DID + Bans []*TempSpindleModDefs_Ban `json:"bans" cborgen:"bans"` +} + +// TempSpindleModListBans calls the XRPC method "org.tangled.temp.spindle.mod.listBans". +func TempSpindleModListBans(ctx context.Context, c util.LexClient) (*TempSpindleModListBans_Output, error) { + var out TempSpindleModListBans_Output + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.spindle.mod.listBans", nil, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/modunban.go b/api/org_tangled/modunban.go new file mode 100644 index 000000000..b2102dc77 --- /dev/null +++ b/api/org_tangled/modunban.go @@ -0,0 +1,30 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.spindle.mod.unban + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempSpindleModUnbanNSID = "org.tangled.temp.spindle.mod.unban" +) + +// TempSpindleModUnban_Input is the input argument to a org.tangled.temp.spindle.mod.unban call. +type TempSpindleModUnban_Input struct { + // did: DID of the repository or account owner to unban + Did string `json:"did" cborgen:"did"` +} + +// TempSpindleModUnban calls the XRPC method "org.tangled.temp.spindle.mod.unban". +func TempSpindleModUnban(ctx context.Context, c util.LexClient, input *TempSpindleModUnban_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.spindle.mod.unban", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/tangled/notificationdeleteNotification.go b/api/org_tangled/notificationdeleteNotification.go similarity index 98% rename from api/tangled/notificationdeleteNotification.go rename to api/org_tangled/notificationdeleteNotification.go index ebf10bf8e..17b09b2dd 100644 --- a/api/tangled/notificationdeleteNotification.go +++ b/api/org_tangled/notificationdeleteNotification.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.notification.deleteNotification diff --git a/api/tangled/notificationgetPreferences.go b/api/org_tangled/notificationgetPreferences.go similarity index 98% rename from api/tangled/notificationgetPreferences.go rename to api/org_tangled/notificationgetPreferences.go index 171413bb7..8c4447b78 100644 --- a/api/tangled/notificationgetPreferences.go +++ b/api/org_tangled/notificationgetPreferences.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.notification.getPreferences diff --git a/api/tangled/notificationgetUnreadCount.go b/api/org_tangled/notificationgetUnreadCount.go similarity index 97% rename from api/tangled/notificationgetUnreadCount.go rename to api/org_tangled/notificationgetUnreadCount.go index 679083828..d641b754a 100644 --- a/api/tangled/notificationgetUnreadCount.go +++ b/api/org_tangled/notificationgetUnreadCount.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.notification.getUnreadCount diff --git a/api/tangled/notificationlistNotifications.go b/api/org_tangled/notificationlistNotifications.go similarity index 99% rename from api/tangled/notificationlistNotifications.go rename to api/org_tangled/notificationlistNotifications.go index 0345dbe86..c07499f8b 100644 --- a/api/tangled/notificationlistNotifications.go +++ b/api/org_tangled/notificationlistNotifications.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.notification.listNotifications diff --git a/api/tangled/notificationlistRecipients.go b/api/org_tangled/notificationlistRecipients.go similarity index 98% rename from api/tangled/notificationlistRecipients.go rename to api/org_tangled/notificationlistRecipients.go index e67a3f8a8..4fc9b1225 100644 --- a/api/tangled/notificationlistRecipients.go +++ b/api/org_tangled/notificationlistRecipients.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.notification.listRecipients diff --git a/api/tangled/notificationmarkAllRead.go b/api/org_tangled/notificationmarkAllRead.go similarity index 96% rename from api/tangled/notificationmarkAllRead.go rename to api/org_tangled/notificationmarkAllRead.go index 239bc1fe4..6bef13fa7 100644 --- a/api/tangled/notificationmarkAllRead.go +++ b/api/org_tangled/notificationmarkAllRead.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.notification.markAllRead diff --git a/api/tangled/notificationmarkEntityRead.go b/api/org_tangled/notificationmarkEntityRead.go similarity index 98% rename from api/tangled/notificationmarkEntityRead.go rename to api/org_tangled/notificationmarkEntityRead.go index 8c6a952c1..190a9099d 100644 --- a/api/tangled/notificationmarkEntityRead.go +++ b/api/org_tangled/notificationmarkEntityRead.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.notification.markEntityRead diff --git a/api/tangled/notificationupdatePreferences.go b/api/org_tangled/notificationupdatePreferences.go similarity index 98% rename from api/tangled/notificationupdatePreferences.go rename to api/org_tangled/notificationupdatePreferences.go index f356fbc3b..7ba8db4b8 100644 --- a/api/tangled/notificationupdatePreferences.go +++ b/api/org_tangled/notificationupdatePreferences.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.notification.updatePreferences diff --git a/api/tangled/notificationupdateSeen.go b/api/org_tangled/notificationupdateSeen.go similarity index 97% rename from api/tangled/notificationupdateSeen.go rename to api/org_tangled/notificationupdateSeen.go index 9e24c1284..a2de7102d 100644 --- a/api/tangled/notificationupdateSeen.go +++ b/api/org_tangled/notificationupdateSeen.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.notification.updateSeen diff --git a/api/tangled/quotadefs.go b/api/org_tangled/quotadefs.go similarity index 98% rename from api/tangled/quotadefs.go rename to api/org_tangled/quotadefs.go index efbe90606..6684772dc 100644 --- a/api/tangled/quotadefs.go +++ b/api/org_tangled/quotadefs.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.spindle.quota.defs diff --git a/api/tangled/quotaget.go b/api/org_tangled/quotaget.go similarity index 98% rename from api/tangled/quotaget.go rename to api/org_tangled/quotaget.go index afb0d5884..9912b4849 100644 --- a/api/tangled/quotaget.go +++ b/api/org_tangled/quotaget.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.spindle.quota.get diff --git a/api/tangled/quotalist.go b/api/org_tangled/quotalist.go similarity index 97% rename from api/tangled/quotalist.go rename to api/org_tangled/quotalist.go index e66e080a2..d3f5d33df 100644 --- a/api/tangled/quotalist.go +++ b/api/org_tangled/quotalist.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.spindle.quota.list diff --git a/api/tangled/quotaset.go b/api/org_tangled/quotaset.go similarity index 98% rename from api/tangled/quotaset.go rename to api/org_tangled/quotaset.go index 65bfb31f9..e95579eb6 100644 --- a/api/tangled/quotaset.go +++ b/api/org_tangled/quotaset.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.spindle.quota.set diff --git a/api/tangled/quotaunset.go b/api/org_tangled/quotaunset.go similarity index 97% rename from api/tangled/quotaunset.go rename to api/org_tangled/quotaunset.go index bb3b810f8..aee9cf11d 100644 --- a/api/tangled/quotaunset.go +++ b/api/org_tangled/quotaunset.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.spindle.quota.unset diff --git a/api/tangled/quotausage.go b/api/org_tangled/quotausage.go similarity index 98% rename from api/tangled/quotausage.go rename to api/org_tangled/quotausage.go index b7003ff7e..02bb5cd2f 100644 --- a/api/tangled/quotausage.go +++ b/api/org_tangled/quotausage.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.spindle.quota.usage diff --git a/api/tangled/repocreateWebhook.go b/api/org_tangled/repocreateWebhook.go similarity index 98% rename from api/tangled/repocreateWebhook.go rename to api/org_tangled/repocreateWebhook.go index d38172d0b..e46706941 100644 --- a/api/tangled/repocreateWebhook.go +++ b/api/org_tangled/repocreateWebhook.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.repo.createWebhook diff --git a/api/tangled/repodeleteWebhook.go b/api/org_tangled/repodeleteWebhook.go similarity index 97% rename from api/tangled/repodeleteWebhook.go rename to api/org_tangled/repodeleteWebhook.go index 3f4bd6a5a..ba7191ea0 100644 --- a/api/tangled/repodeleteWebhook.go +++ b/api/org_tangled/repodeleteWebhook.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.repo.deleteWebhook diff --git a/api/tangled/repodisableSite.go b/api/org_tangled/repodisableSite.go similarity index 97% rename from api/tangled/repodisableSite.go rename to api/org_tangled/repodisableSite.go index 110e405f1..9513c312b 100644 --- a/api/tangled/repodisableSite.go +++ b/api/org_tangled/repodisableSite.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.repo.disableSite diff --git a/api/tangled/repogetSiteConfig.go b/api/org_tangled/repogetSiteConfig.go similarity index 98% rename from api/tangled/repogetSiteConfig.go rename to api/org_tangled/repogetSiteConfig.go index a07b1bb7c..d5a96a976 100644 --- a/api/tangled/repogetSiteConfig.go +++ b/api/org_tangled/repogetSiteConfig.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.repo.getSiteConfig diff --git a/api/tangled/repolistWebhookDeliveries.go b/api/org_tangled/repolistWebhookDeliveries.go similarity index 99% rename from api/tangled/repolistWebhookDeliveries.go rename to api/org_tangled/repolistWebhookDeliveries.go index d46a5c12f..46f8052e2 100644 --- a/api/tangled/repolistWebhookDeliveries.go +++ b/api/org_tangled/repolistWebhookDeliveries.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.repo.listWebhookDeliveries diff --git a/api/tangled/repolistWebhooks.go b/api/org_tangled/repolistWebhooks.go similarity index 98% rename from api/tangled/repolistWebhooks.go rename to api/org_tangled/repolistWebhooks.go index 719ca25e5..13f6b1e2c 100644 --- a/api/tangled/repolistWebhooks.go +++ b/api/org_tangled/repolistWebhooks.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.repo.listWebhooks diff --git a/api/tangled/reporetryWebhookDelivery.go b/api/org_tangled/reporetryWebhookDelivery.go similarity index 98% rename from api/tangled/reporetryWebhookDelivery.go rename to api/org_tangled/reporetryWebhookDelivery.go index d5e3f118b..5963d0068 100644 --- a/api/tangled/reporetryWebhookDelivery.go +++ b/api/org_tangled/reporetryWebhookDelivery.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.repo.retryWebhookDelivery diff --git a/api/tangled/repotoggleWebhook.go b/api/org_tangled/repotoggleWebhook.go similarity index 98% rename from api/tangled/repotoggleWebhook.go rename to api/org_tangled/repotoggleWebhook.go index 69c2d292a..5d4aa8404 100644 --- a/api/tangled/repotoggleWebhook.go +++ b/api/org_tangled/repotoggleWebhook.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.repo.toggleWebhook diff --git a/api/tangled/repoupdateSiteConfig.go b/api/org_tangled/repoupdateSiteConfig.go similarity index 98% rename from api/tangled/repoupdateSiteConfig.go rename to api/org_tangled/repoupdateSiteConfig.go index 850aa7c0d..575141ed3 100644 --- a/api/tangled/repoupdateSiteConfig.go +++ b/api/org_tangled/repoupdateSiteConfig.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.repo.updateSiteConfig diff --git a/api/tangled/repoupdateWebhook.go b/api/org_tangled/repoupdateWebhook.go similarity index 98% rename from api/tangled/repoupdateWebhook.go rename to api/org_tangled/repoupdateWebhook.go index 9d654c5b8..f9078d3f7 100644 --- a/api/tangled/repoupdateWebhook.go +++ b/api/org_tangled/repoupdateWebhook.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.repo.updateWebhook diff --git a/api/tangled/searchsearchCode.go b/api/org_tangled/searchsearchCode.go similarity index 99% rename from api/tangled/searchsearchCode.go rename to api/org_tangled/searchsearchCode.go index 0950f65f2..c7aee7755 100644 --- a/api/tangled/searchsearchCode.go +++ b/api/org_tangled/searchsearchCode.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.search.searchCode diff --git a/api/tangled/siteclaimDomain.go b/api/org_tangled/siteclaimDomain.go similarity index 97% rename from api/tangled/siteclaimDomain.go rename to api/org_tangled/siteclaimDomain.go index 990edd09a..521cdfed6 100644 --- a/api/tangled/siteclaimDomain.go +++ b/api/org_tangled/siteclaimDomain.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.site.claimDomain diff --git a/api/tangled/sitegetDomainClaim.go b/api/org_tangled/sitegetDomainClaim.go similarity index 97% rename from api/tangled/sitegetDomainClaim.go rename to api/org_tangled/sitegetDomainClaim.go index f0e1b9a9d..53132a07f 100644 --- a/api/tangled/sitegetDomainClaim.go +++ b/api/org_tangled/sitegetDomainClaim.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.site.getDomainClaim diff --git a/api/tangled/sitereleaseDomain.go b/api/org_tangled/sitereleaseDomain.go similarity index 97% rename from api/tangled/sitereleaseDomain.go rename to api/org_tangled/sitereleaseDomain.go index d1b6dcd10..27f3d2283 100644 --- a/api/tangled/sitereleaseDomain.go +++ b/api/org_tangled/sitereleaseDomain.go @@ -1,6 +1,6 @@ // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. -package tangled +package org_tangled // schema: org.tangled.temp.site.releaseDomain diff --git a/api/tangled/actorgetTrending.go b/api/tangled/actorgetTrending.go new file mode 100644 index 000000000..8c335cd3b --- /dev/null +++ b/api/tangled/actorgetTrending.go @@ -0,0 +1,31 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.actor.getTrending + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + ActorGetTrendingNSID = "sh.tangled.actor.getTrending" +) + +// ActorGetTrending_Output is the output of a sh.tangled.actor.getTrending call. +type ActorGetTrending_Output struct { + People []*ActorDefs_ProfileViewDetailed `json:"people" cborgen:"people"` + Repos []*RepoDefs_RepoViewBasic `json:"repos" cborgen:"repos"` +} + +// ActorGetTrending calls the XRPC method "sh.tangled.actor.getTrending". +func ActorGetTrending(ctx context.Context, c util.LexClient) (*ActorGetTrending_Output, error) { + var out ActorGetTrending_Output + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.actor.getTrending", nil, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/bobbinawaitRecord.go b/api/tangled/bobbinawaitRecord.go new file mode 100644 index 000000000..d8432cac2 --- /dev/null +++ b/api/tangled/bobbinawaitRecord.go @@ -0,0 +1,46 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.bobbin.awaitRecord + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + BobbinAwaitRecordNSID = "sh.tangled.bobbin.awaitRecord" +) + +// BobbinAwaitRecord_Output is the output of a sh.tangled.bobbin.awaitRecord call. +type BobbinAwaitRecord_Output struct { + // cid: CID of the revision this result is about. + Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` + // detail: Opaque error message which can be more detailed than the reason. + Detail *string `json:"detail,omitempty" cborgen:"detail,omitempty"` + // reason: Why a rejected record will not appear. + Reason *string `json:"reason,omitempty" cborgen:"reason,omitempty"` + // status: What bobbin did with the record. + Status string `json:"status" cborgen:"status"` +} + +// BobbinAwaitRecord calls the XRPC method "sh.tangled.bobbin.awaitRecord". +// +// cid: CID of the revision that was written, as returned by createRecord, putRecord or applyWrites. Omit it only when awaiting a delete, which has no CID. any other responds with whatever revision of the record settles first. +// uri: AT-URI of the record that was written. +func BobbinAwaitRecord(ctx context.Context, c util.LexClient, cid string, uri string) (*BobbinAwaitRecord_Output, error) { + var out BobbinAwaitRecord_Output + + params := map[string]interface{}{} + if cid != "" { + params["cid"] = cid + } + params["uri"] = uri + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.bobbin.awaitRecord", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/cbor_gen.go b/api/tangled/cbor_gen.go index 0f5163dbe..7b39f0b3a 100644 --- a/api/tangled/cbor_gen.go +++ b/api/tangled/cbor_gen.go @@ -3283,6 +3283,172 @@ func (t *CiTrigger_Push) UnmarshalCBOR(r io.Reader) (err error) { return nil } +func (t *EmbedCommit) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write([]byte{163}); err != nil { + return err + } + + // t.Repo (string) (string) + if len("repo") > 1000000 { + return xerrors.Errorf("Value in field \"repo\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { + return err + } + if _, err := cw.WriteString(string("repo")); err != nil { + return err + } + + if len(t.Repo) > 1000000 { + return xerrors.Errorf("Value in field t.Repo was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Repo)); err != nil { + return err + } + + // t.LexiconTypeID (string) (string) + if len("$type") > 1000000 { + return xerrors.Errorf("Value in field \"$type\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { + return err + } + if _, err := cw.WriteString(string("$type")); err != nil { + return err + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.embed.commit"))); err != nil { + return err + } + if _, err := cw.WriteString(string("sh.tangled.embed.commit")); err != nil { + return err + } + + // t.Commit (tangled.EmbedCommit_Commit) (struct) + if len("commit") > 1000000 { + return xerrors.Errorf("Value in field \"commit\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("commit"))); err != nil { + return err + } + if _, err := cw.WriteString(string("commit")); err != nil { + return err + } + + if err := t.Commit.MarshalCBOR(cw); err != nil { + return err + } + return nil +} + +func (t *EmbedCommit) UnmarshalCBOR(r io.Reader) (err error) { + *t = EmbedCommit{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajMap { + return fmt.Errorf("cbor input should be of type map") + } + + if extra > cbg.MaxLength { + return fmt.Errorf("EmbedCommit: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 6) + for i := uint64(0); i < n; i++ { + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) + if err != nil { + return err + } + + if !ok { + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { + return err + } + continue + } + + switch string(nameBuf[:nameLen]) { + // t.Repo (string) (string) + case "repo": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Repo = string(sval) + } + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.Commit (tangled.EmbedCommit_Commit) (struct) + case "commit": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Commit = new(EmbedCommit_Commit) + if err := t.Commit.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Commit pointer: %w", err) + } + } + + } + + default: + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { + return err + } + } + } + + return nil +} func (t *FeedComment) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) @@ -3290,7 +3456,11 @@ func (t *FeedComment) MarshalCBOR(w io.Writer) error { } cw := cbg.NewCborWriter(w) - fieldCount := 6 + fieldCount := 7 + + if t.Embed == nil { + fieldCount-- + } if t.PullRoundIdx == nil { fieldCount-- @@ -3339,6 +3509,25 @@ func (t *FeedComment) MarshalCBOR(w io.Writer) error { return err } + // t.Embed (tangled.FeedComment_Embed) (struct) + if t.Embed != nil { + + if len("embed") > 1000000 { + return xerrors.Errorf("Value in field \"embed\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("embed"))); err != nil { + return err + } + if _, err := cw.WriteString(string("embed")); err != nil { + return err + } + + if err := t.Embed.MarshalCBOR(cw); err != nil { + return err + } + } + // t.ReplyTo (atproto.RepoStrongRef) (struct) if t.ReplyTo != nil { @@ -3503,6 +3692,26 @@ func (t *FeedComment) UnmarshalCBOR(r io.Reader) (err error) { t.LexiconTypeID = string(sval) } + // t.Embed (tangled.FeedComment_Embed) (struct) + case "embed": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Embed = new(FeedComment_Embed) + if err := t.Embed.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Embed pointer: %w", err) + } + } + + } // t.ReplyTo (atproto.RepoStrongRef) (struct) case "replyTo": @@ -3764,447 +3973,21 @@ func (t *FeedReaction) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.Subject = string(sval) - } - // t.Reaction (string) (string) - case "reaction": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.Reaction = string(sval) - } - // t.CreatedAt (string) (string) - case "createdAt": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.CreatedAt = string(sval) - } - - default: - // Field doesn't exist on this type, so ignore it - if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { - return err - } - } - } - - return nil -} -func (t *FeedStar) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - - cw := cbg.NewCborWriter(w) - - if _, err := cw.Write([]byte{163}); err != nil { - return err - } - - // t.LexiconTypeID (string) (string) - if len("$type") > 1000000 { - return xerrors.Errorf("Value in field \"$type\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { - return err - } - if _, err := cw.WriteString(string("$type")); err != nil { - return err - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.feed.star"))); err != nil { - return err - } - if _, err := cw.WriteString(string("sh.tangled.feed.star")); err != nil { - return err - } - - // t.Subject (tangled.FeedStar_Subject) (struct) - if len("subject") > 1000000 { - return xerrors.Errorf("Value in field \"subject\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil { - return err - } - if _, err := cw.WriteString(string("subject")); err != nil { - return err - } - - if err := t.Subject.MarshalCBOR(cw); err != nil { - return err - } - - // t.CreatedAt (string) (string) - if len("createdAt") > 1000000 { - return xerrors.Errorf("Value in field \"createdAt\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { - return err - } - if _, err := cw.WriteString(string("createdAt")); err != nil { - return err - } - - if len(t.CreatedAt) > 1000000 { - return xerrors.Errorf("Value in field t.CreatedAt was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { - return err - } - if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { - return err - } - return nil -} - -func (t *FeedStar) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedStar{} - - cr := cbg.NewCborReader(r) - - maj, extra, err := cr.ReadHeader() - if err != nil { - return err - } - defer func() { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - }() - - if maj != cbg.MajMap { - return fmt.Errorf("cbor input should be of type map") - } - - if extra > cbg.MaxLength { - return fmt.Errorf("FeedStar: map struct too large (%d)", extra) - } - - n := extra - - nameBuf := make([]byte, 9) - for i := uint64(0); i < n; i++ { - nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) - if err != nil { - return err - } - - if !ok { - // Field doesn't exist on this type, so ignore it - if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { - return err - } - continue - } - - switch string(nameBuf[:nameLen]) { - // t.LexiconTypeID (string) (string) - case "$type": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.LexiconTypeID = string(sval) - } - // t.Subject (tangled.FeedStar_Subject) (struct) - case "subject": - - { - - b, err := cr.ReadByte() - if err != nil { - return err - } - if b != cbg.CborNull[0] { - if err := cr.UnreadByte(); err != nil { - return err - } - t.Subject = new(FeedStar_Subject) - if err := t.Subject.UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.Subject pointer: %w", err) - } - } - - } - // t.CreatedAt (string) (string) - case "createdAt": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.CreatedAt = string(sval) - } - - default: - // Field doesn't exist on this type, so ignore it - if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { - return err - } - } - } - - return nil -} -func (t *FeedStar_Repo) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - - cw := cbg.NewCborWriter(w) - - if _, err := cw.Write([]byte{162}); err != nil { - return err - } - - // t.Did (string) (string) - if len("did") > 1000000 { - return xerrors.Errorf("Value in field \"did\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("did"))); err != nil { - return err - } - if _, err := cw.WriteString(string("did")); err != nil { - return err - } - - if len(t.Did) > 1000000 { - return xerrors.Errorf("Value in field t.Did was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Did))); err != nil { - return err - } - if _, err := cw.WriteString(string(t.Did)); err != nil { - return err - } - - // t.LexiconTypeID (string) (string) - if len("$type") > 1000000 { - return xerrors.Errorf("Value in field \"$type\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { - return err - } - if _, err := cw.WriteString(string("$type")); err != nil { - return err - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.feed.star#repo"))); err != nil { - return err - } - if _, err := cw.WriteString(string("sh.tangled.feed.star#repo")); err != nil { - return err - } - return nil -} - -func (t *FeedStar_Repo) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedStar_Repo{} - - cr := cbg.NewCborReader(r) - - maj, extra, err := cr.ReadHeader() - if err != nil { - return err - } - defer func() { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - }() - - if maj != cbg.MajMap { - return fmt.Errorf("cbor input should be of type map") - } - - if extra > cbg.MaxLength { - return fmt.Errorf("FeedStar_Repo: map struct too large (%d)", extra) - } - - n := extra - - nameBuf := make([]byte, 5) - for i := uint64(0); i < n; i++ { - nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) - if err != nil { - return err - } - - if !ok { - // Field doesn't exist on this type, so ignore it - if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { - return err - } - continue - } - - switch string(nameBuf[:nameLen]) { - // t.Did (string) (string) - case "did": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.Did = string(sval) - } - // t.LexiconTypeID (string) (string) - case "$type": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.LexiconTypeID = string(sval) - } - - default: - // Field doesn't exist on this type, so ignore it - if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { - return err - } - } - } - - return nil -} -func (t *FeedStar_String) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - - cw := cbg.NewCborWriter(w) - - if _, err := cw.Write([]byte{162}); err != nil { - return err - } - - // t.Uri (string) (string) - if len("uri") > 1000000 { - return xerrors.Errorf("Value in field \"uri\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("uri"))); err != nil { - return err - } - if _, err := cw.WriteString(string("uri")); err != nil { - return err - } - - if len(t.Uri) > 1000000 { - return xerrors.Errorf("Value in field t.Uri was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Uri))); err != nil { - return err - } - if _, err := cw.WriteString(string(t.Uri)); err != nil { - return err - } - - // t.LexiconTypeID (string) (string) - if len("$type") > 1000000 { - return xerrors.Errorf("Value in field \"$type\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { - return err - } - if _, err := cw.WriteString(string("$type")); err != nil { - return err - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.feed.star#string"))); err != nil { - return err - } - if _, err := cw.WriteString(string("sh.tangled.feed.star#string")); err != nil { - return err - } - return nil -} - -func (t *FeedStar_String) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedStar_String{} - - cr := cbg.NewCborReader(r) - - maj, extra, err := cr.ReadHeader() - if err != nil { - return err - } - defer func() { - if err == io.EOF { - err = io.ErrUnexpectedEOF - } - }() - - if maj != cbg.MajMap { - return fmt.Errorf("cbor input should be of type map") - } - - if extra > cbg.MaxLength { - return fmt.Errorf("FeedStar_String: map struct too large (%d)", extra) - } - - n := extra - - nameBuf := make([]byte, 5) - for i := uint64(0); i < n; i++ { - nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) - if err != nil { - return err - } - - if !ok { - // Field doesn't exist on this type, so ignore it - if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { - return err - } - continue - } - - switch string(nameBuf[:nameLen]) { - // t.Uri (string) (string) - case "uri": - + t.Subject = string(sval) + } + // t.Reaction (string) (string) + case "reaction": + { sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err } - t.Uri = string(sval) + t.Reaction = string(sval) } - // t.LexiconTypeID (string) (string) - case "$type": + // t.CreatedAt (string) (string) + case "createdAt": { sval, err := cbg.ReadStringWithMax(cr, 1000000) @@ -4212,7 +3995,7 @@ func (t *FeedStar_String) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.LexiconTypeID = string(sval) + t.CreatedAt = string(sval) } default: @@ -4225,20 +4008,15 @@ func (t *FeedStar_String) UnmarshalCBOR(r io.Reader) (err error) { return nil } -func (t *FeedSubscription) MarshalCBOR(w io.Writer) error { +func (t *FeedStar) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } cw := cbg.NewCborWriter(w) - fieldCount := 4 - - if t.Collections == nil { - fieldCount-- - } - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + if _, err := cw.Write([]byte{163}); err != nil { return err } @@ -4254,14 +4032,14 @@ func (t *FeedSubscription) MarshalCBOR(w io.Writer) error { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.feed.subscription"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.feed.star"))); err != nil { return err } - if _, err := cw.WriteString(string("org.tangled.feed.subscription")); err != nil { + if _, err := cw.WriteString(string("sh.tangled.feed.star")); err != nil { return err } - // t.Subject (tangled.FeedSubscription_Subject) (struct) + // t.Subject (tangled.FeedStar_Subject) (struct) if len("subject") > 1000000 { return xerrors.Errorf("Value in field \"subject\" was too long") } @@ -4299,47 +4077,11 @@ func (t *FeedSubscription) MarshalCBOR(w io.Writer) error { if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { return err } - - // t.Collections ([]string) (slice) - if t.Collections != nil { - - if len("collections") > 1000000 { - return xerrors.Errorf("Value in field \"collections\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("collections"))); err != nil { - return err - } - if _, err := cw.WriteString(string("collections")); err != nil { - return err - } - - if len(t.Collections) > 8192 { - return xerrors.Errorf("Slice value in field t.Collections was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Collections))); err != nil { - return err - } - for _, v := range t.Collections { - if len(v) > 1000000 { - return xerrors.Errorf("Value in field v was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil { - return err - } - if _, err := cw.WriteString(string(v)); err != nil { - return err - } - - } - } return nil } -func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedSubscription{} +func (t *FeedStar) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedStar{} cr := cbg.NewCborReader(r) @@ -4358,12 +4100,12 @@ func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { } if extra > cbg.MaxLength { - return fmt.Errorf("FeedSubscription: map struct too large (%d)", extra) + return fmt.Errorf("FeedStar: map struct too large (%d)", extra) } n := extra - nameBuf := make([]byte, 11) + nameBuf := make([]byte, 9) for i := uint64(0); i < n; i++ { nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) if err != nil { @@ -4390,7 +4132,7 @@ func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { t.LexiconTypeID = string(sval) } - // t.Subject (tangled.FeedSubscription_Subject) (struct) + // t.Subject (tangled.FeedStar_Subject) (struct) case "subject": { @@ -4403,7 +4145,7 @@ func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { if err := cr.UnreadByte(); err != nil { return err } - t.Subject = new(FeedSubscription_Subject) + t.Subject = new(FeedStar_Subject) if err := t.Subject.UnmarshalCBOR(cr); err != nil { return xerrors.Errorf("unmarshaling t.Subject pointer: %w", err) } @@ -4421,45 +4163,135 @@ func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { t.CreatedAt = string(sval) } - // t.Collections ([]string) (slice) - case "collections": - maj, extra, err = cr.ReadHeader() - if err != nil { + default: + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { return err } + } + } - if extra > 8192 { - return fmt.Errorf("t.Collections: array too large (%d)", extra) - } + return nil +} +func (t *FeedStar_Repo) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } - if maj != cbg.MajArray { - return fmt.Errorf("expected cbor array") - } + cw := cbg.NewCborWriter(w) - if extra > 0 { - t.Collections = make([]string, extra) + if _, err := cw.Write([]byte{162}); err != nil { + return err + } + + // t.Did (string) (string) + if len("did") > 1000000 { + return xerrors.Errorf("Value in field \"did\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("did"))); err != nil { + return err + } + if _, err := cw.WriteString(string("did")); err != nil { + return err + } + + if len(t.Did) > 1000000 { + return xerrors.Errorf("Value in field t.Did was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Did))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Did)); err != nil { + return err + } + + // t.LexiconTypeID (string) (string) + if len("$type") > 1000000 { + return xerrors.Errorf("Value in field \"$type\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { + return err + } + if _, err := cw.WriteString(string("$type")); err != nil { + return err + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.feed.star#repo"))); err != nil { + return err + } + if _, err := cw.WriteString(string("sh.tangled.feed.star#repo")); err != nil { + return err + } + return nil +} + +func (t *FeedStar_Repo) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedStar_Repo{} + + cr := cbg.NewCborReader(r) + + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + defer func() { + if err == io.EOF { + err = io.ErrUnexpectedEOF + } + }() + + if maj != cbg.MajMap { + return fmt.Errorf("cbor input should be of type map") + } + + if extra > cbg.MaxLength { + return fmt.Errorf("FeedStar_Repo: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 5) + for i := uint64(0); i < n; i++ { + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) + if err != nil { + return err + } + + if !ok { + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { + return err } + continue + } - for i := 0; i < int(extra); i++ { - { - var maj byte - var extra uint64 - var err error - _ = maj - _ = extra - _ = err + switch string(nameBuf[:nameLen]) { + // t.Did (string) (string) + case "did": - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } - t.Collections[i] = string(sval) - } + t.Did = string(sval) + } + // t.LexiconTypeID (string) (string) + case "$type": + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err } + + t.LexiconTypeID = string(sval) } default: @@ -4472,7 +4304,7 @@ func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { return nil } -func (t *FeedSubscription_Uri) MarshalCBOR(w io.Writer) error { +func (t *FeedStar_String) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err @@ -4519,17 +4351,17 @@ func (t *FeedSubscription_Uri) MarshalCBOR(w io.Writer) error { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.feed.subscription#uri"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.feed.star#string"))); err != nil { return err } - if _, err := cw.WriteString(string("org.tangled.feed.subscription#uri")); err != nil { + if _, err := cw.WriteString(string("sh.tangled.feed.star#string")); err != nil { return err } return nil } -func (t *FeedSubscription_Uri) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedSubscription_Uri{} +func (t *FeedStar_String) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedStar_String{} cr := cbg.NewCborReader(r) @@ -4548,7 +4380,7 @@ func (t *FeedSubscription_Uri) UnmarshalCBOR(r io.Reader) (err error) { } if extra > cbg.MaxLength { - return fmt.Errorf("FeedSubscription_Uri: map struct too large (%d)", extra) + return fmt.Errorf("FeedStar_String: map struct too large (%d)", extra) } n := extra @@ -4602,7 +4434,7 @@ func (t *FeedSubscription_Uri) UnmarshalCBOR(r io.Reader) (err error) { return nil } -func (t *FeedSubscription_Repo) MarshalCBOR(w io.Writer) error { +func (t *GitOid) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err @@ -4614,26 +4446,26 @@ func (t *FeedSubscription_Repo) MarshalCBOR(w io.Writer) error { return err } - // t.Did (string) (string) - if len("did") > 1000000 { - return xerrors.Errorf("Value in field \"did\" was too long") + // t.Oid (string) (string) + if len("oid") > 1000000 { + return xerrors.Errorf("Value in field \"oid\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("did"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("oid"))); err != nil { return err } - if _, err := cw.WriteString(string("did")); err != nil { + if _, err := cw.WriteString(string("oid")); err != nil { return err } - if len(t.Did) > 1000000 { - return xerrors.Errorf("Value in field t.Did was too long") + if len(t.Oid) > 1000000 { + return xerrors.Errorf("Value in field t.Oid was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Did))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Oid))); err != nil { return err } - if _, err := cw.WriteString(string(t.Did)); err != nil { + if _, err := cw.WriteString(string(t.Oid)); err != nil { return err } @@ -4649,17 +4481,17 @@ func (t *FeedSubscription_Repo) MarshalCBOR(w io.Writer) error { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.feed.subscription#repo"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.git.oid"))); err != nil { return err } - if _, err := cw.WriteString(string("org.tangled.feed.subscription#repo")); err != nil { + if _, err := cw.WriteString(string("sh.tangled.git.oid")); err != nil { return err } return nil } -func (t *FeedSubscription_Repo) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedSubscription_Repo{} +func (t *GitOid) UnmarshalCBOR(r io.Reader) (err error) { + *t = GitOid{} cr := cbg.NewCborReader(r) @@ -4678,7 +4510,7 @@ func (t *FeedSubscription_Repo) UnmarshalCBOR(r io.Reader) (err error) { } if extra > cbg.MaxLength { - return fmt.Errorf("FeedSubscription_Repo: map struct too large (%d)", extra) + return fmt.Errorf("GitOid: map struct too large (%d)", extra) } n := extra @@ -4699,8 +4531,8 @@ func (t *FeedSubscription_Repo) UnmarshalCBOR(r io.Reader) (err error) { } switch string(nameBuf[:nameLen]) { - // t.Did (string) (string) - case "did": + // t.Oid (string) (string) + case "oid": { sval, err := cbg.ReadStringWithMax(cr, 1000000) @@ -4708,7 +4540,7 @@ func (t *FeedSubscription_Repo) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.Did = string(sval) + t.Oid = string(sval) } // t.LexiconTypeID (string) (string) case "$type": @@ -15455,46 +15287,32 @@ func (t *RepoPull_Version) MarshalCBOR(w io.Writer) error { } cw := cbg.NewCborWriter(w) - fieldCount := 3 - - if t.Base == nil { - fieldCount-- - } - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + if _, err := cw.Write([]byte{163}); err != nil { return err } // t.Base (string) (string) - if t.Base != nil { - - if len("base") > 1000000 { - return xerrors.Errorf("Value in field \"base\" was too long") - } + if len("base") > 1000000 { + return xerrors.Errorf("Value in field \"base\" was too long") + } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("base"))); err != nil { - return err - } - if _, err := cw.WriteString(string("base")); err != nil { - return err - } + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("base"))); err != nil { + return err + } + if _, err := cw.WriteString(string("base")); err != nil { + return err + } - if t.Base == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - if len(*t.Base) > 1000000 { - return xerrors.Errorf("Value in field t.Base was too long") - } + if len(t.Base) > 1000000 { + return xerrors.Errorf("Value in field t.Base was too long") + } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Base))); err != nil { - return err - } - if _, err := cw.WriteString(string(*t.Base)); err != nil { - return err - } - } + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Base))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Base)); err != nil { + return err } // t.Head (string) (string) @@ -15590,22 +15408,12 @@ func (t *RepoPull_Version) UnmarshalCBOR(r io.Reader) (err error) { case "base": { - b, err := cr.ReadByte() + sval, err := cbg.ReadStringWithMax(cr, 1000000) if err != nil { return err } - if b != cbg.CborNull[0] { - if err := cr.UnreadByte(); err != nil { - return err - } - - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - t.Base = (*string)(&sval) - } + t.Base = string(sval) } // t.Head (string) (string) case "head": diff --git a/api/tangled/embedcommit.go b/api/tangled/embedcommit.go new file mode 100644 index 000000000..a7b160dc1 --- /dev/null +++ b/api/tangled/embedcommit.go @@ -0,0 +1,83 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.embed.commit + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + + "github.com/bluesky-social/indigo/lex/util" + cbg "github.com/whyrusleeping/cbor-gen" +) + +const ( + EmbedCommitNSID = "sh.tangled.embed.commit" +) + +func init() { + util.RegisterType("sh.tangled.embed.commit#main", &EmbedCommit{}) +} // EmbedCommit is a "main" in the sh.tangled.embed.commit schema. +// RECORDTYPE: EmbedCommit +type EmbedCommit struct { + LexiconTypeID string `json:"$type,const=sh.tangled.embed.commit" cborgen:"$type,const=sh.tangled.embed.commit"` + Commit *EmbedCommit_Commit `json:"commit" cborgen:"commit"` + Repo string `json:"repo" cborgen:"repo"` +} + +type EmbedCommit_Commit struct { + GitOid *GitOid +} + +func (t *EmbedCommit_Commit) MarshalJSON() ([]byte, error) { + if t.GitOid != nil { + t.GitOid.LexiconTypeID = "sh.tangled.git.oid" + return json.Marshal(t.GitOid) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *EmbedCommit_Commit) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "sh.tangled.git.oid": + t.GitOid = new(GitOid) + return json.Unmarshal(b, t.GitOid) + + default: + return nil + } +} + +func (t *EmbedCommit_Commit) MarshalCBOR(w io.Writer) error { + + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + if t.GitOid != nil { + return t.GitOid.MarshalCBOR(w) + } + return fmt.Errorf("cannot cbor marshal empty enum") +} +func (t *EmbedCommit_Commit) UnmarshalCBOR(r io.Reader) error { + typ, b, err := util.CborTypeExtractReader(r) + if err != nil { + return err + } + + switch typ { + case "sh.tangled.git.oid": + t.GitOid = new(GitOid) + return t.GitOid.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return nil + } +} diff --git a/api/tangled/feedcomment.go b/api/tangled/feedcomment.go index d535ec6d4..5237ef3ca 100644 --- a/api/tangled/feedcomment.go +++ b/api/tangled/feedcomment.go @@ -24,9 +24,10 @@ func init() { } // // RECORDTYPE: FeedComment type FeedComment struct { - LexiconTypeID string `json:"$type,const=sh.tangled.feed.comment" cborgen:"$type,const=sh.tangled.feed.comment"` - Body *FeedComment_Body `json:"body" cborgen:"body"` - CreatedAt string `json:"createdAt" cborgen:"createdAt"` + LexiconTypeID string `json:"$type,const=sh.tangled.feed.comment" cborgen:"$type,const=sh.tangled.feed.comment"` + Body *FeedComment_Body `json:"body" cborgen:"body"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Embed *FeedComment_Embed `json:"embed,omitempty" cborgen:"embed,omitempty"` // pullRoundIdx: optional pull submission round index. required when subject is sh.tangled.repo.pull PullRoundIdx *int64 `json:"pullRoundIdx,omitempty" cborgen:"pullRoundIdx,omitempty"` ReplyTo *comatprototypes.RepoStrongRef `json:"replyTo,omitempty" cborgen:"replyTo,omitempty"` @@ -86,3 +87,57 @@ func (t *FeedComment_Body) UnmarshalCBOR(r io.Reader) error { return nil } } + +type FeedComment_Embed struct { + EmbedCommit *EmbedCommit +} + +func (t *FeedComment_Embed) MarshalJSON() ([]byte, error) { + if t.EmbedCommit != nil { + t.EmbedCommit.LexiconTypeID = "sh.tangled.embed.commit" + return json.Marshal(t.EmbedCommit) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *FeedComment_Embed) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "sh.tangled.embed.commit": + t.EmbedCommit = new(EmbedCommit) + return json.Unmarshal(b, t.EmbedCommit) + + default: + return nil + } +} + +func (t *FeedComment_Embed) MarshalCBOR(w io.Writer) error { + + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + if t.EmbedCommit != nil { + return t.EmbedCommit.MarshalCBOR(w) + } + return fmt.Errorf("cannot cbor marshal empty enum") +} +func (t *FeedComment_Embed) UnmarshalCBOR(r io.Reader) error { + typ, b, err := util.CborTypeExtractReader(r) + if err != nil { + return err + } + + switch typ { + case "sh.tangled.embed.commit": + t.EmbedCommit = new(EmbedCommit) + return t.EmbedCommit.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return nil + } +} diff --git a/api/tangled/feedlistComments.go b/api/tangled/feedlistComments.go index f791ef439..568792adb 100644 --- a/api/tangled/feedlistComments.go +++ b/api/tangled/feedlistComments.go @@ -26,14 +26,17 @@ type FeedListComments_ListItem struct { type FeedListComments_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*FeedListComments_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // FeedListComments calls the XRPC method "sh.tangled.feed.listComments". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Record AT-URI the comments attach to. -func FeedListComments(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*FeedListComments_Output, error) { +func FeedListComments(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*FeedListComments_Output, error) { var out FeedListComments_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func FeedListComments(ctx context.Context, c util.LexClient, cursor string, limi if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/feedlistCommentsBy.go b/api/tangled/feedlistCommentsBy.go index 78c575fbf..46d4b6726 100644 --- a/api/tangled/feedlistCommentsBy.go +++ b/api/tangled/feedlistCommentsBy.go @@ -18,14 +18,17 @@ const ( type FeedListCommentsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*FeedListComments_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // FeedListCommentsBy calls the XRPC method "sh.tangled.feed.listCommentsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose comment authorings to list. -func FeedListCommentsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*FeedListCommentsBy_Output, error) { +func FeedListCommentsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*FeedListCommentsBy_Output, error) { var out FeedListCommentsBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func FeedListCommentsBy(ctx context.Context, c util.LexClient, cursor string, li if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/feedlistReactions.go b/api/tangled/feedlistReactions.go index 1880b7a7d..28723bccb 100644 --- a/api/tangled/feedlistReactions.go +++ b/api/tangled/feedlistReactions.go @@ -26,14 +26,17 @@ type FeedListReactions_ListItem struct { type FeedListReactions_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*FeedListReactions_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // FeedListReactions calls the XRPC method "sh.tangled.feed.listReactions". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Record AT-URI the reactions target. -func FeedListReactions(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*FeedListReactions_Output, error) { +func FeedListReactions(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*FeedListReactions_Output, error) { var out FeedListReactions_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func FeedListReactions(ctx context.Context, c util.LexClient, cursor string, lim if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/feedlistReactionsBy.go b/api/tangled/feedlistReactionsBy.go index aafb5d39f..f59946a6c 100644 --- a/api/tangled/feedlistReactionsBy.go +++ b/api/tangled/feedlistReactionsBy.go @@ -18,14 +18,17 @@ const ( type FeedListReactionsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*FeedListReactions_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // FeedListReactionsBy calls the XRPC method "sh.tangled.feed.listReactionsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose reaction authorings to list. -func FeedListReactionsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*FeedListReactionsBy_Output, error) { +func FeedListReactionsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*FeedListReactionsBy_Output, error) { var out FeedListReactionsBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func FeedListReactionsBy(ctx context.Context, c util.LexClient, cursor string, l if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/feedlistStars.go b/api/tangled/feedlistStars.go index a712c4200..b478a1c81 100644 --- a/api/tangled/feedlistStars.go +++ b/api/tangled/feedlistStars.go @@ -26,14 +26,17 @@ type FeedListStars_ListItem struct { type FeedListStars_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*FeedListStars_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // FeedListStars calls the XRPC method "sh.tangled.feed.listStars". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Repo DID to list star edges for. -func FeedListStars(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*FeedListStars_Output, error) { +func FeedListStars(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*FeedListStars_Output, error) { var out FeedListStars_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func FeedListStars(ctx context.Context, c util.LexClient, cursor string, limit i if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/feedlistStarsBy.go b/api/tangled/feedlistStarsBy.go index 34a5bd7bc..7dfe481a4 100644 --- a/api/tangled/feedlistStarsBy.go +++ b/api/tangled/feedlistStarsBy.go @@ -18,14 +18,17 @@ const ( type FeedListStarsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*FeedListStars_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // FeedListStarsBy calls the XRPC method "sh.tangled.feed.listStarsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose star authorings to list. -func FeedListStarsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*FeedListStarsBy_Output, error) { +func FeedListStarsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*FeedListStarsBy_Output, error) { var out FeedListStarsBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func FeedListStarsBy(ctx context.Context, c util.LexClient, cursor string, limit if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/gitdefs.go b/api/tangled/gitdefs.go index 80fcc3e9f..70f06012a 100644 --- a/api/tangled/gitdefs.go +++ b/api/tangled/gitdefs.go @@ -6,6 +6,53 @@ package tangled const () +// GitDefs_ByteChanges is a "byteChanges" in the sh.tangled.git.defs schema. +type GitDefs_ByteChanges struct { + Lhs int64 `json:"lhs" cborgen:"lhs"` + Rhs int64 `json:"rhs" cborgen:"rhs"` +} + +// GitDefs_DiffHunk is a "diffHunk" in the sh.tangled.git.defs schema. +type GitDefs_DiffHunk struct { + Lines []*GitDefs_LinePair `json:"lines" cborgen:"lines"` + // novelLhs: 0-based line numbers holding novel content on the left side + NovelLhs []int64 `json:"novelLhs" cborgen:"novelLhs"` + // novelRhs: 0-based line numbers holding novel content on the right side + NovelRhs []int64 `json:"novelRhs" cborgen:"novelRhs"` +} + +// GitDefs_DiffSrc is a "diffSrc" in the sh.tangled.git.defs schema. +// +// One side of a file diff. +type GitDefs_DiffSrc struct { + // content: Inlined content. Used on interdiff's LHS. + Content *string `json:"content,omitempty" cborgen:"content,omitempty"` + IsBinary bool `json:"isBinary" cborgen:"isBinary"` + IsSubmodule bool `json:"isSubmodule" cborgen:"isSubmodule"` + // oid: Blob oid, or the commit oid for a submodule + Oid string `json:"oid" cborgen:"oid"` + Path string `json:"path" cborgen:"path"` + Size int64 `json:"size" cborgen:"size"` +} + +// GitDefs_FileDiff is a "fileDiff" in the sh.tangled.git.defs schema. +type GitDefs_FileDiff struct { + // hasByteChanges: Byte count per side, present only when the two sides differ + HasByteChanges *GitDefs_ByteChanges `json:"hasByteChanges,omitempty" cborgen:"hasByteChanges,omitempty"` + HasSyntacticChanges bool `json:"hasSyntacticChanges" cborgen:"hasSyntacticChanges"` + Hunks []*GitDefs_DiffHunk `json:"hunks" cborgen:"hunks"` + LhsSrc *GitDefs_DiffSrc `json:"lhsSrc" cborgen:"lhsSrc"` + RhsSrc *GitDefs_DiffSrc `json:"rhsSrc" cborgen:"rhsSrc"` +} + +// GitDefs_LinePair is a "linePair" in the sh.tangled.git.defs schema. +// +// One aligned line pair; a side is absent when that side has no line. +type GitDefs_LinePair struct { + Lhs *int64 `json:"lhs,omitempty" cborgen:"lhs,omitempty"` + Rhs *int64 `json:"rhs,omitempty" cborgen:"rhs,omitempty"` +} + // GitDefs_Signature is a "signature" in the sh.tangled.git.defs schema. type GitDefs_Signature struct { // email: Person email diff --git a/api/tangled/gitkeepCommit.go b/api/tangled/gitkeepCommit.go index 36bca0de9..d0f50a575 100644 --- a/api/tangled/gitkeepCommit.go +++ b/api/tangled/gitkeepCommit.go @@ -78,7 +78,7 @@ type GitKeepCommit_Output struct { // RECORDTYPE: GitKeepCommit_Patches type GitKeepCommit_Patches struct { LexiconTypeID string `json:"$type,const=sh.tangled.git.keepCommit#patches" cborgen:"$type,const=sh.tangled.git.keepCommit#patches"` - Patches []string `json:"patches,omitempty" cborgen:"patches,omitempty"` + Patches []string `json:"patches" cborgen:"patches"` } // GitKeepCommit calls the XRPC method "sh.tangled.git.keepCommit". diff --git a/api/tangled/gitlistRefUpdates.go b/api/tangled/gitlistRefUpdates.go index 86492863d..baa9f51bf 100644 --- a/api/tangled/gitlistRefUpdates.go +++ b/api/tangled/gitlistRefUpdates.go @@ -26,14 +26,17 @@ type GitListRefUpdates_ListItem struct { type GitListRefUpdates_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*GitListRefUpdates_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // GitListRefUpdates calls the XRPC method "sh.tangled.git.listRefUpdates". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Repo DID whose ref-update records to list. -func GitListRefUpdates(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*GitListRefUpdates_Output, error) { +func GitListRefUpdates(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*GitListRefUpdates_Output, error) { var out GitListRefUpdates_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func GitListRefUpdates(ctx context.Context, c util.LexClient, cursor string, lim if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/gitlistRefUpdatesBy.go b/api/tangled/gitlistRefUpdatesBy.go index 341edc35b..fef424ab1 100644 --- a/api/tangled/gitlistRefUpdatesBy.go +++ b/api/tangled/gitlistRefUpdatesBy.go @@ -18,14 +18,17 @@ const ( type GitListRefUpdatesBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*GitListRefUpdates_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // GitListRefUpdatesBy calls the XRPC method "sh.tangled.git.listRefUpdatesBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose ref-update authorings to list. -func GitListRefUpdatesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*GitListRefUpdatesBy_Output, error) { +func GitListRefUpdatesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*GitListRefUpdatesBy_Output, error) { var out GitListRefUpdatesBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func GitListRefUpdatesBy(ctx context.Context, c util.LexClient, cursor string, l if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/gitmergeCheck.go b/api/tangled/gitmergeCheck.go index ad61b06ba..06d12ce6f 100644 --- a/api/tangled/gitmergeCheck.go +++ b/api/tangled/gitmergeCheck.go @@ -27,15 +27,8 @@ type GitMergeCheck_Input struct { // branch: Target branch to merge into Branch string `json:"branch" cborgen:"branch"` // repo: DID of Git repository - Repo string `json:"repo" cborgen:"repo"` - Source *GitMergeCheck_Input_Source `json:"source" cborgen:"source"` -} - -type GitMergeCheck_Input_Source struct { - // commit: Head commit ID of PR to merge - Commit string `json:"commit" cborgen:"commit"` - // repo: DID of source git repository - Repo string `json:"repo" cborgen:"repo"` + Repo string `json:"repo" cborgen:"repo"` + Source *GitMergeCheck_Source `json:"source" cborgen:"source"` } // GitMergeCheck_Output is the output of a sh.tangled.git.mergeCheck call. @@ -48,6 +41,14 @@ type GitMergeCheck_Output struct { Message *string `json:"message,omitempty" cborgen:"message,omitempty"` } +// GitMergeCheck_Source is a "source" in the sh.tangled.git.mergeCheck schema. +type GitMergeCheck_Source struct { + // commit: Head commit ID of PR to merge + Commit string `json:"commit" cborgen:"commit"` + // repo: DID of source git repository + Repo string `json:"repo" cborgen:"repo"` +} + // GitMergeCheck calls the XRPC method "sh.tangled.git.mergeCheck". func GitMergeCheck(ctx context.Context, c util.LexClient, input *GitMergeCheck_Input) (*GitMergeCheck_Output, error) { var out GitMergeCheck_Output diff --git a/api/tangled/gitmergeCommit.go b/api/tangled/gitmergeCommit.go index 7e9d24f9b..e917fe2da 100644 --- a/api/tangled/gitmergeCommit.go +++ b/api/tangled/gitmergeCommit.go @@ -17,26 +17,30 @@ const ( // GitMergeCommit_Input is the input argument to a sh.tangled.git.mergeCommit call. type GitMergeCommit_Input struct { // mergeCommit: Merge commit content. Used when merge commit is created. - MergeCommit *GitMergeCommit_Input_MergeCommit `json:"mergeCommit,omitempty" cborgen:"mergeCommit,omitempty"` - Source *GitMergeCommit_Input_Source `json:"source" cborgen:"source"` - Style string `json:"style" cborgen:"style"` - Target *GitMergeCommit_Input_Target `json:"target" cborgen:"target"` + MergeCommit *GitMergeCommit_MergeCommitContent `json:"mergeCommit,omitempty" cborgen:"mergeCommit,omitempty"` + Source *GitMergeCommit_Source `json:"source" cborgen:"source"` + Style string `json:"style" cborgen:"style"` + Target *GitMergeCommit_Target `json:"target" cborgen:"target"` } +// GitMergeCommit_MergeCommitContent is a "mergeCommitContent" in the sh.tangled.git.mergeCommit schema. +// // Merge commit content. Used when merge commit is created. -type GitMergeCommit_Input_MergeCommit struct { +type GitMergeCommit_MergeCommitContent struct { Author *GitDefs_Signature `json:"author,omitempty" cborgen:"author,omitempty"` Message *string `json:"message,omitempty" cborgen:"message,omitempty"` } -type GitMergeCommit_Input_Source struct { +// GitMergeCommit_Source is a "source" in the sh.tangled.git.mergeCommit schema. +type GitMergeCommit_Source struct { // commit: Head commit ID to merge Commit string `json:"commit" cborgen:"commit"` // repo: DID of source git repository Repo string `json:"repo" cborgen:"repo"` } -type GitMergeCommit_Input_Target struct { +// GitMergeCommit_Target is a "target" in the sh.tangled.git.mergeCommit schema. +type GitMergeCommit_Target struct { // branch: Target branch to merge into Branch string `json:"branch" cborgen:"branch"` // repo: DID of target git repository diff --git a/api/tangled/gitoid.go b/api/tangled/gitoid.go new file mode 100644 index 000000000..35bc62da6 --- /dev/null +++ b/api/tangled/gitoid.go @@ -0,0 +1,22 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.git.oid + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitOidNSID = "sh.tangled.git.oid" +) + +func init() { + util.RegisterType("sh.tangled.git.oid#main", &GitOid{}) +} // GitOid is a "main" in the sh.tangled.git.oid schema. +// RECORDTYPE: GitOid +type GitOid struct { + LexiconTypeID string `json:"$type,const=sh.tangled.git.oid" cborgen:"$type,const=sh.tangled.git.oid"` + Oid string `json:"oid" cborgen:"oid"` +} diff --git a/api/tangled/graphlistFollows.go b/api/tangled/graphlistFollows.go index b9e631ba8..e097746be 100644 --- a/api/tangled/graphlistFollows.go +++ b/api/tangled/graphlistFollows.go @@ -26,14 +26,17 @@ type GraphListFollows_ListItem struct { type GraphListFollows_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*GraphListFollows_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // GraphListFollows calls the XRPC method "sh.tangled.graph.listFollows". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Followee DID whose inbound follows to list. -func GraphListFollows(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*GraphListFollows_Output, error) { +func GraphListFollows(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*GraphListFollows_Output, error) { var out GraphListFollows_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func GraphListFollows(ctx context.Context, c util.LexClient, cursor string, limi if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/graphlistFollowsBy.go b/api/tangled/graphlistFollowsBy.go index 57eb746e1..a32bba6af 100644 --- a/api/tangled/graphlistFollowsBy.go +++ b/api/tangled/graphlistFollowsBy.go @@ -18,14 +18,17 @@ const ( type GraphListFollowsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*GraphListFollows_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // GraphListFollowsBy calls the XRPC method "sh.tangled.graph.listFollowsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose follow authorings to list. -func GraphListFollowsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*GraphListFollowsBy_Output, error) { +func GraphListFollowsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*GraphListFollowsBy_Output, error) { var out GraphListFollowsBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func GraphListFollowsBy(ctx context.Context, c util.LexClient, cursor string, li if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/graphlistNetworkVouches.go b/api/tangled/graphlistNetworkVouches.go new file mode 100644 index 000000000..86588e02e --- /dev/null +++ b/api/tangled/graphlistNetworkVouches.go @@ -0,0 +1,51 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.graph.listNetworkVouches + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GraphListNetworkVouchesNSID = "sh.tangled.graph.listNetworkVouches" +) + +// GraphListNetworkVouches_ListItem is a "listItem" in the sh.tangled.graph.listNetworkVouches schema. +type GraphListNetworkVouches_ListItem struct { + Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` + Uri string `json:"uri" cborgen:"uri"` + // value: Embedded sh.tangled.graph.vouch record + Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` +} + +// GraphListNetworkVouches_Output is the output of a sh.tangled.graph.listNetworkVouches call. +type GraphListNetworkVouches_Output struct { + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + Items []*GraphListNetworkVouches_ListItem `json:"items" cborgen:"items"` +} + +// GraphListNetworkVouches calls the XRPC method "sh.tangled.graph.listNetworkVouches". +// +// actor: The DID of the profile whose network vouches to list. +// cursor: Pagination cursor +func GraphListNetworkVouches(ctx context.Context, c util.LexClient, actor string, cursor string, limit int64) (*GraphListNetworkVouches_Output, error) { + var out GraphListNetworkVouches_Output + + params := map[string]interface{}{} + params["actor"] = actor + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.graph.listNetworkVouches", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/graphlistVouches.go b/api/tangled/graphlistVouches.go index e44fe594f..47b58daf2 100644 --- a/api/tangled/graphlistVouches.go +++ b/api/tangled/graphlistVouches.go @@ -26,14 +26,17 @@ type GraphListVouches_ListItem struct { type GraphListVouches_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*GraphListVouches_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // GraphListVouches calls the XRPC method "sh.tangled.graph.listVouches". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Vouchee DID whose inbound vouches to list. -func GraphListVouches(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*GraphListVouches_Output, error) { +func GraphListVouches(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*GraphListVouches_Output, error) { var out GraphListVouches_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func GraphListVouches(ctx context.Context, c util.LexClient, cursor string, limi if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/graphlistVouchesBy.go b/api/tangled/graphlistVouchesBy.go index 501bd6ace..222baf5b6 100644 --- a/api/tangled/graphlistVouchesBy.go +++ b/api/tangled/graphlistVouchesBy.go @@ -18,14 +18,17 @@ const ( type GraphListVouchesBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*GraphListVouches_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // GraphListVouchesBy calls the XRPC method "sh.tangled.graph.listVouchesBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose vouch authorings to list. -func GraphListVouchesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*GraphListVouchesBy_Output, error) { +func GraphListVouchesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*GraphListVouchesBy_Output, error) { var out GraphListVouchesBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func GraphListVouchesBy(ctx context.Context, c util.LexClient, cursor string, li if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/knotlistKnots.go b/api/tangled/knotlistKnots.go index 98afeeb17..951be8813 100644 --- a/api/tangled/knotlistKnots.go +++ b/api/tangled/knotlistKnots.go @@ -26,14 +26,17 @@ type KnotListKnots_ListItem struct { type KnotListKnots_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*KnotListKnots_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // KnotListKnots calls the XRPC method "sh.tangled.knot.listKnots". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Owner DID whose knot records to list. -func KnotListKnots(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*KnotListKnots_Output, error) { +func KnotListKnots(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*KnotListKnots_Output, error) { var out KnotListKnots_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func KnotListKnots(ctx context.Context, c util.LexClient, cursor string, limit i if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/knotlistMembers.go b/api/tangled/knotlistMembers.go index 77f111c3c..d45e8b65a 100644 --- a/api/tangled/knotlistMembers.go +++ b/api/tangled/knotlistMembers.go @@ -32,14 +32,17 @@ type KnotListMembers_ListItem struct { type KnotListMembers_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*KnotListMembers_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // KnotListMembers calls the XRPC method "sh.tangled.knot.listMembers". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Knot identifier whose member records to list. -func KnotListMembers(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*KnotListMembers_Output, error) { +func KnotListMembers(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*KnotListMembers_Output, error) { var out KnotListMembers_Output params := map[string]interface{}{} @@ -49,6 +52,9 @@ func KnotListMembers(ctx context.Context, c util.LexClient, cursor string, limit if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/knotlistMembersBy.go b/api/tangled/knotlistMembersBy.go index 114f3d4c7..0f50e8030 100644 --- a/api/tangled/knotlistMembersBy.go +++ b/api/tangled/knotlistMembersBy.go @@ -18,14 +18,17 @@ const ( type KnotListMembersBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*KnotListMembers_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // KnotListMembersBy calls the XRPC method "sh.tangled.knot.listMembersBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose knot-member authorings to list. -func KnotListMembersBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*KnotListMembersBy_Output, error) { +func KnotListMembersBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*KnotListMembersBy_Output, error) { var out KnotListMembersBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func KnotListMembersBy(ctx context.Context, c util.LexClient, cursor string, lim if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/labellistDefinitions.go b/api/tangled/labellistDefinitions.go index 3a5ef442e..c0405f995 100644 --- a/api/tangled/labellistDefinitions.go +++ b/api/tangled/labellistDefinitions.go @@ -26,14 +26,17 @@ type LabelListDefinitions_ListItem struct { type LabelListDefinitions_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*LabelListDefinitions_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // LabelListDefinitions calls the XRPC method "sh.tangled.label.listDefinitions". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Scope identifier whose label definitions to list. -func LabelListDefinitions(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*LabelListDefinitions_Output, error) { +func LabelListDefinitions(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*LabelListDefinitions_Output, error) { var out LabelListDefinitions_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func LabelListDefinitions(ctx context.Context, c util.LexClient, cursor string, if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/labellistOps.go b/api/tangled/labellistOps.go index d3269cd76..6232a8a56 100644 --- a/api/tangled/labellistOps.go +++ b/api/tangled/labellistOps.go @@ -26,14 +26,17 @@ type LabelListOps_ListItem struct { type LabelListOps_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*LabelListOps_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // LabelListOps calls the XRPC method "sh.tangled.label.listOps". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Scope identifier whose label op records to list. -func LabelListOps(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*LabelListOps_Output, error) { +func LabelListOps(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*LabelListOps_Output, error) { var out LabelListOps_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func LabelListOps(ctx context.Context, c util.LexClient, cursor string, limit in if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/labellistOpsBy.go b/api/tangled/labellistOpsBy.go index 0afc92d75..ea0ba2096 100644 --- a/api/tangled/labellistOpsBy.go +++ b/api/tangled/labellistOpsBy.go @@ -18,14 +18,17 @@ const ( type LabelListOpsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*LabelListOps_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // LabelListOpsBy calls the XRPC method "sh.tangled.label.listOpsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose label-op authorings to list. -func LabelListOpsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*LabelListOpsBy_Output, error) { +func LabelListOpsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*LabelListOpsBy_Output, error) { var out LabelListOpsBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func LabelListOpsBy(ctx context.Context, c util.LexClient, cursor string, limit if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/pipelinelistPipelines.go b/api/tangled/pipelinelistPipelines.go index 799b7504b..05176796e 100644 --- a/api/tangled/pipelinelistPipelines.go +++ b/api/tangled/pipelinelistPipelines.go @@ -26,14 +26,17 @@ type PipelineListPipelines_ListItem struct { type PipelineListPipelines_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*PipelineListPipelines_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // PipelineListPipelines calls the XRPC method "sh.tangled.pipeline.listPipelines". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Repo or spindle identifier whose pipeline records to list. -func PipelineListPipelines(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*PipelineListPipelines_Output, error) { +func PipelineListPipelines(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*PipelineListPipelines_Output, error) { var out PipelineListPipelines_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func PipelineListPipelines(ctx context.Context, c util.LexClient, cursor string, if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/pipelinelistPipelinesBy.go b/api/tangled/pipelinelistPipelinesBy.go index 9e5dbd32e..41ca37e75 100644 --- a/api/tangled/pipelinelistPipelinesBy.go +++ b/api/tangled/pipelinelistPipelinesBy.go @@ -18,14 +18,17 @@ const ( type PipelineListPipelinesBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*PipelineListPipelines_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // PipelineListPipelinesBy calls the XRPC method "sh.tangled.pipeline.listPipelinesBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose pipeline authorings to list. -func PipelineListPipelinesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*PipelineListPipelinesBy_Output, error) { +func PipelineListPipelinesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*PipelineListPipelinesBy_Output, error) { var out PipelineListPipelinesBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func PipelineListPipelinesBy(ctx context.Context, c util.LexClient, cursor strin if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/pipelinelistStatuses.go b/api/tangled/pipelinelistStatuses.go index 6ef36fc0d..ad0d3edf4 100644 --- a/api/tangled/pipelinelistStatuses.go +++ b/api/tangled/pipelinelistStatuses.go @@ -26,14 +26,17 @@ type PipelineListStatuses_ListItem struct { type PipelineListStatuses_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*PipelineListStatuses_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // PipelineListStatuses calls the XRPC method "sh.tangled.pipeline.listStatuses". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Pipeline AT-URI whose status records to list. -func PipelineListStatuses(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*PipelineListStatuses_Output, error) { +func PipelineListStatuses(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*PipelineListStatuses_Output, error) { var out PipelineListStatuses_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func PipelineListStatuses(ctx context.Context, c util.LexClient, cursor string, if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/pipelinelistStatusesBy.go b/api/tangled/pipelinelistStatusesBy.go index cf16c1ed6..7200bd7c0 100644 --- a/api/tangled/pipelinelistStatusesBy.go +++ b/api/tangled/pipelinelistStatusesBy.go @@ -18,14 +18,17 @@ const ( type PipelineListStatusesBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*PipelineListStatuses_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // PipelineListStatusesBy calls the XRPC method "sh.tangled.pipeline.listStatusesBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose pipeline-status authorings to list. -func PipelineListStatusesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*PipelineListStatusesBy_Output, error) { +func PipelineListStatusesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*PipelineListStatusesBy_Output, error) { var out PipelineListStatusesBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func PipelineListStatusesBy(ctx context.Context, c util.LexClient, cursor string if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/publicKeylistKeys.go b/api/tangled/publicKeylistKeys.go index cc1806b83..ab6c3b512 100644 --- a/api/tangled/publicKeylistKeys.go +++ b/api/tangled/publicKeylistKeys.go @@ -26,14 +26,17 @@ type PublicKeyListKeys_ListItem struct { type PublicKeyListKeys_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*PublicKeyListKeys_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // PublicKeyListKeys calls the XRPC method "sh.tangled.publicKey.listKeys". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Owner DID whose public-key records to list. -func PublicKeyListKeys(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*PublicKeyListKeys_Output, error) { +func PublicKeyListKeys(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*PublicKeyListKeys_Output, error) { var out PublicKeyListKeys_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func PublicKeyListKeys(ctx context.Context, c util.LexClient, cursor string, lim if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/pulldefs.go b/api/tangled/pulldefs.go new file mode 100644 index 000000000..beb3fc901 --- /dev/null +++ b/api/tangled/pulldefs.go @@ -0,0 +1,48 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.pull.defs + +const () + +// PullDefs_PatchView is a "patchView" in the sh.tangled.pull.defs schema. +type PullDefs_PatchView struct { + Base string `json:"base" cborgen:"base"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Head string `json:"head" cborgen:"head"` +} + +// PullDefs_PullView is a "pullView" in the sh.tangled.pull.defs schema. +type PullDefs_PullView struct { + Author *ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` + Cid string `json:"cid" cborgen:"cid"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Repo *RepoDefs_RepoViewBasic `json:"repo" cborgen:"repo"` + State *string `json:"state,omitempty" cborgen:"state,omitempty"` + TargetBranch string `json:"targetBranch" cborgen:"targetBranch"` + Title string `json:"title" cborgen:"title"` + Uri string `json:"uri" cborgen:"uri"` +} + +// PullDefs_PullViewDetailed is a "pullViewDetailed" in the sh.tangled.pull.defs schema. +type PullDefs_PullViewDetailed struct { + Author *ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` + Body *MarkupMarkdown `json:"body,omitempty" cborgen:"body,omitempty"` + Cid string `json:"cid" cborgen:"cid"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Repo *RepoDefs_RepoViewBasic `json:"repo" cborgen:"repo"` + Source *PullDefs_Source `json:"source,omitempty" cborgen:"source,omitempty"` + State *string `json:"state,omitempty" cborgen:"state,omitempty"` + TargetBranch string `json:"targetBranch" cborgen:"targetBranch"` + Title string `json:"title" cborgen:"title"` + Uri string `json:"uri" cborgen:"uri"` + // versions: TODO: this should be paginated maybe even as a separate `listPatches` method + Versions []*PullDefs_PatchView `json:"versions" cborgen:"versions"` +} + +// PullDefs_Source is a "source" in the sh.tangled.pull.defs schema. +type PullDefs_Source struct { + Branch string `json:"branch" cborgen:"branch"` + Repo *RepoDefs_RepoViewBasic `json:"repo,omitempty" cborgen:"repo,omitempty"` +} diff --git a/api/tangled/pullgetPullView.go b/api/tangled/pullgetPullView.go new file mode 100644 index 000000000..79e9493f2 --- /dev/null +++ b/api/tangled/pullgetPullView.go @@ -0,0 +1,28 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.pull.getPullView + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + PullGetPullViewNSID = "sh.tangled.pull.getPullView" +) + +// PullGetPullView calls the XRPC method "sh.tangled.pull.getPullView". +func PullGetPullView(ctx context.Context, c util.LexClient, uri string) (*PullDefs_PullViewDetailed, error) { + var out PullDefs_PullViewDetailed + + params := map[string]interface{}{} + params["uri"] = uri + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.pull.getPullView", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/pulllistPullViews.go b/api/tangled/pulllistPullViews.go new file mode 100644 index 000000000..daf39845c --- /dev/null +++ b/api/tangled/pulllistPullViews.go @@ -0,0 +1,46 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.pull.listPullViews + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + PullListPullViewsNSID = "sh.tangled.pull.listPullViews" +) + +// PullListPullViews_Output is the output of a sh.tangled.pull.listPullViews call. +type PullListPullViews_Output struct { + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + Items []*PullDefs_PullView `json:"items" cborgen:"items"` +} + +// PullListPullViews calls the XRPC method "sh.tangled.pull.listPullViews". +// +// cursor: Pagination cursor +// subject: Repo DID to list pulls for +func PullListPullViews(ctx context.Context, c util.LexClient, cursor string, limit int64, state string, subject string) (*PullListPullViews_Output, error) { + var out PullListPullViews_Output + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + if state != "" { + params["state"] = state + } + params["subject"] = subject + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.pull.listPullViews", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/queryenrichResponse.go b/api/tangled/queryenrichResponse.go index 2dd5a2768..6a5b06334 100644 --- a/api/tangled/queryenrichResponse.go +++ b/api/tangled/queryenrichResponse.go @@ -20,8 +20,6 @@ type QueryEnrichResponse_Input struct { Enrich []*QueryEnrichResponse_LinkDescriptor `json:"enrich" cborgen:"enrich"` // params: Parameters for the inner query, exactly as it declares them. Params *util.LexiconTypeDecoder `json:"params,omitempty" cborgen:"params,omitempty"` - // sources: Record paths into the inner response restricting which references get payloads. All references are enriched when omitted. - Sources []string `json:"sources,omitempty" cborgen:"sources,omitempty"` // viewer: DID whose own relation to each reference is looked up for viewer payloads. Required when any descriptor requests one. Viewer *string `json:"viewer,omitempty" cborgen:"viewer,omitempty"` // xrpc: NSID of the inner query to run, e.g. sh.tangled.repo.listRepos. @@ -34,6 +32,8 @@ type QueryEnrichResponse_Input struct { type QueryEnrichResponse_LinkDescriptor struct { // source: Collection whose records are linked, a colon, then an index-backed path (subject or .repo). Source string `json:"source" cborgen:"source"` + // targets: Record paths into the inner response selecting references for this payload. All references are considered when omitted. + Targets []string `json:"targets,omitempty" cborgen:"targets,omitempty"` // type: NSID of the payload type to produce, which also defines the payload's shape. Results land at data[ref][source][type]. Type string `json:"type" cborgen:"type"` } diff --git a/api/tangled/repodefs.go b/api/tangled/repodefs.go index e14b83b3f..f95814521 100644 --- a/api/tangled/repodefs.go +++ b/api/tangled/repodefs.go @@ -11,6 +11,7 @@ type RepoDefs_RepoViewBasic struct { CreatedAt string `json:"createdAt" cborgen:"createdAt"` Description *string `json:"description,omitempty" cborgen:"description,omitempty"` Did string `json:"did" cborgen:"did"` + ForkCount *int64 `json:"forkCount,omitempty" cborgen:"forkCount,omitempty"` IsStarred *bool `json:"isStarred,omitempty" cborgen:"isStarred,omitempty"` Owner *ActorDefs_ProfileViewBasic `json:"owner" cborgen:"owner"` Slug string `json:"slug" cborgen:"slug"` @@ -22,5 +23,6 @@ type RepoDefs_RepoViewBasic struct { // // Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests. type RepoDefs_ViewerState struct { + Fork *string `json:"fork,omitempty" cborgen:"fork,omitempty"` Star *string `json:"star,omitempty" cborgen:"star,omitempty"` } diff --git a/api/tangled/repolistArtifacts.go b/api/tangled/repolistArtifacts.go index 44a07c7fe..e067523f1 100644 --- a/api/tangled/repolistArtifacts.go +++ b/api/tangled/repolistArtifacts.go @@ -26,14 +26,17 @@ type RepoListArtifacts_ListItem struct { type RepoListArtifacts_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListArtifacts_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListArtifacts calls the XRPC method "sh.tangled.repo.listArtifacts". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Repo or release identifier whose artifacts to list. -func RepoListArtifacts(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*RepoListArtifacts_Output, error) { +func RepoListArtifacts(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*RepoListArtifacts_Output, error) { var out RepoListArtifacts_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func RepoListArtifacts(ctx context.Context, c util.LexClient, cursor string, lim if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistArtifactsBy.go b/api/tangled/repolistArtifactsBy.go index cb13156f6..3cd43cd45 100644 --- a/api/tangled/repolistArtifactsBy.go +++ b/api/tangled/repolistArtifactsBy.go @@ -18,14 +18,17 @@ const ( type RepoListArtifactsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListArtifacts_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListArtifactsBy calls the XRPC method "sh.tangled.repo.listArtifactsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose artifact authorings to list. -func RepoListArtifactsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*RepoListArtifactsBy_Output, error) { +func RepoListArtifactsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*RepoListArtifactsBy_Output, error) { var out RepoListArtifactsBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func RepoListArtifactsBy(ctx context.Context, c util.LexClient, cursor string, l if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistCollaborators.go b/api/tangled/repolistCollaborators.go index d86db48ed..f2eb55617 100644 --- a/api/tangled/repolistCollaborators.go +++ b/api/tangled/repolistCollaborators.go @@ -32,14 +32,17 @@ type RepoListCollaborators_ListItem struct { type RepoListCollaborators_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListCollaborators_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListCollaborators calls the XRPC method "sh.tangled.repo.listCollaborators". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Repo DID whose collaborator records to list. -func RepoListCollaborators(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*RepoListCollaborators_Output, error) { +func RepoListCollaborators(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*RepoListCollaborators_Output, error) { var out RepoListCollaborators_Output params := map[string]interface{}{} @@ -49,6 +52,9 @@ func RepoListCollaborators(ctx context.Context, c util.LexClient, cursor string, if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistCollaboratorsBy.go b/api/tangled/repolistCollaboratorsBy.go index 7fec8b50c..0bdbaf7b3 100644 --- a/api/tangled/repolistCollaboratorsBy.go +++ b/api/tangled/repolistCollaboratorsBy.go @@ -18,14 +18,17 @@ const ( type RepoListCollaboratorsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListCollaborators_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListCollaboratorsBy calls the XRPC method "sh.tangled.repo.listCollaboratorsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose collaborator authorings to list. -func RepoListCollaboratorsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*RepoListCollaboratorsBy_Output, error) { +func RepoListCollaboratorsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*RepoListCollaboratorsBy_Output, error) { var out RepoListCollaboratorsBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func RepoListCollaboratorsBy(ctx context.Context, c util.LexClient, cursor strin if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistIssues.go b/api/tangled/repolistIssues.go index 297f83e89..4c4f6f37e 100644 --- a/api/tangled/repolistIssues.go +++ b/api/tangled/repolistIssues.go @@ -32,16 +32,19 @@ type RepoListIssues_IssueListItem struct { type RepoListIssues_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListIssues_IssueListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListIssues calls the XRPC method "sh.tangled.repo.listIssues". // // author: Restrict to issues authored by this user DID. // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // state: Restrict to issues whose latest derived state matches. // subject: Repo DID to list issues for -func RepoListIssues(ctx context.Context, c util.LexClient, author string, cursor string, limit int64, order string, state string, subject string) (*RepoListIssues_Output, error) { +func RepoListIssues(ctx context.Context, c util.LexClient, author string, cursor string, limit int64, offset int64, order string, state string, subject string) (*RepoListIssues_Output, error) { var out RepoListIssues_Output params := map[string]interface{}{} @@ -54,6 +57,9 @@ func RepoListIssues(ctx context.Context, c util.LexClient, author string, cursor if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistIssuesBy.go b/api/tangled/repolistIssuesBy.go index c05ea7cef..7091b37c8 100644 --- a/api/tangled/repolistIssuesBy.go +++ b/api/tangled/repolistIssuesBy.go @@ -18,15 +18,18 @@ const ( type RepoListIssuesBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListIssues_IssueListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListIssuesBy calls the XRPC method "sh.tangled.repo.listIssuesBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // state: Restrict to issues whose latest derived state matches. // subject: Actor DID whose issue authorings to list -func RepoListIssuesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, state string, subject string) (*RepoListIssuesBy_Output, error) { +func RepoListIssuesBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, state string, subject string) (*RepoListIssuesBy_Output, error) { var out RepoListIssuesBy_Output params := map[string]interface{}{} @@ -36,6 +39,9 @@ func RepoListIssuesBy(ctx context.Context, c util.LexClient, cursor string, limi if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistPulls.go b/api/tangled/repolistPulls.go index 8ba707ac7..d5e516f90 100644 --- a/api/tangled/repolistPulls.go +++ b/api/tangled/repolistPulls.go @@ -18,6 +18,8 @@ const ( type RepoListPulls_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListPulls_PullListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListPulls_PullListItem is a "pullListItem" in the sh.tangled.repo.listPulls schema. @@ -38,10 +40,11 @@ type RepoListPulls_PullListItem struct { // // author: Restrict to pulls authored by this user DID. // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // status: Restrict to pulls whose latest derived status matches. // subject: Repo DID to list pulls for -func RepoListPulls(ctx context.Context, c util.LexClient, author string, cursor string, limit int64, order string, status string, subject string) (*RepoListPulls_Output, error) { +func RepoListPulls(ctx context.Context, c util.LexClient, author string, cursor string, limit int64, offset int64, order string, status string, subject string) (*RepoListPulls_Output, error) { var out RepoListPulls_Output params := map[string]interface{}{} @@ -54,6 +57,9 @@ func RepoListPulls(ctx context.Context, c util.LexClient, author string, cursor if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistPullsBy.go b/api/tangled/repolistPullsBy.go index 6b2b93e6a..c10c59bc5 100644 --- a/api/tangled/repolistPullsBy.go +++ b/api/tangled/repolistPullsBy.go @@ -18,15 +18,18 @@ const ( type RepoListPullsBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListPulls_PullListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListPullsBy calls the XRPC method "sh.tangled.repo.listPullsBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // status: Restrict to pulls whose latest derived status matches. // subject: Actor DID whose pull authorings to list -func RepoListPullsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, status string, subject string) (*RepoListPullsBy_Output, error) { +func RepoListPullsBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, status string, subject string) (*RepoListPullsBy_Output, error) { var out RepoListPullsBy_Output params := map[string]interface{}{} @@ -36,6 +39,9 @@ func RepoListPullsBy(ctx context.Context, c util.LexClient, cursor string, limit if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repolistRepos.go b/api/tangled/repolistRepos.go index c507d136f..c6cb3883f 100644 --- a/api/tangled/repolistRepos.go +++ b/api/tangled/repolistRepos.go @@ -26,14 +26,17 @@ type RepoListRepos_ListItem struct { type RepoListRepos_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*RepoListRepos_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // RepoListRepos calls the XRPC method "sh.tangled.repo.listRepos". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Owner DID whose repo records to list. -func RepoListRepos(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*RepoListRepos_Output, error) { +func RepoListRepos(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*RepoListRepos_Output, error) { var out RepoListRepos_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func RepoListRepos(ctx context.Context, c util.LexClient, cursor string, limit i if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/repopull.go b/api/tangled/repopull.go index 1530d96fd..5925d98b3 100644 --- a/api/tangled/repopull.go +++ b/api/tangled/repopull.go @@ -55,8 +55,8 @@ type RepoPull_Target struct { // RepoPull_Version is a "version" in the sh.tangled.repo.pull schema. type RepoPull_Version struct { // base: merge-base commit ID for combined interdiff - Base *string `json:"base,omitempty" cborgen:"base,omitempty"` - CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Base string `json:"base" cborgen:"base"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` // head: HEAD commit ID Head string `json:"head" cborgen:"head"` } diff --git a/api/tangled/searchquery.go b/api/tangled/searchquery.go index 3aede6533..6045d5f63 100644 --- a/api/tangled/searchquery.go +++ b/api/tangled/searchquery.go @@ -37,11 +37,12 @@ type SearchQuery_Output struct { // author: Restrict to records authored by this DID. // cursor: Pagination cursor // nsid: Restrict to records of this collection. +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // q: Full-text search query. // repo: Restrict to records under this repo DID. // since: Restrict to records created at or after this time. // until: Restrict to records created at or before this time. -func SearchQuery(ctx context.Context, c util.LexClient, author string, cursor string, limit int64, nsid string, q string, repo string, since string, until string) (*SearchQuery_Output, error) { +func SearchQuery(ctx context.Context, c util.LexClient, author string, cursor string, limit int64, nsid string, offset int64, q string, repo string, since string, until string) (*SearchQuery_Output, error) { var out SearchQuery_Output params := map[string]interface{}{} @@ -57,6 +58,9 @@ func SearchQuery(ctx context.Context, c util.LexClient, author string, cursor st if nsid != "" { params["nsid"] = nsid } + if offset != 0 { + params["offset"] = offset + } params["q"] = q if repo != "" { params["repo"] = repo diff --git a/api/tangled/spindlelistMembers.go b/api/tangled/spindlelistMembers.go index 53771a78b..d6b2a9b36 100644 --- a/api/tangled/spindlelistMembers.go +++ b/api/tangled/spindlelistMembers.go @@ -26,14 +26,17 @@ type SpindleListMembers_ListItem struct { type SpindleListMembers_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*SpindleListMembers_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // SpindleListMembers calls the XRPC method "sh.tangled.spindle.listMembers". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Spindle identifier whose member records to list. -func SpindleListMembers(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*SpindleListMembers_Output, error) { +func SpindleListMembers(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*SpindleListMembers_Output, error) { var out SpindleListMembers_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func SpindleListMembers(ctx context.Context, c util.LexClient, cursor string, li if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/spindlelistMembersBy.go b/api/tangled/spindlelistMembersBy.go index b8fb86118..2eb60d375 100644 --- a/api/tangled/spindlelistMembersBy.go +++ b/api/tangled/spindlelistMembersBy.go @@ -18,14 +18,17 @@ const ( type SpindleListMembersBy_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*SpindleListMembers_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // SpindleListMembersBy calls the XRPC method "sh.tangled.spindle.listMembersBy". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Actor DID whose spindle-member authorings to list. -func SpindleListMembersBy(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*SpindleListMembersBy_Output, error) { +func SpindleListMembersBy(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*SpindleListMembersBy_Output, error) { var out SpindleListMembersBy_Output params := map[string]interface{}{} @@ -35,6 +38,9 @@ func SpindleListMembersBy(ctx context.Context, c util.LexClient, cursor string, if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/spindlelistSpindles.go b/api/tangled/spindlelistSpindles.go index 5b8cbaaaf..6a52aee08 100644 --- a/api/tangled/spindlelistSpindles.go +++ b/api/tangled/spindlelistSpindles.go @@ -26,14 +26,17 @@ type SpindleListSpindles_ListItem struct { type SpindleListSpindles_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*SpindleListSpindles_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // SpindleListSpindles calls the XRPC method "sh.tangled.spindle.listSpindles". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Owner DID whose spindle records to list. -func SpindleListSpindles(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*SpindleListSpindles_Output, error) { +func SpindleListSpindles(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*SpindleListSpindles_Output, error) { var out SpindleListSpindles_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func SpindleListSpindles(ctx context.Context, c util.LexClient, cursor string, l if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/stringlistStrings.go b/api/tangled/stringlistStrings.go index 3f79d87e9..e623281ef 100644 --- a/api/tangled/stringlistStrings.go +++ b/api/tangled/stringlistStrings.go @@ -26,14 +26,17 @@ type StringListStrings_ListItem struct { type StringListStrings_Output struct { Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` Items []*StringListStrings_ListItem `json:"items" cborgen:"items"` + // total: Total items in the full list; omitted for filtered or merged views + Total *int64 `json:"total,omitempty" cborgen:"total,omitempty"` } // StringListStrings calls the XRPC method "sh.tangled.string.listStrings". // // cursor: Pagination cursor +// offset: Absolute offset for random-access pagination. Mutually exclusive with cursor; offsets drift under concurrent writes, so follow up with the returned cursor. // order: Sort direction by createdAt. // subject: Scope identifier whose string records to list. -func StringListStrings(ctx context.Context, c util.LexClient, cursor string, limit int64, order string, subject string) (*StringListStrings_Output, error) { +func StringListStrings(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, subject string) (*StringListStrings_Output, error) { var out StringListStrings_Output params := map[string]interface{}{} @@ -43,6 +46,9 @@ func StringListStrings(ctx context.Context, c util.LexClient, cursor string, lim if limit != 0 { params["limit"] = limit } + if offset != 0 { + params["offset"] = offset + } if order != "" { params["order"] = order } diff --git a/api/tangled/temp2getDiff.go b/api/tangled/temp2getDiff.go new file mode 100644 index 000000000..760cb8331 --- /dev/null +++ b/api/tangled/temp2getDiff.go @@ -0,0 +1,36 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.git.temp2.getDiff + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitTemp2GetDiffNSID = "sh.tangled.git.temp2.getDiff" +) + +// GitTemp2GetDiff_Output is the output of a sh.tangled.git.temp2.getDiff call. +type GitTemp2GetDiff_Output struct { + Diffs []*GitDefs_FileDiff `json:"diffs" cborgen:"diffs"` +} + +// GitTemp2GetDiff calls the XRPC method "sh.tangled.git.temp2.getDiff". +func GitTemp2GetDiff(ctx context.Context, c util.LexClient, baseCommit string, baseRepo string, headCommit string, headRepo string) (*GitTemp2GetDiff_Output, error) { + var out GitTemp2GetDiff_Output + + params := map[string]interface{}{} + params["baseCommit"] = baseCommit + params["baseRepo"] = baseRepo + params["headCommit"] = headCommit + params["headRepo"] = headRepo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp2.getDiff", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/temp2getInterdiff.go b/api/tangled/temp2getInterdiff.go new file mode 100644 index 000000000..9ff4c96cb --- /dev/null +++ b/api/tangled/temp2getInterdiff.go @@ -0,0 +1,38 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.git.temp2.getInterdiff + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitTemp2GetInterdiffNSID = "sh.tangled.git.temp2.getInterdiff" +) + +// GitTemp2GetInterdiff_Output is the output of a sh.tangled.git.temp2.getInterdiff call. +type GitTemp2GetInterdiff_Output struct { + Diffs []*GitDefs_FileDiff `json:"diffs" cborgen:"diffs"` +} + +// GitTemp2GetInterdiff calls the XRPC method "sh.tangled.git.temp2.getInterdiff". +func GitTemp2GetInterdiff(ctx context.Context, c util.LexClient, baseCommit1 string, baseCommit2 string, baseRepo string, headCommit1 string, headCommit2 string, headRepo string) (*GitTemp2GetInterdiff_Output, error) { + var out GitTemp2GetInterdiff_Output + + params := map[string]interface{}{} + params["baseCommit1"] = baseCommit1 + params["baseCommit2"] = baseCommit2 + params["baseRepo"] = baseRepo + params["headCommit1"] = headCommit1 + params["headCommit2"] = headCommit2 + params["headRepo"] = headRepo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp2.getInterdiff", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/temp2listCommits.go b/api/tangled/temp2listCommits.go new file mode 100644 index 000000000..c95bd6c9b --- /dev/null +++ b/api/tangled/temp2listCommits.go @@ -0,0 +1,72 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.git.temp2.listCommits + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitTemp2ListCommitsNSID = "sh.tangled.git.temp2.listCommits" +) + +// GitTemp2ListCommits_Commit is a "commit" in the sh.tangled.git.temp2.listCommits schema. +type GitTemp2ListCommits_Commit struct { + Author *GitDefs_Signature `json:"author" cborgen:"author"` + Committer *GitDefs_Signature `json:"committer" cborgen:"committer"` + ExtraHeaders []*GitTemp2ListCommits_Header `json:"extraHeaders" cborgen:"extraHeaders"` + Message string `json:"message" cborgen:"message"` + Oid string `json:"oid" cborgen:"oid"` + Parents []string `json:"parents" cborgen:"parents"` + Tree string `json:"tree" cborgen:"tree"` +} + +// GitTemp2ListCommits_Header is a "header" in the sh.tangled.git.temp2.listCommits schema. +type GitTemp2ListCommits_Header struct { + Key string `json:"key" cborgen:"key"` + Value string `json:"value" cborgen:"value"` +} + +// GitTemp2ListCommits_Output is the output of a sh.tangled.git.temp2.listCommits call. +type GitTemp2ListCommits_Output struct { + Commits []*GitTemp2ListCommits_Commit `json:"commits" cborgen:"commits"` +} + +// GitTemp2ListCommits calls the XRPC method "sh.tangled.git.temp2.listCommits". +// +// limit: Maximum number of commits to return +// repo: DID of the repository +// skip: Number of matching commits to skip. A poor man's pagination. +func GitTemp2ListCommits(ctx context.Context, c util.LexClient, after string, allRefs bool, before string, limit int64, ranges []string, repo string, skip int64) (*GitTemp2ListCommits_Output, error) { + var out GitTemp2ListCommits_Output + + params := map[string]interface{}{} + if after != "" { + params["after"] = after + } + if allRefs { + params["allRefs"] = allRefs + } + if before != "" { + params["before"] = before + } + if limit != 0 { + params["limit"] = limit + } + if len(ranges) != 0 { + params["ranges"] = ranges + } + params["repo"] = repo + if skip != 0 { + params["skip"] = skip + } + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp2.listCommits", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/temp2mergeCheck.go b/api/tangled/temp2mergeCheck.go new file mode 100644 index 000000000..73fa54eb6 --- /dev/null +++ b/api/tangled/temp2mergeCheck.go @@ -0,0 +1,51 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.git.temp2.mergeCheck + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitTemp2MergeCheckNSID = "sh.tangled.git.temp2.mergeCheck" +) + +// GitTemp2MergeCheck_Conflict is a "conflict" in the sh.tangled.git.temp2.mergeCheck schema. +type GitTemp2MergeCheck_Conflict struct { + // filename: Path of the conflicted file + Filename string `json:"filename" cborgen:"filename"` + // reason: Short classification of the conflict + Reason string `json:"reason" cborgen:"reason"` +} + +// GitTemp2MergeCheck_Output is the output of a sh.tangled.git.temp2.mergeCheck call. +type GitTemp2MergeCheck_Output struct { + Conflicts []*GitTemp2MergeCheck_Conflict `json:"conflicts" cborgen:"conflicts"` + // isConflicted: Whether the merge has unresolved conflicts + IsConflicted bool `json:"isConflicted" cborgen:"isConflicted"` + // message: Additional detail, e.g. unrelated histories + Message *string `json:"message,omitempty" cborgen:"message,omitempty"` +} + +// GitTemp2MergeCheck calls the XRPC method "sh.tangled.git.temp2.mergeCheck". +// +// sourceCommit: Source commit to merge (theirs) +// targetCommit: Target branch tip to merge into (ours) +func GitTemp2MergeCheck(ctx context.Context, c util.LexClient, sourceCommit string, sourceRepo string, targetCommit string, targetRepo string) (*GitTemp2MergeCheck_Output, error) { + var out GitTemp2MergeCheck_Output + + params := map[string]interface{}{} + params["sourceCommit"] = sourceCommit + params["sourceRepo"] = sourceRepo + params["targetCommit"] = targetCommit + params["targetRepo"] = targetRepo + if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp2.mergeCheck", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/cmd/cborgen/cborgen.go b/cmd/cborgen/cborgen.go index 4cbd5edc6..7c501a48a 100644 --- a/cmd/cborgen/cborgen.go +++ b/cmd/cborgen/cborgen.go @@ -2,6 +2,7 @@ package main import ( cbg "github.com/whyrusleeping/cbor-gen" + "tangled.org/core/api/org_tangled" "tangled.org/core/api/tangled" ) @@ -23,14 +24,13 @@ func main() { tangled.CiTrigger_Pair{}, tangled.CiTrigger_PullRequest{}, tangled.CiTrigger_Push{}, + tangled.EmbedCommit{}, tangled.FeedComment{}, tangled.FeedReaction{}, tangled.FeedStar{}, tangled.FeedStar_Repo{}, tangled.FeedStar_String{}, - tangled.FeedSubscription{}, - tangled.FeedSubscription_Uri{}, - tangled.FeedSubscription_Repo{}, + tangled.GitOid{}, tangled.GitRefUpdate{}, tangled.GitRefUpdate_CommitCountBreakdown{}, tangled.GitRefUpdate_IndividualEmailCommitCount{}, @@ -80,4 +80,14 @@ func main() { ); err != nil { panic(err) } + + if err := genCfg.WriteMapEncodersToFile( + "api/org_tangled/cbor_gen.go", + "org_tangled", + org_tangled.FeedSubscription{}, + org_tangled.FeedSubscription_Record{}, + org_tangled.FeedSubscription_Repo{}, + ); err != nil { + panic(err) + } } diff --git a/flake.nix b/flake.nix index e218e4865..b37cbf77d 100644 --- a/flake.nix +++ b/flake.nix @@ -648,7 +648,7 @@ program = (pkgs.writeShellApplication { name = "lexgen"; - runtimeInputs = [pkgs.stdenv.cc]; + runtimeInputs = [pkgs.stdenv.cc pkgs.gnused]; text = '' if ! command -v lexgen > /dev/null; then echo "error: must be executed from devshell" @@ -662,22 +662,22 @@ cd "$rootDir" # *_ext.go are hand-written extensions; never remove or mutate them - find api/tangled -maxdepth 1 -type f -not -name '*_ext.go' -delete + find api/tangled api/org_tangled -maxdepth 1 -type f -not -name '*_ext.go' -delete lexgen --build-file lexicon-build-config.json lexicons # disable type registration temporarily while running cborgen - find api/tangled -maxdepth 1 -name '*.go' -not -name '*_ext.go' -exec \ + find api/tangled api/org_tangled -maxdepth 1 -name '*.go' -not -name '*_ext.go' -exec \ sed -i.bak 's/\tutil/\/\/\tutil/' {} + # lexgen generates incomplete Marshaler/Unmarshaler for union types - find api/tangled -maxdepth 1 -name '*.go' -not -name '*_ext.go' -not -name "cbor_gen.go" -exec \ + find api/tangled api/org_tangled -maxdepth 1 -name '*.go' -not -name '*_ext.go' -not -name "cbor_gen.go" -exec \ sed -i '/^func.*\(MarshalCBOR\|UnmarshalCBOR\)/,/^}/ s/^/\/\/ /' {} + - for f in api/tangled/*_ext.go; do [ -e "''$f" ] && mv "''$f" "''$f.bak"; done - ${pkgs.gotools}/bin/goimports -w api/tangled/* + for f in api/tangled/*_ext.go api/org_tangled/*_ext.go; do [ -e "''$f" ] || continue; mv "''$f" "''$f.bak"; done + ${pkgs.gotools}/bin/goimports -w api/tangled/* api/org_tangled/* CGO_ENABLED=1 go run ./cmd/cborgen/ - for f in api/tangled/*_ext.go.bak; do [ -e "''$f" ] && mv "''$f" "''${f%.bak}"; done + for f in api/tangled/*_ext.go.bak api/org_tangled/*_ext.go.bak; do [ -e "''$f" ] || continue; mv "''$f" "''${f%.bak}"; done lexgen --build-file lexicon-build-config.json lexicons - rm api/tangled/*.bak + rm -f api/tangled/*.bak api/org_tangled/*.bak ''; }) + /bin/lexgen; diff --git a/lexicon-build-config.json b/lexicon-build-config.json index f0c905c42..8af0ae39f 100644 --- a/lexicon-build-config.json +++ b/lexicon-build-config.json @@ -13,10 +13,10 @@ "gen-server": true }, { - "package": "tangled", + "package": "org_tangled", "prefix": "org.tangled", - "outdir": "api/tangled", - "import": "tangled.org/core/api/tangled", + "outdir": "api/org_tangled", + "import": "tangled.org/core/api/org_tangled", "gen-server": true } ] diff --git a/lexicons/feed/subscription.json b/lexicons/feed/subscription.json index 6b7595da9..21856811b 100644 --- a/lexicons/feed/subscription.json +++ b/lexicons/feed/subscription.json @@ -14,14 +14,9 @@ "properties": { "subject": { "type": "union", - "refs": ["#uri", "#repo"], + "refs": ["#record", "#repo"], "closed": true }, - "collections": { - "type": "array", - "items": { "type": "string" }, - "description": "Optional collection NSIDs to filter which notifications are sent. Empty or absent means all collections." - }, "createdAt": { "type": "string", "format": "datetime" @@ -29,7 +24,7 @@ } } }, - "uri": { + "record": { "type": "object", "required": ["uri"], "properties": {