diff --git a/api/org_tangled/actordefs.go b/api/org_tangled/actordefs.go index 84b42a578..e12948a6a 100644 --- a/api/org_tangled/actordefs.go +++ b/api/org_tangled/actordefs.go @@ -2,22 +2,22 @@ package org_tangled -// schema: org.tangled.temp.actor.defs +// schema: org.tangled.actor.defs const () -// TempActorDefs_SavedKnotPref is a "savedKnotPref" in the org.tangled.temp.actor.defs schema. -type TempActorDefs_SavedKnotPref struct { - Items []*TempActorDefs_SavedService `json:"items" cborgen:"items"` +// ActorDefs_ProfileViewBasic is a "profileViewBasic" in the org.tangled.actor.defs schema. +type ActorDefs_ProfileViewBasic struct { + Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"` + Did string `json:"did" cborgen:"did"` + Handle string `json:"handle" cborgen:"handle"` + Viewer *ActorDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` } -// TempActorDefs_SavedService is a "savedService" in the org.tangled.temp.actor.defs schema. -type TempActorDefs_SavedService struct { - Id string `json:"id" cborgen:"id"` - Value string `json:"value" cborgen:"value"` -} - -// TempActorDefs_SavedSpindlePref is a "savedSpindlePref" in the org.tangled.temp.actor.defs schema. -type TempActorDefs_SavedSpindlePref struct { - Items []*TempActorDefs_SavedService `json:"items" cborgen:"items"` +// ActorDefs_ViewerState is a "viewerState" in the org.tangled.actor.defs schema. +// +// Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. +type ActorDefs_ViewerState struct { + FollowedBy *string `json:"followedBy,omitempty" cborgen:"followedBy,omitempty"` + Following *string `json:"following,omitempty" cborgen:"following,omitempty"` } diff --git a/api/org_tangled/actorprofile.go b/api/org_tangled/actorprofile.go new file mode 100644 index 000000000..3b44abe22 --- /dev/null +++ b/api/org_tangled/actorprofile.go @@ -0,0 +1,39 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.actor.profile + +import ( + comatprototypes "github.com/bluesky-social/indigo/api/atproto" + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + ActorProfileNSID = "org.tangled.actor.profile" +) + +func init() { + util.RegisterType("org.tangled.actor.profile", &ActorProfile{}) +} // +// RECORDTYPE: ActorProfile +type ActorProfile struct { + LexiconTypeID string `json:"$type,const=org.tangled.actor.profile" cborgen:"$type,const=org.tangled.actor.profile"` + // avatar: Small image to be displayed next to posts from account. AKA, 'profile picture' + Avatar *util.LexBlob `json:"avatar,omitempty" cborgen:"avatar,omitempty"` + // description: Free-form profile description text. + Description *string `json:"description,omitempty" cborgen:"description,omitempty"` + IsOrganization *bool `json:"isOrganization,omitempty" cborgen:"isOrganization,omitempty"` + // labels: Self-label values for this record. Most common use-case is 'bot'. + Labels *comatprototypes.LabelDefs_SelfLabels `json:"labels,omitempty" cborgen:"labels,omitempty"` + Links []string `json:"links,omitempty" cborgen:"links,omitempty"` + // location: Free-form location text. + Location *string `json:"location,omitempty" cborgen:"location,omitempty"` + // pinnedRepositories: Pinned repositories. Values are repo DIDs for repos that have them, or AT-URIs for legacy repos. + PinnedRepositories []string `json:"pinnedRepositories,omitempty" cborgen:"pinnedRepositories,omitempty"` + // preferredHandle: A handle the user prefers to be displayed as. + PreferredHandle *string `json:"preferredHandle,omitempty" cborgen:"preferredHandle,omitempty"` + // pronouns: Preferred gender pronouns. + Pronouns *string `json:"pronouns,omitempty" cborgen:"pronouns,omitempty"` + Stats []string `json:"stats,omitempty" cborgen:"stats,omitempty"` +} diff --git a/api/org_tangled/cbor_gen.go b/api/org_tangled/cbor_gen.go index 97f8fabe0..ba74dc895 100644 --- a/api/org_tangled/cbor_gen.go +++ b/api/org_tangled/cbor_gen.go @@ -8,6 +8,8 @@ import ( "math" "sort" + atproto "github.com/bluesky-social/indigo/api/atproto" + util "github.com/bluesky-social/indigo/lex/util" cid "github.com/ipfs/go-cid" cbg "github.com/whyrusleeping/cbor-gen" xerrors "golang.org/x/xerrors" @@ -18,28 +20,52 @@ var _ = cid.Undef var _ = math.E var _ = sort.Sort -func (t *CiSubscribePipelineLogs_Control) MarshalCBOR(w io.Writer) error { +func (t *ActorProfile) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } cw := cbg.NewCborWriter(w) - fieldCount := 8 + fieldCount := 11 - if t.Command == nil { + if t.Avatar == nil { fieldCount-- } - if t.Kind == nil { + if t.Description == nil { fieldCount-- } - if t.Outcome == nil { + if t.IsOrganization == nil { fieldCount-- } - if t.Status == nil { + if t.Labels == nil { + fieldCount-- + } + + if t.Links == nil { + fieldCount-- + } + + if t.Location == nil { + fieldCount-- + } + + if t.PinnedRepositories == nil { + fieldCount-- + } + + if t.PreferredHandle == nil { + fieldCount-- + } + + if t.Pronouns == nil { + fieldCount-- + } + + if t.Stats == nil { fieldCount-- } @@ -47,229 +73,328 @@ func (t *CiSubscribePipelineLogs_Control) MarshalCBOR(w io.Writer) error { return err } - // t.Kind (string) (string) - if t.Kind != nil { + // t.LexiconTypeID (string) (string) + if len("$type") > 1000000 { + return xerrors.Errorf("Value in field \"$type\" was too long") + } - if len("kind") > 1000000 { - return xerrors.Errorf("Value in field \"kind\" 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.actor.profile"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.actor.profile")); err != nil { + return err + } + + // t.Links ([]string) (slice) + if t.Links != nil { + + if len("links") > 1000000 { + return xerrors.Errorf("Value in field \"links\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("kind"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("links"))); err != nil { return err } - if _, err := cw.WriteString(string("kind")); err != nil { + if _, err := cw.WriteString(string("links")); err != nil { return err } - if t.Kind == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { + if len(t.Links) > 8192 { + return xerrors.Errorf("Slice value in field t.Links was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Links))); err != nil { + return err + } + for _, v := range t.Links { + 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 } - } else { - if len(*t.Kind) > 1000000 { - return xerrors.Errorf("Value in field t.Kind was too long") + if _, err := cw.WriteString(string(v)); err != nil { + return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Kind))); err != nil { + } + } + + // t.Stats ([]string) (slice) + if t.Stats != nil { + + if len("stats") > 1000000 { + return xerrors.Errorf("Value in field \"stats\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("stats"))); err != nil { + return err + } + if _, err := cw.WriteString(string("stats")); err != nil { + return err + } + + if len(t.Stats) > 8192 { + return xerrors.Errorf("Slice value in field t.Stats was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Stats))); err != nil { + return err + } + for _, v := range t.Stats { + 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(*t.Kind)); err != nil { + if _, err := cw.WriteString(string(v)); err != nil { return err } + } } - // t.Step (int64) (int64) - if len("step") > 1000000 { - return xerrors.Errorf("Value in field \"step\" was too long") - } + // t.Avatar (util.LexBlob) (struct) + if t.Avatar != nil { - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("step"))); err != nil { - return err - } - if _, err := cw.WriteString(string("step")); err != nil { - return err - } + if len("avatar") > 1000000 { + return xerrors.Errorf("Value in field \"avatar\" was too long") + } - if t.Step >= 0 { - if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Step)); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("avatar"))); err != nil { return err } - } else { - if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Step-1)); err != nil { + if _, err := cw.WriteString(string("avatar")); err != nil { return err } - } - // t.Time (string) (string) - if len("time") > 1000000 { - return xerrors.Errorf("Value in field \"time\" was too long") + if err := t.Avatar.MarshalCBOR(cw); err != nil { + return err + } } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("time"))); err != nil { - return err - } - if _, err := cw.WriteString(string("time")); err != nil { - return err - } + // t.Labels (atproto.LabelDefs_SelfLabels) (struct) + if t.Labels != nil { - if len(t.Time) > 1000000 { - return xerrors.Errorf("Value in field t.Time was too long") - } + if len("labels") > 1000000 { + return xerrors.Errorf("Value in field \"labels\" was too long") + } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Time))); err != nil { - return err - } - if _, err := cw.WriteString(string(t.Time)); err != nil { - return err + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("labels"))); err != nil { + return err + } + if _, err := cw.WriteString(string("labels")); err != nil { + return err + } + + if err := t.Labels.MarshalCBOR(cw); err != nil { + return err + } } - // t.Status (string) (string) - if t.Status != nil { + // t.Location (string) (string) + if t.Location != nil { - if len("status") > 1000000 { - return xerrors.Errorf("Value in field \"status\" was too long") + if len("location") > 1000000 { + return xerrors.Errorf("Value in field \"location\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("location"))); err != nil { return err } - if _, err := cw.WriteString(string("status")); err != nil { + if _, err := cw.WriteString(string("location")); err != nil { return err } - if t.Status == nil { + if t.Location == nil { if _, err := cw.Write(cbg.CborNull); err != nil { return err } } else { - if len(*t.Status) > 1000000 { - return xerrors.Errorf("Value in field t.Status was too long") + if len(*t.Location) > 1000000 { + return xerrors.Errorf("Value in field t.Location was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Status))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Location))); err != nil { return err } - if _, err := cw.WriteString(string(*t.Status)); err != nil { + if _, err := cw.WriteString(string(*t.Location)); err != nil { return err } } } - // t.Command (string) (string) - if t.Command != nil { + // t.Pronouns (string) (string) + if t.Pronouns != nil { - if len("command") > 1000000 { - return xerrors.Errorf("Value in field \"command\" was too long") + if len("pronouns") > 1000000 { + return xerrors.Errorf("Value in field \"pronouns\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("command"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pronouns"))); err != nil { return err } - if _, err := cw.WriteString(string("command")); err != nil { + if _, err := cw.WriteString(string("pronouns")); err != nil { return err } - if t.Command == nil { + if t.Pronouns == nil { if _, err := cw.Write(cbg.CborNull); err != nil { return err } } else { - if len(*t.Command) > 1000000 { - return xerrors.Errorf("Value in field t.Command was too long") + if len(*t.Pronouns) > 1000000 { + return xerrors.Errorf("Value in field t.Pronouns was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Command))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Pronouns))); err != nil { return err } - if _, err := cw.WriteString(string(*t.Command)); err != nil { + if _, err := cw.WriteString(string(*t.Pronouns)); err != nil { return err } } } - // t.Content (string) (string) - if len("content") > 1000000 { - return xerrors.Errorf("Value in field \"content\" was too long") - } + // t.Description (string) (string) + if t.Description != nil { - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("content"))); err != nil { - return err - } - if _, err := cw.WriteString(string("content")); err != nil { - return err - } + if len("description") > 1000000 { + return xerrors.Errorf("Value in field \"description\" was too long") + } - if len(t.Content) > 1000000 { - return xerrors.Errorf("Value in field t.Content was too long") - } + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("description"))); err != nil { + return err + } + if _, err := cw.WriteString(string("description")); err != nil { + return err + } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Content))); err != nil { - return err + if t.Description == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.Description) > 1000000 { + return xerrors.Errorf("Value in field t.Description was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Description))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.Description)); err != nil { + return err + } + } } - if _, err := cw.WriteString(string(t.Content)); err != nil { - return err + + // t.IsOrganization (bool) (bool) + if t.IsOrganization != nil { + + if len("isOrganization") > 1000000 { + return xerrors.Errorf("Value in field \"isOrganization\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("isOrganization"))); err != nil { + return err + } + if _, err := cw.WriteString(string("isOrganization")); err != nil { + return err + } + + if t.IsOrganization == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if err := cbg.WriteBool(w, *t.IsOrganization); err != nil { + return err + } + } } - // t.Outcome (string) (string) - if t.Outcome != nil { + // t.PreferredHandle (string) (string) + if t.PreferredHandle != nil { - if len("outcome") > 1000000 { - return xerrors.Errorf("Value in field \"outcome\" was too long") + if len("preferredHandle") > 1000000 { + return xerrors.Errorf("Value in field \"preferredHandle\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("outcome"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("preferredHandle"))); err != nil { return err } - if _, err := cw.WriteString(string("outcome")); err != nil { + if _, err := cw.WriteString(string("preferredHandle")); err != nil { return err } - if t.Outcome == nil { + if t.PreferredHandle == nil { if _, err := cw.Write(cbg.CborNull); err != nil { return err } } else { - if len(*t.Outcome) > 1000000 { - return xerrors.Errorf("Value in field t.Outcome was too long") + if len(*t.PreferredHandle) > 1000000 { + return xerrors.Errorf("Value in field t.PreferredHandle was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Outcome))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.PreferredHandle))); err != nil { return err } - if _, err := cw.WriteString(string(*t.Outcome)); err != nil { + if _, err := cw.WriteString(string(*t.PreferredHandle)); err != nil { return err } } } - // t.Workflow (string) (string) - if len("workflow") > 1000000 { - return xerrors.Errorf("Value in field \"workflow\" was too long") - } + // t.PinnedRepositories ([]string) (slice) + if t.PinnedRepositories != nil { - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflow"))); err != nil { - return err - } - if _, err := cw.WriteString(string("workflow")); err != nil { - return err - } + if len("pinnedRepositories") > 1000000 { + return xerrors.Errorf("Value in field \"pinnedRepositories\" was too long") + } - if len(t.Workflow) > 1000000 { - return xerrors.Errorf("Value in field t.Workflow was too long") - } + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pinnedRepositories"))); err != nil { + return err + } + if _, err := cw.WriteString(string("pinnedRepositories")); err != nil { + return err + } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Workflow))); err != nil { - return err - } - if _, err := cw.WriteString(string(t.Workflow)); err != nil { - return err + if len(t.PinnedRepositories) > 8192 { + return xerrors.Errorf("Slice value in field t.PinnedRepositories was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.PinnedRepositories))); err != nil { + return err + } + for _, v := range t.PinnedRepositories { + 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 *CiSubscribePipelineLogs_Control) UnmarshalCBOR(r io.Reader) (err error) { - *t = CiSubscribePipelineLogs_Control{} +func (t *ActorProfile) UnmarshalCBOR(r io.Reader) (err error) { + *t = ActorProfile{} cr := cbg.NewCborReader(r) @@ -288,12 +413,12 @@ func (t *CiSubscribePipelineLogs_Control) UnmarshalCBOR(r io.Reader) (err error) } if extra > cbg.MaxLength { - return fmt.Errorf("CiSubscribePipelineLogs_Control: map struct too large (%d)", extra) + return fmt.Errorf("ActorProfile: map struct too large (%d)", extra) } n := extra - nameBuf := make([]byte, 8) + nameBuf := make([]byte, 18) for i := uint64(0); i < n; i++ { nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) if err != nil { @@ -309,66 +434,139 @@ func (t *CiSubscribePipelineLogs_Control) UnmarshalCBOR(r io.Reader) (err error) } switch string(nameBuf[:nameLen]) { - // t.Kind (string) (string) - case "kind": + // t.LexiconTypeID (string) (string) + case "$type": { - 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.LexiconTypeID = string(sval) + } + // t.Links ([]string) (slice) + case "links": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > 8192 { + return fmt.Errorf("t.Links: array too large (%d)", extra) + } + + if maj != cbg.MajArray { + return fmt.Errorf("expected cbor array") + } + + if extra > 0 { + t.Links = make([]string, extra) + } + + for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Links[i] = string(sval) + } - t.Kind = (*string)(&sval) } } - // t.Step (int64) (int64) - case "step": + // t.Stats ([]string) (slice) + case "stats": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > 8192 { + return fmt.Errorf("t.Stats: array too large (%d)", extra) + } + + if maj != cbg.MajArray { + return fmt.Errorf("expected cbor array") + } + + if extra > 0 { + t.Stats = make([]string, extra) + } + + for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Stats[i] = string(sval) + } + + } + } + // t.Avatar (util.LexBlob) (struct) + case "avatar": + { - maj, extra, err := cr.ReadHeader() + + b, err := cr.ReadByte() if err != nil { return err } - var extraI int64 - switch maj { - case cbg.MajUnsignedInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 positive overflow") + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err } - case cbg.MajNegativeInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 negative overflow") + t.Avatar = new(util.LexBlob) + if err := t.Avatar.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Avatar pointer: %w", err) } - extraI = -1 - extraI - default: - return fmt.Errorf("wrong type for int64 field: %d", maj) } - t.Step = int64(extraI) } - // t.Time (string) (string) - case "time": + // t.Labels (atproto.LabelDefs_SelfLabels) (struct) + case "labels": { - sval, err := cbg.ReadStringWithMax(cr, 1000000) + + b, err := cr.ReadByte() if err != nil { return err } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Labels = new(atproto.LabelDefs_SelfLabels) + if err := t.Labels.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Labels pointer: %w", err) + } + } - t.Time = string(sval) } - // t.Status (string) (string) - case "status": + // t.Location (string) (string) + case "location": { b, err := cr.ReadByte() @@ -385,11 +583,11 @@ func (t *CiSubscribePipelineLogs_Control) UnmarshalCBOR(r io.Reader) (err error) return err } - t.Status = (*string)(&sval) + t.Location = (*string)(&sval) } } - // t.Command (string) (string) - case "command": + // t.Pronouns (string) (string) + case "pronouns": { b, err := cr.ReadByte() @@ -406,22 +604,32 @@ func (t *CiSubscribePipelineLogs_Control) UnmarshalCBOR(r io.Reader) (err error) return err } - t.Command = (*string)(&sval) + t.Pronouns = (*string)(&sval) } } - // t.Content (string) (string) - case "content": + // t.Description (string) (string) + case "description": { - sval, err := cbg.ReadStringWithMax(cr, 1000000) + b, err := cr.ReadByte() if err != nil { return err } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } - t.Content = string(sval) + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Description = (*string)(&sval) + } } - // t.Outcome (string) (string) - case "outcome": + // t.IsOrganization (bool) (bool) + case "isOrganization": { b, err := cr.ReadByte() @@ -433,24 +641,86 @@ func (t *CiSubscribePipelineLogs_Control) UnmarshalCBOR(r io.Reader) (err error) return err } - sval, err := cbg.ReadStringWithMax(cr, 1000000) + maj, extra, err = cr.ReadHeader() if err != nil { return err } + if maj != cbg.MajOther { + return fmt.Errorf("booleans must be major type 7") + } - t.Outcome = (*string)(&sval) + var val bool + switch extra { + case 20: + val = false + case 21: + val = true + default: + return fmt.Errorf("booleans are either major type 7, value 20 or 21 (got %d)", extra) + } + t.IsOrganization = &val } } - // t.Workflow (string) (string) - case "workflow": + // t.PreferredHandle (string) (string) + case "preferredHandle": { - sval, err := cbg.ReadStringWithMax(cr, 1000000) + b, err := cr.ReadByte() if err != nil { return err } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } - t.Workflow = string(sval) + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.PreferredHandle = (*string)(&sval) + } + } + // t.PinnedRepositories ([]string) (slice) + case "pinnedRepositories": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > 8192 { + return fmt.Errorf("t.PinnedRepositories: array too large (%d)", extra) + } + + if maj != cbg.MajArray { + return fmt.Errorf("expected cbor array") + } + + if extra > 0 { + t.PinnedRepositories = make([]string, extra) + } + + for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.PinnedRepositories[i] = string(sval) + } + + } } default: @@ -463,18 +733,67 @@ func (t *CiSubscribePipelineLogs_Control) UnmarshalCBOR(r io.Reader) (err error) return nil } -func (t *CiSubscribePipelineLogs_Data) MarshalCBOR(w io.Writer) error { +func (t *CiSubscribePipelineLogs_Control) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } cw := cbg.NewCborWriter(w) + fieldCount := 8 - if _, err := cw.Write([]byte{165}); err != nil { + if t.Command == nil { + fieldCount-- + } + + if t.Kind == nil { + fieldCount-- + } + + if t.Outcome == nil { + fieldCount-- + } + + if t.Status == nil { + fieldCount-- + } + + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { return err } + // t.Kind (string) (string) + if t.Kind != nil { + + if len("kind") > 1000000 { + return xerrors.Errorf("Value in field \"kind\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("kind"))); err != nil { + return err + } + if _, err := cw.WriteString(string("kind")); err != nil { + return err + } + + if t.Kind == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.Kind) > 1000000 { + return xerrors.Errorf("Value in field t.Kind was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Kind))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.Kind)); err != nil { + return err + } + } + } + // t.Step (int64) (int64) if len("step") > 1000000 { return xerrors.Errorf("Value in field \"step\" was too long") @@ -513,86 +832,6708 @@ func (t *CiSubscribePipelineLogs_Data) MarshalCBOR(w io.Writer) error { return xerrors.Errorf("Value in field t.Time was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Time))); err != nil { - return err - } - if _, err := cw.WriteString(string(t.Time)); err != nil { - return err - } + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Time))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Time)); err != nil { + return err + } + + // t.Status (string) (string) + if t.Status != nil { + + if len("status") > 1000000 { + return xerrors.Errorf("Value in field \"status\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil { + return err + } + if _, err := cw.WriteString(string("status")); err != nil { + return err + } + + if t.Status == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.Status) > 1000000 { + return xerrors.Errorf("Value in field t.Status was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Status))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.Status)); err != nil { + return err + } + } + } + + // t.Command (string) (string) + if t.Command != nil { + + if len("command") > 1000000 { + return xerrors.Errorf("Value in field \"command\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("command"))); err != nil { + return err + } + if _, err := cw.WriteString(string("command")); err != nil { + return err + } + + if t.Command == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.Command) > 1000000 { + return xerrors.Errorf("Value in field t.Command was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Command))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.Command)); err != nil { + return err + } + } + } + + // t.Content (string) (string) + if len("content") > 1000000 { + return xerrors.Errorf("Value in field \"content\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("content"))); err != nil { + return err + } + if _, err := cw.WriteString(string("content")); err != nil { + return err + } + + if len(t.Content) > 1000000 { + return xerrors.Errorf("Value in field t.Content was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Content))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Content)); err != nil { + return err + } + + // t.Outcome (string) (string) + if t.Outcome != nil { + + if len("outcome") > 1000000 { + return xerrors.Errorf("Value in field \"outcome\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("outcome"))); err != nil { + return err + } + if _, err := cw.WriteString(string("outcome")); err != nil { + return err + } + + if t.Outcome == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.Outcome) > 1000000 { + return xerrors.Errorf("Value in field t.Outcome was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Outcome))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.Outcome)); err != nil { + return err + } + } + } + + // t.Workflow (string) (string) + if len("workflow") > 1000000 { + return xerrors.Errorf("Value in field \"workflow\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflow"))); err != nil { + return err + } + if _, err := cw.WriteString(string("workflow")); err != nil { + return err + } + + if len(t.Workflow) > 1000000 { + return xerrors.Errorf("Value in field t.Workflow was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Workflow))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Workflow)); err != nil { + return err + } + return nil +} + +func (t *CiSubscribePipelineLogs_Control) UnmarshalCBOR(r io.Reader) (err error) { + *t = CiSubscribePipelineLogs_Control{} + + 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("CiSubscribePipelineLogs_Control: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 8) + 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.Kind (string) (string) + case "kind": + + { + b, err := cr.ReadByte() + 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.Kind = (*string)(&sval) + } + } + // t.Step (int64) (int64) + case "step": + { + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + var extraI int64 + switch maj { + case cbg.MajUnsignedInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 positive overflow") + } + case cbg.MajNegativeInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 negative overflow") + } + extraI = -1 - extraI + default: + return fmt.Errorf("wrong type for int64 field: %d", maj) + } + + t.Step = int64(extraI) + } + // t.Time (string) (string) + case "time": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Time = string(sval) + } + // t.Status (string) (string) + case "status": + + { + b, err := cr.ReadByte() + 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.Status = (*string)(&sval) + } + } + // t.Command (string) (string) + case "command": + + { + b, err := cr.ReadByte() + 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.Command = (*string)(&sval) + } + } + // t.Content (string) (string) + case "content": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Content = string(sval) + } + // t.Outcome (string) (string) + case "outcome": + + { + b, err := cr.ReadByte() + 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.Outcome = (*string)(&sval) + } + } + // t.Workflow (string) (string) + case "workflow": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Workflow = 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 *CiSubscribePipelineLogs_Data) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write([]byte{165}); err != nil { + return err + } + + // t.Step (int64) (int64) + if len("step") > 1000000 { + return xerrors.Errorf("Value in field \"step\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("step"))); err != nil { + return err + } + if _, err := cw.WriteString(string("step")); err != nil { + return err + } + + if t.Step >= 0 { + if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.Step)); err != nil { + return err + } + } else { + if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.Step-1)); err != nil { + return err + } + } + + // t.Time (string) (string) + if len("time") > 1000000 { + return xerrors.Errorf("Value in field \"time\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("time"))); err != nil { + return err + } + if _, err := cw.WriteString(string("time")); err != nil { + return err + } + + if len(t.Time) > 1000000 { + return xerrors.Errorf("Value in field t.Time was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Time))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Time)); err != nil { + return err + } + + // t.Stream (string) (string) + if len("stream") > 1000000 { + return xerrors.Errorf("Value in field \"stream\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("stream"))); err != nil { + return err + } + if _, err := cw.WriteString(string("stream")); err != nil { + return err + } + + if len(t.Stream) > 1000000 { + return xerrors.Errorf("Value in field t.Stream was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Stream))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Stream)); err != nil { + return err + } + + // t.Content (string) (string) + if len("content") > 1000000 { + return xerrors.Errorf("Value in field \"content\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("content"))); err != nil { + return err + } + if _, err := cw.WriteString(string("content")); err != nil { + return err + } + + if len(t.Content) > 1000000 { + return xerrors.Errorf("Value in field t.Content was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Content))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Content)); err != nil { + return err + } + + // t.Workflow (string) (string) + if len("workflow") > 1000000 { + return xerrors.Errorf("Value in field \"workflow\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflow"))); err != nil { + return err + } + if _, err := cw.WriteString(string("workflow")); err != nil { + return err + } + + if len(t.Workflow) > 1000000 { + return xerrors.Errorf("Value in field t.Workflow was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Workflow))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Workflow)); err != nil { + return err + } + return nil +} + +func (t *CiSubscribePipelineLogs_Data) UnmarshalCBOR(r io.Reader) (err error) { + *t = CiSubscribePipelineLogs_Data{} + + 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("CiSubscribePipelineLogs_Data: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 8) + 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.Step (int64) (int64) + case "step": + { + maj, extra, err := cr.ReadHeader() + if err != nil { + return err + } + var extraI int64 + switch maj { + case cbg.MajUnsignedInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 positive overflow") + } + case cbg.MajNegativeInt: + extraI = int64(extra) + if extraI < 0 { + return fmt.Errorf("int64 negative overflow") + } + extraI = -1 - extraI + default: + return fmt.Errorf("wrong type for int64 field: %d", maj) + } + + t.Step = int64(extraI) + } + // t.Time (string) (string) + case "time": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Time = string(sval) + } + // t.Stream (string) (string) + case "stream": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Stream = string(sval) + } + // t.Content (string) (string) + case "content": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Content = string(sval) + } + // t.Workflow (string) (string) + case "workflow": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Workflow = 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 *CiTriggerManual) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + fieldCount := 5 + + if t.Inputs == nil { + fieldCount-- + } + + if t.Ref == nil { + fieldCount-- + } + + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + return err + } + + // t.Ref (string) (string) + if t.Ref != nil { + + if len("ref") > 1000000 { + return xerrors.Errorf("Value in field \"ref\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ref"))); err != nil { + return err + } + if _, err := cw.WriteString(string("ref")); err != nil { + return err + } + + if t.Ref == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.Ref) > 1000000 { + return xerrors.Errorf("Value in field t.Ref was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Ref))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.Ref)); 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("org.tangled.ci.trigger.manual"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.ci.trigger.manual")); err != nil { + return err + } + + // t.Commit (string) (string) + 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 len(t.Commit) > 1000000 { + return xerrors.Errorf("Value in field t.Commit was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Commit))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Commit)); err != nil { + return err + } + + // t.Inputs ([]*org_tangled.CiTriggerManual_Pair) (slice) + if t.Inputs != nil { + + if len("inputs") > 1000000 { + return xerrors.Errorf("Value in field \"inputs\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("inputs"))); err != nil { + return err + } + if _, err := cw.WriteString(string("inputs")); err != nil { + return err + } + + if len(t.Inputs) > 8192 { + return xerrors.Errorf("Slice value in field t.Inputs was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Inputs))); err != nil { + return err + } + for _, v := range t.Inputs { + if err := v.MarshalCBOR(cw); err != nil { + return err + } + + } + } + return nil +} + +func (t *CiTriggerManual) UnmarshalCBOR(r io.Reader) (err error) { + *t = CiTriggerManual{} + + 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("CiTriggerManual: 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.Ref (string) (string) + case "ref": + + { + b, err := cr.ReadByte() + 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.Ref = (*string)(&sval) + } + } + // 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 (string) (string) + case "commit": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Commit = string(sval) + } + // t.Inputs ([]*org_tangled.CiTriggerManual_Pair) (slice) + case "inputs": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > 8192 { + return fmt.Errorf("t.Inputs: array too large (%d)", extra) + } + + if maj != cbg.MajArray { + return fmt.Errorf("expected cbor array") + } + + if extra > 0 { + t.Inputs = make([]*CiTriggerManual_Pair, extra) + } + + for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Inputs[i] = new(CiTriggerManual_Pair) + if err := t.Inputs[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Inputs[i] 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 *CiTriggerManual_Pair) 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.Key (string) (string) + if len("key") > 1000000 { + return xerrors.Errorf("Value in field \"key\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("key"))); err != nil { + return err + } + if _, err := cw.WriteString(string("key")); err != nil { + return err + } + + if len(t.Key) > 1000000 { + return xerrors.Errorf("Value in field t.Key was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Key)); err != nil { + return err + } + + // t.Value (string) (string) + if len("value") > 1000000 { + return xerrors.Errorf("Value in field \"value\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("value"))); err != nil { + return err + } + if _, err := cw.WriteString(string("value")); err != nil { + return err + } + + if len(t.Value) > 1000000 { + return xerrors.Errorf("Value in field t.Value was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Value))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Value)); err != nil { + return err + } + return nil +} + +func (t *CiTriggerManual_Pair) UnmarshalCBOR(r io.Reader) (err error) { + *t = CiTriggerManual_Pair{} + + 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("CiTriggerManual_Pair: 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.Key (string) (string) + case "key": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Key = string(sval) + } + // t.Value (string) (string) + case "value": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Value = 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 *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("org.tangled.embed.commit"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.embed.commit")); err != nil { + return err + } + + // t.Commit (org_tangled.GitOid) (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 (org_tangled.GitOid) (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(GitOid) + 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 *EventPullRequest) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write([]byte{161}); 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.event.pullRequest"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.event.pullRequest")); err != nil { + return err + } + return nil +} + +func (t *EventPullRequest) UnmarshalCBOR(r io.Reader) (err error) { + *t = EventPullRequest{} + + 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("EventPullRequest: 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.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 *EventPush) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write([]byte{165}); err != nil { + return err + } + + // t.Ref (string) (string) + if len("ref") > 1000000 { + return xerrors.Errorf("Value in field \"ref\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ref"))); err != nil { + return err + } + if _, err := cw.WriteString(string("ref")); err != nil { + return err + } + + if len(t.Ref) > 1000000 { + return xerrors.Errorf("Value in field t.Ref was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Ref))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Ref)); 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("org.tangled.event.push"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.event.push")); err != nil { + return err + } + + // t.NewSha (string) (string) + if len("newSha") > 1000000 { + return xerrors.Errorf("Value in field \"newSha\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("newSha"))); err != nil { + return err + } + if _, err := cw.WriteString(string("newSha")); err != nil { + return err + } + + if len(t.NewSha) > 1000000 { + return xerrors.Errorf("Value in field t.NewSha was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.NewSha))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.NewSha)); err != nil { + return err + } + + // t.OldSha (string) (string) + if len("oldSha") > 1000000 { + return xerrors.Errorf("Value in field \"oldSha\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("oldSha"))); err != nil { + return err + } + if _, err := cw.WriteString(string("oldSha")); err != nil { + return err + } + + if len(t.OldSha) > 1000000 { + return xerrors.Errorf("Value in field t.OldSha was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.OldSha))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.OldSha)); err != nil { + return err + } + return nil +} + +func (t *EventPush) UnmarshalCBOR(r io.Reader) (err error) { + *t = EventPush{} + + 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("EventPush: 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.Ref (string) (string) + case "ref": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Ref = string(sval) + } + // 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.NewSha (string) (string) + case "newSha": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.NewSha = string(sval) + } + // t.OldSha (string) (string) + case "oldSha": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.OldSha = 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 *FeedComment) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + fieldCount := 6 + + if t.Embed == nil { + fieldCount-- + } + + if t.ReplyTo == nil { + fieldCount-- + } + + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + return err + } + + // t.Body (org_tangled.FeedComment_Body) (struct) + if len("body") > 1000000 { + return xerrors.Errorf("Value in field \"body\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil { + return err + } + if _, err := cw.WriteString(string("body")); err != nil { + return err + } + + if err := t.Body.MarshalCBOR(cw); 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.comment"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.feed.comment")); err != nil { + return err + } + + // t.Embed (org_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 { + + if len("replyTo") > 1000000 { + return xerrors.Errorf("Value in field \"replyTo\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("replyTo"))); err != nil { + return err + } + if _, err := cw.WriteString(string("replyTo")); err != nil { + return err + } + + if err := t.ReplyTo.MarshalCBOR(cw); err != nil { + return err + } + } + + // t.Subject (org_tangled.FeedComment_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 *FeedComment) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedComment{} + + 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("FeedComment: 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.Body (org_tangled.FeedComment_Body) (struct) + case "body": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Body = new(FeedComment_Body) + if err := t.Body.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Body pointer: %w", err) + } + } + + } + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.Embed (org_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": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.ReplyTo = new(atproto.RepoStrongRef) + if err := t.ReplyTo.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.ReplyTo pointer: %w", err) + } + } + + } + // t.Subject (org_tangled.FeedComment_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(FeedComment_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 *FeedReaction) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write([]byte{164}); 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.reaction"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.feed.reaction")); err != nil { + return err + } + + // t.Subject (atproto.RepoStrongRef) (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.Reaction (string) (string) + if len("reaction") > 1000000 { + return xerrors.Errorf("Value in field \"reaction\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("reaction"))); err != nil { + return err + } + if _, err := cw.WriteString(string("reaction")); err != nil { + return err + } + + if len(t.Reaction) > 1000000 { + return xerrors.Errorf("Value in field t.Reaction was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Reaction))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Reaction)); 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 *FeedReaction) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedReaction{} + + 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("FeedReaction: 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 (atproto.RepoStrongRef) (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(atproto.RepoStrongRef) + if err := t.Subject.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Subject pointer: %w", err) + } + } + + } + // 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("org.tangled.feed.star"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.feed.star")); err != nil { + return err + } + + // t.Subject (org_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 (org_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_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.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.star#record"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.feed.star#record")); err != nil { + return err + } + + // t.Record (atproto.RepoStrongRef) (struct) + if len("record") > 1000000 { + return xerrors.Errorf("Value in field \"record\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("record"))); err != nil { + return err + } + if _, err := cw.WriteString(string("record")); err != nil { + return err + } + + if err := t.Record.MarshalCBOR(cw); err != nil { + return err + } + return nil +} + +func (t *FeedStar_Record) UnmarshalCBOR(r io.Reader) (err error) { + *t = FeedStar_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("FeedStar_Record: 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.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.Record (atproto.RepoStrongRef) (struct) + case "record": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Record = new(atproto.RepoStrongRef) + if err := t.Record.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Record 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 *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.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.star#repo"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.feed.star#repo")); err != nil { + return err + } + + // t.Identity (string) (string) + if len("identity") > 1000000 { + return xerrors.Errorf("Value in field \"identity\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("identity"))); err != nil { + return err + } + if _, err := cw.WriteString(string("identity")); err != nil { + return err + } + + if len(t.Identity) > 1000000 { + return xerrors.Errorf("Value in field t.Identity was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Identity))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Identity)); 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, 8) + 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.Identity (string) (string) + case "identity": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Identity = 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) 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 +} +func (t *GitOid) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write([]byte{161}); err != nil { + return err + } + + // 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("oid"))); err != nil { + return err + } + if _, err := cw.WriteString(string("oid")); err != nil { + return err + } + + 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.Oid))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Oid)); err != nil { + return err + } + return nil +} + +func (t *GitOid) UnmarshalCBOR(r io.Reader) (err error) { + *t = GitOid{} + + 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("GitOid: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 3) + 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.Oid (string) (string) + case "oid": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Oid = 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 *GitRefs) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + fieldCount := 3 + + if t.Refs == nil { + fieldCount-- + } + + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + return err + } + + // t.Refs (util.LexBytes) (slice) + if t.Refs != nil { + + if len("refs") > 1000000 { + return xerrors.Errorf("Value in field \"refs\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("refs"))); err != nil { + return err + } + if _, err := cw.WriteString(string("refs")); err != nil { + return err + } + + if len(t.Refs) > 2097152 { + return xerrors.Errorf("Byte array in field t.Refs was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajByteString, uint64(len(t.Refs))); err != nil { + return err + } + + if _, err := cw.Write(t.Refs); 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.git.refs"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.git.refs")); err != nil { + return err + } + + // t.DefaultBranch (string) (string) + if len("defaultBranch") > 1000000 { + return xerrors.Errorf("Value in field \"defaultBranch\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("defaultBranch"))); err != nil { + return err + } + if _, err := cw.WriteString(string("defaultBranch")); err != nil { + return err + } + + if len(t.DefaultBranch) > 1000000 { + return xerrors.Errorf("Value in field t.DefaultBranch was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.DefaultBranch))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.DefaultBranch)); err != nil { + return err + } + return nil +} + +func (t *GitRefs) UnmarshalCBOR(r io.Reader) (err error) { + *t = GitRefs{} + + 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("GitRefs: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 13) + 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.Refs (util.LexBytes) (slice) + case "refs": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > 2097152 { + return fmt.Errorf("t.Refs: byte array too large (%d)", extra) + } + if maj != cbg.MajByteString { + return fmt.Errorf("expected byte array") + } + + if extra > 0 { + t.Refs = make([]uint8, extra) + } + + if _, err := io.ReadFull(cr, t.Refs); err != nil { + return err + } + + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.DefaultBranch (string) (string) + case "defaultBranch": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.DefaultBranch = 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 *GraphAttestation) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + fieldCount := 4 + + if t.Change == nil { + fieldCount-- + } + + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); 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.graph.attestation"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.graph.attestation")); err != nil { + return err + } + + // t.Change (string) (string) + if t.Change != nil { + + if len("change") > 1000000 { + return xerrors.Errorf("Value in field \"change\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("change"))); err != nil { + return err + } + if _, err := cw.WriteString(string("change")); err != nil { + return err + } + + if t.Change == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.Change) > 1000000 { + return xerrors.Errorf("Value in field t.Change was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Change))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.Change)); err != nil { + return err + } + } + } + + // t.Subject (atproto.RepoStrongRef) (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 *GraphAttestation) UnmarshalCBOR(r io.Reader) (err error) { + *t = GraphAttestation{} + + 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("GraphAttestation: 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.Change (string) (string) + case "change": + + { + b, err := cr.ReadByte() + 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.Change = (*string)(&sval) + } + } + // t.Subject (atproto.RepoStrongRef) (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(atproto.RepoStrongRef) + 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 *GraphCollaborator) 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.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.graph.collaborator"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.graph.collaborator")); 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 *GraphCollaborator) UnmarshalCBOR(r io.Reader) (err error) { + *t = GraphCollaborator{} + + 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("GraphCollaborator: 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.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 *GraphFollow) 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.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.graph.follow"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.graph.follow")); 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 *GraphFollow) UnmarshalCBOR(r io.Reader) (err error) { + *t = GraphFollow{} + + 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("GraphFollow: 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.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 *GraphVouch) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + fieldCount := 5 + + if t.Evidences == nil { + fieldCount-- + } + + if t.Reason == nil { + fieldCount-- + } + + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + return err + } + + // t.Kind (string) (string) + if len("kind") > 1000000 { + return xerrors.Errorf("Value in field \"kind\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("kind"))); err != nil { + return err + } + if _, err := cw.WriteString(string("kind")); err != nil { + return err + } + + if len(t.Kind) > 1000000 { + return xerrors.Errorf("Value in field t.Kind was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Kind))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Kind)); 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.graph.vouch"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.graph.vouch")); err != nil { + return err + } + + // t.Reason (string) (string) + if t.Reason != nil { + + if len("reason") > 1000000 { + return xerrors.Errorf("Value in field \"reason\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("reason"))); err != nil { + return err + } + if _, err := cw.WriteString(string("reason")); err != nil { + return err + } + + if t.Reason == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.Reason) > 1000000 { + return xerrors.Errorf("Value in field t.Reason was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Reason))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.Reason)); 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 + } + + // t.Evidences ([]*atproto.RepoStrongRef) (slice) + if t.Evidences != nil { + + if len("evidences") > 1000000 { + return xerrors.Errorf("Value in field \"evidences\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("evidences"))); err != nil { + return err + } + if _, err := cw.WriteString(string("evidences")); err != nil { + return err + } + + if len(t.Evidences) > 8192 { + return xerrors.Errorf("Slice value in field t.Evidences was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Evidences))); err != nil { + return err + } + for _, v := range t.Evidences { + if err := v.MarshalCBOR(cw); err != nil { + return err + } + + } + } + return nil +} + +func (t *GraphVouch) UnmarshalCBOR(r io.Reader) (err error) { + *t = GraphVouch{} + + 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("GraphVouch: 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.Kind (string) (string) + case "kind": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Kind = string(sval) + } + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.Reason (string) (string) + case "reason": + + { + b, err := cr.ReadByte() + 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.Reason = (*string)(&sval) + } + } + // t.CreatedAt (string) (string) + case "createdAt": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.CreatedAt = string(sval) + } + // t.Evidences ([]*atproto.RepoStrongRef) (slice) + case "evidences": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > 8192 { + return fmt.Errorf("t.Evidences: array too large (%d)", extra) + } + + if maj != cbg.MajArray { + return fmt.Errorf("expected cbor array") + } + + if extra > 0 { + t.Evidences = make([]*atproto.RepoStrongRef, extra) + } + + for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Evidences[i] = new(atproto.RepoStrongRef) + if err := t.Evidences[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Evidences[i] 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 *KeySshKey) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + fieldCount := 5 + + if t.Usages == nil { + fieldCount-- + } + + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + return err + } + + // t.Name (string) (string) + if len("name") > 1000000 { + return xerrors.Errorf("Value in field \"name\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil { + return err + } + if _, err := cw.WriteString(string("name")); err != nil { + return err + } + + if len(t.Name) > 1000000 { + return xerrors.Errorf("Value in field t.Name was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Name)); 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.key.sshKey"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.key.sshKey")); err != nil { + return err + } + + // t.Usages ([]string) (slice) + if t.Usages != nil { + + if len("usages") > 1000000 { + return xerrors.Errorf("Value in field \"usages\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("usages"))); err != nil { + return err + } + if _, err := cw.WriteString(string("usages")); err != nil { + return err + } + + if len(t.Usages) > 8192 { + return xerrors.Errorf("Slice value in field t.Usages was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Usages))); err != nil { + return err + } + for _, v := range t.Usages { + 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 + } + + } + } + + // 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 + } + + // t.PublicKey (string) (string) + if len("publicKey") > 1000000 { + return xerrors.Errorf("Value in field \"publicKey\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("publicKey"))); err != nil { + return err + } + if _, err := cw.WriteString(string("publicKey")); err != nil { + return err + } + + if len(t.PublicKey) > 1000000 { + return xerrors.Errorf("Value in field t.PublicKey was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.PublicKey))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.PublicKey)); err != nil { + return err + } + return nil +} + +func (t *KeySshKey) UnmarshalCBOR(r io.Reader) (err error) { + *t = KeySshKey{} + + 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("KeySshKey: 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.Name (string) (string) + case "name": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Name = string(sval) + } + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.Usages ([]string) (slice) + case "usages": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > 8192 { + return fmt.Errorf("t.Usages: array too large (%d)", extra) + } + + if maj != cbg.MajArray { + return fmt.Errorf("expected cbor array") + } + + if extra > 0 { + t.Usages = make([]string, extra) + } + + for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Usages[i] = string(sval) + } + + } + } + // t.CreatedAt (string) (string) + case "createdAt": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.CreatedAt = string(sval) + } + // t.PublicKey (string) (string) + case "publicKey": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.PublicKey = 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 *KeyUnspeccedGpgKey) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + + if _, err := cw.Write([]byte{164}); err != nil { + return err + } + + // t.Name (string) (string) + if len("name") > 1000000 { + return xerrors.Errorf("Value in field \"name\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil { + return err + } + if _, err := cw.WriteString(string("name")); err != nil { + return err + } + + if len(t.Name) > 1000000 { + return xerrors.Errorf("Value in field t.Name was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Name)); 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.key.unspecced.gpgKey"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.key.unspecced.gpgKey")); 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 + } + + // t.PublicKey (string) (string) + if len("publicKey") > 1000000 { + return xerrors.Errorf("Value in field \"publicKey\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("publicKey"))); err != nil { + return err + } + if _, err := cw.WriteString(string("publicKey")); err != nil { + return err + } + + if len(t.PublicKey) > 1000000 { + return xerrors.Errorf("Value in field t.PublicKey was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.PublicKey))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.PublicKey)); err != nil { + return err + } + return nil +} + +func (t *KeyUnspeccedGpgKey) UnmarshalCBOR(r io.Reader) (err error) { + *t = KeyUnspeccedGpgKey{} + + 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("KeyUnspeccedGpgKey: 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.Name (string) (string) + case "name": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Name = string(sval) + } + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.CreatedAt (string) (string) + case "createdAt": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.CreatedAt = string(sval) + } + // t.PublicKey (string) (string) + case "publicKey": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.PublicKey = 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 *KnotBlock) 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.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.knot.block"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.knot.block")); 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 *KnotBlock) UnmarshalCBOR(r io.Reader) (err error) { + *t = KnotBlock{} + + 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("KnotBlock: 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.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 *KnotMember) 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.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.knot.member"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.knot.member")); 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 *KnotMember) UnmarshalCBOR(r io.Reader) (err error) { + *t = KnotMember{} + + 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("KnotMember: 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.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 *LabelDefinition) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + fieldCount := 4 + + if t.Color == nil { + fieldCount-- + } + + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + return err + } + + // t.Name (string) (string) + if len("name") > 1000000 { + return xerrors.Errorf("Value in field \"name\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil { + return err + } + if _, err := cw.WriteString(string("name")); err != nil { + return err + } + + if len(t.Name) > 1000000 { + return xerrors.Errorf("Value in field t.Name was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Name)); 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.label.definition"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.label.definition")); err != nil { + return err + } + + // t.Color (string) (string) + if t.Color != nil { + + if len("color") > 1000000 { + return xerrors.Errorf("Value in field \"color\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("color"))); err != nil { + return err + } + if _, err := cw.WriteString(string("color")); err != nil { + return err + } + + if t.Color == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.Color) > 1000000 { + return xerrors.Errorf("Value in field t.Color was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Color))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.Color)); 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 *LabelDefinition) UnmarshalCBOR(r io.Reader) (err error) { + *t = LabelDefinition{} + + 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("LabelDefinition: 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.Name (string) (string) + case "name": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Name = string(sval) + } + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.Color (string) (string) + case "color": + + { + b, err := cr.ReadByte() + 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.Color = (*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 *LabelDefs_LabelToken) 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.Key (string) (string) + if len("key") > 1000000 { + return xerrors.Errorf("Value in field \"key\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("key"))); err != nil { + return err + } + if _, err := cw.WriteString(string("key")); err != nil { + return err + } + + if len(t.Key) > 1000000 { + return xerrors.Errorf("Value in field t.Key was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Key)); 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.label.defs#labelToken"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.label.defs#labelToken")); err != nil { + return err + } + return nil +} + +func (t *LabelDefs_LabelToken) UnmarshalCBOR(r io.Reader) (err error) { + *t = LabelDefs_LabelToken{} + + 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("LabelDefs_LabelToken: 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.Key (string) (string) + case "key": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Key = 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 *MarkupEmbedImage) 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.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.markup.embed.image"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.markup.embed.image")); err != nil { + return err + } + + // t.Image (util.LexBlob) (struct) + if len("image") > 1000000 { + return xerrors.Errorf("Value in field \"image\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("image"))); err != nil { + return err + } + if _, err := cw.WriteString(string("image")); err != nil { + return err + } + + if err := t.Image.MarshalCBOR(cw); err != nil { + return err + } + return nil +} + +func (t *MarkupEmbedImage) UnmarshalCBOR(r io.Reader) (err error) { + *t = MarkupEmbedImage{} + + 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("MarkupEmbedImage: 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.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.Image (util.LexBlob) (struct) + case "image": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Image = new(util.LexBlob) + if err := t.Image.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Image 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 *MarkupEmbedVideo) 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.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.markup.embed.video"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.markup.embed.video")); err != nil { + return err + } + + // t.Video (util.LexBlob) (struct) + if len("video") > 1000000 { + return xerrors.Errorf("Value in field \"video\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("video"))); err != nil { + return err + } + if _, err := cw.WriteString(string("video")); err != nil { + return err + } + + if err := t.Video.MarshalCBOR(cw); err != nil { + return err + } + return nil +} + +func (t *MarkupEmbedVideo) UnmarshalCBOR(r io.Reader) (err error) { + *t = MarkupEmbedVideo{} + + 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("MarkupEmbedVideo: 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.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.Video (util.LexBlob) (struct) + case "video": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Video = new(util.LexBlob) + if err := t.Video.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Video 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 *MarkupMarkdown) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + fieldCount := 3 + + if t.Blobs == nil { + fieldCount-- + } + + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + return err + } + + // t.Text (string) (string) + if len("text") > 1000000 { + return xerrors.Errorf("Value in field \"text\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("text"))); err != nil { + return err + } + if _, err := cw.WriteString(string("text")); err != nil { + return err + } + + if len(t.Text) > 1000000 { + return xerrors.Errorf("Value in field t.Text was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Text))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Text)); 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.markup.markdown"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.markup.markdown")); err != nil { + return err + } + + // t.Blobs ([]*org_tangled.MarkupMarkdown_Blobs_Elem) (slice) + if t.Blobs != nil { + + if len("blobs") > 1000000 { + return xerrors.Errorf("Value in field \"blobs\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("blobs"))); err != nil { + return err + } + if _, err := cw.WriteString(string("blobs")); err != nil { + return err + } + + if len(t.Blobs) > 8192 { + return xerrors.Errorf("Slice value in field t.Blobs was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Blobs))); err != nil { + return err + } + for _, v := range t.Blobs { + if err := v.MarshalCBOR(cw); err != nil { + return err + } + + } + } + return nil +} + +func (t *MarkupMarkdown) UnmarshalCBOR(r io.Reader) (err error) { + *t = MarkupMarkdown{} + + 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("MarkupMarkdown: 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.Text (string) (string) + case "text": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Text = string(sval) + } + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.Blobs ([]*org_tangled.MarkupMarkdown_Blobs_Elem) (slice) + case "blobs": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > 8192 { + return fmt.Errorf("t.Blobs: array too large (%d)", extra) + } + + if maj != cbg.MajArray { + return fmt.Errorf("expected cbor array") + } + + if extra > 0 { + t.Blobs = make([]*MarkupMarkdown_Blobs_Elem, extra) + } + + for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Blobs[i] = new(MarkupMarkdown_Blobs_Elem) + if err := t.Blobs[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Blobs[i] 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 *MarkupMarkdown_Inline) 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.Text (string) (string) + if len("text") > 1000000 { + return xerrors.Errorf("Value in field \"text\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("text"))); err != nil { + return err + } + if _, err := cw.WriteString(string("text")); err != nil { + return err + } + + if len(t.Text) > 1000000 { + return xerrors.Errorf("Value in field t.Text was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Text))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Text)); 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.markup.markdown#inline"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.markup.markdown#inline")); err != nil { + return err + } + return nil +} + +func (t *MarkupMarkdown_Inline) UnmarshalCBOR(r io.Reader) (err error) { + *t = MarkupMarkdown_Inline{} + + 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("MarkupMarkdown_Inline: 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.Text (string) (string) + case "text": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Text = 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 *RepoDeclaration) 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("org.tangled.repo.declaration"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.repo.declaration")); 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 *RepoDeclaration) UnmarshalCBOR(r io.Reader) (err error) { + *t = RepoDeclaration{} + + 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("RepoDeclaration: 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.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.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 *RepoDefs_SourceExternal) 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.repo.defs#sourceExternal"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.repo.defs#sourceExternal")); err != nil { + return err + } + return nil +} + +func (t *RepoDefs_SourceExternal) UnmarshalCBOR(r io.Reader) (err error) { + *t = RepoDefs_SourceExternal{} + + 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("RepoDefs_SourceExternal: 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 *RepoDefs_SourceTangled) 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.repo.defs#sourceTangled"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.repo.defs#sourceTangled")); err != nil { + return err + } + return nil +} + +func (t *RepoDefs_SourceTangled) UnmarshalCBOR(r io.Reader) (err error) { + *t = RepoDefs_SourceTangled{} + + 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("RepoDefs_SourceTangled: 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 *RepoManifest) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + + cw := cbg.NewCborWriter(w) + fieldCount := 10 + + if t.ContributionPolicy == nil { + fieldCount-- + } + + if t.DefaultBranch == nil { + fieldCount-- + } + + if t.Description == nil { + fieldCount-- + } + + if t.Source == nil { + fieldCount-- + } + + if t.Spindle == nil { + fieldCount-- + } + + if t.Topics == nil { + fieldCount-- + } + + if t.Website == nil { + fieldCount-- + } + + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); 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.repo.manifest"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.repo.manifest")); err != nil { + return err + } + + // t.Source (org_tangled.RepoManifest_Source) (struct) + if t.Source != nil { + + if len("source") > 1000000 { + return xerrors.Errorf("Value in field \"source\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("source"))); err != nil { + return err + } + if _, err := cw.WriteString(string("source")); err != nil { + return err + } + + if err := t.Source.MarshalCBOR(cw); err != nil { + return err + } + } + + // t.Topics ([]string) (slice) + if t.Topics != nil { + + if len("topics") > 1000000 { + return xerrors.Errorf("Value in field \"topics\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("topics"))); err != nil { + return err + } + if _, err := cw.WriteString(string("topics")); err != nil { + return err + } + + if len(t.Topics) > 8192 { + return xerrors.Errorf("Slice value in field t.Topics was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Topics))); err != nil { + return err + } + for _, v := range t.Topics { + 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 + } + + } + } + + // t.Spindle (string) (string) + if t.Spindle != nil { + + if len("spindle") > 1000000 { + return xerrors.Errorf("Value in field \"spindle\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("spindle"))); err != nil { + return err + } + if _, err := cw.WriteString(string("spindle")); err != nil { + return err + } + + if t.Spindle == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.Spindle) > 1000000 { + return xerrors.Errorf("Value in field t.Spindle was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Spindle))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.Spindle)); err != nil { + return err + } + } + } + + // t.Website (string) (string) + if t.Website != nil { + + if len("website") > 1000000 { + return xerrors.Errorf("Value in field \"website\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("website"))); err != nil { + return err + } + if _, err := cw.WriteString(string("website")); err != nil { + return err + } + + if t.Website == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.Website) > 1000000 { + return xerrors.Errorf("Value in field t.Website was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Website))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.Website)); 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 + } + + // t.Declaration (org_tangled.RepoManifest_Declaration) (struct) + if len("declaration") > 1000000 { + return xerrors.Errorf("Value in field \"declaration\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("declaration"))); err != nil { + return err + } + if _, err := cw.WriteString(string("declaration")); err != nil { + return err + } + + if err := t.Declaration.MarshalCBOR(cw); err != nil { + return err + } + + // t.Description (string) (string) + if t.Description != nil { + + if len("description") > 1000000 { + return xerrors.Errorf("Value in field \"description\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("description"))); err != nil { + return err + } + if _, err := cw.WriteString(string("description")); err != nil { + return err + } + + if t.Description == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.Description) > 1000000 { + return xerrors.Errorf("Value in field t.Description was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Description))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.Description)); err != nil { + return err + } + } + } + + // t.DefaultBranch (string) (string) + if t.DefaultBranch != nil { + + if len("defaultBranch") > 1000000 { + return xerrors.Errorf("Value in field \"defaultBranch\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("defaultBranch"))); err != nil { + return err + } + if _, err := cw.WriteString(string("defaultBranch")); err != nil { + return err + } + + if t.DefaultBranch == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.DefaultBranch) > 1000000 { + return xerrors.Errorf("Value in field t.DefaultBranch was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.DefaultBranch))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.DefaultBranch)); err != nil { + return err + } + } + } + + // t.ContributionPolicy (string) (string) + if t.ContributionPolicy != nil { + + if len("contributionPolicy") > 1000000 { + return xerrors.Errorf("Value in field \"contributionPolicy\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("contributionPolicy"))); err != nil { + return err + } + if _, err := cw.WriteString(string("contributionPolicy")); err != nil { + return err + } + + if t.ContributionPolicy == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.ContributionPolicy) > 1000000 { + return xerrors.Errorf("Value in field t.ContributionPolicy was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.ContributionPolicy))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.ContributionPolicy)); err != nil { + return err + } + } + } + return nil +} + +func (t *RepoManifest) UnmarshalCBOR(r io.Reader) (err error) { + *t = RepoManifest{} + + 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("RepoManifest: map struct too large (%d)", extra) + } + + n := extra + + nameBuf := make([]byte, 18) + 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.Source (org_tangled.RepoManifest_Source) (struct) + case "source": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Source = new(RepoManifest_Source) + if err := t.Source.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Source pointer: %w", err) + } + } + + } + // t.Topics ([]string) (slice) + case "topics": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > 8192 { + return fmt.Errorf("t.Topics: array too large (%d)", extra) + } + + if maj != cbg.MajArray { + return fmt.Errorf("expected cbor array") + } + + if extra > 0 { + t.Topics = make([]string, extra) + } + + for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Topics[i] = string(sval) + } + + } + } + // t.Spindle (string) (string) + case "spindle": + + { + b, err := cr.ReadByte() + 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.Spindle = (*string)(&sval) + } + } + // t.Website (string) (string) + case "website": + + { + b, err := cr.ReadByte() + 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.Website = (*string)(&sval) + } + } + // t.CreatedAt (string) (string) + case "createdAt": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.CreatedAt = string(sval) + } + // t.Declaration (org_tangled.RepoManifest_Declaration) (struct) + case "declaration": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Declaration = new(RepoManifest_Declaration) + if err := t.Declaration.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Declaration pointer: %w", err) + } + } + + } + // t.Description (string) (string) + case "description": + + { + b, err := cr.ReadByte() + 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.Description = (*string)(&sval) + } + } + // t.DefaultBranch (string) (string) + case "defaultBranch": + + { + b, err := cr.ReadByte() + 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.DefaultBranch = (*string)(&sval) + } + } + // t.ContributionPolicy (string) (string) + case "contributionPolicy": + + { + b, err := cr.ReadByte() + 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.ContributionPolicy = (*string)(&sval) + } + } - // t.Stream (string) (string) - if len("stream") > 1000000 { - return xerrors.Errorf("Value in field \"stream\" was too long") + default: + // Field doesn't exist on this type, so ignore it + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { + return err + } + } } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("stream"))); err != nil { - return err - } - if _, err := cw.WriteString(string("stream")); err != nil { + return nil +} +func (t *RepoManifest_Declaration) MarshalCBOR(w io.Writer) error { + if t == nil { + _, err := w.Write(cbg.CborNull) return err } - if len(t.Stream) > 1000000 { - return xerrors.Errorf("Value in field t.Stream was too long") - } + cw := cbg.NewCborWriter(w) - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Stream))); err != nil { - return err - } - if _, err := cw.WriteString(string(t.Stream)); err != nil { + if _, err := cw.Write([]byte{162}); err != nil { return err } - // t.Content (string) (string) - if len("content") > 1000000 { - return xerrors.Errorf("Value in field \"content\" was too long") + // t.Name (string) (string) + if len("name") > 1000000 { + return xerrors.Errorf("Value in field \"name\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("content"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil { return err } - if _, err := cw.WriteString(string("content")); err != nil { + if _, err := cw.WriteString(string("name")); err != nil { return err } - if len(t.Content) > 1000000 { - return xerrors.Errorf("Value in field t.Content was too long") + if len(t.Name) > 1000000 { + return xerrors.Errorf("Value in field t.Name was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Content))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil { return err } - if _, err := cw.WriteString(string(t.Content)); err != nil { + if _, err := cw.WriteString(string(t.Name)); err != nil { return err } - // t.Workflow (string) (string) - if len("workflow") > 1000000 { - return xerrors.Errorf("Value in field \"workflow\" was too long") + // t.Owner (string) (string) + if len("owner") > 1000000 { + return xerrors.Errorf("Value in field \"owner\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("workflow"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("owner"))); err != nil { return err } - if _, err := cw.WriteString(string("workflow")); err != nil { + if _, err := cw.WriteString(string("owner")); err != nil { return err } - if len(t.Workflow) > 1000000 { - return xerrors.Errorf("Value in field t.Workflow was too long") + if len(t.Owner) > 1000000 { + return xerrors.Errorf("Value in field t.Owner was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Workflow))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Owner))); err != nil { return err } - if _, err := cw.WriteString(string(t.Workflow)); err != nil { + if _, err := cw.WriteString(string(t.Owner)); err != nil { return err } return nil } -func (t *CiSubscribePipelineLogs_Data) UnmarshalCBOR(r io.Reader) (err error) { - *t = CiSubscribePipelineLogs_Data{} +func (t *RepoManifest_Declaration) UnmarshalCBOR(r io.Reader) (err error) { + *t = RepoManifest_Declaration{} cr := cbg.NewCborReader(r) @@ -611,12 +7552,12 @@ func (t *CiSubscribePipelineLogs_Data) UnmarshalCBOR(r io.Reader) (err error) { } if extra > cbg.MaxLength { - return fmt.Errorf("CiSubscribePipelineLogs_Data: map struct too large (%d)", extra) + return fmt.Errorf("RepoManifest_Declaration: map struct too large (%d)", extra) } n := extra - nameBuf := make([]byte, 8) + nameBuf := make([]byte, 5) for i := uint64(0); i < n; i++ { nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) if err != nil { @@ -632,56 +7573,8 @@ func (t *CiSubscribePipelineLogs_Data) UnmarshalCBOR(r io.Reader) (err error) { } switch string(nameBuf[:nameLen]) { - // t.Step (int64) (int64) - case "step": - { - maj, extra, err := cr.ReadHeader() - if err != nil { - return err - } - var extraI int64 - switch maj { - case cbg.MajUnsignedInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 positive overflow") - } - case cbg.MajNegativeInt: - extraI = int64(extra) - if extraI < 0 { - return fmt.Errorf("int64 negative overflow") - } - extraI = -1 - extraI - default: - return fmt.Errorf("wrong type for int64 field: %d", maj) - } - - t.Step = int64(extraI) - } - // t.Time (string) (string) - case "time": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.Time = string(sval) - } - // t.Stream (string) (string) - case "stream": - - { - sval, err := cbg.ReadStringWithMax(cr, 1000000) - if err != nil { - return err - } - - t.Stream = string(sval) - } - // t.Content (string) (string) - case "content": + // t.Name (string) (string) + case "name": { sval, err := cbg.ReadStringWithMax(cr, 1000000) @@ -689,10 +7582,10 @@ func (t *CiSubscribePipelineLogs_Data) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.Content = string(sval) + t.Name = string(sval) } - // t.Workflow (string) (string) - case "workflow": + // t.Owner (string) (string) + case "owner": { sval, err := cbg.ReadStringWithMax(cr, 1000000) @@ -700,7 +7593,7 @@ func (t *CiSubscribePipelineLogs_Data) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.Workflow = string(sval) + t.Owner = string(sval) } default: @@ -713,20 +7606,16 @@ func (t *CiSubscribePipelineLogs_Data) UnmarshalCBOR(r io.Reader) (err error) { return nil } -func (t *CiTriggerManual) MarshalCBOR(w io.Writer) error { +func (t *RepoReviewUnspeccedRound) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } cw := cbg.NewCborWriter(w) - fieldCount := 5 - - if t.Inputs == nil { - fieldCount-- - } + fieldCount := 6 - if t.Ref == nil { + if t.Labels == nil { fieldCount-- } @@ -734,81 +7623,55 @@ func (t *CiTriggerManual) MarshalCBOR(w io.Writer) error { return err } - // t.Ref (string) (string) - if t.Ref != nil { - - if len("ref") > 1000000 { - return xerrors.Errorf("Value in field \"ref\" was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ref"))); err != nil { - return err - } - if _, err := cw.WriteString(string("ref")); err != nil { - return err - } - - if t.Ref == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - if len(*t.Ref) > 1000000 { - return xerrors.Errorf("Value in field t.Ref was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Ref))); err != nil { - return err - } - if _, err := cw.WriteString(string(*t.Ref)); err != nil { - return err - } - } - } - - // t.Repo (string) (string) - if len("repo") > 1000000 { - return xerrors.Errorf("Value in field \"repo\" was too long") + // 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("repo"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { return err } - if _, err := cw.WriteString(string("repo")); err != nil { + if _, err := cw.WriteString(string("$type")); 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 { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.repo.review.unspecced.round"))); err != nil { return err } - if _, err := cw.WriteString(string(t.Repo)); err != nil { + if _, err := cw.WriteString(string("org.tangled.repo.review.unspecced.round")); err != nil { return err } - // t.LexiconTypeID (string) (string) - if len("$type") > 1000000 { - return xerrors.Errorf("Value in field \"$type\" was too long") + // t.State (string) (string) + if len("state") > 1000000 { + return xerrors.Errorf("Value in field \"state\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("state"))); err != nil { return err } - if _, err := cw.WriteString(string("$type")); err != nil { + if _, err := cw.WriteString(string("state")); err != nil { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.ci.trigger.manual"))); err != nil { - return err - } - if _, err := cw.WriteString(string("org.tangled.ci.trigger.manual")); err != nil { - return err + if t.State == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.State) > 1000000 { + return xerrors.Errorf("Value in field t.State was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.State))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.State)); err != nil { + return err + } } - // t.Commit (string) (string) + // t.Commit (org_tangled.GitOid) (struct) if len("commit") > 1000000 { return xerrors.Errorf("Value in field \"commit\" was too long") } @@ -820,50 +7683,79 @@ func (t *CiTriggerManual) MarshalCBOR(w io.Writer) error { return err } - if len(t.Commit) > 1000000 { - return xerrors.Errorf("Value in field t.Commit was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Commit))); err != nil { - return err - } - if _, err := cw.WriteString(string(t.Commit)); err != nil { + if err := t.Commit.MarshalCBOR(cw); err != nil { return err } - // t.Inputs ([]*org_tangled.CiTriggerManual_Pair) (slice) - if t.Inputs != nil { + // t.Labels (atproto.LabelDefs_SelfLabels) (struct) + if t.Labels != nil { - if len("inputs") > 1000000 { - return xerrors.Errorf("Value in field \"inputs\" was too long") + if len("labels") > 1000000 { + return xerrors.Errorf("Value in field \"labels\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("inputs"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("labels"))); err != nil { return err } - if _, err := cw.WriteString(string("inputs")); err != nil { + if _, err := cw.WriteString(string("labels")); err != nil { return err } - if len(t.Inputs) > 8192 { - return xerrors.Errorf("Slice value in field t.Inputs was too long") - } - - if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.Inputs))); err != nil { + if err := t.Labels.MarshalCBOR(cw); err != nil { return err } - for _, v := range t.Inputs { - if err := v.MarshalCBOR(cw); err != nil { - return err - } + } - } + // t.Subject (string) (string) + 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 len(t.Subject) > 1000000 { + return xerrors.Errorf("Value in field t.Subject was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Subject))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Subject)); 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 *CiTriggerManual) UnmarshalCBOR(r io.Reader) (err error) { - *t = CiTriggerManual{} +func (t *RepoReviewUnspeccedRound) UnmarshalCBOR(r io.Reader) (err error) { + *t = RepoReviewUnspeccedRound{} cr := cbg.NewCborReader(r) @@ -882,12 +7774,12 @@ func (t *CiTriggerManual) UnmarshalCBOR(r io.Reader) (err error) { } if extra > cbg.MaxLength { - return fmt.Errorf("CiTriggerManual: map struct too large (%d)", extra) + return fmt.Errorf("RepoReviewUnspeccedRound: map struct too large (%d)", extra) } n := extra - nameBuf := make([]byte, 6) + nameBuf := make([]byte, 9) for i := uint64(0); i < n; i++ { nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) if err != nil { @@ -903,8 +7795,19 @@ func (t *CiTriggerManual) UnmarshalCBOR(r io.Reader) (err error) { } switch string(nameBuf[:nameLen]) { - // t.Ref (string) (string) - case "ref": + // t.LexiconTypeID (string) (string) + case "$type": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.LexiconTypeID = string(sval) + } + // t.State (string) (string) + case "state": { b, err := cr.ReadByte() @@ -921,33 +7824,51 @@ func (t *CiTriggerManual) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.Ref = (*string)(&sval) + t.State = (*string)(&sval) } } - // t.Repo (string) (string) - case "repo": + // t.Commit (org_tangled.GitOid) (struct) + case "commit": { - sval, err := cbg.ReadStringWithMax(cr, 1000000) + + 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(GitOid) + if err := t.Commit.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Commit pointer: %w", err) + } + } - t.Repo = string(sval) } - // t.LexiconTypeID (string) (string) - case "$type": + // t.Labels (atproto.LabelDefs_SelfLabels) (struct) + case "labels": { - sval, err := cbg.ReadStringWithMax(cr, 1000000) + + b, err := cr.ReadByte() if err != nil { return err } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Labels = new(atproto.LabelDefs_SelfLabels) + if err := t.Labels.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Labels pointer: %w", err) + } + } - t.LexiconTypeID = string(sval) } - // t.Commit (string) (string) - case "commit": + // t.Subject (string) (string) + case "subject": { sval, err := cbg.ReadStringWithMax(cr, 1000000) @@ -955,56 +7876,18 @@ func (t *CiTriggerManual) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.Commit = string(sval) - } - // t.Inputs ([]*org_tangled.CiTriggerManual_Pair) (slice) - case "inputs": - - maj, extra, err = cr.ReadHeader() - if err != nil { - return err - } - - if extra > 8192 { - return fmt.Errorf("t.Inputs: array too large (%d)", extra) - } - - if maj != cbg.MajArray { - return fmt.Errorf("expected cbor array") - } - - if extra > 0 { - t.Inputs = make([]*CiTriggerManual_Pair, extra) + t.Subject = string(sval) } + // t.CreatedAt (string) (string) + case "createdAt": - for i := 0; i < int(extra); i++ { - { - var maj byte - var extra uint64 - var err error - _ = maj - _ = extra - _ = err - - { - - b, err := cr.ReadByte() - if err != nil { - return err - } - if b != cbg.CborNull[0] { - if err := cr.UnreadByte(); err != nil { - return err - } - t.Inputs[i] = new(CiTriggerManual_Pair) - if err := t.Inputs[i].UnmarshalCBOR(cr); err != nil { - return xerrors.Errorf("unmarshaling t.Inputs[i] pointer: %w", err) - } - } - - } - + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err } + + t.CreatedAt = string(sval) } default: @@ -1017,7 +7900,7 @@ func (t *CiTriggerManual) UnmarshalCBOR(r io.Reader) (err error) { return nil } -func (t *CiTriggerManual_Pair) MarshalCBOR(w io.Writer) error { +func (t *ReviewPatch) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err @@ -1025,60 +7908,111 @@ func (t *CiTriggerManual_Pair) MarshalCBOR(w io.Writer) error { cw := cbg.NewCborWriter(w) - if _, err := cw.Write([]byte{162}); err != nil { + if _, err := cw.Write([]byte{165}); err != nil { return err } - // t.Key (string) (string) - if len("key") > 1000000 { - return xerrors.Errorf("Value in field \"key\" was too long") + // t.Base (org_tangled.GitOid) (struct) + if len("base") > 1000000 { + return xerrors.Errorf("Value in field \"base\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("key"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("base"))); err != nil { return err } - if _, err := cw.WriteString(string("key")); err != nil { + if _, err := cw.WriteString(string("base")); err != nil { return err } - if len(t.Key) > 1000000 { - return xerrors.Errorf("Value in field t.Key was too long") + if err := t.Base.MarshalCBOR(cw); err != nil { + return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Key))); err != nil { + // t.Head (org_tangled.GitOid) (struct) + if len("head") > 1000000 { + return xerrors.Errorf("Value in field \"head\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("head"))); err != nil { return err } - if _, err := cw.WriteString(string(t.Key)); err != nil { + if _, err := cw.WriteString(string("head")); err != nil { return err } - // t.Value (string) (string) - if len("value") > 1000000 { - return xerrors.Errorf("Value in field \"value\" was too long") + if err := t.Head.MarshalCBOR(cw); err != nil { + return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("value"))); err != nil { + // 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("value")); err != nil { + if _, err := cw.WriteString(string("$type")); err != nil { return err } - if len(t.Value) > 1000000 { - return xerrors.Errorf("Value in field t.Value was too long") + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.review.patch"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.review.patch")); err != nil { + return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Value))); err != nil { + // t.Ticket (string) (string) + if len("ticket") > 1000000 { + return xerrors.Errorf("Value in field \"ticket\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ticket"))); err != nil { return err } - if _, err := cw.WriteString(string(t.Value)); err != nil { + if _, err := cw.WriteString(string("ticket")); err != nil { + return err + } + + if len(t.Ticket) > 1000000 { + return xerrors.Errorf("Value in field t.Ticket was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Ticket))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Ticket)); 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 *CiTriggerManual_Pair) UnmarshalCBOR(r io.Reader) (err error) { - *t = CiTriggerManual_Pair{} +func (t *ReviewPatch) UnmarshalCBOR(r io.Reader) (err error) { + *t = ReviewPatch{} cr := cbg.NewCborReader(r) @@ -1097,12 +8031,12 @@ func (t *CiTriggerManual_Pair) UnmarshalCBOR(r io.Reader) (err error) { } if extra > cbg.MaxLength { - return fmt.Errorf("CiTriggerManual_Pair: map struct too large (%d)", extra) + return fmt.Errorf("ReviewPatch: map struct too large (%d)", extra) } n := extra - nameBuf := make([]byte, 5) + nameBuf := make([]byte, 9) for i := uint64(0); i < n; i++ { nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) if err != nil { @@ -1118,8 +8052,48 @@ func (t *CiTriggerManual_Pair) UnmarshalCBOR(r io.Reader) (err error) { } switch string(nameBuf[:nameLen]) { - // t.Key (string) (string) - case "key": + // t.Base (org_tangled.GitOid) (struct) + case "base": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Base = new(GitOid) + if err := t.Base.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Base pointer: %w", err) + } + } + + } + // t.Head (org_tangled.GitOid) (struct) + case "head": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Head = new(GitOid) + if err := t.Head.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Head pointer: %w", err) + } + } + + } + // t.LexiconTypeID (string) (string) + case "$type": { sval, err := cbg.ReadStringWithMax(cr, 1000000) @@ -1127,10 +8101,10 @@ func (t *CiTriggerManual_Pair) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.Key = string(sval) + t.LexiconTypeID = string(sval) } - // t.Value (string) (string) - case "value": + // t.Ticket (string) (string) + case "ticket": { sval, err := cbg.ReadStringWithMax(cr, 1000000) @@ -1138,7 +8112,18 @@ func (t *CiTriggerManual_Pair) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.Value = string(sval) + t.Ticket = string(sval) + } + // t.CreatedAt (string) (string) + case "createdAt": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.CreatedAt = string(sval) } default: @@ -1151,7 +8136,7 @@ func (t *CiTriggerManual_Pair) UnmarshalCBOR(r io.Reader) (err error) { return nil } -func (t *EventPullRequest) MarshalCBOR(w io.Writer) error { +func (t *ShTombstone) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err @@ -1159,7 +8144,7 @@ func (t *EventPullRequest) MarshalCBOR(w io.Writer) error { cw := cbg.NewCborWriter(w) - if _, err := cw.Write([]byte{161}); err != nil { + if _, err := cw.Write([]byte{162}); err != nil { return err } @@ -1175,17 +8160,40 @@ func (t *EventPullRequest) MarshalCBOR(w io.Writer) error { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.event.pullRequest"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.shTombstone"))); err != nil { return err } - if _, err := cw.WriteString(string("org.tangled.event.pullRequest")); err != nil { + if _, err := cw.WriteString(string("org.tangled.shTombstone")); 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 *EventPullRequest) UnmarshalCBOR(r io.Reader) (err error) { - *t = EventPullRequest{} +func (t *ShTombstone) UnmarshalCBOR(r io.Reader) (err error) { + *t = ShTombstone{} cr := cbg.NewCborReader(r) @@ -1204,12 +8212,12 @@ func (t *EventPullRequest) UnmarshalCBOR(r io.Reader) (err error) { } if extra > cbg.MaxLength { - return fmt.Errorf("EventPullRequest: map struct too large (%d)", extra) + return fmt.Errorf("ShTombstone: map struct too large (%d)", extra) } n := extra - nameBuf := make([]byte, 5) + nameBuf := make([]byte, 9) for i := uint64(0); i < n; i++ { nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) if err != nil { @@ -1234,7 +8242,18 @@ func (t *EventPullRequest) UnmarshalCBOR(r io.Reader) (err error) { return err } - t.LexiconTypeID = string(sval) + t.LexiconTypeID = string(sval) + } + // t.CreatedAt (string) (string) + case "createdAt": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.CreatedAt = string(sval) } default: @@ -1247,15 +8266,20 @@ func (t *EventPullRequest) UnmarshalCBOR(r io.Reader) (err error) { return nil } -func (t *EventPush) MarshalCBOR(w io.Writer) error { +func (t *SnippetString) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } cw := cbg.NewCborWriter(w) + fieldCount := 4 - if _, err := cw.Write([]byte{161}); err != nil { + if t.Description == nil { + fieldCount-- + } + + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { return err } @@ -1271,17 +8295,88 @@ func (t *EventPush) MarshalCBOR(w io.Writer) error { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.event.push"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.snippet.string"))); err != nil { return err } - if _, err := cw.WriteString(string("org.tangled.event.push")); err != nil { + if _, err := cw.WriteString(string("org.tangled.snippet.string")); err != nil { return err } + + // t.Snippet (org_tangled.SnippetString_Snippet) (struct) + if len("snippet") > 1000000 { + return xerrors.Errorf("Value in field \"snippet\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("snippet"))); err != nil { + return err + } + if _, err := cw.WriteString(string("snippet")); err != nil { + return err + } + + if err := t.Snippet.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 + } + + // t.Description (string) (string) + if t.Description != nil { + + if len("description") > 1000000 { + return xerrors.Errorf("Value in field \"description\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("description"))); err != nil { + return err + } + if _, err := cw.WriteString(string("description")); err != nil { + return err + } + + if t.Description == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.Description) > 1000000 { + return xerrors.Errorf("Value in field t.Description was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Description))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.Description)); err != nil { + return err + } + } + } return nil } -func (t *EventPush) UnmarshalCBOR(r io.Reader) (err error) { - *t = EventPush{} +func (t *SnippetString) UnmarshalCBOR(r io.Reader) (err error) { + *t = SnippetString{} cr := cbg.NewCborReader(r) @@ -1300,12 +8395,12 @@ func (t *EventPush) UnmarshalCBOR(r io.Reader) (err error) { } if extra > cbg.MaxLength { - return fmt.Errorf("EventPush: map struct too large (%d)", extra) + return fmt.Errorf("SnippetString: map struct too large (%d)", extra) } n := extra - nameBuf := make([]byte, 5) + nameBuf := make([]byte, 11) for i := uint64(0); i < n; i++ { nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) if err != nil { @@ -1332,6 +8427,58 @@ func (t *EventPush) UnmarshalCBOR(r io.Reader) (err error) { t.LexiconTypeID = string(sval) } + // t.Snippet (org_tangled.SnippetString_Snippet) (struct) + case "snippet": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Snippet = new(SnippetString_Snippet) + if err := t.Snippet.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Snippet pointer: %w", err) + } + } + + } + // t.CreatedAt (string) (string) + case "createdAt": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.CreatedAt = string(sval) + } + // t.Description (string) (string) + case "description": + + { + b, err := cr.ReadByte() + 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.Description = (*string)(&sval) + } + } default: // Field doesn't exist on this type, so ignore it @@ -1343,7 +8490,7 @@ func (t *EventPush) UnmarshalCBOR(r io.Reader) (err error) { return nil } -func (t *FeedSubscription) MarshalCBOR(w io.Writer) error { +func (t *SnippetString_TextFile) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err @@ -1355,68 +8502,68 @@ func (t *FeedSubscription) MarshalCBOR(w io.Writer) error { return err } - // t.LexiconTypeID (string) (string) - if len("$type") > 1000000 { - return xerrors.Errorf("Value in field \"$type\" was too long") + // t.Name (string) (string) + if len("name") > 1000000 { + return xerrors.Errorf("Value in field \"name\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil { return err } - if _, err := cw.WriteString(string("$type")); err != nil { + if _, err := cw.WriteString(string("name")); err != nil { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.feed.subscription"))); err != nil { + if len(t.Name) > 1000000 { + return xerrors.Errorf("Value in field t.Name was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil { return err } - if _, err := cw.WriteString(string("org.tangled.feed.subscription")); err != nil { + if _, err := cw.WriteString(string(t.Name)); 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") + // 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("subject"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { return err } - if _, err := cw.WriteString(string("subject")); err != nil { + if _, err := cw.WriteString(string("$type")); err != nil { return err } - if err := t.Subject.MarshalCBOR(cw); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.snippet.string#textFile"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.snippet.string#textFile")); err != nil { return err } - // t.CreatedAt (string) (string) - if len("createdAt") > 1000000 { - return xerrors.Errorf("Value in field \"createdAt\" was too long") + // t.Content (util.LexBlob) (struct) + if len("content") > 1000000 { + return xerrors.Errorf("Value in field \"content\" was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("content"))); err != nil { return err } - if _, err := cw.WriteString(string("createdAt")); err != nil { + if _, err := cw.WriteString(string("content")); 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 { + if err := t.Content.MarshalCBOR(cw); err != nil { return err } return nil } -func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedSubscription{} +func (t *SnippetString_TextFile) UnmarshalCBOR(r io.Reader) (err error) { + *t = SnippetString_TextFile{} cr := cbg.NewCborReader(r) @@ -1435,12 +8582,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("SnippetString_TextFile: map struct too large (%d)", extra) } n := extra - nameBuf := make([]byte, 9) + nameBuf := make([]byte, 7) for i := uint64(0); i < n; i++ { nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) if err != nil { @@ -1456,7 +8603,18 @@ func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { } switch string(nameBuf[:nameLen]) { - // t.LexiconTypeID (string) (string) + // t.Name (string) (string) + case "name": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.Name = string(sval) + } + // t.LexiconTypeID (string) (string) case "$type": { @@ -1467,8 +8625,8 @@ func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { t.LexiconTypeID = string(sval) } - // t.Subject (org_tangled.FeedSubscription_Subject) (struct) - case "subject": + // t.Content (util.LexBlob) (struct) + case "content": { @@ -1480,24 +8638,13 @@ func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { 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.Content = new(util.LexBlob) + if err := t.Content.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Content 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 @@ -1509,64 +8656,225 @@ func (t *FeedSubscription) UnmarshalCBOR(r io.Reader) (err error) { return nil } -func (t *FeedSubscription_Record) MarshalCBOR(w io.Writer) error { +func (t *TrackTicket) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } cw := cbg.NewCborWriter(w) + fieldCount := 8 - if _, err := cw.Write([]byte{162}); err != nil { + if t.Body == nil { + fieldCount-- + } + + if t.Labels == nil { + fieldCount-- + } + + if t.TangledLabels == nil { + fieldCount-- + } + + if t.TargetBranch == nil { + fieldCount-- + } + + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + return err + } + + // t.Body (org_tangled.TrackTicket_Body) (struct) + if t.Body != nil { + + if len("body") > 1000000 { + return xerrors.Errorf("Value in field \"body\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil { + return err + } + if _, err := cw.WriteString(string("body")); err != nil { + return err + } + + if err := t.Body.MarshalCBOR(cw); 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.track.ticket"))); err != nil { + return err + } + if _, err := cw.WriteString(string("org.tangled.track.ticket")); err != nil { + return err + } + + // t.State (string) (string) + if len("state") > 1000000 { + return xerrors.Errorf("Value in field \"state\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("state"))); err != nil { + return err + } + if _, err := cw.WriteString(string("state")); err != nil { + return err + } + + if t.State == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.State) > 1000000 { + return xerrors.Errorf("Value in field t.State was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.State))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.State)); err != nil { + return err + } + } + + // t.Title (org_tangled.TrackTicket_Title) (struct) + if len("title") > 1000000 { + return xerrors.Errorf("Value in field \"title\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("title"))); 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.WriteString(string("title")); err != nil { + return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("uri"))); err != nil { + if err := t.Title.MarshalCBOR(cw); err != nil { return err } - if _, err := cw.WriteString(string("uri")); err != nil { - return err + + // t.Labels (atproto.LabelDefs_SelfLabels) (struct) + if t.Labels != nil { + + if len("labels") > 1000000 { + return xerrors.Errorf("Value in field \"labels\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("labels"))); err != nil { + return err + } + if _, err := cw.WriteString(string("labels")); err != nil { + return err + } + + if err := t.Labels.MarshalCBOR(cw); err != nil { + return err + } } - if len(t.Uri) > 1000000 { - return xerrors.Errorf("Value in field t.Uri was too long") + // 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(t.Uri))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { return err } - if _, err := cw.WriteString(string(t.Uri)); err != nil { + if _, err := cw.WriteString(string("createdAt")); err != nil { return err } - // t.LexiconTypeID (string) (string) - if len("$type") > 1000000 { - return xerrors.Errorf("Value in field \"$type\" was too long") + if len(t.CreatedAt) > 1000000 { + return xerrors.Errorf("Value in field t.CreatedAt was too long") } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { return err } - if _, err := cw.WriteString(string("$type")); err != nil { + if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { return err } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("org.tangled.feed.subscription#record"))); err != nil { - return err + // t.TargetBranch (string) (string) + if t.TargetBranch != nil { + + if len("targetBranch") > 1000000 { + return xerrors.Errorf("Value in field \"targetBranch\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("targetBranch"))); err != nil { + return err + } + if _, err := cw.WriteString(string("targetBranch")); err != nil { + return err + } + + if t.TargetBranch == nil { + if _, err := cw.Write(cbg.CborNull); err != nil { + return err + } + } else { + if len(*t.TargetBranch) > 1000000 { + return xerrors.Errorf("Value in field t.TargetBranch was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.TargetBranch))); err != nil { + return err + } + if _, err := cw.WriteString(string(*t.TargetBranch)); err != nil { + return err + } + } } - if _, err := cw.WriteString(string("org.tangled.feed.subscription#record")); err != nil { - return err + + // t.TangledLabels ([]*org_tangled.TrackTicket_TangledLabels_Elem) (slice) + if t.TangledLabels != nil { + + if len("tangledLabels") > 1000000 { + return xerrors.Errorf("Value in field \"tangledLabels\" was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("tangledLabels"))); err != nil { + return err + } + if _, err := cw.WriteString(string("tangledLabels")); err != nil { + return err + } + + if len(t.TangledLabels) > 8192 { + return xerrors.Errorf("Slice value in field t.TangledLabels was too long") + } + + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.TangledLabels))); err != nil { + return err + } + for _, v := range t.TangledLabels { + if err := v.MarshalCBOR(cw); err != nil { + return err + } + + } } return nil } -func (t *FeedSubscription_Record) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedSubscription_Record{} +func (t *TrackTicket) UnmarshalCBOR(r io.Reader) (err error) { + *t = TrackTicket{} cr := cbg.NewCborReader(r) @@ -1585,12 +8893,12 @@ func (t *FeedSubscription_Record) UnmarshalCBOR(r io.Reader) (err error) { } if extra > cbg.MaxLength { - return fmt.Errorf("FeedSubscription_Record: map struct too large (%d)", extra) + return fmt.Errorf("TrackTicket: map struct too large (%d)", extra) } n := extra - nameBuf := make([]byte, 5) + nameBuf := make([]byte, 13) for i := uint64(0); i < n; i++ { nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) if err != nil { @@ -1606,16 +8914,25 @@ func (t *FeedSubscription_Record) UnmarshalCBOR(r io.Reader) (err error) { } switch string(nameBuf[:nameLen]) { - // t.Uri (string) (string) - case "uri": + // t.Body (org_tangled.TrackTicket_Body) (struct) + case "body": { - sval, err := cbg.ReadStringWithMax(cr, 1000000) + + b, err := cr.ReadByte() if err != nil { return err } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Body = new(TrackTicket_Body) + if err := t.Body.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Body pointer: %w", err) + } + } - t.Uri = string(sval) } // t.LexiconTypeID (string) (string) case "$type": @@ -1628,6 +8945,148 @@ func (t *FeedSubscription_Record) UnmarshalCBOR(r io.Reader) (err error) { t.LexiconTypeID = string(sval) } + // t.State (string) (string) + case "state": + + { + b, err := cr.ReadByte() + 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.State = (*string)(&sval) + } + } + // t.Title (org_tangled.TrackTicket_Title) (struct) + case "title": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Title = new(TrackTicket_Title) + if err := t.Title.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Title pointer: %w", err) + } + } + + } + // t.Labels (atproto.LabelDefs_SelfLabels) (struct) + case "labels": + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.Labels = new(atproto.LabelDefs_SelfLabels) + if err := t.Labels.UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.Labels pointer: %w", err) + } + } + + } + // t.CreatedAt (string) (string) + case "createdAt": + + { + sval, err := cbg.ReadStringWithMax(cr, 1000000) + if err != nil { + return err + } + + t.CreatedAt = string(sval) + } + // t.TargetBranch (string) (string) + case "targetBranch": + + { + b, err := cr.ReadByte() + 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.TargetBranch = (*string)(&sval) + } + } + // t.TangledLabels ([]*org_tangled.TrackTicket_TangledLabels_Elem) (slice) + case "tangledLabels": + + maj, extra, err = cr.ReadHeader() + if err != nil { + return err + } + + if extra > 8192 { + return fmt.Errorf("t.TangledLabels: array too large (%d)", extra) + } + + if maj != cbg.MajArray { + return fmt.Errorf("expected cbor array") + } + + if extra > 0 { + t.TangledLabels = make([]*TrackTicket_TangledLabels_Elem, extra) + } + + for i := 0; i < int(extra); i++ { + { + var maj byte + var extra uint64 + var err error + _ = maj + _ = extra + _ = err + + { + + b, err := cr.ReadByte() + if err != nil { + return err + } + if b != cbg.CborNull[0] { + if err := cr.UnreadByte(); err != nil { + return err + } + t.TangledLabels[i] = new(TrackTicket_TangledLabels_Elem) + if err := t.TangledLabels[i].UnmarshalCBOR(cr); err != nil { + return xerrors.Errorf("unmarshaling t.TangledLabels[i] pointer: %w", err) + } + } + + } + + } + } default: // Field doesn't exist on this type, so ignore it @@ -1639,7 +9098,7 @@ func (t *FeedSubscription_Record) UnmarshalCBOR(r io.Reader) (err error) { return nil } -func (t *FeedSubscription_Repo) MarshalCBOR(w io.Writer) error { +func (t *TrackUnspeccedMilestone) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err @@ -1647,30 +9106,7 @@ func (t *FeedSubscription_Repo) MarshalCBOR(w io.Writer) error { 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 { + if _, err := cw.Write([]byte{161}); err != nil { return err } @@ -1686,17 +9122,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("org.tangled.track.unspecced.milestone"))); err != nil { return err } - if _, err := cw.WriteString(string("org.tangled.feed.subscription#repo")); err != nil { + if _, err := cw.WriteString(string("org.tangled.track.unspecced.milestone")); err != nil { return err } return nil } -func (t *FeedSubscription_Repo) UnmarshalCBOR(r io.Reader) (err error) { - *t = FeedSubscription_Repo{} +func (t *TrackUnspeccedMilestone) UnmarshalCBOR(r io.Reader) (err error) { + *t = TrackUnspeccedMilestone{} cr := cbg.NewCborReader(r) @@ -1715,7 +9151,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("TrackUnspeccedMilestone: map struct too large (%d)", extra) } n := extra @@ -1736,18 +9172,7 @@ func (t *FeedSubscription_Repo) UnmarshalCBOR(r io.Reader) (err error) { } 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) + // t.LexiconTypeID (string) (string) case "$type": { diff --git a/api/org_tangled/cigetPipeline.go b/api/org_tangled/cigetPipeline.go index 10ccac20c..b11d3ec25 100644 --- a/api/org_tangled/cigetPipeline.go +++ b/api/org_tangled/cigetPipeline.go @@ -17,11 +17,13 @@ const ( // CiGetPipeline calls the XRPC method "org.tangled.ci.getPipeline". // // pipeline: Spindle-local pipeline id -func CiGetPipeline(ctx context.Context, c util.LexClient, pipeline string) (*CiPipeline, error) { +// repo: Repository DID +func CiGetPipeline(ctx context.Context, c util.LexClient, pipeline string, repo string) (*CiPipeline, error) { var out CiPipeline params := map[string]interface{}{} params["pipeline"] = pipeline + params["repo"] = repo if err := c.LexDo(ctx, util.Query, "", "org.tangled.ci.getPipeline", params, nil, &out); err != nil { return nil, err } diff --git a/api/org_tangled/cisubscribePipelineLogs_ext_test.go b/api/org_tangled/cisubscribePipelineLogs_ext_test.go index 3974e94db..34b800c7b 100644 --- a/api/org_tangled/cisubscribePipelineLogs_ext_test.go +++ b/api/org_tangled/cisubscribePipelineLogs_ext_test.go @@ -1,20 +1,21 @@ -package org_tangled +package org_tangled_test import ( "bytes" "testing" + "tangled.org/core/api/org_tangled" "tangled.org/core/api/tangled" ) func TestCiSubscribePipelineLogsEventRoundTrip(t *testing.T) { - roundTrip := func(want CiSubscribePipelineLogs_Event) CiSubscribePipelineLogs_Event { + roundTrip := func(want org_tangled.CiSubscribePipelineLogs_Event) org_tangled.CiSubscribePipelineLogs_Event { t.Helper() var buf bytes.Buffer if err := want.Serialize(&buf); err != nil { t.Fatal(err) } - var got CiSubscribePipelineLogs_Event + var got org_tangled.CiSubscribePipelineLogs_Event if err := got.Deserialize(&buf); err != nil { t.Fatal(err) } @@ -22,14 +23,14 @@ func TestCiSubscribePipelineLogsEventRoundTrip(t *testing.T) { } kind := "user" - got := roundTrip(CiSubscribePipelineLogs_Event{Control: &CiSubscribePipelineLogs_Control{ + got := roundTrip(org_tangled.CiSubscribePipelineLogs_Event{Control: &org_tangled.CiSubscribePipelineLogs_Control{ Content: "building", Kind: &kind, Step: 2, Time: "2026-08-30T00:00:00Z", Workflow: "ci.yml", }}) if got.Control == nil || got.Control.Content != "building" || got.Control.Workflow != "ci.yml" || got.Control.Step != 2 { t.Fatalf("control = %+v", got.Control) } - got = roundTrip(CiSubscribePipelineLogs_Event{Data: &CiSubscribePipelineLogs_Data{ + got = roundTrip(org_tangled.CiSubscribePipelineLogs_Event{Data: &org_tangled.CiSubscribePipelineLogs_Data{ Content: "hello", Step: 1, Stream: "stdout", Time: "2026-08-30T00:00:00Z", Workflow: "ci.yml", }}) if got.Data == nil || got.Data.Content != "hello" || got.Data.Stream != "stdout" { @@ -43,7 +44,7 @@ func TestCiSubscribePipelineLogsEventRoundTrip(t *testing.T) { if err := legacy.Serialize(&buf); err != nil { t.Fatal(err) } - got = CiSubscribePipelineLogs_Event{} + got = org_tangled.CiSubscribePipelineLogs_Event{} if err := got.Deserialize(&buf); err != nil { t.Fatal(err) } diff --git a/api/org_tangled/triggermanual.go b/api/org_tangled/citriggermanual.go similarity index 100% rename from api/org_tangled/triggermanual.go rename to api/org_tangled/citriggermanual.go diff --git a/api/org_tangled/embedcommit.go b/api/org_tangled/embedcommit.go new file mode 100644 index 000000000..e43ed265e --- /dev/null +++ b/api/org_tangled/embedcommit.go @@ -0,0 +1,23 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.embed.commit + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + EmbedCommitNSID = "org.tangled.embed.commit" +) + +func init() { + util.RegisterType("org.tangled.embed.commit#main", &EmbedCommit{}) +} // EmbedCommit is a "main" in the org.tangled.embed.commit schema. +// RECORDTYPE: EmbedCommit +type EmbedCommit struct { + LexiconTypeID string `json:"$type,const=org.tangled.embed.commit" cborgen:"$type,const=org.tangled.embed.commit"` + Commit *GitOid `json:"commit" cborgen:"commit"` + Repo string `json:"repo" cborgen:"repo"` +} diff --git a/api/org_tangled/embedunspeccedfile.go b/api/org_tangled/embedunspeccedfile.go new file mode 100644 index 000000000..aec57c3fd --- /dev/null +++ b/api/org_tangled/embedunspeccedfile.go @@ -0,0 +1,16 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.embed.unspecced.file + +const ( + EmbedUnspeccedFileNSID = "org.tangled.embed.unspecced.file" +) + +// EmbedUnspeccedFile is a "main" in the org.tangled.embed.unspecced.file schema. +type EmbedUnspeccedFile struct { + Commit *GitOid `json:"commit" cborgen:"commit"` + Path string `json:"path" cborgen:"path"` + Repo string `json:"repo" cborgen:"repo"` +} diff --git a/api/org_tangled/eventpush.go b/api/org_tangled/eventpush.go index bac20f86a..4981e9ed1 100644 --- a/api/org_tangled/eventpush.go +++ b/api/org_tangled/eventpush.go @@ -20,4 +20,8 @@ func init() { // RECORDTYPE: EventPush type EventPush struct { LexiconTypeID string `json:"$type,const=org.tangled.event.push" cborgen:"$type,const=org.tangled.event.push"` + NewSha string `json:"newSha" cborgen:"newSha"` + OldSha string `json:"oldSha" cborgen:"oldSha"` + Ref string `json:"ref" cborgen:"ref"` + Repo string `json:"repo" cborgen:"repo"` } diff --git a/api/org_tangled/feedcomment.go b/api/org_tangled/feedcomment.go new file mode 100644 index 000000000..2798e5a68 --- /dev/null +++ b/api/org_tangled/feedcomment.go @@ -0,0 +1,195 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.feed.comment + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + + comatprototypes "github.com/bluesky-social/indigo/api/atproto" + "github.com/bluesky-social/indigo/lex/util" + cbg "github.com/whyrusleeping/cbor-gen" +) + +const ( + FeedCommentNSID = "org.tangled.feed.comment" +) + +func init() { + util.RegisterType("org.tangled.feed.comment", &FeedComment{}) +} // +// RECORDTYPE: FeedComment +type FeedComment struct { + LexiconTypeID string `json:"$type,const=org.tangled.feed.comment" cborgen:"$type,const=org.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"` + ReplyTo *comatprototypes.RepoStrongRef `json:"replyTo,omitempty" cborgen:"replyTo,omitempty"` + Subject *FeedComment_Subject `json:"subject" cborgen:"subject"` +} + +type FeedComment_Body struct { + MarkupMarkdown *MarkupMarkdown +} + +func (t *FeedComment_Body) MarshalJSON() ([]byte, error) { + if t.MarkupMarkdown != nil { + t.MarkupMarkdown.LexiconTypeID = "org.tangled.markup.markdown" + return json.Marshal(t.MarkupMarkdown) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *FeedComment_Body) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "org.tangled.markup.markdown": + t.MarkupMarkdown = new(MarkupMarkdown) + return json.Unmarshal(b, t.MarkupMarkdown) + + default: + return nil + } +} + +func (t *FeedComment_Body) MarshalCBOR(w io.Writer) error { + + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + if t.MarkupMarkdown != nil { + return t.MarkupMarkdown.MarshalCBOR(w) + } + return fmt.Errorf("cannot cbor marshal empty enum") +} +func (t *FeedComment_Body) UnmarshalCBOR(r io.Reader) error { + typ, b, err := util.CborTypeExtractReader(r) + if err != nil { + return err + } + + switch typ { + case "org.tangled.markup.markdown": + t.MarkupMarkdown = new(MarkupMarkdown) + return t.MarkupMarkdown.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return nil + } +} + +type FeedComment_Embed struct { + EmbedCommit *EmbedCommit +} + +func (t *FeedComment_Embed) MarshalJSON() ([]byte, error) { + if t.EmbedCommit != nil { + t.EmbedCommit.LexiconTypeID = "org.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 "org.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 "org.tangled.embed.commit": + t.EmbedCommit = new(EmbedCommit) + return t.EmbedCommit.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return nil + } +} + +type FeedComment_Subject struct { + RepoStrongRef *comatprototypes.RepoStrongRef +} + +func (t *FeedComment_Subject) MarshalJSON() ([]byte, error) { + if t.RepoStrongRef != nil { + t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" + return json.Marshal(t.RepoStrongRef) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *FeedComment_Subject) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "com.atproto.repo.strongRef": + t.RepoStrongRef = new(comatprototypes.RepoStrongRef) + return json.Unmarshal(b, t.RepoStrongRef) + + default: + return nil + } +} + +func (t *FeedComment_Subject) MarshalCBOR(w io.Writer) error { + + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + if t.RepoStrongRef != nil { + return t.RepoStrongRef.MarshalCBOR(w) + } + return fmt.Errorf("cannot cbor marshal empty enum") +} +func (t *FeedComment_Subject) UnmarshalCBOR(r io.Reader) error { + typ, b, err := util.CborTypeExtractReader(r) + if err != nil { + return err + } + + switch typ { + case "com.atproto.repo.strongRef": + t.RepoStrongRef = new(comatprototypes.RepoStrongRef) + return t.RepoStrongRef.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return nil + } +} diff --git a/api/org_tangled/feedreaction.go b/api/org_tangled/feedreaction.go new file mode 100644 index 000000000..e1dfa56fc --- /dev/null +++ b/api/org_tangled/feedreaction.go @@ -0,0 +1,25 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.feed.reaction + +import ( + comatprototypes "github.com/bluesky-social/indigo/api/atproto" + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + FeedReactionNSID = "org.tangled.feed.reaction" +) + +func init() { + util.RegisterType("org.tangled.feed.reaction", &FeedReaction{}) +} // +// RECORDTYPE: FeedReaction +type FeedReaction struct { + LexiconTypeID string `json:"$type,const=org.tangled.feed.reaction" cborgen:"$type,const=org.tangled.feed.reaction"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Reaction string `json:"reaction" cborgen:"reaction"` + Subject *comatprototypes.RepoStrongRef `json:"subject" cborgen:"subject"` +} diff --git a/api/org_tangled/feedstar.go b/api/org_tangled/feedstar.go new file mode 100644 index 000000000..65b6b682b --- /dev/null +++ b/api/org_tangled/feedstar.go @@ -0,0 +1,114 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.feed.star + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + + comatprototypes "github.com/bluesky-social/indigo/api/atproto" + "github.com/bluesky-social/indigo/lex/util" + cbg "github.com/whyrusleeping/cbor-gen" +) + +const ( + FeedStarNSID = "org.tangled.feed.star" +) + +func init() { + util.RegisterType("org.tangled.feed.star", &FeedStar{}) +} // +// RECORDTYPE: FeedStar +type FeedStar struct { + LexiconTypeID string `json:"$type,const=org.tangled.feed.star" cborgen:"$type,const=org.tangled.feed.star"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Subject *FeedStar_Subject `json:"subject" cborgen:"subject"` +} + +// FeedStar_Record is a "record" in the org.tangled.feed.star schema. +// +// RECORDTYPE: FeedStar_Record +type FeedStar_Record struct { + LexiconTypeID string `json:"$type,const=org.tangled.feed.star#record" cborgen:"$type,const=org.tangled.feed.star#record"` + Record *comatprototypes.RepoStrongRef `json:"record" cborgen:"record"` +} + +// FeedStar_Repo is a "repo" in the org.tangled.feed.star schema. +// +// RECORDTYPE: FeedStar_Repo +type FeedStar_Repo struct { + LexiconTypeID string `json:"$type,const=org.tangled.feed.star#repo" cborgen:"$type,const=org.tangled.feed.star#repo"` + Identity string `json:"identity" cborgen:"identity"` +} + +type FeedStar_Subject struct { + FeedStar_Repo *FeedStar_Repo + FeedStar_Record *FeedStar_Record +} + +func (t *FeedStar_Subject) MarshalJSON() ([]byte, error) { + if t.FeedStar_Repo != nil { + t.FeedStar_Repo.LexiconTypeID = "org.tangled.feed.star#repo" + return json.Marshal(t.FeedStar_Repo) + } + if t.FeedStar_Record != nil { + t.FeedStar_Record.LexiconTypeID = "org.tangled.feed.star#record" + return json.Marshal(t.FeedStar_Record) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *FeedStar_Subject) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "org.tangled.feed.star#repo": + t.FeedStar_Repo = new(FeedStar_Repo) + return json.Unmarshal(b, t.FeedStar_Repo) + case "org.tangled.feed.star#record": + t.FeedStar_Record = new(FeedStar_Record) + return json.Unmarshal(b, t.FeedStar_Record) + + default: + return fmt.Errorf("closed enums must have a matching value") + } +} + +func (t *FeedStar_Subject) MarshalCBOR(w io.Writer) error { + + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + if t.FeedStar_Repo != nil { + return t.FeedStar_Repo.MarshalCBOR(w) + } + if t.FeedStar_Record != nil { + return t.FeedStar_Record.MarshalCBOR(w) + } + return fmt.Errorf("cannot cbor marshal empty enum") +} +func (t *FeedStar_Subject) UnmarshalCBOR(r io.Reader) error { + typ, b, err := util.CborTypeExtractReader(r) + if err != nil { + return err + } + + switch typ { + case "org.tangled.feed.star#repo": + t.FeedStar_Repo = new(FeedStar_Repo) + return t.FeedStar_Repo.UnmarshalCBOR(bytes.NewReader(b)) + case "org.tangled.feed.star#record": + t.FeedStar_Record = new(FeedStar_Record) + return t.FeedStar_Record.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return fmt.Errorf("closed enums must have a matching value") + } +} diff --git a/api/org_tangled/feedsubscription.go b/api/org_tangled/feedsubscription.go index 8ccd828cb..3b6c6438f 100644 --- a/api/org_tangled/feedsubscription.go +++ b/api/org_tangled/feedsubscription.go @@ -23,9 +23,11 @@ func init() { } // // RECORDTYPE: FeedSubscription type FeedSubscription struct { - 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"` + LexiconTypeID string `json:"$type,const=org.tangled.feed.subscription" cborgen:"$type,const=org.tangled.feed.subscription"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // ignore: mute this thread + Ignore *bool `json:"ignore,omitempty" cborgen:"ignore,omitempty"` + Subject *FeedSubscription_Subject `json:"subject" cborgen:"subject"` } // FeedSubscription_Record is a "record" in the org.tangled.feed.subscription schema. diff --git a/api/org_tangled/gitdefs.go b/api/org_tangled/gitdefs.go new file mode 100644 index 000000000..2b47877f9 --- /dev/null +++ b/api/org_tangled/gitdefs.go @@ -0,0 +1,92 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.defs + +const () + +// GitDefs_ByteChanges is a "byteChanges" in the org.tangled.git.defs schema. +type GitDefs_ByteChanges struct { + Lhs int64 `json:"lhs" cborgen:"lhs"` + Rhs int64 `json:"rhs" cborgen:"rhs"` +} + +// GitDefs_Commit is a "commit" in the org.tangled.git.defs schema. +type GitDefs_Commit struct { + Author *GitDefs_Signature `json:"author" cborgen:"author"` + Committer *GitDefs_Signature `json:"committer" cborgen:"committer"` + // hash: Commit Object ID + Hash string `json:"hash" cborgen:"hash"` + Message string `json:"message" cborgen:"message"` + // tree: Tree Object ID + Tree string `json:"tree" cborgen:"tree"` +} + +// GitDefs_DiffHunk is a "diffHunk" in the org.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 org.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_DiffStat is a "diffStat" in the org.tangled.git.defs schema. +type GitDefs_DiffStat struct { + Deletions int64 `json:"deletions" cborgen:"deletions"` + FilesChanged int64 `json:"filesChanged" cborgen:"filesChanged"` + Insertions int64 `json:"insertions" cborgen:"insertions"` +} + +// GitDefs_FileDiff is a "fileDiff" in the org.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 org.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 org.tangled.git.defs schema. +type GitDefs_Signature struct { + // email: Person email + Email string `json:"email" cborgen:"email"` + // name: Person name + Name string `json:"name" cborgen:"name"` + // when: Timestamp of the signature + When string `json:"when" cborgen:"when"` +} + +// GitDefs_Submodule is a "submodule" in the org.tangled.git.defs schema. +type GitDefs_Submodule struct { + // branch: Branch to track in the submodule + Branch *string `json:"branch,omitempty" cborgen:"branch,omitempty"` + // name: Submodule name + Name string `json:"name" cborgen:"name"` + // url: Submodule repository URL + Url string `json:"url" cborgen:"url"` +} diff --git a/api/org_tangled/gitdeleteBranch.go b/api/org_tangled/gitdeleteBranch.go index 958452206..7e1497b9a 100644 --- a/api/org_tangled/gitdeleteBranch.go +++ b/api/org_tangled/gitdeleteBranch.go @@ -2,7 +2,7 @@ package org_tangled -// schema: org.tangled.temp.git.deleteBranch +// schema: org.tangled.git.deleteBranch import ( "context" @@ -11,19 +11,19 @@ import ( ) const ( - TempGitDeleteBranchNSID = "org.tangled.temp.git.deleteBranch" + GitDeleteBranchNSID = "org.tangled.git.deleteBranch" ) -// TempGitDeleteBranch_Input is the input argument to a org.tangled.temp.git.deleteBranch call. -type TempGitDeleteBranch_Input struct { +// GitDeleteBranch_Input is the input argument to a org.tangled.git.deleteBranch call. +type GitDeleteBranch_Input struct { Branch string `json:"branch" cborgen:"branch"` // repo: DID of the repository Repo string `json:"repo" cborgen:"repo"` } -// TempGitDeleteBranch calls the XRPC method "org.tangled.temp.git.deleteBranch". -func TempGitDeleteBranch(ctx context.Context, c util.LexClient, input *TempGitDeleteBranch_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.git.deleteBranch", nil, input, nil); err != nil { +// GitDeleteBranch calls the XRPC method "org.tangled.git.deleteBranch". +func GitDeleteBranch(ctx context.Context, c util.LexClient, input *GitDeleteBranch_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.git.deleteBranch", nil, input, nil); err != nil { return err } diff --git a/api/org_tangled/gitgetArchive.go b/api/org_tangled/gitgetArchive.go new file mode 100644 index 000000000..b238b519b --- /dev/null +++ b/api/org_tangled/gitgetArchive.go @@ -0,0 +1,39 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.getArchive + +import ( + "bytes" + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitGetArchiveNSID = "org.tangled.git.getArchive" +) + +// GitGetArchive calls the XRPC method "org.tangled.git.getArchive". +// +// format: Archive format +// prefix: Prefix for files in the archive +// ref: Git reference (branch, tag, or commit SHA) +// repo: DID of the repository +func GitGetArchive(ctx context.Context, c util.LexClient, format string, prefix string, ref string, repo string) ([]byte, error) { + buf := new(bytes.Buffer) + + params := map[string]interface{}{} + if format != "" { + params["format"] = format + } + params["prefix"] = prefix + params["ref"] = ref + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.git.getArchive", params, nil, buf); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} diff --git a/api/org_tangled/gitgetBlame.go b/api/org_tangled/gitgetBlame.go new file mode 100644 index 000000000..94cda57cf --- /dev/null +++ b/api/org_tangled/gitgetBlame.go @@ -0,0 +1,71 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.getBlame + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitGetBlameNSID = "org.tangled.git.getBlame" +) + +// GitGetBlame_Author is a "author" in the org.tangled.git.getBlame schema. +type GitGetBlame_Author struct { + Email string `json:"email" cborgen:"email"` + Name string `json:"name" cborgen:"name"` +} + +// GitGetBlame_Commit is a "commit" in the org.tangled.git.getBlame schema. +type GitGetBlame_Commit struct { + Author *GitGetBlame_Author `json:"author" cborgen:"author"` + // authoredAt: When the change was authored + AuthoredAt string `json:"authoredAt" cborgen:"authoredAt"` + // sha: Commit Object ID + Sha string `json:"sha" cborgen:"sha"` + // subject: First line of the commit message + Subject string `json:"subject" cborgen:"subject"` +} + +// GitGetBlame_Output is the output of a org.tangled.git.getBlame call. +type GitGetBlame_Output struct { + // commit: The resolved commit Object ID + Commit string `json:"commit" cborgen:"commit"` + // commits: Unique commits referenced by blame runs + Commits []*GitGetBlame_Commit `json:"commits" cborgen:"commits"` + // runs: Complete, gap-free one-based line ranges sorted by start + Runs []*GitGetBlame_Run `json:"runs" cborgen:"runs"` +} + +// GitGetBlame_Run is a "run" in the org.tangled.git.getBlame schema. +type GitGetBlame_Run struct { + // commit: The commit Object ID of the entry in commits this run is attributed to + Commit string `json:"commit" cborgen:"commit"` + // count: Number of lines in the run + Count int64 `json:"count" cborgen:"count"` + // start: First line of the run, one-based + Start int64 `json:"start" cborgen:"start"` +} + +// GitGetBlame calls the XRPC method "org.tangled.git.getBlame". +// +// path: Path of the file to blame +// ref: Git revision (branch, tag, or commit Object ID) +// repo: DID of the repository +func GitGetBlame(ctx context.Context, c util.LexClient, path string, ref string, repo string) (*GitGetBlame_Output, error) { + var out GitGetBlame_Output + + params := map[string]interface{}{} + params["path"] = path + params["ref"] = ref + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.git.getBlame", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/gitgetBlob.go b/api/org_tangled/gitgetBlob.go index 6bbddf596..b1145aeee 100644 --- a/api/org_tangled/gitgetBlob.go +++ b/api/org_tangled/gitgetBlob.go @@ -2,7 +2,7 @@ package org_tangled -// schema: org.tangled.temp.git.getBlob +// schema: org.tangled.git.getBlob import ( "bytes" @@ -12,15 +12,15 @@ import ( ) const ( - TempGitGetBlobNSID = "org.tangled.temp.git.getBlob" + GitGetBlobNSID = "org.tangled.git.getBlob" ) -// TempGitGetBlob calls the XRPC method "org.tangled.temp.git.getBlob". +// GitGetBlob calls the XRPC method "org.tangled.git.getBlob". // // path: Path within the repository tree // ref: Git reference (branch, tag, or commit SHA) // repo: DID of the repository -func TempGitGetBlob(ctx context.Context, c util.LexClient, path string, ref string, repo string) ([]byte, error) { +func GitGetBlob(ctx context.Context, c util.LexClient, path string, ref string, repo string) ([]byte, error) { buf := new(bytes.Buffer) params := map[string]interface{}{} @@ -29,7 +29,7 @@ func TempGitGetBlob(ctx context.Context, c util.LexClient, path string, ref stri params["ref"] = ref } params["repo"] = repo - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.getBlob", params, nil, buf); err != nil { + if err := c.LexDo(ctx, util.Query, "", "org.tangled.git.getBlob", params, nil, buf); err != nil { return nil, err } diff --git a/api/org_tangled/gitgetBranch.go b/api/org_tangled/gitgetBranch.go index 2b5ecd444..40d393f50 100644 --- a/api/org_tangled/gitgetBranch.go +++ b/api/org_tangled/gitgetBranch.go @@ -2,41 +2,42 @@ package org_tangled -// schema: org.tangled.temp.git.getBranch +// schema: org.tangled.git.getBranch import ( "context" "github.com/bluesky-social/indigo/lex/util" - shtangledtypes "tangled.org/core/api/tangled" ) const ( - TempGitGetBranchNSID = "org.tangled.temp.git.getBranch" + GitGetBranchNSID = "org.tangled.git.getBranch" ) -// TempGitGetBranch_Output is the output of a org.tangled.temp.git.getBranch call. -type TempGitGetBranch_Output struct { - Author *shtangledtypes.GitDefs_Signature `json:"author" cborgen:"author"` +// GitGetBranch_Output is the output of a org.tangled.git.getBranch call. +type GitGetBranch_Output struct { + Author *GitDefs_Signature `json:"author" cborgen:"author"` // hash: Latest commit hash on this branch Hash string `json:"hash" cborgen:"hash"` // message: Latest commit message Message string `json:"message" cborgen:"message"` // name: Branch name Name string `json:"name" cborgen:"name"` + // totalCommits: Number of commits reachable from this branch + TotalCommits int64 `json:"totalCommits" cborgen:"totalCommits"` } -// TempGitGetBranch calls the XRPC method "org.tangled.temp.git.getBranch". +// GitGetBranch calls the XRPC method "org.tangled.git.getBranch". // // name: Branch name to get information for // repo: DID of the repository -func TempGitGetBranch(ctx context.Context, c util.LexClient, name string, repo string) (*TempGitGetBranch_Output, error) { - var out TempGitGetBranch_Output +func GitGetBranch(ctx context.Context, c util.LexClient, name string, repo string) (*GitGetBranch_Output, error) { + var out GitGetBranch_Output params := map[string]interface{}{} params["name"] = name params["repo"] = repo - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.getBranch", params, nil, &out); err != nil { + if err := c.LexDo(ctx, util.Query, "", "org.tangled.git.getBranch", params, nil, &out); err != nil { return nil, err } diff --git a/api/org_tangled/gitgetDiff.go b/api/org_tangled/gitgetDiff.go new file mode 100644 index 000000000..b5d2f2cf4 --- /dev/null +++ b/api/org_tangled/gitgetDiff.go @@ -0,0 +1,44 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.getDiff + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitGetDiffNSID = "org.tangled.git.getDiff" +) + +// GitGetDiff_Output is the output of a org.tangled.git.getDiff call. +type GitGetDiff_Output struct { + Diffs []*GitDefs_FileDiff `json:"diffs" cborgen:"diffs"` + Stats *GitDefs_DiffStat `json:"stats,omitempty" cborgen:"stats,omitempty"` +} + +// GitGetDiff calls the XRPC method "org.tangled.git.getDiff". +// +// base: Base revision (branch, tag, or commit Object ID) +// head: Head revision (branch, tag, or commit Object ID) +// paths: Only include diffs touching these paths, comma-separated +// repo: DID of the repository +func GitGetDiff(ctx context.Context, c util.LexClient, base string, head string, paths string, repo string) (*GitGetDiff_Output, error) { + var out GitGetDiff_Output + + params := map[string]interface{}{} + params["base"] = base + params["head"] = head + if paths != "" { + params["paths"] = paths + } + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.git.getDiff", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/gitgetEntry.go b/api/org_tangled/gitgetEntry.go index bf468d52c..35aea8559 100644 --- a/api/org_tangled/gitgetEntry.go +++ b/api/org_tangled/gitgetEntry.go @@ -2,39 +2,38 @@ package org_tangled -// schema: org.tangled.temp.git.getEntry +// schema: org.tangled.git.getEntry import ( "context" "github.com/bluesky-social/indigo/lex/util" - shtangledtypes "tangled.org/core/api/tangled" ) const ( - TempGitGetEntryNSID = "org.tangled.temp.git.getEntry" + GitGetEntryNSID = "org.tangled.git.getEntry" ) -// TempGitGetEntry_Output is the output of a org.tangled.temp.git.getEntry call. -type TempGitGetEntry_Output struct { - LastCommit *shtangledtypes.GitTempDefs_Commit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"` - Mode string `json:"mode" cborgen:"mode"` +// GitGetEntry_Output is the output of a org.tangled.git.getEntry call. +type GitGetEntry_Output struct { + LastCommit *GitDefs_Commit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"` + Mode string `json:"mode" cborgen:"mode"` // name: The file name Name string `json:"name" cborgen:"name"` Oid string `json:"oid" cborgen:"oid"` // size: Blob size Size int64 `json:"size" cborgen:"size"` // submodule: Submodule information if path is a submodule - Submodule *shtangledtypes.GitTempDefs_Submodule `json:"submodule,omitempty" cborgen:"submodule,omitempty"` + Submodule *GitDefs_Submodule `json:"submodule,omitempty" cborgen:"submodule,omitempty"` } -// TempGitGetEntry calls the XRPC method "org.tangled.temp.git.getEntry". +// GitGetEntry calls the XRPC method "org.tangled.git.getEntry". // // path: path of the entity -// ref: Git revision (branch, tag, or commit id) +// ref: Git revision (branch, tag, or commit Object ID) // repo: DID of the repository -func TempGitGetEntry(ctx context.Context, c util.LexClient, path string, ref string, repo string) (*TempGitGetEntry_Output, error) { - var out TempGitGetEntry_Output +func GitGetEntry(ctx context.Context, c util.LexClient, path string, ref string, repo string) (*GitGetEntry_Output, error) { + var out GitGetEntry_Output params := map[string]interface{}{} params["path"] = path @@ -42,7 +41,7 @@ func TempGitGetEntry(ctx context.Context, c util.LexClient, path string, ref str params["ref"] = ref } params["repo"] = repo - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.getEntry", params, nil, &out); err != nil { + if err := c.LexDo(ctx, util.Query, "", "org.tangled.git.getEntry", params, nil, &out); err != nil { return nil, err } diff --git a/api/org_tangled/gitgetTag.go b/api/org_tangled/gitgetTag.go new file mode 100644 index 000000000..5c2791d59 --- /dev/null +++ b/api/org_tangled/gitgetTag.go @@ -0,0 +1,45 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.getTag + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitGetTagNSID = "org.tangled.git.getTag" +) + +// GitGetTag_Output is the output of a org.tangled.git.getTag call. +type GitGetTag_Output struct { + // annotation: Present only for annotated tags + Annotation *GitListTags_Annotation `json:"annotation,omitempty" cborgen:"annotation,omitempty"` + Author *GitDefs_Signature `json:"author" cborgen:"author"` + // message: Latest commit message + Message string `json:"message" cborgen:"message"` + // name: Tag name + Name string `json:"name" cborgen:"name"` + // oid: Latest commit oid on this tag + Oid string `json:"oid" cborgen:"oid"` +} + +// GitGetTag calls the XRPC method "org.tangled.git.getTag". +// +// repo: DID of the repository +// tag: Name of tag, such as v1.3.0 +func GitGetTag(ctx context.Context, c util.LexClient, repo string, tag string) (*GitGetTag_Output, error) { + var out GitGetTag_Output + + params := map[string]interface{}{} + params["repo"] = repo + params["tag"] = tag + if err := c.LexDo(ctx, util.Query, "", "org.tangled.git.getTag", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/gitgetTree.go b/api/org_tangled/gitgetTree.go index 3b1fde98c..87267a89b 100644 --- a/api/org_tangled/gitgetTree.go +++ b/api/org_tangled/gitgetTree.go @@ -2,28 +2,27 @@ package org_tangled -// schema: org.tangled.temp.git.getTree +// schema: org.tangled.git.getTree import ( "context" "github.com/bluesky-social/indigo/lex/util" - shtangledtypes "tangled.org/core/api/tangled" ) const ( - TempGitGetTreeNSID = "org.tangled.temp.git.getTree" + GitGetTreeNSID = "org.tangled.git.getTree" ) -// TempGitGetTree_Output is the output of a org.tangled.temp.git.getTree call. -type TempGitGetTree_Output struct { - Entries []*TempGitGetTree_TreeEntry `json:"entries" cborgen:"entries"` - LastCommit *shtangledtypes.GitTempDefs_Commit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"` +// GitGetTree_Output is the output of a org.tangled.git.getTree call. +type GitGetTree_Output struct { + Entries []*GitGetTree_TreeEntry `json:"entries" cborgen:"entries"` + LastCommit *GitDefs_Commit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"` } -// TempGitGetTree_TreeEntry is a "treeEntry" in the org.tangled.temp.git.getTree schema. -type TempGitGetTree_TreeEntry struct { - LastCommit *shtangledtypes.GitTempDefs_Commit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"` +// GitGetTree_TreeEntry is a "treeEntry" in the org.tangled.git.getTree schema. +type GitGetTree_TreeEntry struct { + LastCommit *GitDefs_Commit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"` // mode: File mode Mode string `json:"mode" cborgen:"mode"` // name: Relative file or directory name @@ -32,13 +31,13 @@ type TempGitGetTree_TreeEntry struct { Size int64 `json:"size" cborgen:"size"` } -// TempGitGetTree calls the XRPC method "org.tangled.temp.git.getTree". +// GitGetTree calls the XRPC method "org.tangled.git.getTree". // // path: Path within the repository tree -// ref: Git revision (branch, tag, or commit id) +// ref: Git revision (branch, tag, or commit Object ID) // repo: DID of the repository -func TempGitGetTree(ctx context.Context, c util.LexClient, path string, ref string, repo string) (*TempGitGetTree_Output, error) { - var out TempGitGetTree_Output +func GitGetTree(ctx context.Context, c util.LexClient, path string, ref string, repo string) (*GitGetTree_Output, error) { + var out GitGetTree_Output params := map[string]interface{}{} if path != "" { @@ -48,7 +47,7 @@ func TempGitGetTree(ctx context.Context, c util.LexClient, path string, ref stri params["ref"] = ref } params["repo"] = repo - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.getTree", params, nil, &out); err != nil { + if err := c.LexDo(ctx, util.Query, "", "org.tangled.git.getTree", params, nil, &out); err != nil { return nil, err } diff --git a/api/org_tangled/gitlistBranches.go b/api/org_tangled/gitlistBranches.go new file mode 100644 index 000000000..9e4392754 --- /dev/null +++ b/api/org_tangled/gitlistBranches.go @@ -0,0 +1,60 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.listBranches + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitListBranchesNSID = "org.tangled.git.listBranches" +) + +// GitListBranches_BranchInfo is a "branchInfo" in the org.tangled.git.listBranches schema. +type GitListBranches_BranchInfo struct { + Author *GitDefs_Signature `json:"author" cborgen:"author"` + Committer *GitDefs_Signature `json:"committer" cborgen:"committer"` + // message: Latest commit message + Message string `json:"message" cborgen:"message"` + // name: Branch name + Name string `json:"name" cborgen:"name"` + // oid: Latest commit oid on this branch + Oid string `json:"oid" cborgen:"oid"` +} + +// GitListBranches_Output is the output of a org.tangled.git.listBranches call. +type GitListBranches_Output struct { + Branches []*GitListBranches_BranchInfo `json:"branches" cborgen:"branches"` + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + // defaultBranch: Name of the default branch + DefaultBranch *string `json:"defaultBranch,omitempty" cborgen:"defaultBranch,omitempty"` + // total: Total number of branches in the repository + Total int64 `json:"total" cborgen:"total"` +} + +// GitListBranches calls the XRPC method "org.tangled.git.listBranches". +// +// cursor: Pagination cursor +// limit: Maximum number of branches to return +// repo: DID of the repository +func GitListBranches(ctx context.Context, c util.LexClient, cursor string, limit int64, repo string) (*GitListBranches_Output, error) { + var out GitListBranches_Output + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.git.listBranches", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/gitlistCommits.go b/api/org_tangled/gitlistCommits.go new file mode 100644 index 000000000..015d6e385 --- /dev/null +++ b/api/org_tangled/gitlistCommits.go @@ -0,0 +1,51 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.listCommits + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitListCommitsNSID = "org.tangled.git.listCommits" +) + +// GitListCommits_Output is the output of a org.tangled.git.listCommits call. +type GitListCommits_Output struct { + Commits []*GitDefs_Commit `json:"commits" cborgen:"commits"` + // cursor: Cursor for the next page, absent when the last page is reached + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` +} + +// GitListCommits calls the XRPC method "org.tangled.git.listCommits". +// +// cursor: Commit Object ID of the last commit in the previous page +// limit: Maximum number of commits to return in this page +// path: Only list commits touching this path +// ref: Git revision (branch, tag, commit Object ID, or full ref name) +// repo: DID of the repository +func GitListCommits(ctx context.Context, c util.LexClient, cursor string, limit int64, path string, ref string, repo string) (*GitListCommits_Output, error) { + var out GitListCommits_Output + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + if path != "" { + params["path"] = path + } + params["ref"] = ref + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.git.listCommits", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/gitlistLanguages.go b/api/org_tangled/gitlistLanguages.go new file mode 100644 index 000000000..333b85f7b --- /dev/null +++ b/api/org_tangled/gitlistLanguages.go @@ -0,0 +1,61 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.listLanguages + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitListLanguagesNSID = "org.tangled.git.listLanguages" +) + +// GitListLanguages_Language is a "language" in the org.tangled.git.listLanguages schema. +type GitListLanguages_Language struct { + // color: Render color for this language + Color *string `json:"color,omitempty" cborgen:"color,omitempty"` + // extensions: File extensions recognized as this language + Extensions []string `json:"extensions,omitempty" cborgen:"extensions,omitempty"` + // fileCount: Files counted for this language + FileCount *int64 `json:"fileCount,omitempty" cborgen:"fileCount,omitempty"` + // name: Language name + Name string `json:"name" cborgen:"name"` + // percentage: Share of total size, 0-100 + Percentage int64 `json:"percentage" cborgen:"percentage"` + // size: Bytes counted for this language + Size int64 `json:"size" cborgen:"size"` +} + +// GitListLanguages_Output is the output of a org.tangled.git.listLanguages call. +type GitListLanguages_Output struct { + Languages []*GitListLanguages_Language `json:"languages" cborgen:"languages"` + // ref: The ref the breakdown was computed at + Ref string `json:"ref" cborgen:"ref"` + // totalFiles: Total counted files + TotalFiles *int64 `json:"totalFiles,omitempty" cborgen:"totalFiles,omitempty"` + // totalSize: Total bytes across counted files + TotalSize *int64 `json:"totalSize,omitempty" cborgen:"totalSize,omitempty"` +} + +// GitListLanguages calls the XRPC method "org.tangled.git.listLanguages". +// +// ref: Git revision (branch, tag, or commit Object ID) +// repo: DID of the repository +func GitListLanguages(ctx context.Context, c util.LexClient, ref string, repo string) (*GitListLanguages_Output, error) { + var out GitListLanguages_Output + + params := map[string]interface{}{} + if ref != "" { + params["ref"] = ref + } + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.git.listLanguages", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/gitlistRefs.go b/api/org_tangled/gitlistRefs.go new file mode 100644 index 000000000..47ad7f277 --- /dev/null +++ b/api/org_tangled/gitlistRefs.go @@ -0,0 +1,62 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.listRefs + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitListRefsNSID = "org.tangled.git.listRefs" +) + +// GitListRefs_DefaultBranch is a "defaultBranch" in the org.tangled.git.listRefs schema. +type GitListRefs_DefaultBranch struct { + // head: Commit SHA at the tip of the default branch, for reconciling against a last-known state. Width depends on the repo's git object-format. + Head *string `json:"head,omitempty" cborgen:"head,omitempty"` + // ref: Default branch ref name that HEAD points at, eg. refs/heads/main. + Ref string `json:"ref" cborgen:"ref"` +} + +// GitListRefs_Output is the output of a org.tangled.git.listRefs call. +type GitListRefs_Output struct { + // cursor: Cursor for the next page, absent when the last page is reached + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + DefaultBranch *GitListRefs_DefaultBranch `json:"defaultBranch,omitempty" cborgen:"defaultBranch,omitempty"` + Refs []*GitListRefs_Ref `json:"refs" cborgen:"refs"` +} + +// GitListRefs_Ref is a "ref" in the org.tangled.git.listRefs schema. +type GitListRefs_Ref struct { + // ref: Full ref name, eg. refs/heads/main or refs/tags/v1.0 + Ref string `json:"ref" cborgen:"ref"` + // sha: Object SHA the ref points at. Width depends on the repo's git object-format. + Sha string `json:"sha" cborgen:"sha"` +} + +// GitListRefs calls the XRPC method "org.tangled.git.listRefs". +// +// cursor: Pagination cursor +// limit: Maximum number of refs to return in this page +// repo: DID of the git repo as minted by the knot +func GitListRefs(ctx context.Context, c util.LexClient, cursor string, limit int64, repo string) (*GitListRefs_Output, error) { + var out GitListRefs_Output + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.git.listRefs", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/gitlistTags.go b/api/org_tangled/gitlistTags.go new file mode 100644 index 000000000..70e41dba3 --- /dev/null +++ b/api/org_tangled/gitlistTags.go @@ -0,0 +1,66 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.listTags + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitListTagsNSID = "org.tangled.git.listTags" +) + +// GitListTags_Annotation is a "annotation" in the org.tangled.git.listTags schema. +type GitListTags_Annotation struct { + // message: Tag message + Message string `json:"message" cborgen:"message"` + Tagger *GitDefs_Signature `json:"tagger,omitempty" cborgen:"tagger,omitempty"` +} + +// GitListTags_Output is the output of a org.tangled.git.listTags call. +type GitListTags_Output struct { + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + Tags []*GitListTags_TagInfo `json:"tags" cborgen:"tags"` + // total: Total number of tags in the repository + Total int64 `json:"total" cborgen:"total"` +} + +// GitListTags_TagInfo is a "tagInfo" in the org.tangled.git.listTags schema. +type GitListTags_TagInfo struct { + // annotation: Present only for annotated tags + Annotation *GitListTags_Annotation `json:"annotation,omitempty" cborgen:"annotation,omitempty"` + Author *GitDefs_Signature `json:"author" cborgen:"author"` + // message: Latest commit message + Message string `json:"message" cborgen:"message"` + // name: Tag name + Name string `json:"name" cborgen:"name"` + // oid: Latest commit oid on this tag + Oid string `json:"oid" cborgen:"oid"` +} + +// GitListTags calls the XRPC method "org.tangled.git.listTags". +// +// cursor: Pagination cursor +// limit: Maximum number of tags to return +// repo: DID of the repository +func GitListTags(ctx context.Context, c util.LexClient, cursor string, limit int64, repo string) (*GitListTags_Output, error) { + var out GitListTags_Output + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.git.listTags", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/gitmergeCheck.go b/api/org_tangled/gitmergeCheck.go new file mode 100644 index 000000000..45a1e6e40 --- /dev/null +++ b/api/org_tangled/gitmergeCheck.go @@ -0,0 +1,52 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.mergeCheck + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitMergeCheckNSID = "org.tangled.git.mergeCheck" +) + +// GitMergeCheck_Conflict is a "conflict" in the org.tangled.git.mergeCheck schema. +type GitMergeCheck_Conflict struct { + // filename: Path of the conflicted file + Filename string `json:"filename" cborgen:"filename"` + // reason: Why the file conflicts + Reason string `json:"reason" cborgen:"reason"` +} + +// GitMergeCheck_Input is the input argument to a org.tangled.git.mergeCheck call. +type GitMergeCheck_Input struct { + // branch: Target branch. Defaults to the ticket's targetBranch, falling back to the repo's default branch. + Branch *string `json:"branch,omitempty" cborgen:"branch,omitempty"` + // patch: Record key of the org.tangled.review.patch record to check + Patch string `json:"patch" cborgen:"patch"` + // repo: DID of the repository + Repo string `json:"repo" cborgen:"repo"` +} + +// GitMergeCheck_Output is the output of a org.tangled.git.mergeCheck call. +type GitMergeCheck_Output struct { + Conflicts []*GitMergeCheck_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"` +} + +// GitMergeCheck calls the XRPC method "org.tangled.git.mergeCheck". +func GitMergeCheck(ctx context.Context, c util.LexClient, input *GitMergeCheck_Input) (*GitMergeCheck_Output, error) { + var out GitMergeCheck_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.git.mergeCheck", nil, input, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/gitoid.go b/api/org_tangled/gitoid.go new file mode 100644 index 000000000..ceb07a875 --- /dev/null +++ b/api/org_tangled/gitoid.go @@ -0,0 +1,14 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.oid + +const ( + GitOidNSID = "org.tangled.git.oid" +) + +// GitOid is a "main" in the org.tangled.git.oid schema. +type GitOid struct { + Oid string `json:"oid" cborgen:"oid"` +} diff --git a/api/org_tangled/gitpushEvent.go b/api/org_tangled/gitpushEvent.go new file mode 100644 index 000000000..de37d823e --- /dev/null +++ b/api/org_tangled/gitpushEvent.go @@ -0,0 +1,44 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.pushEvent + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitPushEventNSID = "org.tangled.git.pushEvent" +) + +// GitPushEvent is a "main" in the org.tangled.git.pushEvent schema. +// +// Represents git-push operation to target repository. +type GitPushEvent struct { + Edits []*GitPushEvent_RefEdit `json:"edits" cborgen:"edits"` + // options: Git push options. + Options []string `json:"options,omitempty" cborgen:"options,omitempty"` + // pusher: The account that performed this push. + Pusher string `json:"pusher" cborgen:"pusher"` + // repo: The repo this event comes from. + Repo string `json:"repo" cborgen:"repo"` + // seq: The stream sequence number of this message. + Seq int64 `json:"seq" cborgen:"seq"` + // sig: Signature over the DAG-CBOR of this message with the seq and sig keys absent (repo/pusher DID, edits, time, options), by the repo's atproto signing key. seq is excluded so a relay can reassign it without invalidating the signature. + Sig util.LexBytes `json:"sig,omitempty" cborgen:"sig,omitempty"` + // time: Timestamp of when this message was originally broadcast. + Time string `json:"time" cborgen:"time"` +} + +// GitPushEvent_RefEdit is a "refEdit" in the org.tangled.git.pushEvent schema. +// +// A git ref edit. +type GitPushEvent_RefEdit struct { + // name: Full git reference name, ie refs/heads/main. + Name string `json:"name" cborgen:"name"` + // new: Full hex object id the ref now points at. + New *string `json:"new" cborgen:"new"` + // old: Full hex object id the ref pointed at before. + Old *string `json:"old" cborgen:"old"` +} diff --git a/api/org_tangled/gitreceivePack.go b/api/org_tangled/gitreceivePack.go new file mode 100644 index 000000000..7cad129af --- /dev/null +++ b/api/org_tangled/gitreceivePack.go @@ -0,0 +1,24 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.receivePack + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitReceivePackNSID = "org.tangled.git.receivePack" +) + +// GitReceivePack calls the XRPC method "org.tangled.git.receivePack". +func GitReceivePack(ctx context.Context, c util.LexClient) error { + if err := c.LexDo(ctx, util.Procedure, "", "org.tangled.git.receivePack", nil, nil, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/gitrefs.go b/api/org_tangled/gitrefs.go new file mode 100644 index 000000000..d3a3eaa88 --- /dev/null +++ b/api/org_tangled/gitrefs.go @@ -0,0 +1,25 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.git.refs + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GitRefsNSID = "org.tangled.git.refs" +) + +func init() { + util.RegisterType("org.tangled.git.refs", &GitRefs{}) +} // +// RECORDTYPE: GitRefs +type GitRefs struct { + LexiconTypeID string `json:"$type,const=org.tangled.git.refs" cborgen:"$type,const=org.tangled.git.refs"` + // defaultBranch: Default branch name without refs/heads/ prefix. + DefaultBranch string `json:"defaultBranch" cborgen:"defaultBranch"` + // refs: List of git refs in `git show-ref` format. + Refs util.LexBytes `json:"refs,omitempty" cborgen:"refs,omitempty"` +} diff --git a/api/org_tangled/graphattestation.go b/api/org_tangled/graphattestation.go new file mode 100644 index 000000000..d9ab32a67 --- /dev/null +++ b/api/org_tangled/graphattestation.go @@ -0,0 +1,26 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.graph.attestation + +import ( + comatprototypes "github.com/bluesky-social/indigo/api/atproto" + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GraphAttestationNSID = "org.tangled.graph.attestation" +) + +func init() { + util.RegisterType("org.tangled.graph.attestation", &GraphAttestation{}) +} // +// RECORDTYPE: GraphAttestation +type GraphAttestation struct { + LexiconTypeID string `json:"$type,const=org.tangled.graph.attestation" cborgen:"$type,const=org.tangled.graph.attestation"` + // change: The Git Object ID of the COB change that made the knot-side record. + Change *string `json:"change,omitempty" cborgen:"change,omitempty"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Subject *comatprototypes.RepoStrongRef `json:"subject" cborgen:"subject"` +} diff --git a/api/org_tangled/graphcollaborator.go b/api/org_tangled/graphcollaborator.go new file mode 100644 index 000000000..cda0acbae --- /dev/null +++ b/api/org_tangled/graphcollaborator.go @@ -0,0 +1,22 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.graph.collaborator + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GraphCollaboratorNSID = "org.tangled.graph.collaborator" +) + +func init() { + util.RegisterType("org.tangled.graph.collaborator", &GraphCollaborator{}) +} // +// RECORDTYPE: GraphCollaborator +type GraphCollaborator struct { + LexiconTypeID string `json:"$type,const=org.tangled.graph.collaborator" cborgen:"$type,const=org.tangled.graph.collaborator"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` +} diff --git a/api/org_tangled/graphfollow.go b/api/org_tangled/graphfollow.go new file mode 100644 index 000000000..8ca00b966 --- /dev/null +++ b/api/org_tangled/graphfollow.go @@ -0,0 +1,22 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.graph.follow + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GraphFollowNSID = "org.tangled.graph.follow" +) + +func init() { + util.RegisterType("org.tangled.graph.follow", &GraphFollow{}) +} // +// RECORDTYPE: GraphFollow +type GraphFollow struct { + LexiconTypeID string `json:"$type,const=org.tangled.graph.follow" cborgen:"$type,const=org.tangled.graph.follow"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` +} diff --git a/api/org_tangled/graphvouch.go b/api/org_tangled/graphvouch.go new file mode 100644 index 000000000..ac5cda2ab --- /dev/null +++ b/api/org_tangled/graphvouch.go @@ -0,0 +1,29 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.graph.vouch + +import ( + comatprototypes "github.com/bluesky-social/indigo/api/atproto" + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + GraphVouchNSID = "org.tangled.graph.vouch" +) + +func init() { + util.RegisterType("org.tangled.graph.vouch", &GraphVouch{}) +} // +// RECORDTYPE: GraphVouch +type GraphVouch struct { + LexiconTypeID string `json:"$type,const=org.tangled.graph.vouch" cborgen:"$type,const=org.tangled.graph.vouch"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // evidences: Optional list of ATURIs serving as evidence for this vouch (ex. issues, PRs) + Evidences []*comatprototypes.RepoStrongRef `json:"evidences,omitempty" cborgen:"evidences,omitempty"` + // kind: Whether this user is being vouched for or denounced + Kind string `json:"kind" cborgen:"kind"` + // reason: The reason for this vouch/denouncement + Reason *string `json:"reason,omitempty" cborgen:"reason,omitempty"` +} diff --git a/api/org_tangled/keysshKey.go b/api/org_tangled/keysshKey.go new file mode 100644 index 000000000..7d11063b2 --- /dev/null +++ b/api/org_tangled/keysshKey.go @@ -0,0 +1,28 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.key.sshKey + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + KeySshKeyNSID = "org.tangled.key.sshKey" +) + +func init() { + util.RegisterType("org.tangled.key.sshKey", &KeySshKey{}) +} // +// RECORDTYPE: KeySshKey +type KeySshKey struct { + LexiconTypeID string `json:"$type,const=org.tangled.key.sshKey" cborgen:"$type,const=org.tangled.key.sshKey"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // name: human-readable name for this key + Name string `json:"name" cborgen:"name"` + // publicKey: public key in OpenSSH authorized_keys format + PublicKey string `json:"publicKey" cborgen:"publicKey"` + // usages: default to `["auth", "sign"]` when omitted. + Usages []string `json:"usages,omitempty" cborgen:"usages,omitempty"` +} diff --git a/api/org_tangled/keyunspeccedgpgKey.go b/api/org_tangled/keyunspeccedgpgKey.go new file mode 100644 index 000000000..d9721b94f --- /dev/null +++ b/api/org_tangled/keyunspeccedgpgKey.go @@ -0,0 +1,26 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.key.unspecced.gpgKey + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + KeyUnspeccedGpgKeyNSID = "org.tangled.key.unspecced.gpgKey" +) + +func init() { + util.RegisterType("org.tangled.key.unspecced.gpgKey", &KeyUnspeccedGpgKey{}) +} // +// RECORDTYPE: KeyUnspeccedGpgKey +type KeyUnspeccedGpgKey struct { + LexiconTypeID string `json:"$type,const=org.tangled.key.unspecced.gpgKey" cborgen:"$type,const=org.tangled.key.unspecced.gpgKey"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // name: human-readable name for this key + Name string `json:"name" cborgen:"name"` + // publicKey: ASCII-armored public key block + PublicKey string `json:"publicKey" cborgen:"publicKey"` +} diff --git a/api/org_tangled/knotblock.go b/api/org_tangled/knotblock.go new file mode 100644 index 000000000..74a6d7337 --- /dev/null +++ b/api/org_tangled/knotblock.go @@ -0,0 +1,22 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.knot.block + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + KnotBlockNSID = "org.tangled.knot.block" +) + +func init() { + util.RegisterType("org.tangled.knot.block", &KnotBlock{}) +} // +// RECORDTYPE: KnotBlock +type KnotBlock struct { + LexiconTypeID string `json:"$type,const=org.tangled.knot.block" cborgen:"$type,const=org.tangled.knot.block"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` +} diff --git a/api/org_tangled/knotdescribeKnot.go b/api/org_tangled/knotdescribeKnot.go new file mode 100644 index 000000000..207de57f0 --- /dev/null +++ b/api/org_tangled/knotdescribeKnot.go @@ -0,0 +1,48 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.knot.describeKnot + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + KnotDescribeKnotNSID = "org.tangled.knot.describeKnot" +) + +// KnotDescribeKnot_Contact is a "contact" in the org.tangled.knot.describeKnot schema. +type KnotDescribeKnot_Contact struct { + Email *string `json:"email,omitempty" cborgen:"email,omitempty"` +} + +// KnotDescribeKnot_Links is a "links" in the org.tangled.knot.describeKnot schema. +type KnotDescribeKnot_Links struct { + PrivacyPolicy *string `json:"privacyPolicy,omitempty" cborgen:"privacyPolicy,omitempty"` + TermsOfService *string `json:"termsOfService,omitempty" cborgen:"termsOfService,omitempty"` +} + +// KnotDescribeKnot_Output is the output of a org.tangled.knot.describeKnot call. +type KnotDescribeKnot_Output struct { + // capabilities: Protocol capability tokens this knot implements. Knots that omit this field are treated as legacy. + Capabilities []string `json:"capabilities,omitempty" cborgen:"capabilities,omitempty"` + // contact: Contact information + Contact *KnotDescribeKnot_Contact `json:"contact,omitempty" cborgen:"contact,omitempty"` + Did string `json:"did" cborgen:"did"` + // links: URLs of service policy documents. + Links *KnotDescribeKnot_Links `json:"links,omitempty" cborgen:"links,omitempty"` + Version string `json:"version" cborgen:"version"` +} + +// KnotDescribeKnot calls the XRPC method "org.tangled.knot.describeKnot". +func KnotDescribeKnot(ctx context.Context, c util.LexClient) (*KnotDescribeKnot_Output, error) { + var out KnotDescribeKnot_Output + if err := c.LexDo(ctx, util.Query, "", "org.tangled.knot.describeKnot", nil, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/knotmember.go b/api/org_tangled/knotmember.go new file mode 100644 index 000000000..d720d0339 --- /dev/null +++ b/api/org_tangled/knotmember.go @@ -0,0 +1,22 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.knot.member + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + KnotMemberNSID = "org.tangled.knot.member" +) + +func init() { + util.RegisterType("org.tangled.knot.member", &KnotMember{}) +} // +// RECORDTYPE: KnotMember +type KnotMember struct { + LexiconTypeID string `json:"$type,const=org.tangled.knot.member" cborgen:"$type,const=org.tangled.knot.member"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` +} diff --git a/api/org_tangled/labeldefinition.go b/api/org_tangled/labeldefinition.go new file mode 100644 index 000000000..718da3978 --- /dev/null +++ b/api/org_tangled/labeldefinition.go @@ -0,0 +1,26 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.label.definition + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + LabelDefinitionNSID = "org.tangled.label.definition" +) + +func init() { + util.RegisterType("org.tangled.label.definition", &LabelDefinition{}) +} // +// RECORDTYPE: LabelDefinition +type LabelDefinition struct { + LexiconTypeID string `json:"$type,const=org.tangled.label.definition" cborgen:"$type,const=org.tangled.label.definition"` + // color: The hex value for the background color for the label. Appviews may choose to respect this. + Color *string `json:"color,omitempty" cborgen:"color,omitempty"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // name: The display name of this label. + Name string `json:"name" cborgen:"name"` +} diff --git a/api/org_tangled/labeldefs.go b/api/org_tangled/labeldefs.go new file mode 100644 index 000000000..291d6e38c --- /dev/null +++ b/api/org_tangled/labeldefs.go @@ -0,0 +1,16 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.label.defs + +const () + +// LabelDefs_LabelToken is a "labelToken" in the org.tangled.label.defs schema. +// +// RECORDTYPE: LabelDefs_LabelToken +type LabelDefs_LabelToken struct { + LexiconTypeID string `json:"$type,const=org.tangled.label.defs#labelToken" cborgen:"$type,const=org.tangled.label.defs#labelToken"` + // key: Record-key of org.tangled.label.definition owned by this repository. + Key string `json:"key" cborgen:"key"` +} diff --git a/api/org_tangled/markupembedimage.go b/api/org_tangled/markupembedimage.go new file mode 100644 index 000000000..bd2956b71 --- /dev/null +++ b/api/org_tangled/markupembedimage.go @@ -0,0 +1,22 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.markup.embed.image + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + MarkupEmbedImageNSID = "org.tangled.markup.embed.image" +) + +func init() { + util.RegisterType("org.tangled.markup.embed.image#main", &MarkupEmbedImage{}) +} // MarkupEmbedImage is a "main" in the org.tangled.markup.embed.image schema. +// RECORDTYPE: MarkupEmbedImage +type MarkupEmbedImage struct { + LexiconTypeID string `json:"$type,const=org.tangled.markup.embed.image" cborgen:"$type,const=org.tangled.markup.embed.image"` + Image *util.LexBlob `json:"image" cborgen:"image"` +} diff --git a/api/org_tangled/markupembedvideo.go b/api/org_tangled/markupembedvideo.go new file mode 100644 index 000000000..0ce04492a --- /dev/null +++ b/api/org_tangled/markupembedvideo.go @@ -0,0 +1,22 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.markup.embed.video + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + MarkupEmbedVideoNSID = "org.tangled.markup.embed.video" +) + +func init() { + util.RegisterType("org.tangled.markup.embed.video#main", &MarkupEmbedVideo{}) +} // MarkupEmbedVideo is a "main" in the org.tangled.markup.embed.video schema. +// RECORDTYPE: MarkupEmbedVideo +type MarkupEmbedVideo struct { + LexiconTypeID string `json:"$type,const=org.tangled.markup.embed.video" cborgen:"$type,const=org.tangled.markup.embed.video"` + Video *util.LexBlob `json:"video" cborgen:"video"` +} diff --git a/api/org_tangled/markupmarkdown.go b/api/org_tangled/markupmarkdown.go new file mode 100644 index 000000000..7a9169b49 --- /dev/null +++ b/api/org_tangled/markupmarkdown.go @@ -0,0 +1,112 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.markup.markdown + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + + "github.com/bluesky-social/indigo/lex/util" + cbg "github.com/whyrusleeping/cbor-gen" +) + +const ( + MarkupMarkdownNSID = "org.tangled.markup.markdown" +) + +func init() { + util.RegisterType("org.tangled.markup.markdown#main", &MarkupMarkdown{}) +} // MarkupMarkdown is a "main" in the org.tangled.markup.markdown schema. +// Tangled Flavored Markdown format text +// +// RECORDTYPE: MarkupMarkdown +type MarkupMarkdown struct { + LexiconTypeID string `json:"$type,const=org.tangled.markup.markdown" cborgen:"$type,const=org.tangled.markup.markdown"` + // blobs: list of blobs referenced in markdown + Blobs []*MarkupMarkdown_Blobs_Elem `json:"blobs,omitempty" cborgen:"blobs,omitempty"` + // text: Final post-processed markdown content that will be rendered + Text string `json:"text" cborgen:"text"` +} + +type MarkupMarkdown_Blobs_Elem struct { + MarkupEmbedImage *MarkupEmbedImage + MarkupEmbedVideo *MarkupEmbedVideo +} + +func (t *MarkupMarkdown_Blobs_Elem) MarshalJSON() ([]byte, error) { + if t.MarkupEmbedImage != nil { + t.MarkupEmbedImage.LexiconTypeID = "org.tangled.markup.embed.image" + return json.Marshal(t.MarkupEmbedImage) + } + if t.MarkupEmbedVideo != nil { + t.MarkupEmbedVideo.LexiconTypeID = "org.tangled.markup.embed.video" + return json.Marshal(t.MarkupEmbedVideo) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *MarkupMarkdown_Blobs_Elem) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "org.tangled.markup.embed.image": + t.MarkupEmbedImage = new(MarkupEmbedImage) + return json.Unmarshal(b, t.MarkupEmbedImage) + case "org.tangled.markup.embed.video": + t.MarkupEmbedVideo = new(MarkupEmbedVideo) + return json.Unmarshal(b, t.MarkupEmbedVideo) + + default: + return nil + } +} + +func (t *MarkupMarkdown_Blobs_Elem) MarshalCBOR(w io.Writer) error { + + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + if t.MarkupEmbedImage != nil { + return t.MarkupEmbedImage.MarshalCBOR(w) + } + if t.MarkupEmbedVideo != nil { + return t.MarkupEmbedVideo.MarshalCBOR(w) + } + return fmt.Errorf("cannot cbor marshal empty enum") +} +func (t *MarkupMarkdown_Blobs_Elem) UnmarshalCBOR(r io.Reader) error { + typ, b, err := util.CborTypeExtractReader(r) + if err != nil { + return err + } + + switch typ { + case "org.tangled.markup.embed.image": + t.MarkupEmbedImage = new(MarkupEmbedImage) + return t.MarkupEmbedImage.UnmarshalCBOR(bytes.NewReader(b)) + case "org.tangled.markup.embed.video": + t.MarkupEmbedVideo = new(MarkupEmbedVideo) + return t.MarkupEmbedVideo.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return nil + } +} + +// MarkupMarkdown_Inline is a "inline" in the org.tangled.markup.markdown schema. +// +// Tangled Flavored Markdown format text (inline) +// +// RECORDTYPE: MarkupMarkdown_Inline +type MarkupMarkdown_Inline struct { + LexiconTypeID string `json:"$type,const=org.tangled.markup.markdown#inline" cborgen:"$type,const=org.tangled.markup.markdown#inline"` + // text: Final post-processed markdown content that will be rendered + Text string `json:"text" cborgen:"text"` +} diff --git a/api/org_tangled/markupplaintext.go b/api/org_tangled/markupplaintext.go new file mode 100644 index 000000000..72e9781b9 --- /dev/null +++ b/api/org_tangled/markupplaintext.go @@ -0,0 +1,14 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.markup.plaintext + +const ( + MarkupPlaintextNSID = "org.tangled.markup.plaintext" +) + +// MarkupPlaintext is a "main" in the org.tangled.markup.plaintext schema. +type MarkupPlaintext struct { + Text string `json:"text" cborgen:"text"` +} diff --git a/api/org_tangled/repocreateRepo.go b/api/org_tangled/repocreateRepo.go new file mode 100644 index 000000000..aae5d695e --- /dev/null +++ b/api/org_tangled/repocreateRepo.go @@ -0,0 +1,89 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.repo.createRepo + +import ( + "context" + "encoding/json" + "fmt" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoCreateRepoNSID = "org.tangled.repo.createRepo" +) + +// RepoCreateRepo_Input is the input argument to a org.tangled.repo.createRepo call. +type RepoCreateRepo_Input struct { + CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"` + // defaultBranch: Default branch of the repository. + DefaultBranch *string `json:"defaultBranch,omitempty" cborgen:"defaultBranch,omitempty"` + Description *string `json:"description,omitempty" cborgen:"description,omitempty"` + // did: Optional user-provided DID to use as the repo identity instead of minting one. + Did *string `json:"did,omitempty" cborgen:"did,omitempty"` + // name: Name of the repository. + Name string `json:"name" cborgen:"name"` + // source: A source to clone from, populate this when forking or importing a repository. + Source *RepoCreateRepo_Input_Source `json:"source,omitempty" cborgen:"source,omitempty"` + Spindle *string `json:"spindle,omitempty" cborgen:"spindle,omitempty"` + // topics: Topics related to the repo + Topics []string `json:"topics,omitempty" cborgen:"topics,omitempty"` + // website: Any URI related to the repo + Website *string `json:"website,omitempty" cborgen:"website,omitempty"` +} + +// A source to clone from, populate this when forking or importing a repository. +type RepoCreateRepo_Input_Source struct { + RepoDefs_SourceTangled *RepoDefs_SourceTangled + RepoDefs_SourceExternal *RepoDefs_SourceExternal +} + +func (t *RepoCreateRepo_Input_Source) MarshalJSON() ([]byte, error) { + if t.RepoDefs_SourceTangled != nil { + t.RepoDefs_SourceTangled.LexiconTypeID = "org.tangled.repo.defs#sourceTangled" + return json.Marshal(t.RepoDefs_SourceTangled) + } + if t.RepoDefs_SourceExternal != nil { + t.RepoDefs_SourceExternal.LexiconTypeID = "org.tangled.repo.defs#sourceExternal" + return json.Marshal(t.RepoDefs_SourceExternal) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *RepoCreateRepo_Input_Source) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "org.tangled.repo.defs#sourceTangled": + t.RepoDefs_SourceTangled = new(RepoDefs_SourceTangled) + return json.Unmarshal(b, t.RepoDefs_SourceTangled) + case "org.tangled.repo.defs#sourceExternal": + t.RepoDefs_SourceExternal = new(RepoDefs_SourceExternal) + return json.Unmarshal(b, t.RepoDefs_SourceExternal) + + default: + return nil + } +} + +// RepoCreateRepo_Output is the output of a org.tangled.repo.createRepo call. +type RepoCreateRepo_Output struct { + Did *string `json:"did,omitempty" cborgen:"did,omitempty"` + // key: Multibase-encoded public signing key the knot holds for this repository + Key *string `json:"key,omitempty" cborgen:"key,omitempty"` +} + +// RepoCreateRepo calls the XRPC method "org.tangled.repo.createRepo". +func RepoCreateRepo(ctx context.Context, c util.LexClient, input *RepoCreateRepo_Input) (*RepoCreateRepo_Output, error) { + var out RepoCreateRepo_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.repo.createRepo", nil, input, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/repodeclaration.go b/api/org_tangled/repodeclaration.go new file mode 100644 index 000000000..96b64ac8c --- /dev/null +++ b/api/org_tangled/repodeclaration.go @@ -0,0 +1,24 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.repo.declaration + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoDeclarationNSID = "org.tangled.repo.declaration" +) + +func init() { + util.RegisterType("org.tangled.repo.declaration", &RepoDeclaration{}) +} // +// RECORDTYPE: RepoDeclaration +type RepoDeclaration struct { + LexiconTypeID string `json:"$type,const=org.tangled.repo.declaration" cborgen:"$type,const=org.tangled.repo.declaration"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // repo: DID of the repo + Repo string `json:"repo" cborgen:"repo"` +} diff --git a/api/org_tangled/repodefs.go b/api/org_tangled/repodefs.go new file mode 100644 index 000000000..a1083c1cd --- /dev/null +++ b/api/org_tangled/repodefs.go @@ -0,0 +1,48 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.repo.defs + +const () + +// RepoDefs_RepoViewBasic is a "repoViewBasic" in the org.tangled.repo.defs schema. +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"` + OpenIssueCount *int64 `json:"openIssueCount,omitempty" cborgen:"openIssueCount,omitempty"` + OpenPullCount *int64 `json:"openPullCount,omitempty" cborgen:"openPullCount,omitempty"` + Owner *ActorDefs_ProfileViewBasic `json:"owner" cborgen:"owner"` + Slug string `json:"slug" cborgen:"slug"` + StarCount *int64 `json:"starCount,omitempty" cborgen:"starCount,omitempty"` + Viewer *RepoDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` +} + +// RepoDefs_SourceExternal is a "sourceExternal" in the org.tangled.repo.defs schema. +// +// RECORDTYPE: RepoDefs_SourceExternal +type RepoDefs_SourceExternal struct { + LexiconTypeID string `json:"$type,const=org.tangled.repo.defs#sourceExternal" cborgen:"$type,const=org.tangled.repo.defs#sourceExternal"` + // uri: git-clone uri of the repo + Uri string `json:"uri" cborgen:"uri"` +} + +// RepoDefs_SourceTangled is a "sourceTangled" in the org.tangled.repo.defs schema. +// +// RECORDTYPE: RepoDefs_SourceTangled +type RepoDefs_SourceTangled struct { + LexiconTypeID string `json:"$type,const=org.tangled.repo.defs#sourceTangled" cborgen:"$type,const=org.tangled.repo.defs#sourceTangled"` + // did: DID of the repo identity + Did string `json:"did" cborgen:"did"` +} + +// RepoDefs_ViewerState is a "viewerState" in the org.tangled.repo.defs schema. +// +// 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/org_tangled/repodeleteRepo.go b/api/org_tangled/repodeleteRepo.go new file mode 100644 index 000000000..6fa6bb5f1 --- /dev/null +++ b/api/org_tangled/repodeleteRepo.go @@ -0,0 +1,31 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.repo.deleteRepo + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoDeleteRepoNSID = "org.tangled.repo.deleteRepo" +) + +// RepoDeleteRepo_Input is the input argument to a org.tangled.repo.deleteRepo call. +type RepoDeleteRepo_Input struct { + // force: Skip the check for a declaration record on the owner's PDS. Knot admins only. + Force *bool `json:"force,omitempty" cborgen:"force,omitempty"` + Repo string `json:"repo" cborgen:"repo"` +} + +// RepoDeleteRepo calls the XRPC method "org.tangled.repo.deleteRepo". +func RepoDeleteRepo(ctx context.Context, c util.LexClient, input *RepoDeleteRepo_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.repo.deleteRepo", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/repoforkSync.go b/api/org_tangled/repoforkSync.go new file mode 100644 index 000000000..06a55f9ba --- /dev/null +++ b/api/org_tangled/repoforkSync.go @@ -0,0 +1,32 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.repo.forkSync + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoForkSyncNSID = "org.tangled.repo.forkSync" +) + +// RepoForkSync_Input is the input argument to a org.tangled.repo.forkSync call. +type RepoForkSync_Input struct { + // branch: Branch to fetch from the upstream + Branch string `json:"branch" cborgen:"branch"` + // repo: DID of the fork repository + Repo string `json:"repo" cborgen:"repo"` +} + +// RepoForkSync calls the XRPC method "org.tangled.repo.forkSync". +func RepoForkSync(ctx context.Context, c util.LexClient, input *RepoForkSync_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.repo.forkSync", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/repolistRecordVersions.go b/api/org_tangled/repolistRecordVersions.go new file mode 100644 index 000000000..803ac7572 --- /dev/null +++ b/api/org_tangled/repolistRecordVersions.go @@ -0,0 +1,57 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.repo.listRecordVersions + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoListRecordVersionsNSID = "org.tangled.repo.listRecordVersions" +) + +// RepoListRecordVersions_Output is the output of a org.tangled.repo.listRecordVersions call. +type RepoListRecordVersions_Output struct { + // cursor: Cursor for the next page, left out when the page already reaches the newest version + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + Uri string `json:"uri" cborgen:"uri"` + Versions []*RepoListRecordVersions_Version `json:"versions" cborgen:"versions"` +} + +// RepoListRecordVersions_Version is a "version" in the org.tangled.repo.listRecordVersions schema. +type RepoListRecordVersions_Version struct { + // changeId: Object ID of the git change that produced this version + ChangeId string `json:"changeId" cborgen:"changeId"` + // cid: Content id of this version. Missing when the version was removed or the change is a deletion. + Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` + // createdAt: When this knot wrote the commit this version rides in. Not the record's own `createdAt`. + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // editor: The account that authored the change + Editor string `json:"editor" cborgen:"editor"` +} + +// RepoListRecordVersions calls the XRPC method "org.tangled.repo.listRecordVersions". +// +// cursor: Pagination cursor +// uri: Record in a repo this knot hosts +func RepoListRecordVersions(ctx context.Context, c util.LexClient, cursor string, limit int64, uri string) (*RepoListRecordVersions_Output, error) { + var out RepoListRecordVersions_Output + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + params["uri"] = uri + if err := c.LexDo(ctx, util.Query, "", "org.tangled.repo.listRecordVersions", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/repomanifest.go b/api/org_tangled/repomanifest.go new file mode 100644 index 000000000..df2b88f99 --- /dev/null +++ b/api/org_tangled/repomanifest.go @@ -0,0 +1,117 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.repo.manifest + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + + "github.com/bluesky-social/indigo/lex/util" + cbg "github.com/whyrusleeping/cbor-gen" +) + +const ( + RepoManifestNSID = "org.tangled.repo.manifest" +) + +func init() { + util.RegisterType("org.tangled.repo.manifest", &RepoManifest{}) +} // +// RECORDTYPE: RepoManifest +type RepoManifest struct { + LexiconTypeID string `json:"$type,const=org.tangled.repo.manifest" cborgen:"$type,const=org.tangled.repo.manifest"` + // contributionPolicy: Who may open tickets and patches on this repo. anyone = any DID, members = the knot's member roll, collaborators = the owner plus repo collaborators. Absent means the knot-wide default. + ContributionPolicy *string `json:"contributionPolicy,omitempty" cborgen:"contributionPolicy,omitempty"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Declaration *RepoManifest_Declaration `json:"declaration" cborgen:"declaration"` + // defaultBranch: Default branch name without the refs/heads/ prefix. The knot will move HEAD to match when this field changes. + DefaultBranch *string `json:"defaultBranch,omitempty" cborgen:"defaultBranch,omitempty"` + Description *string `json:"description,omitempty" cborgen:"description,omitempty"` + // source: source of the repo + Source *RepoManifest_Source `json:"source,omitempty" cborgen:"source,omitempty"` + Spindle *string `json:"spindle,omitempty" cborgen:"spindle,omitempty"` + // topics: Topics related to the repo + Topics []string `json:"topics,omitempty" cborgen:"topics,omitempty"` + // website: Any URI related to the repo + Website *string `json:"website,omitempty" cborgen:"website,omitempty"` +} + +// RepoManifest_Declaration is a "declaration" in the org.tangled.repo.manifest schema. +type RepoManifest_Declaration struct { + // name: repository name; the slug (rkey of org.tangled.repo.declaration) is lowercase(name) + Name string `json:"name" cborgen:"name"` + Owner string `json:"owner" cborgen:"owner"` +} + +// source of the repo +type RepoManifest_Source struct { + RepoDefs_SourceTangled *RepoDefs_SourceTangled + RepoDefs_SourceExternal *RepoDefs_SourceExternal +} + +func (t *RepoManifest_Source) MarshalJSON() ([]byte, error) { + if t.RepoDefs_SourceTangled != nil { + t.RepoDefs_SourceTangled.LexiconTypeID = "org.tangled.repo.defs#sourceTangled" + return json.Marshal(t.RepoDefs_SourceTangled) + } + if t.RepoDefs_SourceExternal != nil { + t.RepoDefs_SourceExternal.LexiconTypeID = "org.tangled.repo.defs#sourceExternal" + return json.Marshal(t.RepoDefs_SourceExternal) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *RepoManifest_Source) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "org.tangled.repo.defs#sourceTangled": + t.RepoDefs_SourceTangled = new(RepoDefs_SourceTangled) + return json.Unmarshal(b, t.RepoDefs_SourceTangled) + case "org.tangled.repo.defs#sourceExternal": + t.RepoDefs_SourceExternal = new(RepoDefs_SourceExternal) + return json.Unmarshal(b, t.RepoDefs_SourceExternal) + + default: + return nil + } +} + +func (t *RepoManifest_Source) MarshalCBOR(w io.Writer) error { + + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + if t.RepoDefs_SourceTangled != nil { + return t.RepoDefs_SourceTangled.MarshalCBOR(w) + } + if t.RepoDefs_SourceExternal != nil { + return t.RepoDefs_SourceExternal.MarshalCBOR(w) + } + return fmt.Errorf("cannot cbor marshal empty enum") +} +func (t *RepoManifest_Source) UnmarshalCBOR(r io.Reader) error { + typ, b, err := util.CborTypeExtractReader(r) + if err != nil { + return err + } + + switch typ { + case "org.tangled.repo.defs#sourceTangled": + t.RepoDefs_SourceTangled = new(RepoDefs_SourceTangled) + return t.RepoDefs_SourceTangled.UnmarshalCBOR(bytes.NewReader(b)) + case "org.tangled.repo.defs#sourceExternal": + t.RepoDefs_SourceExternal = new(RepoDefs_SourceExternal) + return t.RepoDefs_SourceExternal.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return nil + } +} diff --git a/api/org_tangled/repomintToken.go b/api/org_tangled/repomintToken.go new file mode 100644 index 000000000..5671d6b1e --- /dev/null +++ b/api/org_tangled/repomintToken.go @@ -0,0 +1,43 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.repo.mintToken + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoMintTokenNSID = "org.tangled.repo.mintToken" +) + +// RepoMintToken_Input is the input argument to a org.tangled.repo.mintToken call. +type RepoMintToken_Input struct { + // aud: Audience of the minted token, a DID service ref for the service, that the token is addressed to. + Aud string `json:"aud" cborgen:"aud"` + // exp: Unix seconds. Must be in the future, and at most 60s after mint time. + Exp int64 `json:"exp" cborgen:"exp"` + // lxm: Lexicon method to which minted token binds. + Lxm string `json:"lxm" cborgen:"lxm"` + // repo: DID of the repo that becomes the token's issuer. Must be the audience of a given calling session. + Repo string `json:"repo" cborgen:"repo"` +} + +// RepoMintToken_Output is the output of a org.tangled.repo.mintToken call. +type RepoMintToken_Output struct { + // token: The signed service-auth JWT. + Token string `json:"token" cborgen:"token"` +} + +// RepoMintToken calls the XRPC method "org.tangled.repo.mintToken". +func RepoMintToken(ctx context.Context, c util.LexClient, input *RepoMintToken_Input) (*RepoMintToken_Output, error) { + var out RepoMintToken_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.repo.mintToken", nil, input, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/reporeserveKey.go b/api/org_tangled/reporeserveKey.go new file mode 100644 index 000000000..abbaaea7e --- /dev/null +++ b/api/org_tangled/reporeserveKey.go @@ -0,0 +1,38 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.repo.reserveKey + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoReserveKeyNSID = "org.tangled.repo.reserveKey" +) + +// RepoReserveKey_Input is the input argument to a org.tangled.repo.reserveKey call. +type RepoReserveKey_Input struct { + // repoDid: The caller-minted DID to reserve + RepoDid string `json:"repoDid" cborgen:"repoDid"` +} + +// RepoReserveKey_Output is the output of a org.tangled.repo.reserveKey call. +type RepoReserveKey_Output struct { + // key: Multibase-encoded public signing key the knot holds for this repo identity + Key string `json:"key" cborgen:"key"` + RepoDid string `json:"repoDid" cborgen:"repoDid"` +} + +// RepoReserveKey calls the XRPC method "org.tangled.repo.reserveKey". +func RepoReserveKey(ctx context.Context, c util.LexClient, input *RepoReserveKey_Input) (*RepoReserveKey_Output, error) { + var out RepoReserveKey_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.repo.reserveKey", nil, input, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/reporeviewunspeccedround.go b/api/org_tangled/reporeviewunspeccedround.go new file mode 100644 index 000000000..78e927329 --- /dev/null +++ b/api/org_tangled/reporeviewunspeccedround.go @@ -0,0 +1,31 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.repo.review.unspecced.round + +import ( + comatprototypes "github.com/bluesky-social/indigo/api/atproto" + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoReviewUnspeccedRoundNSID = "org.tangled.repo.review.unspecced.round" +) + +func init() { + util.RegisterType("org.tangled.repo.review.unspecced.round", &RepoReviewUnspeccedRound{}) +} // +// RECORDTYPE: RepoReviewUnspeccedRound +type RepoReviewUnspeccedRound struct { + LexiconTypeID string `json:"$type,const=org.tangled.repo.review.unspecced.round" cborgen:"$type,const=org.tangled.repo.review.unspecced.round"` + // commit: ID of commit that is getting reviewed. + Commit *GitOid `json:"commit" cborgen:"commit"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // labels: Self-label values for this record. Most common use-case is 'bot'. + Labels *comatprototypes.LabelDefs_SelfLabels `json:"labels,omitempty" cborgen:"labels,omitempty"` + // state: The reviewed state of that commit. This is one and only meaningful content of this record. + State *string `json:"state" cborgen:"state"` + // subject: ticket-id + Subject string `json:"subject" cborgen:"subject"` +} diff --git a/api/org_tangled/reviewmergePatch.go b/api/org_tangled/reviewmergePatch.go new file mode 100644 index 000000000..21e8abd5d --- /dev/null +++ b/api/org_tangled/reviewmergePatch.go @@ -0,0 +1,41 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.review.mergePatch + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + ReviewMergePatchNSID = "org.tangled.review.mergePatch" +) + +// ReviewMergePatch_Input is the input argument to a org.tangled.review.mergePatch call. +type ReviewMergePatch_Input struct { + // patch: Record key of the org.tangled.review.patch record to merge + Patch string `json:"patch" cborgen:"patch"` + // repo: DID of the repository + Repo string `json:"repo" cborgen:"repo"` +} + +// ReviewMergePatch_Output is the output of a org.tangled.review.mergePatch call. +type ReviewMergePatch_Output struct { + // merged: Patch records merged by this call + Merged []string `json:"merged" cborgen:"merged"` + // tip: Commit Object ID the target branch ended on; the current tip when no move was needed + Tip string `json:"tip" cborgen:"tip"` +} + +// ReviewMergePatch calls the XRPC method "org.tangled.review.mergePatch". +func ReviewMergePatch(ctx context.Context, c util.LexClient, input *ReviewMergePatch_Input) (*ReviewMergePatch_Output, error) { + var out ReviewMergePatch_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.review.mergePatch", nil, input, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/reviewpatch.go b/api/org_tangled/reviewpatch.go new file mode 100644 index 000000000..5adf75e76 --- /dev/null +++ b/api/org_tangled/reviewpatch.go @@ -0,0 +1,26 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.review.patch + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + ReviewPatchNSID = "org.tangled.review.patch" +) + +func init() { + util.RegisterType("org.tangled.review.patch", &ReviewPatch{}) +} // +// RECORDTYPE: ReviewPatch +type ReviewPatch struct { + LexiconTypeID string `json:"$type,const=org.tangled.review.patch" cborgen:"$type,const=org.tangled.review.patch"` + Base *GitOid `json:"base" cborgen:"base"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Head *GitOid `json:"head" cborgen:"head"` + // ticket: ticket-id + Ticket string `json:"ticket" cborgen:"ticket"` +} diff --git a/api/org_tangled/reviewunspecceddefs.go b/api/org_tangled/reviewunspecceddefs.go new file mode 100644 index 000000000..41d4f5830 --- /dev/null +++ b/api/org_tangled/reviewunspecceddefs.go @@ -0,0 +1,7 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.review.unspecced.defs + +const () diff --git a/api/org_tangled/shTombstone.go b/api/org_tangled/shTombstone.go new file mode 100644 index 000000000..243a6a100 --- /dev/null +++ b/api/org_tangled/shTombstone.go @@ -0,0 +1,22 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.shTombstone + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + ShTombstoneNSID = "org.tangled.shTombstone" +) + +func init() { + util.RegisterType("org.tangled.shTombstone", &ShTombstone{}) +} // +// RECORDTYPE: ShTombstone +type ShTombstone struct { + LexiconTypeID string `json:"$type,const=org.tangled.shTombstone" cborgen:"$type,const=org.tangled.shTombstone"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` +} diff --git a/api/org_tangled/snippetstring.go b/api/org_tangled/snippetstring.go new file mode 100644 index 000000000..a7bb03065 --- /dev/null +++ b/api/org_tangled/snippetstring.go @@ -0,0 +1,94 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.snippet.string + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + + "github.com/bluesky-social/indigo/lex/util" + cbg "github.com/whyrusleeping/cbor-gen" +) + +const ( + SnippetStringNSID = "org.tangled.snippet.string" +) + +func init() { + util.RegisterType("org.tangled.snippet.string", &SnippetString{}) +} // +// RECORDTYPE: SnippetString +type SnippetString struct { + LexiconTypeID string `json:"$type,const=org.tangled.snippet.string" cborgen:"$type,const=org.tangled.snippet.string"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + Description *string `json:"description,omitempty" cborgen:"description,omitempty"` + Snippet *SnippetString_Snippet `json:"snippet" cborgen:"snippet"` +} + +type SnippetString_Snippet struct { + SnippetString_TextFile *SnippetString_TextFile +} + +func (t *SnippetString_Snippet) MarshalJSON() ([]byte, error) { + if t.SnippetString_TextFile != nil { + t.SnippetString_TextFile.LexiconTypeID = "org.tangled.snippet.string#textFile" + return json.Marshal(t.SnippetString_TextFile) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *SnippetString_Snippet) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "org.tangled.snippet.string#textFile": + t.SnippetString_TextFile = new(SnippetString_TextFile) + return json.Unmarshal(b, t.SnippetString_TextFile) + + default: + return nil + } +} + +func (t *SnippetString_Snippet) MarshalCBOR(w io.Writer) error { + + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + if t.SnippetString_TextFile != nil { + return t.SnippetString_TextFile.MarshalCBOR(w) + } + return fmt.Errorf("cannot cbor marshal empty enum") +} +func (t *SnippetString_Snippet) UnmarshalCBOR(r io.Reader) error { + typ, b, err := util.CborTypeExtractReader(r) + if err != nil { + return err + } + + switch typ { + case "org.tangled.snippet.string#textFile": + t.SnippetString_TextFile = new(SnippetString_TextFile) + return t.SnippetString_TextFile.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return nil + } +} + +// SnippetString_TextFile is a "textFile" in the org.tangled.snippet.string schema. +// +// RECORDTYPE: SnippetString_TextFile +type SnippetString_TextFile struct { + LexiconTypeID string `json:"$type,const=org.tangled.snippet.string#textFile" cborgen:"$type,const=org.tangled.snippet.string#textFile"` + Content *util.LexBlob `json:"content" cborgen:"content"` + // name: file name + Name string `json:"name" cborgen:"name"` +} diff --git a/api/org_tangled/accountaddEmail.go b/api/org_tangled/tempaccountaddEmail.go similarity index 100% rename from api/org_tangled/accountaddEmail.go rename to api/org_tangled/tempaccountaddEmail.go diff --git a/api/org_tangled/accountbeginSignup.go b/api/org_tangled/tempaccountbeginSignup.go similarity index 100% rename from api/org_tangled/accountbeginSignup.go rename to api/org_tangled/tempaccountbeginSignup.go diff --git a/api/org_tangled/accountcompleteSignup.go b/api/org_tangled/tempaccountcompleteSignup.go similarity index 100% rename from api/org_tangled/accountcompleteSignup.go rename to api/org_tangled/tempaccountcompleteSignup.go diff --git a/api/org_tangled/accountdeleteEmail.go b/api/org_tangled/tempaccountdeleteEmail.go similarity index 100% rename from api/org_tangled/accountdeleteEmail.go rename to api/org_tangled/tempaccountdeleteEmail.go diff --git a/api/org_tangled/accountdismissNewsletter.go b/api/org_tangled/tempaccountdismissNewsletter.go similarity index 100% rename from api/org_tangled/accountdismissNewsletter.go rename to api/org_tangled/tempaccountdismissNewsletter.go diff --git a/api/org_tangled/accountlistEmails.go b/api/org_tangled/tempaccountlistEmails.go similarity index 100% rename from api/org_tangled/accountlistEmails.go rename to api/org_tangled/tempaccountlistEmails.go diff --git a/api/org_tangled/accountresendSignup.go b/api/org_tangled/tempaccountresendSignup.go similarity index 100% rename from api/org_tangled/accountresendSignup.go rename to api/org_tangled/tempaccountresendSignup.go diff --git a/api/org_tangled/accountsetPrimaryEmail.go b/api/org_tangled/tempaccountsetPrimaryEmail.go similarity index 100% rename from api/org_tangled/accountsetPrimaryEmail.go rename to api/org_tangled/tempaccountsetPrimaryEmail.go diff --git a/api/org_tangled/accountsubscribeNewsletter.go b/api/org_tangled/tempaccountsubscribeNewsletter.go similarity index 100% rename from api/org_tangled/accountsubscribeNewsletter.go rename to api/org_tangled/tempaccountsubscribeNewsletter.go diff --git a/api/org_tangled/accountverifyEmail.go b/api/org_tangled/tempaccountverifyEmail.go similarity index 100% rename from api/org_tangled/accountverifyEmail.go rename to api/org_tangled/tempaccountverifyEmail.go diff --git a/api/org_tangled/tempactordefs.go b/api/org_tangled/tempactordefs.go new file mode 100644 index 000000000..84b42a578 --- /dev/null +++ b/api/org_tangled/tempactordefs.go @@ -0,0 +1,23 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.actor.defs + +const () + +// TempActorDefs_SavedKnotPref is a "savedKnotPref" in the org.tangled.temp.actor.defs schema. +type TempActorDefs_SavedKnotPref struct { + Items []*TempActorDefs_SavedService `json:"items" cborgen:"items"` +} + +// TempActorDefs_SavedService is a "savedService" in the org.tangled.temp.actor.defs schema. +type TempActorDefs_SavedService struct { + Id string `json:"id" cborgen:"id"` + Value string `json:"value" cborgen:"value"` +} + +// TempActorDefs_SavedSpindlePref is a "savedSpindlePref" in the org.tangled.temp.actor.defs schema. +type TempActorDefs_SavedSpindlePref struct { + Items []*TempActorDefs_SavedService `json:"items" cborgen:"items"` +} diff --git a/api/org_tangled/focusbeginSession.go b/api/org_tangled/tempfocusbeginSession.go similarity index 100% rename from api/org_tangled/focusbeginSession.go rename to api/org_tangled/tempfocusbeginSession.go diff --git a/api/org_tangled/focusendSession.go b/api/org_tangled/tempfocusendSession.go similarity index 100% rename from api/org_tangled/focusendSession.go rename to api/org_tangled/tempfocusendSession.go diff --git a/api/org_tangled/focusnextItem.go b/api/org_tangled/tempfocusnextItem.go similarity index 100% rename from api/org_tangled/focusnextItem.go rename to api/org_tangled/tempfocusnextItem.go diff --git a/api/org_tangled/tempgitdeleteBranch.go b/api/org_tangled/tempgitdeleteBranch.go new file mode 100644 index 000000000..958452206 --- /dev/null +++ b/api/org_tangled/tempgitdeleteBranch.go @@ -0,0 +1,31 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.git.deleteBranch + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempGitDeleteBranchNSID = "org.tangled.temp.git.deleteBranch" +) + +// TempGitDeleteBranch_Input is the input argument to a org.tangled.temp.git.deleteBranch call. +type TempGitDeleteBranch_Input struct { + Branch string `json:"branch" cborgen:"branch"` + // repo: DID of the repository + Repo string `json:"repo" cborgen:"repo"` +} + +// TempGitDeleteBranch calls the XRPC method "org.tangled.temp.git.deleteBranch". +func TempGitDeleteBranch(ctx context.Context, c util.LexClient, input *TempGitDeleteBranch_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.git.deleteBranch", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/tempgitgetArchive.go b/api/org_tangled/tempgitgetArchive.go new file mode 100644 index 000000000..cb0345807 --- /dev/null +++ b/api/org_tangled/tempgitgetArchive.go @@ -0,0 +1,39 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.git.getArchive + +import ( + "bytes" + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempGitGetArchiveNSID = "org.tangled.temp.git.getArchive" +) + +// TempGitGetArchive calls the XRPC method "org.tangled.temp.git.getArchive". +// +// format: Archive format +// prefix: Prefix for files in the archive +// ref: Git reference (branch, tag, or commit SHA) +// repo: DID of the repository +func TempGitGetArchive(ctx context.Context, c util.LexClient, format string, prefix string, ref string, repo string) ([]byte, error) { + buf := new(bytes.Buffer) + + params := map[string]interface{}{} + if format != "" { + params["format"] = format + } + params["prefix"] = prefix + params["ref"] = ref + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.getArchive", params, nil, buf); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} diff --git a/api/org_tangled/tempgitgetBlob.go b/api/org_tangled/tempgitgetBlob.go new file mode 100644 index 000000000..6bbddf596 --- /dev/null +++ b/api/org_tangled/tempgitgetBlob.go @@ -0,0 +1,37 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.git.getBlob + +import ( + "bytes" + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempGitGetBlobNSID = "org.tangled.temp.git.getBlob" +) + +// TempGitGetBlob calls the XRPC method "org.tangled.temp.git.getBlob". +// +// path: Path within the repository tree +// ref: Git reference (branch, tag, or commit SHA) +// repo: DID of the repository +func TempGitGetBlob(ctx context.Context, c util.LexClient, path string, ref string, repo string) ([]byte, error) { + buf := new(bytes.Buffer) + + params := map[string]interface{}{} + params["path"] = path + if ref != "" { + params["ref"] = ref + } + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.getBlob", params, nil, buf); err != nil { + return nil, err + } + + return buf.Bytes(), nil +} diff --git a/api/org_tangled/tempgitgetBranch.go b/api/org_tangled/tempgitgetBranch.go new file mode 100644 index 000000000..698790a24 --- /dev/null +++ b/api/org_tangled/tempgitgetBranch.go @@ -0,0 +1,45 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.git.getBranch + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempGitGetBranchNSID = "org.tangled.temp.git.getBranch" +) + +// TempGitGetBranch_Output is the output of a org.tangled.temp.git.getBranch call. +type TempGitGetBranch_Output struct { + Author *GitDefs_Signature `json:"author" cborgen:"author"` + // hash: Latest commit hash on this branch + Hash string `json:"hash" cborgen:"hash"` + // message: Latest commit message + Message string `json:"message" cborgen:"message"` + // name: Branch name + Name string `json:"name" cborgen:"name"` + // totalCommits: Number of commits reachable from this branch + TotalCommits int64 `json:"totalCommits" cborgen:"totalCommits"` +} + +// TempGitGetBranch calls the XRPC method "org.tangled.temp.git.getBranch". +// +// name: Branch name to get information for +// repo: DID of the repository +func TempGitGetBranch(ctx context.Context, c util.LexClient, name string, repo string) (*TempGitGetBranch_Output, error) { + var out TempGitGetBranch_Output + + params := map[string]interface{}{} + params["name"] = name + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.getBranch", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/tempgitgetEntry.go b/api/org_tangled/tempgitgetEntry.go new file mode 100644 index 000000000..1cfcdc89c --- /dev/null +++ b/api/org_tangled/tempgitgetEntry.go @@ -0,0 +1,49 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.git.getEntry + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempGitGetEntryNSID = "org.tangled.temp.git.getEntry" +) + +// TempGitGetEntry_Output is the output of a org.tangled.temp.git.getEntry call. +type TempGitGetEntry_Output struct { + LastCommit *GitDefs_Commit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"` + Mode string `json:"mode" cborgen:"mode"` + // name: The file name + Name string `json:"name" cborgen:"name"` + Oid string `json:"oid" cborgen:"oid"` + // size: Blob size + Size int64 `json:"size" cborgen:"size"` + // submodule: Submodule information if path is a submodule + Submodule *GitDefs_Submodule `json:"submodule,omitempty" cborgen:"submodule,omitempty"` +} + +// TempGitGetEntry calls the XRPC method "org.tangled.temp.git.getEntry". +// +// path: path of the entity +// ref: Git revision (branch, tag, or commit id) +// repo: DID of the repository +func TempGitGetEntry(ctx context.Context, c util.LexClient, path string, ref string, repo string) (*TempGitGetEntry_Output, error) { + var out TempGitGetEntry_Output + + params := map[string]interface{}{} + params["path"] = path + if ref != "" { + params["ref"] = ref + } + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.getEntry", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/gitgetMergeBase.go b/api/org_tangled/tempgitgetMergeBase.go similarity index 100% rename from api/org_tangled/gitgetMergeBase.go rename to api/org_tangled/tempgitgetMergeBase.go diff --git a/api/org_tangled/tempgitgetRef.go b/api/org_tangled/tempgitgetRef.go new file mode 100644 index 000000000..42a480bba --- /dev/null +++ b/api/org_tangled/tempgitgetRef.go @@ -0,0 +1,47 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.git.getRef + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempGitGetRefNSID = "org.tangled.temp.git.getRef" +) + +// TempGitGetRef_Output is the output of a org.tangled.temp.git.getRef call. +type TempGitGetRef_Output struct { + // annotation: Present only for annotated tags + Annotation *TempGitListTags_Annotation `json:"annotation,omitempty" cborgen:"annotation,omitempty"` + Author *GitDefs_Signature `json:"author" cborgen:"author"` + // message: Latest commit message + Message string `json:"message" cborgen:"message"` + // name: Full reference name. Example: refs/heads/master + Name string `json:"name" cborgen:"name"` + // oid: Latest commit oid on this reference. + Oid string `json:"oid" cborgen:"oid"` + // totalCommits: Number of commits reachable from this tip + TotalCommits int64 `json:"totalCommits" cborgen:"totalCommits"` +} + +// TempGitGetRef calls the XRPC method "org.tangled.temp.git.getRef". +// +// ref: Reference name. Such as master, refs/heads/master, or v1.16.0-alpha. +// repo: DID of the repository +func TempGitGetRef(ctx context.Context, c util.LexClient, ref string, repo string) (*TempGitGetRef_Output, error) { + var out TempGitGetRef_Output + + params := map[string]interface{}{} + params["ref"] = ref + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.getRef", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/tempgitgetTag.go b/api/org_tangled/tempgitgetTag.go new file mode 100644 index 000000000..a673da556 --- /dev/null +++ b/api/org_tangled/tempgitgetTag.go @@ -0,0 +1,45 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.git.getTag + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempGitGetTagNSID = "org.tangled.temp.git.getTag" +) + +// TempGitGetTag_Output is the output of a org.tangled.temp.git.getTag call. +type TempGitGetTag_Output struct { + // annotation: Present only for annotated tags + Annotation *TempGitListTags_Annotation `json:"annotation,omitempty" cborgen:"annotation,omitempty"` + Author *GitDefs_Signature `json:"author" cborgen:"author"` + // message: Latest commit message + Message string `json:"message" cborgen:"message"` + // name: Tag name + Name string `json:"name" cborgen:"name"` + // oid: Latest commit oid on this tag + Oid string `json:"oid" cborgen:"oid"` +} + +// TempGitGetTag calls the XRPC method "org.tangled.temp.git.getTag". +// +// repo: DID of the repository +// tag: Name of tag, such as v1.3.0 +func TempGitGetTag(ctx context.Context, c util.LexClient, repo string, tag string) (*TempGitGetTag_Output, error) { + var out TempGitGetTag_Output + + params := map[string]interface{}{} + params["repo"] = repo + params["tag"] = tag + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.getTag", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/tempgitgetTree.go b/api/org_tangled/tempgitgetTree.go new file mode 100644 index 000000000..6da2282a8 --- /dev/null +++ b/api/org_tangled/tempgitgetTree.go @@ -0,0 +1,55 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.git.getTree + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempGitGetTreeNSID = "org.tangled.temp.git.getTree" +) + +// TempGitGetTree_Output is the output of a org.tangled.temp.git.getTree call. +type TempGitGetTree_Output struct { + Entries []*TempGitGetTree_TreeEntry `json:"entries" cborgen:"entries"` + LastCommit *GitDefs_Commit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"` +} + +// TempGitGetTree_TreeEntry is a "treeEntry" in the org.tangled.temp.git.getTree schema. +type TempGitGetTree_TreeEntry struct { + LastCommit *GitDefs_Commit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"` + // mode: File mode + Mode string `json:"mode" cborgen:"mode"` + // name: Relative file or directory name + Name string `json:"name" cborgen:"name"` + // size: File size in bytes + Size int64 `json:"size" cborgen:"size"` +} + +// TempGitGetTree calls the XRPC method "org.tangled.temp.git.getTree". +// +// path: Path within the repository tree +// ref: Git revision (branch, tag, or commit id) +// repo: DID of the repository +func TempGitGetTree(ctx context.Context, c util.LexClient, path string, ref string, repo string) (*TempGitGetTree_Output, error) { + var out TempGitGetTree_Output + + params := map[string]interface{}{} + if path != "" { + params["path"] = path + } + if ref != "" { + params["ref"] = ref + } + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.getTree", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/tempgitlistBranches.go b/api/org_tangled/tempgitlistBranches.go new file mode 100644 index 000000000..0747259d8 --- /dev/null +++ b/api/org_tangled/tempgitlistBranches.go @@ -0,0 +1,60 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.git.listBranches + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempGitListBranchesNSID = "org.tangled.temp.git.listBranches" +) + +// TempGitListBranches_BranchInfo is a "branchInfo" in the org.tangled.temp.git.listBranches schema. +type TempGitListBranches_BranchInfo struct { + Author *GitDefs_Signature `json:"author" cborgen:"author"` + Committer *GitDefs_Signature `json:"committer" cborgen:"committer"` + // message: Latest commit message + Message string `json:"message" cborgen:"message"` + // name: Branch name + Name string `json:"name" cborgen:"name"` + // oid: Latest commit oid on this branch + Oid string `json:"oid" cborgen:"oid"` +} + +// TempGitListBranches_Output is the output of a org.tangled.temp.git.listBranches call. +type TempGitListBranches_Output struct { + Branches []*TempGitListBranches_BranchInfo `json:"branches" cborgen:"branches"` + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + // defaultBranch: Name of the default branch + DefaultBranch *string `json:"defaultBranch,omitempty" cborgen:"defaultBranch,omitempty"` + // total: Total number of branches in the repository + Total int64 `json:"total" cborgen:"total"` +} + +// TempGitListBranches calls the XRPC method "org.tangled.temp.git.listBranches". +// +// cursor: Pagination cursor +// limit: Maximum number of branches to return +// repo: DID of the repository +func TempGitListBranches(ctx context.Context, c util.LexClient, cursor string, limit int64, repo string) (*TempGitListBranches_Output, error) { + var out TempGitListBranches_Output + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.listBranches", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/tempgitlistTags.go b/api/org_tangled/tempgitlistTags.go new file mode 100644 index 000000000..793d106cf --- /dev/null +++ b/api/org_tangled/tempgitlistTags.go @@ -0,0 +1,66 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.git.listTags + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempGitListTagsNSID = "org.tangled.temp.git.listTags" +) + +// TempGitListTags_Annotation is a "annotation" in the org.tangled.temp.git.listTags schema. +type TempGitListTags_Annotation struct { + // message: Tag message + Message string `json:"message" cborgen:"message"` + Tagger *GitDefs_Signature `json:"tagger,omitempty" cborgen:"tagger,omitempty"` +} + +// TempGitListTags_Output is the output of a org.tangled.temp.git.listTags call. +type TempGitListTags_Output struct { + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + Tags []*TempGitListTags_TagInfo `json:"tags" cborgen:"tags"` + // total: Total number of tags in the repository + Total int64 `json:"total" cborgen:"total"` +} + +// TempGitListTags_TagInfo is a "tagInfo" in the org.tangled.temp.git.listTags schema. +type TempGitListTags_TagInfo struct { + // annotation: Present only for annotated tags + Annotation *TempGitListTags_Annotation `json:"annotation,omitempty" cborgen:"annotation,omitempty"` + Author *GitDefs_Signature `json:"author" cborgen:"author"` + // message: Latest commit message + Message string `json:"message" cborgen:"message"` + // name: Tag name + Name string `json:"name" cborgen:"name"` + // oid: Latest commit oid on this tag + Oid string `json:"oid" cborgen:"oid"` +} + +// TempGitListTags calls the XRPC method "org.tangled.temp.git.listTags". +// +// cursor: Pagination cursor +// limit: Maximum number of tags to return +// repo: DID of the repository +func TempGitListTags(ctx context.Context, c util.LexClient, cursor string, limit int64, repo string) (*TempGitListTags_Output, error) { + var out TempGitListTags_Output + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.listTags", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/gitmergeCommit.go b/api/org_tangled/tempgitmergeCommit.go similarity index 89% rename from api/org_tangled/gitmergeCommit.go rename to api/org_tangled/tempgitmergeCommit.go index 3ff0a597a..e45a7b74c 100644 --- a/api/org_tangled/gitmergeCommit.go +++ b/api/org_tangled/tempgitmergeCommit.go @@ -8,7 +8,6 @@ import ( "context" "github.com/bluesky-social/indigo/lex/util" - shtangledtypes "tangled.org/core/api/tangled" ) const ( @@ -28,8 +27,8 @@ type TempGitMergeCommit_Input struct { // // Merge commit content. Used when merge commit is created. type TempGitMergeCommit_MergeCommitContent struct { - Author *shtangledtypes.GitDefs_Signature `json:"author,omitempty" cborgen:"author,omitempty"` - Message *string `json:"message,omitempty" cborgen:"message,omitempty"` + Author *GitDefs_Signature `json:"author,omitempty" cborgen:"author,omitempty"` + Message *string `json:"message,omitempty" cborgen:"message,omitempty"` } // TempGitMergeCommit_Source is a "source" in the org.tangled.temp.git.mergeCommit schema. diff --git a/api/org_tangled/migratorcreateTask.go b/api/org_tangled/tempmigratorcreateTask.go similarity index 100% rename from api/org_tangled/migratorcreateTask.go rename to api/org_tangled/tempmigratorcreateTask.go diff --git a/api/org_tangled/migratordefs.go b/api/org_tangled/tempmigratordefs.go similarity index 100% rename from api/org_tangled/migratordefs.go rename to api/org_tangled/tempmigratordefs.go diff --git a/api/org_tangled/migratordescribeSource.go b/api/org_tangled/tempmigratordescribeSource.go similarity index 100% rename from api/org_tangled/migratordescribeSource.go rename to api/org_tangled/tempmigratordescribeSource.go diff --git a/api/org_tangled/migratorgetTask.go b/api/org_tangled/tempmigratorgetTask.go similarity index 100% rename from api/org_tangled/migratorgetTask.go rename to api/org_tangled/tempmigratorgetTask.go diff --git a/api/org_tangled/migratorlistTasks.go b/api/org_tangled/tempmigratorlistTasks.go similarity index 100% rename from api/org_tangled/migratorlistTasks.go rename to api/org_tangled/tempmigratorlistTasks.go diff --git a/api/org_tangled/migratorretryJob.go b/api/org_tangled/tempmigratorretryJob.go similarity index 100% rename from api/org_tangled/migratorretryJob.go rename to api/org_tangled/tempmigratorretryJob.go diff --git a/api/org_tangled/notificationdeleteNotification.go b/api/org_tangled/tempnotificationdeleteNotification.go similarity index 100% rename from api/org_tangled/notificationdeleteNotification.go rename to api/org_tangled/tempnotificationdeleteNotification.go diff --git a/api/org_tangled/notificationgetPreferences.go b/api/org_tangled/tempnotificationgetPreferences.go similarity index 100% rename from api/org_tangled/notificationgetPreferences.go rename to api/org_tangled/tempnotificationgetPreferences.go diff --git a/api/org_tangled/notificationgetUnreadCount.go b/api/org_tangled/tempnotificationgetUnreadCount.go similarity index 100% rename from api/org_tangled/notificationgetUnreadCount.go rename to api/org_tangled/tempnotificationgetUnreadCount.go diff --git a/api/org_tangled/notificationlistNotifications.go b/api/org_tangled/tempnotificationlistNotifications.go similarity index 100% rename from api/org_tangled/notificationlistNotifications.go rename to api/org_tangled/tempnotificationlistNotifications.go diff --git a/api/org_tangled/notificationlistRecipients.go b/api/org_tangled/tempnotificationlistRecipients.go similarity index 100% rename from api/org_tangled/notificationlistRecipients.go rename to api/org_tangled/tempnotificationlistRecipients.go diff --git a/api/org_tangled/notificationmarkAllRead.go b/api/org_tangled/tempnotificationmarkAllRead.go similarity index 100% rename from api/org_tangled/notificationmarkAllRead.go rename to api/org_tangled/tempnotificationmarkAllRead.go diff --git a/api/org_tangled/notificationmarkEntityRead.go b/api/org_tangled/tempnotificationmarkEntityRead.go similarity index 100% rename from api/org_tangled/notificationmarkEntityRead.go rename to api/org_tangled/tempnotificationmarkEntityRead.go diff --git a/api/org_tangled/notificationupdatePreferences.go b/api/org_tangled/tempnotificationupdatePreferences.go similarity index 100% rename from api/org_tangled/notificationupdatePreferences.go rename to api/org_tangled/tempnotificationupdatePreferences.go diff --git a/api/org_tangled/notificationupdateSeen.go b/api/org_tangled/tempnotificationupdateSeen.go similarity index 100% rename from api/org_tangled/notificationupdateSeen.go rename to api/org_tangled/tempnotificationupdateSeen.go diff --git a/api/org_tangled/repodisableSite.go b/api/org_tangled/temprepodisableSite.go similarity index 100% rename from api/org_tangled/repodisableSite.go rename to api/org_tangled/temprepodisableSite.go diff --git a/api/org_tangled/temprepogetRepoByName.go b/api/org_tangled/temprepogetRepoByName.go new file mode 100644 index 000000000..20f1a6e63 --- /dev/null +++ b/api/org_tangled/temprepogetRepoByName.go @@ -0,0 +1,51 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.repo.getRepoByName + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempRepoGetRepoByNameNSID = "org.tangled.temp.repo.getRepoByName" +) + +// TempRepoGetRepoByName_GitInfo is a "gitInfo" in the org.tangled.temp.repo.getRepoByName schema. +type TempRepoGetRepoByName_GitInfo struct { + // defaultBranch: Default branch name from `org.tangled.git.refs/self` record. + DefaultBranch string `json:"defaultBranch" cborgen:"defaultBranch"` + // isEmpty: True if `refs` in `org.tangled.git.refs/self` record is empty. + IsEmpty bool `json:"isEmpty" cborgen:"isEmpty"` +} + +// TempRepoGetRepoByName_Output is the output of a org.tangled.temp.repo.getRepoByName call. +type TempRepoGetRepoByName_Output struct { + Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` + Git *TempRepoGetRepoByName_GitInfo `json:"git,omitempty" cborgen:"git,omitempty"` + // knot: Host of the knot named by the #tangled_knot service in the repo's DID document. Absent when it names none. + Knot *string `json:"knot,omitempty" cborgen:"knot,omitempty"` + Uri string `json:"uri" cborgen:"uri"` + // value: Embedded org.tangled.repo.manifest record. + Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` +} + +// TempRepoGetRepoByName calls the XRPC method "org.tangled.temp.repo.getRepoByName". +// +// name: Lowercased repository name. +// owner: DID of the account that owns the repo. +func TempRepoGetRepoByName(ctx context.Context, c util.LexClient, name string, owner string) (*TempRepoGetRepoByName_Output, error) { + var out TempRepoGetRepoByName_Output + + params := map[string]interface{}{} + params["name"] = name + params["owner"] = owner + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.repo.getRepoByName", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/repogetSiteConfig.go b/api/org_tangled/temprepogetSiteConfig.go similarity index 100% rename from api/org_tangled/repogetSiteConfig.go rename to api/org_tangled/temprepogetSiteConfig.go diff --git a/api/org_tangled/repoupdateSiteConfig.go b/api/org_tangled/temprepoupdateSiteConfig.go similarity index 100% rename from api/org_tangled/repoupdateSiteConfig.go rename to api/org_tangled/temprepoupdateSiteConfig.go diff --git a/api/org_tangled/tempreviewlistPatches.go b/api/org_tangled/tempreviewlistPatches.go new file mode 100644 index 000000000..12c87c979 --- /dev/null +++ b/api/org_tangled/tempreviewlistPatches.go @@ -0,0 +1,61 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.review.listPatches + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempReviewListPatchesNSID = "org.tangled.temp.review.listPatches" +) + +// TempReviewListPatches_ListItem is a "listItem" in the org.tangled.temp.review.listPatches schema. +type TempReviewListPatches_ListItem struct { + Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` + Uri string `json:"uri" cborgen:"uri"` + // value: Embedded org.tangled.review.patch record + Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` +} + +// TempReviewListPatches_Output is the output of a org.tangled.temp.review.listPatches call. +type TempReviewListPatches_Output struct { + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` + Items []*TempReviewListPatches_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"` +} + +// TempReviewListPatches calls the XRPC method "org.tangled.temp.review.listPatches". +// +// 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. +// ticket: AT-URI of the org.tangled.track.ticket the patches belong to. +func TempReviewListPatches(ctx context.Context, c util.LexClient, cursor string, limit int64, offset int64, order string, ticket string) (*TempReviewListPatches_Output, error) { + var out TempReviewListPatches_Output + + params := map[string]interface{}{} + if cursor != "" { + params["cursor"] = cursor + } + if limit != 0 { + params["limit"] = limit + } + if offset != 0 { + params["offset"] = offset + } + if order != "" { + params["order"] = order + } + params["ticket"] = ticket + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.review.listPatches", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/searchsearchCode.go b/api/org_tangled/tempsearchsearchCode.go similarity index 92% rename from api/org_tangled/searchsearchCode.go rename to api/org_tangled/tempsearchsearchCode.go index da8c4c63f..073474b1a 100644 --- a/api/org_tangled/searchsearchCode.go +++ b/api/org_tangled/tempsearchsearchCode.go @@ -8,7 +8,6 @@ import ( "context" "github.com/bluesky-social/indigo/lex/util" - shtangledtypes "tangled.org/core/api/tangled" ) const ( @@ -36,8 +35,8 @@ type TempSearchSearchCode_FileResult struct { // path: File path relative to repository root. Path string `json:"path" cborgen:"path"` // ranges: set for a filename match - Ranges []*TempSearchSearchCode_Highlight `json:"ranges,omitempty" cborgen:"ranges,omitempty"` - Repo *shtangledtypes.RepoDefs_RepoViewBasic `json:"repo" cborgen:"repo"` + Ranges []*TempSearchSearchCode_Highlight `json:"ranges,omitempty" cborgen:"ranges,omitempty"` + Repo *RepoDefs_RepoViewBasic `json:"repo" cborgen:"repo"` } // TempSearchSearchCode_Highlight is a "highlight" in the org.tangled.temp.search.searchCode schema. diff --git a/api/org_tangled/servercreateInviteCode.go b/api/org_tangled/tempservercreateInviteCode.go similarity index 100% rename from api/org_tangled/servercreateInviteCode.go rename to api/org_tangled/tempservercreateInviteCode.go diff --git a/api/org_tangled/serverredeemInviteCode.go b/api/org_tangled/tempserverredeemInviteCode.go similarity index 100% rename from api/org_tangled/serverredeemInviteCode.go rename to api/org_tangled/tempserverredeemInviteCode.go diff --git a/api/org_tangled/siteclaimDomain.go b/api/org_tangled/tempsiteclaimDomain.go similarity index 100% rename from api/org_tangled/siteclaimDomain.go rename to api/org_tangled/tempsiteclaimDomain.go diff --git a/api/org_tangled/sitegetDomainClaim.go b/api/org_tangled/tempsitegetDomainClaim.go similarity index 100% rename from api/org_tangled/sitegetDomainClaim.go rename to api/org_tangled/tempsitegetDomainClaim.go diff --git a/api/org_tangled/sitereleaseDomain.go b/api/org_tangled/tempsitereleaseDomain.go similarity index 100% rename from api/org_tangled/sitereleaseDomain.go rename to api/org_tangled/tempsitereleaseDomain.go diff --git a/api/org_tangled/allowListadd.go b/api/org_tangled/tempspindleallowListadd.go similarity index 90% rename from api/org_tangled/allowListadd.go rename to api/org_tangled/tempspindleallowListadd.go index 9d4b2137e..640ec1384 100644 --- a/api/org_tangled/allowListadd.go +++ b/api/org_tangled/tempspindleallowListadd.go @@ -16,7 +16,7 @@ const ( // TempSpindleAllowListAdd_Input is the input argument to a org.tangled.temp.spindle.allowList.add call. type TempSpindleAllowListAdd_Input struct { - // did: DID of the account allowed to enroll repos on this spindle. + // did: DID of account that should be allowed to enroll repos on this here spindle. Did string `json:"did" cborgen:"did"` } diff --git a/api/org_tangled/allowListlist.go b/api/org_tangled/tempspindleallowListlist.go similarity index 94% rename from api/org_tangled/allowListlist.go rename to api/org_tangled/tempspindleallowListlist.go index 85675c6f4..3463aa95a 100644 --- a/api/org_tangled/allowListlist.go +++ b/api/org_tangled/tempspindleallowListlist.go @@ -16,7 +16,7 @@ const ( // TempSpindleAllowListList_Output is the output of a org.tangled.temp.spindle.allowList.list call. type TempSpindleAllowListList_Output struct { - // dids: Allow-list entries ordered lexically. + // dids: Allow-list entries. Dids []string `json:"dids" cborgen:"dids"` } diff --git a/api/org_tangled/allowListremove.go b/api/org_tangled/tempspindleallowListremove.go similarity index 95% rename from api/org_tangled/allowListremove.go rename to api/org_tangled/tempspindleallowListremove.go index 6bd9a0f52..8ffbc3eb8 100644 --- a/api/org_tangled/allowListremove.go +++ b/api/org_tangled/tempspindleallowListremove.go @@ -16,7 +16,7 @@ const ( // TempSpindleAllowListRemove_Input is the input argument to a org.tangled.temp.spindle.allowList.remove call. type TempSpindleAllowListRemove_Input struct { - // did: DID to remove from the allow-list. + // did: DID to remove from allow-list. Did string `json:"did" cborgen:"did"` } diff --git a/api/org_tangled/moderationban.go b/api/org_tangled/tempspindlemoderationban.go similarity index 100% rename from api/org_tangled/moderationban.go rename to api/org_tangled/tempspindlemoderationban.go diff --git a/api/org_tangled/moderationdefs.go b/api/org_tangled/tempspindlemoderationdefs.go similarity index 100% rename from api/org_tangled/moderationdefs.go rename to api/org_tangled/tempspindlemoderationdefs.go diff --git a/api/org_tangled/moderationgetBan.go b/api/org_tangled/tempspindlemoderationgetBan.go similarity index 100% rename from api/org_tangled/moderationgetBan.go rename to api/org_tangled/tempspindlemoderationgetBan.go diff --git a/api/org_tangled/moderationlistBans.go b/api/org_tangled/tempspindlemoderationlistBans.go similarity index 100% rename from api/org_tangled/moderationlistBans.go rename to api/org_tangled/tempspindlemoderationlistBans.go diff --git a/api/org_tangled/moderationunban.go b/api/org_tangled/tempspindlemoderationunban.go similarity index 100% rename from api/org_tangled/moderationunban.go rename to api/org_tangled/tempspindlemoderationunban.go diff --git a/api/org_tangled/quotadefs.go b/api/org_tangled/tempspindlequotadefs.go similarity index 100% rename from api/org_tangled/quotadefs.go rename to api/org_tangled/tempspindlequotadefs.go diff --git a/api/org_tangled/quotaget.go b/api/org_tangled/tempspindlequotaget.go similarity index 100% rename from api/org_tangled/quotaget.go rename to api/org_tangled/tempspindlequotaget.go diff --git a/api/org_tangled/quotalist.go b/api/org_tangled/tempspindlequotalist.go similarity index 100% rename from api/org_tangled/quotalist.go rename to api/org_tangled/tempspindlequotalist.go diff --git a/api/org_tangled/quotaset.go b/api/org_tangled/tempspindlequotaset.go similarity index 100% rename from api/org_tangled/quotaset.go rename to api/org_tangled/tempspindlequotaset.go diff --git a/api/org_tangled/quotaunset.go b/api/org_tangled/tempspindlequotaunset.go similarity index 100% rename from api/org_tangled/quotaunset.go rename to api/org_tangled/tempspindlequotaunset.go diff --git a/api/org_tangled/quotausage.go b/api/org_tangled/tempspindlequotausage.go similarity index 100% rename from api/org_tangled/quotausage.go rename to api/org_tangled/tempspindlequotausage.go diff --git a/api/org_tangled/tempwebhookcreateWebhook.go b/api/org_tangled/tempwebhookcreateWebhook.go new file mode 100644 index 000000000..d90129a5d --- /dev/null +++ b/api/org_tangled/tempwebhookcreateWebhook.go @@ -0,0 +1,45 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.webhook.createWebhook + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempWebhookCreateWebhookNSID = "org.tangled.temp.webhook.createWebhook" +) + +// TempWebhookCreateWebhook_Input is the input argument to a org.tangled.temp.webhook.createWebhook call. +type TempWebhookCreateWebhook_Input struct { + // active: Whether the webhook should be active immediately. Defaults to true. + Active *bool `json:"active,omitempty" cborgen:"active,omitempty"` + // events: Event types to subscribe to (e.g. 'push', 'repository:renamed'). + Events []string `json:"events" cborgen:"events"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` + // secret: Optional HMAC secret used to sign payloads. If omitted, payloads are not signed. + Secret *string `json:"secret,omitempty" cborgen:"secret,omitempty"` + // url: Endpoint URL that will receive webhook payloads. + Url string `json:"url" cborgen:"url"` +} + +// TempWebhookCreateWebhook_Output is the output of a org.tangled.temp.webhook.createWebhook call. +type TempWebhookCreateWebhook_Output struct { + // id: ID of the newly created webhook. + Id int64 `json:"id" cborgen:"id"` +} + +// TempWebhookCreateWebhook calls the XRPC method "org.tangled.temp.webhook.createWebhook". +func TempWebhookCreateWebhook(ctx context.Context, c util.LexClient, input *TempWebhookCreateWebhook_Input) (*TempWebhookCreateWebhook_Output, error) { + var out TempWebhookCreateWebhook_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.webhook.createWebhook", nil, input, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/tempwebhookdeleteWebhook.go b/api/org_tangled/tempwebhookdeleteWebhook.go new file mode 100644 index 000000000..4d6097eb2 --- /dev/null +++ b/api/org_tangled/tempwebhookdeleteWebhook.go @@ -0,0 +1,32 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.webhook.deleteWebhook + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempWebhookDeleteWebhookNSID = "org.tangled.temp.webhook.deleteWebhook" +) + +// TempWebhookDeleteWebhook_Input is the input argument to a org.tangled.temp.webhook.deleteWebhook call. +type TempWebhookDeleteWebhook_Input struct { + // id: Webhook ID to delete. + Id int64 `json:"id" cborgen:"id"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` +} + +// TempWebhookDeleteWebhook calls the XRPC method "org.tangled.temp.webhook.deleteWebhook". +func TempWebhookDeleteWebhook(ctx context.Context, c util.LexClient, input *TempWebhookDeleteWebhook_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.webhook.deleteWebhook", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/webhookgetDeliveriesForWebhooks.go b/api/org_tangled/tempwebhookgetDeliveriesForWebhooks.go similarity index 100% rename from api/org_tangled/webhookgetDeliveriesForWebhooks.go rename to api/org_tangled/tempwebhookgetDeliveriesForWebhooks.go diff --git a/api/org_tangled/tempwebhooklistWebhooks.go b/api/org_tangled/tempwebhooklistWebhooks.go new file mode 100644 index 000000000..309e47c4c --- /dev/null +++ b/api/org_tangled/tempwebhooklistWebhooks.go @@ -0,0 +1,49 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.webhook.listWebhooks + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempWebhookListWebhooksNSID = "org.tangled.temp.webhook.listWebhooks" +) + +// TempWebhookListWebhooks_Output is the output of a org.tangled.temp.webhook.listWebhooks call. +type TempWebhookListWebhooks_Output struct { + Webhooks []*TempWebhookListWebhooks_Webhook `json:"webhooks" cborgen:"webhooks"` +} + +// TempWebhookListWebhooks_Webhook is a "webhook" in the org.tangled.temp.webhook.listWebhooks schema. +type TempWebhookListWebhooks_Webhook struct { + // active: Whether the webhook is currently enabled. + Active bool `json:"active" cborgen:"active"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // events: Event types this webhook is subscribed to (e.g. 'push', 'repository:renamed'). + Events []string `json:"events" cborgen:"events"` + // id: Webhook identifier. + Id int64 `json:"id" cborgen:"id"` + UpdatedAt *string `json:"updatedAt,omitempty" cborgen:"updatedAt,omitempty"` + // url: Endpoint URL that receives webhook payloads. + Url string `json:"url" cborgen:"url"` +} + +// TempWebhookListWebhooks calls the XRPC method "org.tangled.temp.webhook.listWebhooks". +// +// repoDid: DID of the repository as minted by the knot. +func TempWebhookListWebhooks(ctx context.Context, c util.LexClient, repoDid string) (*TempWebhookListWebhooks_Output, error) { + var out TempWebhookListWebhooks_Output + + params := map[string]interface{}{} + params["repoDid"] = repoDid + if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.webhook.listWebhooks", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/webhookretryDelivery.go b/api/org_tangled/tempwebhookretryDelivery.go similarity index 100% rename from api/org_tangled/webhookretryDelivery.go rename to api/org_tangled/tempwebhookretryDelivery.go diff --git a/api/org_tangled/webhooktoggleWebhook.go b/api/org_tangled/tempwebhooktoggleWebhook.go similarity index 100% rename from api/org_tangled/webhooktoggleWebhook.go rename to api/org_tangled/tempwebhooktoggleWebhook.go diff --git a/api/org_tangled/tempwebhookupdateWebhook.go b/api/org_tangled/tempwebhookupdateWebhook.go new file mode 100644 index 000000000..06793ee54 --- /dev/null +++ b/api/org_tangled/tempwebhookupdateWebhook.go @@ -0,0 +1,36 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.temp.webhook.updateWebhook + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TempWebhookUpdateWebhookNSID = "org.tangled.temp.webhook.updateWebhook" +) + +// TempWebhookUpdateWebhook_Input is the input argument to a org.tangled.temp.webhook.updateWebhook call. +type TempWebhookUpdateWebhook_Input struct { + Active *bool `json:"active,omitempty" cborgen:"active,omitempty"` + Events []string `json:"events,omitempty" cborgen:"events,omitempty"` + // id: Webhook ID to update. + Id int64 `json:"id" cborgen:"id"` + // repoDid: DID of the repository as minted by the knot. + RepoDid string `json:"repoDid" cborgen:"repoDid"` + Secret *string `json:"secret,omitempty" cborgen:"secret,omitempty"` + Url *string `json:"url,omitempty" cborgen:"url,omitempty"` +} + +// TempWebhookUpdateWebhook calls the XRPC method "org.tangled.temp.webhook.updateWebhook". +func TempWebhookUpdateWebhook(ctx context.Context, c util.LexClient, input *TempWebhookUpdateWebhook_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.webhook.updateWebhook", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/trackdefs.go b/api/org_tangled/trackdefs.go new file mode 100644 index 000000000..41e0dc36a --- /dev/null +++ b/api/org_tangled/trackdefs.go @@ -0,0 +1,111 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.track.defs + +import ( + "encoding/json" + "fmt" + + "github.com/bluesky-social/indigo/lex/util" +) + +const () + +// TrackDefs_TicketViewDetailed is a "ticketViewDetailed" in the org.tangled.track.defs schema. +type TrackDefs_TicketViewDetailed struct { + // author: Last editor of the ticket record (`x-tngl-editor`). + Author *ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` + Body *TrackDefs_TicketViewDetailed_Body `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"` + State *string `json:"state" cborgen:"state"` + TangledLabels []*TrackDefs_TicketViewDetailed_TangledLabels_Elem `json:"tangledLabels,omitempty" cborgen:"tangledLabels,omitempty"` + // targetBranch: Present when the ticket is a pull request. + TargetBranch *string `json:"targetBranch,omitempty" cborgen:"targetBranch,omitempty"` + Title *TrackDefs_TicketViewDetailed_Title `json:"title" cborgen:"title"` + Uri string `json:"uri" cborgen:"uri"` +} + +type TrackDefs_TicketViewDetailed_Body struct { + MarkupMarkdown *MarkupMarkdown +} + +func (t *TrackDefs_TicketViewDetailed_Body) MarshalJSON() ([]byte, error) { + if t.MarkupMarkdown != nil { + t.MarkupMarkdown.LexiconTypeID = "org.tangled.markup.markdown" + return json.Marshal(t.MarkupMarkdown) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *TrackDefs_TicketViewDetailed_Body) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "org.tangled.markup.markdown": + t.MarkupMarkdown = new(MarkupMarkdown) + return json.Unmarshal(b, t.MarkupMarkdown) + + default: + return nil + } +} + +type TrackDefs_TicketViewDetailed_TangledLabels_Elem struct { + LabelDefs_LabelToken *LabelDefs_LabelToken +} + +func (t *TrackDefs_TicketViewDetailed_TangledLabels_Elem) MarshalJSON() ([]byte, error) { + if t.LabelDefs_LabelToken != nil { + t.LabelDefs_LabelToken.LexiconTypeID = "org.tangled.label.defs#labelToken" + return json.Marshal(t.LabelDefs_LabelToken) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *TrackDefs_TicketViewDetailed_TangledLabels_Elem) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "org.tangled.label.defs#labelToken": + t.LabelDefs_LabelToken = new(LabelDefs_LabelToken) + return json.Unmarshal(b, t.LabelDefs_LabelToken) + + default: + return nil + } +} + +type TrackDefs_TicketViewDetailed_Title struct { + MarkupMarkdown_Inline *MarkupMarkdown_Inline +} + +func (t *TrackDefs_TicketViewDetailed_Title) MarshalJSON() ([]byte, error) { + if t.MarkupMarkdown_Inline != nil { + t.MarkupMarkdown_Inline.LexiconTypeID = "org.tangled.markup.markdown#inline" + return json.Marshal(t.MarkupMarkdown_Inline) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *TrackDefs_TicketViewDetailed_Title) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "org.tangled.markup.markdown#inline": + t.MarkupMarkdown_Inline = new(MarkupMarkdown_Inline) + return json.Unmarshal(b, t.MarkupMarkdown_Inline) + + default: + return nil + } +} diff --git a/api/org_tangled/trackgetTicketView.go b/api/org_tangled/trackgetTicketView.go new file mode 100644 index 000000000..cef5719df --- /dev/null +++ b/api/org_tangled/trackgetTicketView.go @@ -0,0 +1,28 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.track.getTicketView + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TrackGetTicketViewNSID = "org.tangled.track.getTicketView" +) + +// TrackGetTicketView calls the XRPC method "org.tangled.track.getTicketView". +func TrackGetTicketView(ctx context.Context, c util.LexClient, uri string) (*TrackDefs_TicketViewDetailed, error) { + var out TrackDefs_TicketViewDetailed + + params := map[string]interface{}{} + params["uri"] = uri + if err := c.LexDo(ctx, util.Query, "", "org.tangled.track.getTicketView", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/trackticket.go b/api/org_tangled/trackticket.go new file mode 100644 index 000000000..deb325da6 --- /dev/null +++ b/api/org_tangled/trackticket.go @@ -0,0 +1,199 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.track.ticket + +import ( + "bytes" + "encoding/json" + "fmt" + "io" + + comatprototypes "github.com/bluesky-social/indigo/api/atproto" + "github.com/bluesky-social/indigo/lex/util" + cbg "github.com/whyrusleeping/cbor-gen" +) + +const ( + TrackTicketNSID = "org.tangled.track.ticket" +) + +func init() { + util.RegisterType("org.tangled.track.ticket", &TrackTicket{}) +} // +// RECORDTYPE: TrackTicket +type TrackTicket struct { + LexiconTypeID string `json:"$type,const=org.tangled.track.ticket" cborgen:"$type,const=org.tangled.track.ticket"` + Body *TrackTicket_Body `json:"body,omitempty" cborgen:"body,omitempty"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // labels: Self-label values for this record. + Labels *comatprototypes.LabelDefs_SelfLabels `json:"labels,omitempty" cborgen:"labels,omitempty"` + State *string `json:"state" cborgen:"state"` + TangledLabels []*TrackTicket_TangledLabels_Elem `json:"tangledLabels,omitempty" cborgen:"tangledLabels,omitempty"` + // targetBranch: Target branch name. Must not include the `refs/heads/` prefix. + TargetBranch *string `json:"targetBranch,omitempty" cborgen:"targetBranch,omitempty"` + Title *TrackTicket_Title `json:"title" cborgen:"title"` +} + +type TrackTicket_Body struct { + MarkupMarkdown *MarkupMarkdown +} + +func (t *TrackTicket_Body) MarshalJSON() ([]byte, error) { + if t.MarkupMarkdown != nil { + t.MarkupMarkdown.LexiconTypeID = "org.tangled.markup.markdown" + return json.Marshal(t.MarkupMarkdown) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *TrackTicket_Body) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "org.tangled.markup.markdown": + t.MarkupMarkdown = new(MarkupMarkdown) + return json.Unmarshal(b, t.MarkupMarkdown) + + default: + return nil + } +} + +func (t *TrackTicket_Body) MarshalCBOR(w io.Writer) error { + + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + if t.MarkupMarkdown != nil { + return t.MarkupMarkdown.MarshalCBOR(w) + } + return fmt.Errorf("cannot cbor marshal empty enum") +} +func (t *TrackTicket_Body) UnmarshalCBOR(r io.Reader) error { + typ, b, err := util.CborTypeExtractReader(r) + if err != nil { + return err + } + + switch typ { + case "org.tangled.markup.markdown": + t.MarkupMarkdown = new(MarkupMarkdown) + return t.MarkupMarkdown.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return nil + } +} + +type TrackTicket_TangledLabels_Elem struct { + LabelDefs_LabelToken *LabelDefs_LabelToken +} + +func (t *TrackTicket_TangledLabels_Elem) MarshalJSON() ([]byte, error) { + if t.LabelDefs_LabelToken != nil { + t.LabelDefs_LabelToken.LexiconTypeID = "org.tangled.label.defs#labelToken" + return json.Marshal(t.LabelDefs_LabelToken) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *TrackTicket_TangledLabels_Elem) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "org.tangled.label.defs#labelToken": + t.LabelDefs_LabelToken = new(LabelDefs_LabelToken) + return json.Unmarshal(b, t.LabelDefs_LabelToken) + + default: + return nil + } +} + +func (t *TrackTicket_TangledLabels_Elem) MarshalCBOR(w io.Writer) error { + + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + if t.LabelDefs_LabelToken != nil { + return t.LabelDefs_LabelToken.MarshalCBOR(w) + } + return fmt.Errorf("cannot cbor marshal empty enum") +} +func (t *TrackTicket_TangledLabels_Elem) UnmarshalCBOR(r io.Reader) error { + typ, b, err := util.CborTypeExtractReader(r) + if err != nil { + return err + } + + switch typ { + case "org.tangled.label.defs#labelToken": + t.LabelDefs_LabelToken = new(LabelDefs_LabelToken) + return t.LabelDefs_LabelToken.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return nil + } +} + +type TrackTicket_Title struct { + MarkupMarkdown_Inline *MarkupMarkdown_Inline +} + +func (t *TrackTicket_Title) MarshalJSON() ([]byte, error) { + if t.MarkupMarkdown_Inline != nil { + t.MarkupMarkdown_Inline.LexiconTypeID = "org.tangled.markup.markdown#inline" + return json.Marshal(t.MarkupMarkdown_Inline) + } + return nil, fmt.Errorf("cannot marshal empty enum") +} +func (t *TrackTicket_Title) UnmarshalJSON(b []byte) error { + typ, err := util.TypeExtract(b) + if err != nil { + return err + } + + switch typ { + case "org.tangled.markup.markdown#inline": + t.MarkupMarkdown_Inline = new(MarkupMarkdown_Inline) + return json.Unmarshal(b, t.MarkupMarkdown_Inline) + + default: + return nil + } +} + +func (t *TrackTicket_Title) MarshalCBOR(w io.Writer) error { + + if t == nil { + _, err := w.Write(cbg.CborNull) + return err + } + if t.MarkupMarkdown_Inline != nil { + return t.MarkupMarkdown_Inline.MarshalCBOR(w) + } + return fmt.Errorf("cannot cbor marshal empty enum") +} +func (t *TrackTicket_Title) UnmarshalCBOR(r io.Reader) error { + typ, b, err := util.CborTypeExtractReader(r) + if err != nil { + return err + } + + switch typ { + case "org.tangled.markup.markdown#inline": + t.MarkupMarkdown_Inline = new(MarkupMarkdown_Inline) + return t.MarkupMarkdown_Inline.UnmarshalCBOR(bytes.NewReader(b)) + + default: + return nil + } +} diff --git a/api/org_tangled/trackunspeccedmilestone.go b/api/org_tangled/trackunspeccedmilestone.go new file mode 100644 index 000000000..8964c4e75 --- /dev/null +++ b/api/org_tangled/trackunspeccedmilestone.go @@ -0,0 +1,21 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.track.unspecced.milestone + +import ( + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + TrackUnspeccedMilestoneNSID = "org.tangled.track.unspecced.milestone" +) + +func init() { + util.RegisterType("org.tangled.track.unspecced.milestone", &TrackUnspeccedMilestone{}) +} // +// RECORDTYPE: TrackUnspeccedMilestone +type TrackUnspeccedMilestone struct { + LexiconTypeID string `json:"$type,const=org.tangled.track.unspecced.milestone" cborgen:"$type,const=org.tangled.track.unspecced.milestone"` +} diff --git a/api/org_tangled/webhookcreateWebhook.go b/api/org_tangled/webhookcreateWebhook.go index d90129a5d..14dfc2c66 100644 --- a/api/org_tangled/webhookcreateWebhook.go +++ b/api/org_tangled/webhookcreateWebhook.go @@ -2,7 +2,7 @@ package org_tangled -// schema: org.tangled.temp.webhook.createWebhook +// schema: org.tangled.webhook.createWebhook import ( "context" @@ -11,33 +11,33 @@ import ( ) const ( - TempWebhookCreateWebhookNSID = "org.tangled.temp.webhook.createWebhook" + WebhookCreateWebhookNSID = "org.tangled.webhook.createWebhook" ) -// TempWebhookCreateWebhook_Input is the input argument to a org.tangled.temp.webhook.createWebhook call. -type TempWebhookCreateWebhook_Input struct { - // active: Whether the webhook should be active immediately. Defaults to true. +// WebhookCreateWebhook_Input is the input argument to a org.tangled.webhook.createWebhook call. +type WebhookCreateWebhook_Input struct { + // active: Whether the webhook should be active immediately. Active *bool `json:"active,omitempty" cborgen:"active,omitempty"` - // events: Event types to subscribe to (e.g. 'push', 'repository:renamed'). - Events []string `json:"events" cborgen:"events"` - // repoDid: DID of the repository as minted by the knot. - RepoDid string `json:"repoDid" cborgen:"repoDid"` + // events: Event types to subscribe to. + Events []*string `json:"events" cborgen:"events"` + // repo: DID of the repository as minted by the knot. + Repo string `json:"repo" cborgen:"repo"` // secret: Optional HMAC secret used to sign payloads. If omitted, payloads are not signed. Secret *string `json:"secret,omitempty" cborgen:"secret,omitempty"` // url: Endpoint URL that will receive webhook payloads. Url string `json:"url" cborgen:"url"` } -// TempWebhookCreateWebhook_Output is the output of a org.tangled.temp.webhook.createWebhook call. -type TempWebhookCreateWebhook_Output struct { +// WebhookCreateWebhook_Output is the output of a org.tangled.webhook.createWebhook call. +type WebhookCreateWebhook_Output struct { // id: ID of the newly created webhook. - Id int64 `json:"id" cborgen:"id"` + Id string `json:"id" cborgen:"id"` } -// TempWebhookCreateWebhook calls the XRPC method "org.tangled.temp.webhook.createWebhook". -func TempWebhookCreateWebhook(ctx context.Context, c util.LexClient, input *TempWebhookCreateWebhook_Input) (*TempWebhookCreateWebhook_Output, error) { - var out TempWebhookCreateWebhook_Output - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.webhook.createWebhook", nil, input, &out); err != nil { +// WebhookCreateWebhook calls the XRPC method "org.tangled.webhook.createWebhook". +func WebhookCreateWebhook(ctx context.Context, c util.LexClient, input *WebhookCreateWebhook_Input) (*WebhookCreateWebhook_Output, error) { + var out WebhookCreateWebhook_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.webhook.createWebhook", nil, input, &out); err != nil { return nil, err } diff --git a/api/org_tangled/webhookdefs.go b/api/org_tangled/webhookdefs.go new file mode 100644 index 000000000..1ebc4c11b --- /dev/null +++ b/api/org_tangled/webhookdefs.go @@ -0,0 +1,7 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.webhook.defs + +const () diff --git a/api/org_tangled/webhookdeleteWebhook.go b/api/org_tangled/webhookdeleteWebhook.go index 4d6097eb2..33118e14d 100644 --- a/api/org_tangled/webhookdeleteWebhook.go +++ b/api/org_tangled/webhookdeleteWebhook.go @@ -2,7 +2,7 @@ package org_tangled -// schema: org.tangled.temp.webhook.deleteWebhook +// schema: org.tangled.webhook.deleteWebhook import ( "context" @@ -11,20 +11,20 @@ import ( ) const ( - TempWebhookDeleteWebhookNSID = "org.tangled.temp.webhook.deleteWebhook" + WebhookDeleteWebhookNSID = "org.tangled.webhook.deleteWebhook" ) -// TempWebhookDeleteWebhook_Input is the input argument to a org.tangled.temp.webhook.deleteWebhook call. -type TempWebhookDeleteWebhook_Input struct { - // id: Webhook ID to delete. - Id int64 `json:"id" cborgen:"id"` - // repoDid: DID of the repository as minted by the knot. - RepoDid string `json:"repoDid" cborgen:"repoDid"` +// WebhookDeleteWebhook_Input is the input argument to a org.tangled.webhook.deleteWebhook call. +type WebhookDeleteWebhook_Input struct { + // repo: DID of the repository as minted by the knot. + Repo string `json:"repo" cborgen:"repo"` + // webhook: Webhook ID to delete. + Webhook string `json:"webhook" cborgen:"webhook"` } -// TempWebhookDeleteWebhook calls the XRPC method "org.tangled.temp.webhook.deleteWebhook". -func TempWebhookDeleteWebhook(ctx context.Context, c util.LexClient, input *TempWebhookDeleteWebhook_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.webhook.deleteWebhook", nil, input, nil); err != nil { +// WebhookDeleteWebhook calls the XRPC method "org.tangled.webhook.deleteWebhook". +func WebhookDeleteWebhook(ctx context.Context, c util.LexClient, input *WebhookDeleteWebhook_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.webhook.deleteWebhook", nil, input, nil); err != nil { return err } diff --git a/api/org_tangled/webhooklistWebhookDeliveries.go b/api/org_tangled/webhooklistWebhookDeliveries.go new file mode 100644 index 000000000..a9e385f94 --- /dev/null +++ b/api/org_tangled/webhooklistWebhookDeliveries.go @@ -0,0 +1,54 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.webhook.listWebhookDeliveries + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + WebhookListWebhookDeliveriesNSID = "org.tangled.webhook.listWebhookDeliveries" +) + +// WebhookListWebhookDeliveries_Delivery is a "delivery" in the org.tangled.webhook.listWebhookDeliveries schema. +type WebhookListWebhookDeliveries_Delivery struct { + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // event: Event type that triggered the delivery. + Event *string `json:"event" cborgen:"event"` + // id: Unique ID for tracking this delivery attempt. + Id string `json:"id" cborgen:"id"` + RequestBody util.LexBytes `json:"requestBody,omitempty" cborgen:"requestBody,omitempty"` + ResponseBody util.LexBytes `json:"responseBody,omitempty" cborgen:"responseBody,omitempty"` + ResponseCode *int64 `json:"responseCode,omitempty" cborgen:"responseCode,omitempty"` + Success bool `json:"success" cborgen:"success"` + Url string `json:"url" cborgen:"url"` +} + +// WebhookListWebhookDeliveries_Output is the output of a org.tangled.webhook.listWebhookDeliveries call. +type WebhookListWebhookDeliveries_Output struct { + Deliveries []*WebhookListWebhookDeliveries_Delivery `json:"deliveries" cborgen:"deliveries"` +} + +// WebhookListWebhookDeliveries calls the XRPC method "org.tangled.webhook.listWebhookDeliveries". +// +// repo: DID of the repository as minted by the knot. +// webhook: Webhook ID. +func WebhookListWebhookDeliveries(ctx context.Context, c util.LexClient, limit int64, repo string, webhook string) (*WebhookListWebhookDeliveries_Output, error) { + var out WebhookListWebhookDeliveries_Output + + params := map[string]interface{}{} + if limit != 0 { + params["limit"] = limit + } + params["repo"] = repo + params["webhook"] = webhook + if err := c.LexDo(ctx, util.Query, "", "org.tangled.webhook.listWebhookDeliveries", params, nil, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/org_tangled/webhooklistWebhooks.go b/api/org_tangled/webhooklistWebhooks.go index 309e47c4c..c0c4ecf0a 100644 --- a/api/org_tangled/webhooklistWebhooks.go +++ b/api/org_tangled/webhooklistWebhooks.go @@ -2,7 +2,7 @@ package org_tangled -// schema: org.tangled.temp.webhook.listWebhooks +// schema: org.tangled.webhook.listWebhooks import ( "context" @@ -11,37 +11,37 @@ import ( ) const ( - TempWebhookListWebhooksNSID = "org.tangled.temp.webhook.listWebhooks" + WebhookListWebhooksNSID = "org.tangled.webhook.listWebhooks" ) -// TempWebhookListWebhooks_Output is the output of a org.tangled.temp.webhook.listWebhooks call. -type TempWebhookListWebhooks_Output struct { - Webhooks []*TempWebhookListWebhooks_Webhook `json:"webhooks" cborgen:"webhooks"` +// WebhookListWebhooks_Output is the output of a org.tangled.webhook.listWebhooks call. +type WebhookListWebhooks_Output struct { + Webhooks []*WebhookListWebhooks_Webhook `json:"webhooks" cborgen:"webhooks"` } -// TempWebhookListWebhooks_Webhook is a "webhook" in the org.tangled.temp.webhook.listWebhooks schema. -type TempWebhookListWebhooks_Webhook struct { +// WebhookListWebhooks_Webhook is a "webhook" in the org.tangled.webhook.listWebhooks schema. +type WebhookListWebhooks_Webhook struct { // active: Whether the webhook is currently enabled. Active bool `json:"active" cborgen:"active"` CreatedAt string `json:"createdAt" cborgen:"createdAt"` - // events: Event types this webhook is subscribed to (e.g. 'push', 'repository:renamed'). - Events []string `json:"events" cborgen:"events"` + // events: Event types this webhook is subscribed to. + Events []*string `json:"events" cborgen:"events"` // id: Webhook identifier. - Id int64 `json:"id" cborgen:"id"` + Id string `json:"id" cborgen:"id"` UpdatedAt *string `json:"updatedAt,omitempty" cborgen:"updatedAt,omitempty"` // url: Endpoint URL that receives webhook payloads. Url string `json:"url" cborgen:"url"` } -// TempWebhookListWebhooks calls the XRPC method "org.tangled.temp.webhook.listWebhooks". +// WebhookListWebhooks calls the XRPC method "org.tangled.webhook.listWebhooks". // -// repoDid: DID of the repository as minted by the knot. -func TempWebhookListWebhooks(ctx context.Context, c util.LexClient, repoDid string) (*TempWebhookListWebhooks_Output, error) { - var out TempWebhookListWebhooks_Output +// repo: DID of the repository as minted by the knot. +func WebhookListWebhooks(ctx context.Context, c util.LexClient, repo string) (*WebhookListWebhooks_Output, error) { + var out WebhookListWebhooks_Output params := map[string]interface{}{} - params["repoDid"] = repoDid - if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.webhook.listWebhooks", params, nil, &out); err != nil { + params["repo"] = repo + if err := c.LexDo(ctx, util.Query, "", "org.tangled.webhook.listWebhooks", params, nil, &out); err != nil { return nil, err } diff --git a/api/org_tangled/webhookretryWebhookDelivery.go b/api/org_tangled/webhookretryWebhookDelivery.go new file mode 100644 index 000000000..8d849be97 --- /dev/null +++ b/api/org_tangled/webhookretryWebhookDelivery.go @@ -0,0 +1,34 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package org_tangled + +// schema: org.tangled.webhook.retryWebhookDelivery + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + WebhookRetryWebhookDeliveryNSID = "org.tangled.webhook.retryWebhookDelivery" +) + +// WebhookRetryWebhookDelivery_Input is the input argument to a org.tangled.webhook.retryWebhookDelivery call. +type WebhookRetryWebhookDelivery_Input struct { + // delivery: Delivery ID to retry. + Delivery string `json:"delivery" cborgen:"delivery"` + // repo: DID of the repository as minted by the knot. + Repo string `json:"repo" cborgen:"repo"` + // webhook: Webhook ID that owns the delivery. + Webhook string `json:"webhook" cborgen:"webhook"` +} + +// WebhookRetryWebhookDelivery calls the XRPC method "org.tangled.webhook.retryWebhookDelivery". +func WebhookRetryWebhookDelivery(ctx context.Context, c util.LexClient, input *WebhookRetryWebhookDelivery_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.webhook.retryWebhookDelivery", nil, input, nil); err != nil { + return err + } + + return nil +} diff --git a/api/org_tangled/webhookupdateWebhook.go b/api/org_tangled/webhookupdateWebhook.go index 06793ee54..2212a610b 100644 --- a/api/org_tangled/webhookupdateWebhook.go +++ b/api/org_tangled/webhookupdateWebhook.go @@ -2,7 +2,7 @@ package org_tangled -// schema: org.tangled.temp.webhook.updateWebhook +// schema: org.tangled.webhook.updateWebhook import ( "context" @@ -11,24 +11,24 @@ import ( ) const ( - TempWebhookUpdateWebhookNSID = "org.tangled.temp.webhook.updateWebhook" + WebhookUpdateWebhookNSID = "org.tangled.webhook.updateWebhook" ) -// TempWebhookUpdateWebhook_Input is the input argument to a org.tangled.temp.webhook.updateWebhook call. -type TempWebhookUpdateWebhook_Input struct { - Active *bool `json:"active,omitempty" cborgen:"active,omitempty"` - Events []string `json:"events,omitempty" cborgen:"events,omitempty"` - // id: Webhook ID to update. - Id int64 `json:"id" cborgen:"id"` - // repoDid: DID of the repository as minted by the knot. - RepoDid string `json:"repoDid" cborgen:"repoDid"` - Secret *string `json:"secret,omitempty" cborgen:"secret,omitempty"` - Url *string `json:"url,omitempty" cborgen:"url,omitempty"` +// WebhookUpdateWebhook_Input is the input argument to a org.tangled.webhook.updateWebhook call. +type WebhookUpdateWebhook_Input struct { + Active *bool `json:"active,omitempty" cborgen:"active,omitempty"` + Events []*string `json:"events,omitempty" cborgen:"events,omitempty"` + // repo: DID of the repository as minted by the knot. + Repo string `json:"repo" cborgen:"repo"` + Secret *string `json:"secret,omitempty" cborgen:"secret,omitempty"` + Url *string `json:"url,omitempty" cborgen:"url,omitempty"` + // webhook: Webhook ID to update. + Webhook string `json:"webhook" cborgen:"webhook"` } -// TempWebhookUpdateWebhook calls the XRPC method "org.tangled.temp.webhook.updateWebhook". -func TempWebhookUpdateWebhook(ctx context.Context, c util.LexClient, input *TempWebhookUpdateWebhook_Input) error { - if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.temp.webhook.updateWebhook", nil, input, nil); err != nil { +// WebhookUpdateWebhook calls the XRPC method "org.tangled.webhook.updateWebhook". +func WebhookUpdateWebhook(ctx context.Context, c util.LexClient, input *WebhookUpdateWebhook_Input) error { + if err := c.LexDo(ctx, util.Procedure, "application/json", "org.tangled.webhook.updateWebhook", nil, input, nil); err != nil { return err } diff --git a/api/tangled/cbor_gen.go b/api/tangled/cbor_gen.go index c4d14a8f7..9b5c04c49 100644 --- a/api/tangled/cbor_gen.go +++ b/api/tangled/cbor_gen.go @@ -3469,7 +3469,7 @@ func (t *EmbedCommit) MarshalCBOR(w io.Writer) error { return err } - // t.Commit (tangled.EmbedCommit_Commit) (struct) + // t.Commit (tangled.GitOid) (struct) if len("commit") > 1000000 { return xerrors.Errorf("Value in field \"commit\" was too long") } @@ -3550,7 +3550,7 @@ func (t *EmbedCommit) UnmarshalCBOR(r io.Reader) (err error) { t.LexiconTypeID = string(sval) } - // t.Commit (tangled.EmbedCommit_Commit) (struct) + // t.Commit (tangled.GitOid) (struct) case "commit": { @@ -3563,7 +3563,7 @@ func (t *EmbedCommit) UnmarshalCBOR(r io.Reader) (err error) { if err := cr.UnreadByte(); err != nil { return err } - t.Commit = new(EmbedCommit_Commit) + t.Commit = new(GitOid) if err := t.Commit.UnmarshalCBOR(cr); err != nil { return xerrors.Errorf("unmarshaling t.Commit pointer: %w", err) } @@ -4772,7 +4772,7 @@ func (t *GitOid) MarshalCBOR(w io.Writer) error { cw := cbg.NewCborWriter(w) - if _, err := cw.Write([]byte{162}); err != nil { + if _, err := cw.Write([]byte{161}); err != nil { return err } @@ -4798,25 +4798,6 @@ func (t *GitOid) MarshalCBOR(w io.Writer) error { if _, err := cw.WriteString(string(t.Oid)); 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.git.oid"))); err != nil { - return err - } - if _, err := cw.WriteString(string("sh.tangled.git.oid")); err != nil { - return err - } return nil } @@ -4845,7 +4826,7 @@ func (t *GitOid) UnmarshalCBOR(r io.Reader) (err error) { n := extra - nameBuf := make([]byte, 5) + nameBuf := make([]byte, 3) for i := uint64(0); i < n; i++ { nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) if err != nil { @@ -4872,17 +4853,6 @@ func (t *GitOid) UnmarshalCBOR(r io.Reader) (err error) { t.Oid = 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 diff --git a/api/tangled/embedcommit.go b/api/tangled/embedcommit.go index 9d35fdab4..9271e05e6 100644 --- a/api/tangled/embedcommit.go +++ b/api/tangled/embedcommit.go @@ -5,13 +5,7 @@ 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 ( @@ -23,63 +17,9 @@ func init() { } // 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 - } + LexiconTypeID string `json:"$type,const=sh.tangled.embed.commit" cborgen:"$type,const=sh.tangled.embed.commit"` + Commit *GitOid `json:"commit" cborgen:"commit"` + Repo string `json:"repo" cborgen:"repo"` } // EmbedCommit_View is a "view" in the sh.tangled.embed.commit schema. diff --git a/api/tangled/feeddefs.go b/api/tangled/feeddefs.go index 88fae6ea5..e766b5489 100644 --- a/api/tangled/feeddefs.go +++ b/api/tangled/feeddefs.go @@ -10,28 +10,31 @@ import ( comatprototypes "github.com/bluesky-social/indigo/api/atproto" "github.com/bluesky-social/indigo/lex/util" + orgtangledtypes "tangled.org/core/api/org_tangled" ) const () // FeedDefs_CommentView is a "commentView" in the sh.tangled.feed.defs schema. type FeedDefs_CommentView struct { - Body *FeedDefs_CommentView_Body `json:"body" cborgen:"body"` - Cid string `json:"cid" cborgen:"cid"` - CreatedAt string `json:"createdAt" cborgen:"createdAt"` - Embed *FeedDefs_CommentView_Embed `json:"embed,omitempty" cborgen:"embed,omitempty"` - ReplyTo *comatprototypes.RepoStrongRef `json:"replyTo,omitempty" cborgen:"replyTo,omitempty"` - Subject *comatprototypes.RepoStrongRef `json:"subject" cborgen:"subject"` - Uri string `json:"uri" cborgen:"uri"` + Body *FeedDefs_CommentView_Body `json:"body" cborgen:"body"` + Cid string `json:"cid" cborgen:"cid"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` + // editor: Who wrote this version (`x-tngl-editor`). A knot-hosted comment's uri names the repo, not the writer. + Editor *string `json:"editor,omitempty" cborgen:"editor,omitempty"` + Embed *FeedDefs_CommentView_Embed `json:"embed,omitempty" cborgen:"embed,omitempty"` + ReplyTo *comatprototypes.RepoStrongRef `json:"replyTo,omitempty" cborgen:"replyTo,omitempty"` + Subject *comatprototypes.RepoStrongRef `json:"subject" cborgen:"subject"` + Uri string `json:"uri" cborgen:"uri"` } type FeedDefs_CommentView_Body struct { - MarkupMarkdown *MarkupMarkdown + MarkupMarkdown *orgtangledtypes.MarkupMarkdown } func (t *FeedDefs_CommentView_Body) MarshalJSON() ([]byte, error) { if t.MarkupMarkdown != nil { - t.MarkupMarkdown.LexiconTypeID = "sh.tangled.markup.markdown" + t.MarkupMarkdown.LexiconTypeID = "org.tangled.markup.markdown" return json.Marshal(t.MarkupMarkdown) } return nil, fmt.Errorf("cannot marshal empty enum") @@ -43,8 +46,8 @@ func (t *FeedDefs_CommentView_Body) UnmarshalJSON(b []byte) error { } switch typ { - case "sh.tangled.markup.markdown": - t.MarkupMarkdown = new(MarkupMarkdown) + case "org.tangled.markup.markdown": + t.MarkupMarkdown = new(orgtangledtypes.MarkupMarkdown) return json.Unmarshal(b, t.MarkupMarkdown) default: diff --git a/api/tangled/feedlistComments.go b/api/tangled/feedlistComments.go index 001792606..025d1b898 100644 --- a/api/tangled/feedlistComments.go +++ b/api/tangled/feedlistComments.go @@ -20,7 +20,7 @@ const ( type FeedListComments_ListItem struct { Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` Uri string `json:"uri" cborgen:"uri"` - // value: Embedded sh.tangled.feed.comment record + // value: Embedded org.tangled.feed.comment record Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` } diff --git a/api/tangled/feedlistReactions.go b/api/tangled/feedlistReactions.go index 28723bccb..33198f38c 100644 --- a/api/tangled/feedlistReactions.go +++ b/api/tangled/feedlistReactions.go @@ -18,7 +18,7 @@ const ( type FeedListReactions_ListItem struct { Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` Uri string `json:"uri" cborgen:"uri"` - // value: Embedded sh.tangled.feed.reaction record + // value: Embedded org.tangled.feed.reaction record Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` } diff --git a/api/tangled/gitoid.go b/api/tangled/gitoid.go index 35bc62da6..c60764636 100644 --- a/api/tangled/gitoid.go +++ b/api/tangled/gitoid.go @@ -4,19 +4,11 @@ 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 +// GitOid is a "main" in the sh.tangled.git.oid schema. 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"` + Oid string `json:"oid" cborgen:"oid"` } diff --git a/api/tangled/temp2getBlame.go b/api/tangled/gittemp2getBlame.go similarity index 100% rename from api/tangled/temp2getBlame.go rename to api/tangled/gittemp2getBlame.go diff --git a/api/tangled/temp2getCommitStats.go b/api/tangled/gittemp2getCommitStats.go similarity index 100% rename from api/tangled/temp2getCommitStats.go rename to api/tangled/gittemp2getCommitStats.go diff --git a/api/tangled/temp2getDiff.go b/api/tangled/gittemp2getDiff.go similarity index 100% rename from api/tangled/temp2getDiff.go rename to api/tangled/gittemp2getDiff.go diff --git a/api/tangled/temp2getInterdiff.go b/api/tangled/gittemp2getInterdiff.go similarity index 100% rename from api/tangled/temp2getInterdiff.go rename to api/tangled/gittemp2getInterdiff.go diff --git a/api/tangled/temp2listCommits.go b/api/tangled/gittemp2listCommits.go similarity index 100% rename from api/tangled/temp2listCommits.go rename to api/tangled/gittemp2listCommits.go diff --git a/api/tangled/temp2mergeCheck.go b/api/tangled/gittemp2mergeCheck.go similarity index 100% rename from api/tangled/temp2mergeCheck.go rename to api/tangled/gittemp2mergeCheck.go diff --git a/api/tangled/tempanalyzeMerge.go b/api/tangled/gittempanalyzeMerge.go similarity index 100% rename from api/tangled/tempanalyzeMerge.go rename to api/tangled/gittempanalyzeMerge.go diff --git a/api/tangled/tempdefs.go b/api/tangled/gittempdefs.go similarity index 100% rename from api/tangled/tempdefs.go rename to api/tangled/gittempdefs.go diff --git a/api/tangled/tempformatPatch.go b/api/tangled/gittempformatPatch.go similarity index 100% rename from api/tangled/tempformatPatch.go rename to api/tangled/gittempformatPatch.go diff --git a/api/tangled/tempgetArchive.go b/api/tangled/gittempgetArchive.go similarity index 100% rename from api/tangled/tempgetArchive.go rename to api/tangled/gittempgetArchive.go diff --git a/api/tangled/tempgetBlob.go b/api/tangled/gittempgetBlob.go similarity index 100% rename from api/tangled/tempgetBlob.go rename to api/tangled/gittempgetBlob.go diff --git a/api/tangled/tempgetBranch.go b/api/tangled/gittempgetBranch.go similarity index 100% rename from api/tangled/tempgetBranch.go rename to api/tangled/gittempgetBranch.go diff --git a/api/tangled/tempgetCommit.go b/api/tangled/gittempgetCommit.go similarity index 100% rename from api/tangled/tempgetCommit.go rename to api/tangled/gittempgetCommit.go diff --git a/api/tangled/tempgetDiff.go b/api/tangled/gittempgetDiff.go similarity index 100% rename from api/tangled/tempgetDiff.go rename to api/tangled/gittempgetDiff.go diff --git a/api/tangled/tempgetEntry.go b/api/tangled/gittempgetEntry.go similarity index 100% rename from api/tangled/tempgetEntry.go rename to api/tangled/gittempgetEntry.go diff --git a/api/tangled/tempgetHead.go b/api/tangled/gittempgetHead.go similarity index 100% rename from api/tangled/tempgetHead.go rename to api/tangled/gittempgetHead.go diff --git a/api/tangled/tempgetMergeBase.go b/api/tangled/gittempgetMergeBase.go similarity index 100% rename from api/tangled/tempgetMergeBase.go rename to api/tangled/gittempgetMergeBase.go diff --git a/api/tangled/tempgetTag.go b/api/tangled/gittempgetTag.go similarity index 100% rename from api/tangled/tempgetTag.go rename to api/tangled/gittempgetTag.go diff --git a/api/tangled/tempgetTree.go b/api/tangled/gittempgetTree.go similarity index 100% rename from api/tangled/tempgetTree.go rename to api/tangled/gittempgetTree.go diff --git a/api/tangled/templistBranches.go b/api/tangled/gittemplistBranches.go similarity index 100% rename from api/tangled/templistBranches.go rename to api/tangled/gittemplistBranches.go diff --git a/api/tangled/templistCommits.go b/api/tangled/gittemplistCommits.go similarity index 100% rename from api/tangled/templistCommits.go rename to api/tangled/gittemplistCommits.go diff --git a/api/tangled/templistLanguages.go b/api/tangled/gittemplistLanguages.go similarity index 100% rename from api/tangled/templistLanguages.go rename to api/tangled/gittemplistLanguages.go diff --git a/api/tangled/templistTags.go b/api/tangled/gittemplistTags.go similarity index 100% rename from api/tangled/templistTags.go rename to api/tangled/gittemplistTags.go diff --git a/api/tangled/tangledknot.go b/api/tangled/knot.go similarity index 100% rename from api/tangled/tangledknot.go rename to api/tangled/knot.go diff --git a/api/tangled/knotmember.go b/api/tangled/knotmember.go index c14e78372..5f0c52793 100644 --- a/api/tangled/knotmember.go +++ b/api/tangled/knotmember.go @@ -15,7 +15,7 @@ const ( func init() { util.RegisterType("sh.tangled.knot.member", &KnotMember{}) } // -// DEPRECATED: knot member list is not published any more. +// DEPRECATED: replaced by org.tangled.knot.member. // // RECORDTYPE: KnotMember type KnotMember struct { diff --git a/api/tangled/labelcountDefinitions.go b/api/tangled/labelcountDefinitions.go index f3bdffc20..e31d6c247 100644 --- a/api/tangled/labelcountDefinitions.go +++ b/api/tangled/labelcountDefinitions.go @@ -24,7 +24,7 @@ type LabelCountDefinitions_Output struct { // LabelCountDefinitions calls the XRPC method "sh.tangled.label.countDefinitions". // -// subject: Scope identifier whose label definitions to list. +// subject: DID of the repo whose label definitions to count. func LabelCountDefinitions(ctx context.Context, c util.LexClient, subject string) (*LabelCountDefinitions_Output, error) { var out LabelCountDefinitions_Output diff --git a/api/tangled/labellistDefinitions.go b/api/tangled/labellistDefinitions.go index c0405f995..e87f9ba8b 100644 --- a/api/tangled/labellistDefinitions.go +++ b/api/tangled/labellistDefinitions.go @@ -18,7 +18,7 @@ const ( type LabelListDefinitions_ListItem struct { Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` Uri string `json:"uri" cborgen:"uri"` - // value: Embedded sh.tangled.label.definition record + // value: Embedded org.tangled.label.definition record Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` } @@ -35,7 +35,7 @@ type LabelListDefinitions_Output struct { // 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. +// subject: DID of the repo whose label definitions to list. 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 diff --git a/api/tangled/tangledowner.go b/api/tangled/owner.go similarity index 100% rename from api/tangled/tangledowner.go rename to api/tangled/owner.go diff --git a/api/tangled/tangledpipeline.go b/api/tangled/pipeline.go similarity index 100% rename from api/tangled/tangledpipeline.go rename to api/tangled/pipeline.go diff --git a/api/tangled/tangledpublicKey.go b/api/tangled/publicKey.go similarity index 100% rename from api/tangled/tangledpublicKey.go rename to api/tangled/publicKey.go diff --git a/api/tangled/queryenrichResponse.go b/api/tangled/queryenrichResponse.go index fc9756224..36a58e347 100644 --- a/api/tangled/queryenrichResponse.go +++ b/api/tangled/queryenrichResponse.go @@ -7,6 +7,7 @@ package tangled import ( "context" + comatprototypes "github.com/bluesky-social/indigo/api/atproto" "github.com/bluesky-social/indigo/lex/util" ) @@ -26,6 +27,13 @@ type QueryEnrichResponse_Input struct { Xrpc string `json:"xrpc" cborgen:"xrpc"` } +// QueryEnrichResponse_Labels is a "labels" in the sh.tangled.query.enrichResponse schema. +// +// Moderation labels the configured labeler applied. Only !hide and !warn are served, takedowns leave subjects out instead. Use collection:. for labels on the record, collection:.repo for labels on its author's account. Absent when there are none. +type QueryEnrichResponse_Labels struct { + Labels []*comatprototypes.LabelDefs_Label `json:"labels" cborgen:"labels"` +} + // QueryEnrichResponse_LinkDescriptor is a "linkDescriptor" in the sh.tangled.query.enrichResponse schema. // // One sidecar payload, computed from the records at a link source whose reference equals the found reference. diff --git a/api/tangled/tangledrepo.go b/api/tangled/repo.go similarity index 100% rename from api/tangled/tangledrepo.go rename to api/tangled/repo.go diff --git a/api/tangled/repocreate.go b/api/tangled/repocreate.go index 583d3dbc4..e78d06537 100644 --- a/api/tangled/repocreate.go +++ b/api/tangled/repocreate.go @@ -20,7 +20,7 @@ type RepoCreate_Input struct { DefaultBranch *string `json:"defaultBranch,omitempty" cborgen:"defaultBranch,omitempty"` // name: Name of the repository Name string `json:"name" cborgen:"name"` - // repoDid: Optional user-provided did:web to use as the repo identity instead of minting a did:plc. + // repoDid: Optional user-provided DID to use as the repo identity instead of minting one. RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` // rkey: Rkey of the repository record Rkey string `json:"rkey" cborgen:"rkey"` diff --git a/api/tangled/repogetRepo.go b/api/tangled/repogetRepo.go index 3486a40c7..5643755af 100644 --- a/api/tangled/repogetRepo.go +++ b/api/tangled/repogetRepo.go @@ -17,7 +17,9 @@ const ( // RepoGetRepo_Output is the output of a sh.tangled.repo.getRepo call. type RepoGetRepo_Output struct { Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` - Uri string `json:"uri" cborgen:"uri"` + // knot: Host of the knot named by the #tangled_knot service in the repo's DID document. Absent when it names none. + Knot *string `json:"knot,omitempty" cborgen:"knot,omitempty"` + Uri string `json:"uri" cborgen:"uri"` // value: Embedded sh.tangled.repo record. Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` } diff --git a/api/tangled/repogetRepoByName.go b/api/tangled/repogetRepoByName.go index 6a103f1f7..cd7a21fd7 100644 --- a/api/tangled/repogetRepoByName.go +++ b/api/tangled/repogetRepoByName.go @@ -17,7 +17,9 @@ const ( // RepoGetRepoByName_Output is the output of a sh.tangled.repo.getRepoByName call. type RepoGetRepoByName_Output struct { Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` - Uri string `json:"uri" cborgen:"uri"` + // knot: Host of the knot named by the #tangled_knot service in the repo's DID document. Absent when it names none. + Knot *string `json:"knot,omitempty" cborgen:"knot,omitempty"` + Uri string `json:"uri" cborgen:"uri"` // value: Embedded sh.tangled.repo record. Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` } diff --git a/api/tangled/repogetRepoByRepoDid.go b/api/tangled/repogetRepoByRepoDid.go index dd5b6adb6..a86459e90 100644 --- a/api/tangled/repogetRepoByRepoDid.go +++ b/api/tangled/repogetRepoByRepoDid.go @@ -17,7 +17,9 @@ const ( // RepoGetRepoByRepoDid_Output is the output of a sh.tangled.repo.getRepoByRepoDid call. type RepoGetRepoByRepoDid_Output struct { Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` - Uri string `json:"uri" cborgen:"uri"` + // knot: Host of the knot named by the #tangled_knot service in the repo's DID document. Absent when it names none. + Knot *string `json:"knot,omitempty" cborgen:"knot,omitempty"` + Uri string `json:"uri" cborgen:"uri"` // value: Embedded sh.tangled.repo record. Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` } diff --git a/api/tangled/issuecomment.go b/api/tangled/repoissuecomment.go similarity index 100% rename from api/tangled/issuecomment.go rename to api/tangled/repoissuecomment.go diff --git a/api/tangled/issuecountStates.go b/api/tangled/repoissuecountStates.go similarity index 100% rename from api/tangled/issuecountStates.go rename to api/tangled/repoissuecountStates.go diff --git a/api/tangled/issuecountStatesBy.go b/api/tangled/repoissuecountStatesBy.go similarity index 100% rename from api/tangled/issuecountStatesBy.go rename to api/tangled/repoissuecountStatesBy.go diff --git a/api/tangled/issuelistStates.go b/api/tangled/repoissuelistStates.go similarity index 100% rename from api/tangled/issuelistStates.go rename to api/tangled/repoissuelistStates.go diff --git a/api/tangled/issuelistStatesBy.go b/api/tangled/repoissuelistStatesBy.go similarity index 100% rename from api/tangled/issuelistStatesBy.go rename to api/tangled/repoissuelistStatesBy.go diff --git a/api/tangled/issuestate.go b/api/tangled/repoissuestate.go similarity index 100% rename from api/tangled/issuestate.go rename to api/tangled/repoissuestate.go diff --git a/api/tangled/stateclosed.go b/api/tangled/repoissuestateclosed.go similarity index 100% rename from api/tangled/stateclosed.go rename to api/tangled/repoissuestateclosed.go diff --git a/api/tangled/stateopen.go b/api/tangled/repoissuestateopen.go similarity index 100% rename from api/tangled/stateopen.go rename to api/tangled/repoissuestateopen.go diff --git a/api/tangled/pullcomment.go b/api/tangled/repopullcomment.go similarity index 100% rename from api/tangled/pullcomment.go rename to api/tangled/repopullcomment.go diff --git a/api/tangled/pullcountStatuses.go b/api/tangled/repopullcountStatuses.go similarity index 100% rename from api/tangled/pullcountStatuses.go rename to api/tangled/repopullcountStatuses.go diff --git a/api/tangled/pullcountStatusesBy.go b/api/tangled/repopullcountStatusesBy.go similarity index 100% rename from api/tangled/pullcountStatusesBy.go rename to api/tangled/repopullcountStatusesBy.go diff --git a/api/tangled/pulllistStatuses.go b/api/tangled/repopulllistStatuses.go similarity index 100% rename from api/tangled/pulllistStatuses.go rename to api/tangled/repopulllistStatuses.go diff --git a/api/tangled/pulllistStatusesBy.go b/api/tangled/repopulllistStatusesBy.go similarity index 100% rename from api/tangled/pulllistStatusesBy.go rename to api/tangled/repopulllistStatusesBy.go diff --git a/api/tangled/repopullmerge.go b/api/tangled/repopullmerge.go new file mode 100644 index 000000000..58bc05f64 --- /dev/null +++ b/api/tangled/repopullmerge.go @@ -0,0 +1,41 @@ +// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. + +package tangled + +// schema: sh.tangled.repo.pull.merge + +import ( + "context" + + "github.com/bluesky-social/indigo/lex/util" +) + +const ( + RepoPullMergeNSID = "sh.tangled.repo.pull.merge" +) + +// RepoPullMerge_Input is the input argument to a sh.tangled.repo.pull.merge call. +type RepoPullMerge_Input struct { + // repo: DID of the repository the pull lives on + Repo string `json:"repo" cborgen:"repo"` + // rkey: Record key of the pull to merge + Rkey string `json:"rkey" cborgen:"rkey"` +} + +// RepoPullMerge_Output is the output of a sh.tangled.repo.pull.merge call. +type RepoPullMerge_Output struct { + // merged: At-uris of the pulls this call marked merged, bottom of the stack first + Merged []string `json:"merged" cborgen:"merged"` + // tip: Commit id the target branch ended on; the standing tip when the merge needed no move + Tip string `json:"tip" cborgen:"tip"` +} + +// RepoPullMerge calls the XRPC method "sh.tangled.repo.pull.merge". +func RepoPullMerge(ctx context.Context, c util.LexClient, input *RepoPullMerge_Input) (*RepoPullMerge_Output, error) { + var out RepoPullMerge_Output + if err := c.LexDo(ctx, util.Procedure, "application/json", "sh.tangled.repo.pull.merge", nil, input, &out); err != nil { + return nil, err + } + + return &out, nil +} diff --git a/api/tangled/pullstatus.go b/api/tangled/repopullstatus.go similarity index 100% rename from api/tangled/pullstatus.go rename to api/tangled/repopullstatus.go diff --git a/api/tangled/statusclosed.go b/api/tangled/repopullstatusclosed.go similarity index 100% rename from api/tangled/statusclosed.go rename to api/tangled/repopullstatusclosed.go diff --git a/api/tangled/statusmerged.go b/api/tangled/repopullstatusmerged.go similarity index 100% rename from api/tangled/statusmerged.go rename to api/tangled/repopullstatusmerged.go diff --git a/api/tangled/statusopen.go b/api/tangled/repopullstatusopen.go similarity index 100% rename from api/tangled/statusopen.go rename to api/tangled/repopullstatusopen.go diff --git a/api/tangled/reporeserveKey.go b/api/tangled/reporeserveKey.go index ed19a211d..efe88296b 100644 --- a/api/tangled/reporeserveKey.go +++ b/api/tangled/reporeserveKey.go @@ -16,13 +16,13 @@ const ( // RepoReserveKey_Input is the input argument to a sh.tangled.repo.reserveKey call. type RepoReserveKey_Input struct { - // repoDid: The did:web identity the repository will use. + // repoDid: The DID this repository will use. RepoDid string `json:"repoDid" cborgen:"repoDid"` } // RepoReserveKey_Output is the output of a sh.tangled.repo.reserveKey call. type RepoReserveKey_Output struct { - // key: Multibase-encoded public key to publish in the did:web document. + // key: Multibase-encoded public key to publish in the DID document. Key string `json:"key" cborgen:"key"` RepoDid string `json:"repoDid" cborgen:"repoDid"` } diff --git a/api/tangled/reposetContributionPolicy.go b/api/tangled/reposetContributionPolicy.go index 3139bf963..e27077b72 100644 --- a/api/tangled/reposetContributionPolicy.go +++ b/api/tangled/reposetContributionPolicy.go @@ -16,7 +16,7 @@ const ( // RepoSetContributionPolicy_Input is the input argument to a sh.tangled.repo.setContributionPolicy call. type RepoSetContributionPolicy_Input struct { - // contributionPolicy: anyone: any account with a DID can contribute. Members: accounts on this knot's member roll. Collaborators: the owner and the repository's collaborators. + // contributionPolicy: anyone: any account with a DID can contribute. Members: accounts on this knot's member grant list. Collaborators: the owner and the repository's collaborators. ContributionPolicy string `json:"contributionPolicy" cborgen:"contributionPolicy"` // repo: DID of the repository this policy change is for Repo string `json:"repo" cborgen:"repo"` diff --git a/api/tangled/tangledspindle.go b/api/tangled/spindle.go similarity index 100% rename from api/tangled/tangledspindle.go rename to api/tangled/spindle.go diff --git a/api/tangled/tangledstring.go b/api/tangled/string.go similarity index 100% rename from api/tangled/tangledstring.go rename to api/tangled/string.go diff --git a/cmd/cborgen/cborgen.go b/cmd/cborgen/cborgen.go index 3903edb22..021d611bd 100644 --- a/cmd/cborgen/cborgen.go +++ b/cmd/cborgen/cborgen.go @@ -87,15 +87,50 @@ func main() { if err := genCfg.WriteMapEncodersToFile( "api/org_tangled/cbor_gen.go", "org_tangled", + org_tangled.ActorProfile{}, org_tangled.CiSubscribePipelineLogs_Control{}, org_tangled.CiSubscribePipelineLogs_Data{}, org_tangled.CiTriggerManual{}, org_tangled.CiTriggerManual_Pair{}, + org_tangled.EmbedCommit{}, org_tangled.EventPullRequest{}, org_tangled.EventPush{}, + org_tangled.FeedComment{}, + org_tangled.FeedReaction{}, + org_tangled.FeedStar{}, + org_tangled.FeedStar_Record{}, + org_tangled.FeedStar_Repo{}, org_tangled.FeedSubscription{}, org_tangled.FeedSubscription_Record{}, org_tangled.FeedSubscription_Repo{}, + org_tangled.GitOid{}, + org_tangled.GitRefs{}, + org_tangled.GraphAttestation{}, + org_tangled.GraphCollaborator{}, + org_tangled.GraphFollow{}, + org_tangled.GraphVouch{}, + org_tangled.KeySshKey{}, + org_tangled.KeyUnspeccedGpgKey{}, + org_tangled.KnotBlock{}, + org_tangled.KnotMember{}, + org_tangled.LabelDefinition{}, + org_tangled.LabelDefs_LabelToken{}, + org_tangled.MarkupEmbedImage{}, + org_tangled.MarkupEmbedVideo{}, + org_tangled.MarkupMarkdown{}, + org_tangled.MarkupMarkdown_Inline{}, + org_tangled.RepoDeclaration{}, + org_tangled.RepoDefs_SourceExternal{}, + org_tangled.RepoDefs_SourceTangled{}, + org_tangled.RepoManifest{}, + org_tangled.RepoManifest_Declaration{}, + org_tangled.RepoReviewUnspeccedRound{}, + org_tangled.ReviewPatch{}, + org_tangled.ShTombstone{}, + org_tangled.SnippetString{}, + org_tangled.SnippetString_TextFile{}, + org_tangled.TrackTicket{}, + org_tangled.TrackUnspeccedMilestone{}, ); err != nil { panic(err) } diff --git a/web/src/lib/api/knotmirror.ts b/web/src/lib/api/knotmirror.ts index 265b2d50e..93fad4003 100644 --- a/web/src/lib/api/knotmirror.ts +++ b/web/src/lib/api/knotmirror.ts @@ -2,7 +2,7 @@ import type { BobbinContext, XrpcRequestInit } from "$lib/api/client"; import { buildUrl, jsonGet, rawGet } from "$lib/api/_request"; import { nsidOf } from "$lib/api/syntax"; import type * as RepoBlob from "$lib/api/lexicons/types/sh/tangled/repo/blob"; -import type * as GitDefs from "$lib/api/lexicons/types/sh/tangled/git/temp/defs"; +import type * as GitDefs from "$lib/api/lexicons/types/org/tangled/git/defs"; import type * as MirrorGetRef from "$lib/api/lexicons/types/org/tangled/temp/git/getRef"; import type * as MirrorEntry from "$lib/api/lexicons/types/org/tangled/temp/git/getEntry"; import type * as MirrorListBranches from "$lib/api/lexicons/types/org/tangled/temp/git/listBranches"; diff --git a/web/src/lib/api/lexicons/index.ts b/web/src/lib/api/lexicons/index.ts index ee501994e..966f47e1e 100644 --- a/web/src/lib/api/lexicons/index.ts +++ b/web/src/lib/api/lexicons/index.ts @@ -1,6 +1,7 @@ export * as ComBadExamplePocketDefs from "./types/com/bad-example/pocket/defs.js"; export * as ComBadExamplePocketGetPreferences from "./types/com/bad-example/pocket/getPreferences.js"; export * as ComBadExamplePocketPutPreferences from "./types/com/bad-example/pocket/putPreferences.js"; +export * as OrgTangledActorDefs from "./types/org/tangled/actor/defs.js"; export * as OrgTangledActorProfile from "./types/org/tangled/actor/profile.js"; export * as OrgTangledCiGetPipeline from "./types/org/tangled/ci/getPipeline.js"; export * as OrgTangledCiGetWorkflowDefinition from "./types/org/tangled/ci/getWorkflowDefinition.js"; @@ -17,6 +18,22 @@ export * as OrgTangledFeedComment from "./types/org/tangled/feed/comment.js"; export * as OrgTangledFeedReaction from "./types/org/tangled/feed/reaction.js"; export * as OrgTangledFeedStar from "./types/org/tangled/feed/star.js"; export * as OrgTangledFeedSubscription from "./types/org/tangled/feed/subscription.js"; +export * as OrgTangledGitDefs from "./types/org/tangled/git/defs.js"; +export * as OrgTangledGitDeleteBranch from "./types/org/tangled/git/deleteBranch.js"; +export * as OrgTangledGitGetArchive from "./types/org/tangled/git/getArchive.js"; +export * as OrgTangledGitGetBlame from "./types/org/tangled/git/getBlame.js"; +export * as OrgTangledGitGetBlob from "./types/org/tangled/git/getBlob.js"; +export * as OrgTangledGitGetBranch from "./types/org/tangled/git/getBranch.js"; +export * as OrgTangledGitGetDiff from "./types/org/tangled/git/getDiff.js"; +export * as OrgTangledGitGetEntry from "./types/org/tangled/git/getEntry.js"; +export * as OrgTangledGitGetTag from "./types/org/tangled/git/getTag.js"; +export * as OrgTangledGitGetTree from "./types/org/tangled/git/getTree.js"; +export * as OrgTangledGitListBranches from "./types/org/tangled/git/listBranches.js"; +export * as OrgTangledGitListCommits from "./types/org/tangled/git/listCommits.js"; +export * as OrgTangledGitListLanguages from "./types/org/tangled/git/listLanguages.js"; +export * as OrgTangledGitListRefs from "./types/org/tangled/git/listRefs.js"; +export * as OrgTangledGitListTags from "./types/org/tangled/git/listTags.js"; +export * as OrgTangledGitMergeCheck from "./types/org/tangled/git/mergeCheck.js"; export * as OrgTangledGitOid from "./types/org/tangled/git/oid.js"; export * as OrgTangledGitPushEvent from "./types/org/tangled/git/pushEvent.js"; export * as OrgTangledGitReceivePack from "./types/org/tangled/git/receivePack.js"; @@ -26,7 +43,9 @@ export * as OrgTangledGraphCollaborator from "./types/org/tangled/graph/collabor export * as OrgTangledGraphFollow from "./types/org/tangled/graph/follow.js"; export * as OrgTangledGraphVouch from "./types/org/tangled/graph/vouch.js"; export * as OrgTangledKeySshKey from "./types/org/tangled/key/sshKey.js"; +export * as OrgTangledKnotBlock from "./types/org/tangled/knot/block.js"; export * as OrgTangledKnotDescribeKnot from "./types/org/tangled/knot/describeKnot.js"; +export * as OrgTangledKnotMember from "./types/org/tangled/knot/member.js"; export * as OrgTangledLabelDefinition from "./types/org/tangled/label/definition.js"; export * as OrgTangledLabelDefs from "./types/org/tangled/label/defs.js"; export * as OrgTangledMarkupEmbedImage from "./types/org/tangled/markup/embed/image.js"; @@ -37,8 +56,12 @@ export * as OrgTangledRepoCreateRepo from "./types/org/tangled/repo/createRepo.j export * as OrgTangledRepoDeclaration from "./types/org/tangled/repo/declaration.js"; export * as OrgTangledRepoDefs from "./types/org/tangled/repo/defs.js"; export * as OrgTangledRepoDeleteRepo from "./types/org/tangled/repo/deleteRepo.js"; +export * as OrgTangledRepoForkSync from "./types/org/tangled/repo/forkSync.js"; +export * as OrgTangledRepoListRecordVersions from "./types/org/tangled/repo/listRecordVersions.js"; export * as OrgTangledRepoManifest from "./types/org/tangled/repo/manifest.js"; export * as OrgTangledRepoMintToken from "./types/org/tangled/repo/mintToken.js"; +export * as OrgTangledRepoReserveKey from "./types/org/tangled/repo/reserveKey.js"; +export * as OrgTangledReviewMergePatch from "./types/org/tangled/review/mergePatch.js"; export * as OrgTangledReviewPatch from "./types/org/tangled/review/patch.js"; export * as OrgTangledSecretAddSecret from "./types/org/tangled/secret/addSecret.js"; export * as OrgTangledSecretListSecrets from "./types/org/tangled/secret/listSecrets.js"; diff --git a/web/src/lib/api/lexicons/types/org/tangled/actor/defs.ts b/web/src/lib/api/lexicons/types/org/tangled/actor/defs.ts new file mode 100644 index 000000000..2197a6bc5 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/actor/defs.ts @@ -0,0 +1,36 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; + +const _profileViewBasicSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.actor.defs#profileViewBasic"), + ), + avatar: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.genericUriString()), + did: /*#__PURE__*/ v.didString(), + handle: /*#__PURE__*/ v.handleString(), + get viewer() { + return /*#__PURE__*/ v.optional(viewerStateSchema); + }, +}); +const _viewerStateSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.actor.defs#viewerState"), + ), + followedBy: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.resourceUriString()), + following: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.resourceUriString()), +}); + +type profileViewBasic$schematype = typeof _profileViewBasicSchema; +type viewerState$schematype = typeof _viewerStateSchema; + +export interface profileViewBasicSchema extends profileViewBasic$schematype {} +export interface viewerStateSchema extends viewerState$schematype {} + +export const profileViewBasicSchema = + _profileViewBasicSchema as profileViewBasicSchema; +export const viewerStateSchema = _viewerStateSchema as viewerStateSchema; + +export interface ProfileViewBasic extends v.InferInput< + typeof profileViewBasicSchema +> {} +export interface ViewerState extends v.InferInput {} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/defs.ts b/web/src/lib/api/lexicons/types/org/tangled/git/defs.ts new file mode 100644 index 000000000..229c09d98 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/defs.ts @@ -0,0 +1,197 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; + +const _byteChangesSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.defs#byteChanges"), + ), + /** + * @minimum 0 + */ + lhs: /*#__PURE__*/ v.integer(), + /** + * @minimum 0 + */ + rhs: /*#__PURE__*/ v.integer(), +}); +const _commitSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.defs#commit"), + ), + get author() { + return signatureSchema; + }, + get committer() { + return signatureSchema; + }, + /** + * Commit Object ID + */ + hash: /*#__PURE__*/ v.string(), + message: /*#__PURE__*/ v.string(), + /** + * Tree Object ID + */ + tree: /*#__PURE__*/ v.string(), +}); +const _diffHunkSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.defs#diffHunk"), + ), + get lines() { + return /*#__PURE__*/ v.array(linePairSchema); + }, + /** + * 0-based line numbers holding novel content on the left side + */ + novelLhs: /*#__PURE__*/ v.array(/*#__PURE__*/ v.integer()), + /** + * 0-based line numbers holding novel content on the right side + */ + novelRhs: /*#__PURE__*/ v.array(/*#__PURE__*/ v.integer()), +}); +const _diffSrcSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.defs#diffSrc"), + ), + /** + * Inlined content. Used on interdiff's LHS. + */ + content: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + isBinary: /*#__PURE__*/ v.boolean(), + isSubmodule: /*#__PURE__*/ v.boolean(), + /** + * Blob oid, or the commit oid for a submodule + */ + oid: /*#__PURE__*/ v.string(), + path: /*#__PURE__*/ v.string(), + /** + * @minimum 0 + */ + size: /*#__PURE__*/ v.integer(), +}); +const _diffStatSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.defs#diffStat"), + ), + /** + * @minimum 0 + */ + deletions: /*#__PURE__*/ v.integer(), + /** + * @minimum 0 + */ + filesChanged: /*#__PURE__*/ v.integer(), + /** + * @minimum 0 + */ + insertions: /*#__PURE__*/ v.integer(), +}); +const _fileDiffSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.defs#fileDiff"), + ), + /** + * Byte count per side, present only when the two sides differ + */ + get hasByteChanges() { + return /*#__PURE__*/ v.optional(byteChangesSchema); + }, + hasSyntacticChanges: /*#__PURE__*/ v.boolean(), + get hunks() { + return /*#__PURE__*/ v.array(diffHunkSchema); + }, + get lhsSrc() { + return diffSrcSchema; + }, + get rhsSrc() { + return diffSrcSchema; + }, +}); +const _linePairSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.defs#linePair"), + ), + /** + * @minimum 0 + */ + lhs: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.integer()), + /** + * @minimum 0 + */ + rhs: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.integer()), +}); +const _signatureSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.defs#signature"), + ), + /** + * Person email + */ + email: /*#__PURE__*/ v.string(), + /** + * Person name + */ + name: /*#__PURE__*/ v.string(), + /** + * Timestamp of the signature + */ + when: /*#__PURE__*/ v.datetimeString(), +}); +const _submoduleSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.defs#submodule"), + ), + /** + * Branch to track in the submodule + */ + branch: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + /** + * Submodule name + */ + name: /*#__PURE__*/ v.string(), + /** + * Submodule repository URL + */ + url: /*#__PURE__*/ v.string(), +}); + +type byteChanges$schematype = typeof _byteChangesSchema; +type commit$schematype = typeof _commitSchema; +type diffHunk$schematype = typeof _diffHunkSchema; +type diffSrc$schematype = typeof _diffSrcSchema; +type diffStat$schematype = typeof _diffStatSchema; +type fileDiff$schematype = typeof _fileDiffSchema; +type linePair$schematype = typeof _linePairSchema; +type signature$schematype = typeof _signatureSchema; +type submodule$schematype = typeof _submoduleSchema; + +export interface byteChangesSchema extends byteChanges$schematype {} +export interface commitSchema extends commit$schematype {} +export interface diffHunkSchema extends diffHunk$schematype {} +export interface diffSrcSchema extends diffSrc$schematype {} +export interface diffStatSchema extends diffStat$schematype {} +export interface fileDiffSchema extends fileDiff$schematype {} +export interface linePairSchema extends linePair$schematype {} +export interface signatureSchema extends signature$schematype {} +export interface submoduleSchema extends submodule$schematype {} + +export const byteChangesSchema = _byteChangesSchema as byteChangesSchema; +export const commitSchema = _commitSchema as commitSchema; +export const diffHunkSchema = _diffHunkSchema as diffHunkSchema; +export const diffSrcSchema = _diffSrcSchema as diffSrcSchema; +export const diffStatSchema = _diffStatSchema as diffStatSchema; +export const fileDiffSchema = _fileDiffSchema as fileDiffSchema; +export const linePairSchema = _linePairSchema as linePairSchema; +export const signatureSchema = _signatureSchema as signatureSchema; +export const submoduleSchema = _submoduleSchema as submoduleSchema; + +export interface ByteChanges extends v.InferInput {} +export interface Commit extends v.InferInput {} +export interface DiffHunk extends v.InferInput {} +export interface DiffSrc extends v.InferInput {} +export interface DiffStat extends v.InferInput {} +export interface FileDiff extends v.InferInput {} +export interface LinePair extends v.InferInput {} +export interface Signature extends v.InferInput {} +export interface Submodule extends v.InferInput {} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/deleteBranch.ts b/web/src/lib/api/lexicons/types/org/tangled/git/deleteBranch.ts new file mode 100644 index 000000000..03728282b --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/deleteBranch.ts @@ -0,0 +1,33 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; + +const _mainSchema = /*#__PURE__*/ v.procedure("org.tangled.git.deleteBranch", { + params: null, + input: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + branch: /*#__PURE__*/ v.string(), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + }, + output: null, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params {} +export interface $input extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCProcedures { + "org.tangled.git.deleteBranch": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/getArchive.ts b/web/src/lib/api/lexicons/types/org/tangled/git/getArchive.ts new file mode 100644 index 000000000..bef60d5ea --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/getArchive.ts @@ -0,0 +1,46 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; + +const _mainSchema = /*#__PURE__*/ v.query("org.tangled.git.getArchive", { + params: /*#__PURE__*/ v.object({ + /** + * Archive format + * @default "tar.gz" + */ + format: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literalEnum(["tar.gz", "zip"]), + "tar.gz", + ), + /** + * Prefix for files in the archive + */ + prefix: /*#__PURE__*/ v.string(), + /** + * Git reference (branch, tag, or commit SHA) + */ + ref: /*#__PURE__*/ v.string(), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + output: { + type: "blob", + }, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export type $output = v.InferXRPCBodyInput; + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "org.tangled.git.getArchive": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/getBlame.ts b/web/src/lib/api/lexicons/types/org/tangled/git/getBlame.ts new file mode 100644 index 000000000..756c3afd9 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/getBlame.ts @@ -0,0 +1,119 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; + +const _authorSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.getBlame#author"), + ), + email: /*#__PURE__*/ v.string(), + name: /*#__PURE__*/ v.string(), +}); +const _commitSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.getBlame#commit"), + ), + get author() { + return authorSchema; + }, + /** + * When the change was authored + */ + authoredAt: /*#__PURE__*/ v.datetimeString(), + /** + * Commit Object ID + */ + sha: /*#__PURE__*/ v.string(), + /** + * First line of the commit message + */ + subject: /*#__PURE__*/ v.string(), +}); +const _mainSchema = /*#__PURE__*/ v.query("org.tangled.git.getBlame", { + params: /*#__PURE__*/ v.object({ + /** + * Path of the file to blame + */ + path: /*#__PURE__*/ v.string(), + /** + * Git revision (branch, tag, or commit Object ID) + */ + ref: /*#__PURE__*/ v.string(), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + /** + * The resolved commit Object ID + */ + commit: /*#__PURE__*/ v.string(), + /** + * Unique commits referenced by blame runs + */ + get commits() { + return /*#__PURE__*/ v.array(commitSchema); + }, + /** + * Complete, gap-free one-based line ranges sorted by start + */ + get runs() { + return /*#__PURE__*/ v.array(runSchema); + }, + }), + }, +}); +const _runSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.getBlame#run"), + ), + /** + * The commit Object ID of the entry in commits this run is attributed to + */ + commit: /*#__PURE__*/ v.string(), + /** + * Number of lines in the run + * @minimum 1 + */ + count: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [ + /*#__PURE__*/ v.integerRange(1), + ]), + /** + * First line of the run, one-based + * @minimum 1 + */ + start: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [ + /*#__PURE__*/ v.integerRange(1), + ]), +}); + +type author$schematype = typeof _authorSchema; +type commit$schematype = typeof _commitSchema; +type main$schematype = typeof _mainSchema; +type run$schematype = typeof _runSchema; + +export interface authorSchema extends author$schematype {} +export interface commitSchema extends commit$schematype {} +export interface mainSchema extends main$schematype {} +export interface runSchema extends run$schematype {} + +export const authorSchema = _authorSchema as authorSchema; +export const commitSchema = _commitSchema as commitSchema; +export const mainSchema = _mainSchema as mainSchema; +export const runSchema = _runSchema as runSchema; + +export interface Author extends v.InferInput {} +export interface Commit extends v.InferInput {} +export interface Run extends v.InferInput {} + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "org.tangled.git.getBlame": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/getBlob.ts b/web/src/lib/api/lexicons/types/org/tangled/git/getBlob.ts new file mode 100644 index 000000000..2a2845c1c --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/getBlob.ts @@ -0,0 +1,39 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; + +const _mainSchema = /*#__PURE__*/ v.query("org.tangled.git.getBlob", { + params: /*#__PURE__*/ v.object({ + /** + * Path within the repository tree + */ + path: /*#__PURE__*/ v.string(), + /** + * Git reference (branch, tag, or commit SHA) + * @default "HEAD" + */ + ref: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string(), "HEAD"), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + output: { + type: "blob", + }, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export type $output = v.InferXRPCBodyInput; + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "org.tangled.git.getBlob": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/getBranch.ts b/web/src/lib/api/lexicons/types/org/tangled/git/getBranch.ts new file mode 100644 index 000000000..51b850b77 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/getBranch.ts @@ -0,0 +1,56 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as OrgTangledGitDefs from "./defs.js"; + +const _mainSchema = /*#__PURE__*/ v.query("org.tangled.git.getBranch", { + params: /*#__PURE__*/ v.object({ + /** + * Branch name to get information for + */ + name: /*#__PURE__*/ v.string(), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + get author() { + return OrgTangledGitDefs.signatureSchema; + }, + /** + * Latest commit hash on this branch + */ + hash: /*#__PURE__*/ v.string(), + /** + * Latest commit message + */ + message: /*#__PURE__*/ v.string(), + /** + * Branch name + */ + name: /*#__PURE__*/ v.string(), + /** + * Number of commits reachable from this branch + */ + totalCommits: /*#__PURE__*/ v.integer(), + }), + }, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "org.tangled.git.getBranch": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/getDiff.ts b/web/src/lib/api/lexicons/types/org/tangled/git/getDiff.ts new file mode 100644 index 000000000..da9ff8a01 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/getDiff.ts @@ -0,0 +1,51 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as OrgTangledGitDefs from "./defs.js"; + +const _mainSchema = /*#__PURE__*/ v.query("org.tangled.git.getDiff", { + params: /*#__PURE__*/ v.object({ + /** + * Base revision (branch, tag, or commit Object ID) + */ + base: /*#__PURE__*/ v.string(), + /** + * Head revision (branch, tag, or commit Object ID) + */ + head: /*#__PURE__*/ v.string(), + /** + * Only include diffs touching these paths, comma-separated + */ + paths: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + get diffs() { + return /*#__PURE__*/ v.array(OrgTangledGitDefs.fileDiffSchema); + }, + get stats() { + return /*#__PURE__*/ v.optional(OrgTangledGitDefs.diffStatSchema); + }, + }), + }, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "org.tangled.git.getDiff": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/getEntry.ts b/web/src/lib/api/lexicons/types/org/tangled/git/getEntry.ts new file mode 100644 index 000000000..843cd27f4 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/getEntry.ts @@ -0,0 +1,67 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as OrgTangledGitDefs from "./defs.js"; + +const _mainSchema = /*#__PURE__*/ v.query("org.tangled.git.getEntry", { + params: /*#__PURE__*/ v.object({ + /** + * path of the entity + */ + path: /*#__PURE__*/ v.string(), + /** + * Git revision (branch, tag, or commit Object ID) + * @default "HEAD" + */ + ref: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string(), "HEAD"), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + get lastCommit() { + return /*#__PURE__*/ v.optional(OrgTangledGitDefs.commitSchema); + }, + mode: /*#__PURE__*/ v.literalEnum([ + "0040000", + "0100644", + "0100755", + "0120000", + "0160000", + ]), + /** + * The file name + */ + name: /*#__PURE__*/ v.string(), + oid: /*#__PURE__*/ v.string(), + /** + * Blob size + */ + size: /*#__PURE__*/ v.integer(), + /** + * Submodule information if path is a submodule + */ + get submodule() { + return /*#__PURE__*/ v.optional(OrgTangledGitDefs.submoduleSchema); + }, + }), + }, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "org.tangled.git.getEntry": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/getTag.ts b/web/src/lib/api/lexicons/types/org/tangled/git/getTag.ts new file mode 100644 index 000000000..7d1562b66 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/getTag.ts @@ -0,0 +1,59 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as OrgTangledGitDefs from "./defs.js"; +import * as OrgTangledGitListTags from "./listTags.js"; + +const _mainSchema = /*#__PURE__*/ v.query("org.tangled.git.getTag", { + params: /*#__PURE__*/ v.object({ + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + /** + * Name of tag, such as v1.3.0 + */ + tag: /*#__PURE__*/ v.string(), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + /** + * Present only for annotated tags + */ + get annotation() { + return /*#__PURE__*/ v.optional(OrgTangledGitListTags.annotationSchema); + }, + get author() { + return OrgTangledGitDefs.signatureSchema; + }, + /** + * Latest commit message + */ + message: /*#__PURE__*/ v.string(), + /** + * Tag name + */ + name: /*#__PURE__*/ v.string(), + /** + * Latest commit oid on this tag + */ + oid: /*#__PURE__*/ v.string(), + }), + }, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "org.tangled.git.getTag": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/getTree.ts b/web/src/lib/api/lexicons/types/org/tangled/git/getTree.ts new file mode 100644 index 000000000..78e31fd78 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/getTree.ts @@ -0,0 +1,80 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as OrgTangledGitDefs from "./defs.js"; + +const _mainSchema = /*#__PURE__*/ v.query("org.tangled.git.getTree", { + params: /*#__PURE__*/ v.object({ + /** + * Path within the repository tree + * @default "" + */ + path: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string(), ""), + /** + * Git revision (branch, tag, or commit Object ID) + * @default "HEAD" + */ + ref: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string(), "HEAD"), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + get entries() { + return /*#__PURE__*/ v.array(treeEntrySchema); + }, + get lastCommit() { + return /*#__PURE__*/ v.optional(OrgTangledGitDefs.commitSchema); + }, + }), + }, +}); +const _treeEntrySchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.getTree#treeEntry"), + ), + get lastCommit() { + return /*#__PURE__*/ v.optional(OrgTangledGitDefs.commitSchema); + }, + /** + * File mode + */ + mode: /*#__PURE__*/ v.literalEnum([ + "0040000", + "0100644", + "0100755", + "0120000", + "0160000", + ]), + /** + * Relative file or directory name + */ + name: /*#__PURE__*/ v.string(), + /** + * File size in bytes + */ + size: /*#__PURE__*/ v.integer(), +}); + +type main$schematype = typeof _mainSchema; +type treeEntry$schematype = typeof _treeEntrySchema; + +export interface mainSchema extends main$schematype {} +export interface treeEntrySchema extends treeEntry$schematype {} + +export const mainSchema = _mainSchema as mainSchema; +export const treeEntrySchema = _treeEntrySchema as treeEntrySchema; + +export interface TreeEntry extends v.InferInput {} + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "org.tangled.git.getTree": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/listBranches.ts b/web/src/lib/api/lexicons/types/org/tangled/git/listBranches.ts new file mode 100644 index 000000000..3c3ac0e04 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/listBranches.ts @@ -0,0 +1,89 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as OrgTangledGitDefs from "./defs.js"; + +const _branchInfoSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.listBranches#branchInfo"), + ), + get author() { + return OrgTangledGitDefs.signatureSchema; + }, + get committer() { + return OrgTangledGitDefs.signatureSchema; + }, + /** + * Latest commit message + */ + message: /*#__PURE__*/ v.string(), + /** + * Branch name + */ + name: /*#__PURE__*/ v.string(), + /** + * Latest commit oid on this branch + */ + oid: /*#__PURE__*/ v.string(), +}); +const _mainSchema = /*#__PURE__*/ v.query("org.tangled.git.listBranches", { + params: /*#__PURE__*/ v.object({ + /** + * Pagination cursor + */ + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + /** + * Maximum number of branches to return + * @minimum 1 + * @maximum 100 + * @default 50 + */ + limit: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [ + /*#__PURE__*/ v.integerRange(1, 100), + ]), + 50, + ), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + get branches() { + return /*#__PURE__*/ v.array(branchInfoSchema); + }, + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + /** + * Name of the default branch + */ + defaultBranch: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + /** + * Total number of branches in the repository + */ + total: /*#__PURE__*/ v.integer(), + }), + }, +}); + +type branchInfo$schematype = typeof _branchInfoSchema; +type main$schematype = typeof _mainSchema; + +export interface branchInfoSchema extends branchInfo$schematype {} +export interface mainSchema extends main$schematype {} + +export const branchInfoSchema = _branchInfoSchema as branchInfoSchema; +export const mainSchema = _mainSchema as mainSchema; + +export interface BranchInfo extends v.InferInput {} + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "org.tangled.git.listBranches": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/listCommits.ts b/web/src/lib/api/lexicons/types/org/tangled/git/listCommits.ts new file mode 100644 index 000000000..2ec07b6e6 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/listCommits.ts @@ -0,0 +1,65 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as OrgTangledGitDefs from "./defs.js"; + +const _mainSchema = /*#__PURE__*/ v.query("org.tangled.git.listCommits", { + params: /*#__PURE__*/ v.object({ + /** + * Commit Object ID of the last commit in the previous page + */ + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + /** + * Maximum number of commits to return in this page + * @minimum 1 + * @maximum 100 + * @default 50 + */ + limit: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [ + /*#__PURE__*/ v.integerRange(1, 100), + ]), + 50, + ), + /** + * Only list commits touching this path + * @default "" + */ + path: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string(), ""), + /** + * Git revision (branch, tag, commit Object ID, or full ref name) + */ + ref: /*#__PURE__*/ v.string(), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + get commits() { + return /*#__PURE__*/ v.array(OrgTangledGitDefs.commitSchema); + }, + /** + * Cursor for the next page, absent when the last page is reached + */ + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + }), + }, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "org.tangled.git.listCommits": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/listLanguages.ts b/web/src/lib/api/lexicons/types/org/tangled/git/listLanguages.ts new file mode 100644 index 000000000..eab969e6c --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/listLanguages.ts @@ -0,0 +1,96 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; + +const _languageSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.listLanguages#language"), + ), + /** + * Render color for this language + */ + color: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + /** + * File extensions recognized as this language + */ + extensions: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.array(/*#__PURE__*/ v.string()), + ), + /** + * Files counted for this language + * @minimum 0 + */ + fileCount: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.integer()), + /** + * Language name + */ + name: /*#__PURE__*/ v.string(), + /** + * Share of total size, 0-100 + * @minimum 0 + * @maximum 100 + */ + percentage: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [ + /*#__PURE__*/ v.integerRange(0, 100), + ]), + /** + * Bytes counted for this language + * @minimum 0 + */ + size: /*#__PURE__*/ v.integer(), +}); +const _mainSchema = /*#__PURE__*/ v.query("org.tangled.git.listLanguages", { + params: /*#__PURE__*/ v.object({ + /** + * Git revision (branch, tag, or commit Object ID) + * @default "HEAD" + */ + ref: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string(), "HEAD"), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + get languages() { + return /*#__PURE__*/ v.array(languageSchema); + }, + /** + * The ref the breakdown was computed at + */ + ref: /*#__PURE__*/ v.string(), + /** + * Total counted files + * @minimum 0 + */ + totalFiles: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.integer()), + /** + * Total bytes across counted files + * @minimum 0 + */ + totalSize: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.integer()), + }), + }, +}); + +type language$schematype = typeof _languageSchema; +type main$schematype = typeof _mainSchema; + +export interface languageSchema extends language$schematype {} +export interface mainSchema extends main$schematype {} + +export const languageSchema = _languageSchema as languageSchema; +export const mainSchema = _mainSchema as mainSchema; + +export interface Language extends v.InferInput {} + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "org.tangled.git.listLanguages": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/listRefs.ts b/web/src/lib/api/lexicons/types/org/tangled/git/listRefs.ts new file mode 100644 index 000000000..1842c2054 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/listRefs.ts @@ -0,0 +1,120 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; + +const _defaultBranchSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.listRefs#defaultBranch"), + ), + /** + * Commit SHA at the tip of the default branch, for reconciling against a last-known state. Width depends on the repo's git object-format. + * @minLength 40 + * @maxLength 128 + */ + head: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [ + /*#__PURE__*/ v.stringLength(40, 128), + ]), + ), + /** + * Default branch ref name that HEAD points at, eg. refs/heads/main. + * @maxLength 2560 + * @maxGraphemes 256 + */ + ref: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [ + /*#__PURE__*/ v.stringLength(0, 2560), + /*#__PURE__*/ v.stringGraphemes(0, 256), + ]), +}); +const _mainSchema = /*#__PURE__*/ v.query("org.tangled.git.listRefs", { + params: /*#__PURE__*/ v.object({ + /** + * Pagination cursor + */ + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + /** + * Maximum number of refs to return in this page + * @minimum 1 + * @maximum 1000 + * @default 100 + */ + limit: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [ + /*#__PURE__*/ v.integerRange(1, 1000), + ]), + 100, + ), + /** + * DID of the git repo as minted by the knot + */ + repo: /*#__PURE__*/ v.didString(), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + /** + * Cursor for the next page, absent when the last page is reached + */ + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + get defaultBranch() { + return /*#__PURE__*/ v.optional(defaultBranchSchema); + }, + /** + * @maxLength 1000 + */ + get refs() { + return /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.array(refSchema), [ + /*#__PURE__*/ v.arrayLength(0, 1000), + ]); + }, + }), + }, +}); +const _refSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.listRefs#ref"), + ), + /** + * Full ref name, eg. refs/heads/main or refs/tags/v1.0 + * @maxLength 2560 + * @maxGraphemes 256 + */ + ref: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [ + /*#__PURE__*/ v.stringLength(0, 2560), + /*#__PURE__*/ v.stringGraphemes(0, 256), + ]), + /** + * Object SHA the ref points at. Width depends on the repo's git object-format. + * @minLength 40 + * @maxLength 128 + */ + sha: /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [ + /*#__PURE__*/ v.stringLength(40, 128), + ]), +}); + +type defaultBranch$schematype = typeof _defaultBranchSchema; +type main$schematype = typeof _mainSchema; +type ref$schematype = typeof _refSchema; + +export interface defaultBranchSchema extends defaultBranch$schematype {} +export interface mainSchema extends main$schematype {} +export interface refSchema extends ref$schematype {} + +export const defaultBranchSchema = _defaultBranchSchema as defaultBranchSchema; +export const mainSchema = _mainSchema as mainSchema; +export const refSchema = _refSchema as refSchema; + +export interface DefaultBranch extends v.InferInput< + typeof defaultBranchSchema +> {} +export interface Ref extends v.InferInput {} + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "org.tangled.git.listRefs": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/listTags.ts b/web/src/lib/api/lexicons/types/org/tangled/git/listTags.ts new file mode 100644 index 000000000..0648554cf --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/listTags.ts @@ -0,0 +1,104 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; +import * as OrgTangledGitDefs from "./defs.js"; + +const _annotationSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.listTags#annotation"), + ), + /** + * Tag message + */ + message: /*#__PURE__*/ v.string(), + get tagger() { + return /*#__PURE__*/ v.optional(OrgTangledGitDefs.signatureSchema); + }, +}); +const _mainSchema = /*#__PURE__*/ v.query("org.tangled.git.listTags", { + params: /*#__PURE__*/ v.object({ + /** + * Pagination cursor + */ + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + /** + * Maximum number of tags to return + * @minimum 1 + * @maximum 100 + * @default 50 + */ + limit: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [ + /*#__PURE__*/ v.integerRange(1, 100), + ]), + 50, + ), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + get tags() { + return /*#__PURE__*/ v.array(tagInfoSchema); + }, + /** + * Total number of tags in the repository + */ + total: /*#__PURE__*/ v.integer(), + }), + }, +}); +const _tagInfoSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.listTags#tagInfo"), + ), + /** + * Present only for annotated tags + */ + get annotation() { + return /*#__PURE__*/ v.optional(annotationSchema); + }, + get author() { + return OrgTangledGitDefs.signatureSchema; + }, + /** + * Latest commit message + */ + message: /*#__PURE__*/ v.string(), + /** + * Tag name + */ + name: /*#__PURE__*/ v.string(), + /** + * Latest commit oid on this tag + */ + oid: /*#__PURE__*/ v.string(), +}); + +type annotation$schematype = typeof _annotationSchema; +type main$schematype = typeof _mainSchema; +type tagInfo$schematype = typeof _tagInfoSchema; + +export interface annotationSchema extends annotation$schematype {} +export interface mainSchema extends main$schematype {} +export interface tagInfoSchema extends tagInfo$schematype {} + +export const annotationSchema = _annotationSchema as annotationSchema; +export const mainSchema = _mainSchema as mainSchema; +export const tagInfoSchema = _tagInfoSchema as tagInfoSchema; + +export interface Annotation extends v.InferInput {} +export interface TagInfo extends v.InferInput {} + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "org.tangled.git.listTags": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/git/mergeCheck.ts b/web/src/lib/api/lexicons/types/org/tangled/git/mergeCheck.ts new file mode 100644 index 000000000..2c5034284 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/git/mergeCheck.ts @@ -0,0 +1,74 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; + +const _conflictSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.git.mergeCheck#conflict"), + ), + /** + * Path of the conflicted file + */ + filename: /*#__PURE__*/ v.string(), + /** + * Why the file conflicts + */ + reason: /*#__PURE__*/ v.string(), +}); +const _mainSchema = /*#__PURE__*/ v.procedure("org.tangled.git.mergeCheck", { + params: null, + input: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + /** + * Target branch. Defaults to the ticket's targetBranch, falling back to the repo's default branch. + */ + branch: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + /** + * Record key of the org.tangled.review.patch record to check + */ + patch: /*#__PURE__*/ v.cidString(), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + }, + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + get conflicts() { + return /*#__PURE__*/ v.array(conflictSchema); + }, + /** + * Whether the merge has unresolved conflicts + */ + isConflicted: /*#__PURE__*/ v.boolean(), + /** + * Additional detail, e.g. unrelated histories + */ + message: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + }), + }, +}); + +type conflict$schematype = typeof _conflictSchema; +type main$schematype = typeof _mainSchema; + +export interface conflictSchema extends conflict$schematype {} +export interface mainSchema extends main$schematype {} + +export const conflictSchema = _conflictSchema as conflictSchema; +export const mainSchema = _mainSchema as mainSchema; + +export interface Conflict extends v.InferInput {} + +export interface $params {} +export interface $input extends v.InferXRPCBodyInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCProcedures { + "org.tangled.git.mergeCheck": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/knot/block.ts b/web/src/lib/api/lexicons/types/org/tangled/knot/block.ts new file mode 100644 index 000000000..f8ac0f9fb --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/knot/block.ts @@ -0,0 +1,25 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; + +const _mainSchema = /*#__PURE__*/ v.record( + /*#__PURE__*/ v.string(), + /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.literal("org.tangled.knot.block"), + createdAt: /*#__PURE__*/ v.datetimeString(), + }), +); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface Main extends v.InferInput {} + +declare module "@atcute/lexicons/ambient" { + interface Records { + "org.tangled.knot.block": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/knot/member.ts b/web/src/lib/api/lexicons/types/org/tangled/knot/member.ts new file mode 100644 index 000000000..7997c55c1 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/knot/member.ts @@ -0,0 +1,25 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; + +const _mainSchema = /*#__PURE__*/ v.record( + /*#__PURE__*/ v.string(), + /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.literal("org.tangled.knot.member"), + createdAt: /*#__PURE__*/ v.datetimeString(), + }), +); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface Main extends v.InferInput {} + +declare module "@atcute/lexicons/ambient" { + interface Records { + "org.tangled.knot.member": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/repo/defs.ts b/web/src/lib/api/lexicons/types/org/tangled/repo/defs.ts index c4019b8f5..649ecba42 100644 --- a/web/src/lib/api/lexicons/types/org/tangled/repo/defs.ts +++ b/web/src/lib/api/lexicons/types/org/tangled/repo/defs.ts @@ -1,6 +1,27 @@ import type {} from "@atcute/lexicons"; import * as v from "@atcute/lexicons/validations"; +import * as OrgTangledActorDefs from "../actor/defs.js"; +const _repoViewBasicSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.repo.defs#repoViewBasic"), + ), + createdAt: /*#__PURE__*/ v.datetimeString(), + description: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + did: /*#__PURE__*/ v.didString(), + forkCount: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.integer()), + isStarred: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.boolean()), + openIssueCount: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.integer()), + openPullCount: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.integer()), + get owner() { + return OrgTangledActorDefs.profileViewBasicSchema; + }, + slug: /*#__PURE__*/ v.string(), + starCount: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.integer()), + get viewer() { + return /*#__PURE__*/ v.optional(viewerStateSchema); + }, +}); const _sourceExternalSchema = /*#__PURE__*/ v.object({ $type: /*#__PURE__*/ v.optional( /*#__PURE__*/ v.literal("org.tangled.repo.defs#sourceExternal"), @@ -19,20 +40,37 @@ const _sourceTangledSchema = /*#__PURE__*/ v.object({ */ did: /*#__PURE__*/ v.didString(), }); +const _viewerStateSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.repo.defs#viewerState"), + ), + fork: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.resourceUriString()), + star: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.resourceUriString()), +}); +type repoViewBasic$schematype = typeof _repoViewBasicSchema; type sourceExternal$schematype = typeof _sourceExternalSchema; type sourceTangled$schematype = typeof _sourceTangledSchema; +type viewerState$schematype = typeof _viewerStateSchema; +export interface repoViewBasicSchema extends repoViewBasic$schematype {} export interface sourceExternalSchema extends sourceExternal$schematype {} export interface sourceTangledSchema extends sourceTangled$schematype {} +export interface viewerStateSchema extends viewerState$schematype {} +export const repoViewBasicSchema = _repoViewBasicSchema as repoViewBasicSchema; export const sourceExternalSchema = _sourceExternalSchema as sourceExternalSchema; export const sourceTangledSchema = _sourceTangledSchema as sourceTangledSchema; +export const viewerStateSchema = _viewerStateSchema as viewerStateSchema; +export interface RepoViewBasic extends v.InferInput< + typeof repoViewBasicSchema +> {} export interface SourceExternal extends v.InferInput< typeof sourceExternalSchema > {} export interface SourceTangled extends v.InferInput< typeof sourceTangledSchema > {} +export interface ViewerState extends v.InferInput {} diff --git a/web/src/lib/api/lexicons/types/org/tangled/repo/deleteRepo.ts b/web/src/lib/api/lexicons/types/org/tangled/repo/deleteRepo.ts index 4ab4be825..5ae4455df 100644 --- a/web/src/lib/api/lexicons/types/org/tangled/repo/deleteRepo.ts +++ b/web/src/lib/api/lexicons/types/org/tangled/repo/deleteRepo.ts @@ -7,6 +7,10 @@ const _mainSchema = /*#__PURE__*/ v.procedure("org.tangled.repo.deleteRepo", { input: { type: "lex", schema: /*#__PURE__*/ v.object({ + /** + * Skip the check for a declaration record on the owner's PDS. Knot admins only. + */ + force: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.boolean()), repo: /*#__PURE__*/ v.didString(), }), }, diff --git a/web/src/lib/api/lexicons/types/org/tangled/repo/forkSync.ts b/web/src/lib/api/lexicons/types/org/tangled/repo/forkSync.ts new file mode 100644 index 000000000..eb9ba26f9 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/repo/forkSync.ts @@ -0,0 +1,36 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; + +const _mainSchema = /*#__PURE__*/ v.procedure("org.tangled.repo.forkSync", { + params: null, + input: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + /** + * Branch to fetch from the upstream + */ + branch: /*#__PURE__*/ v.string(), + /** + * DID of the fork repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + }, + output: null, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params {} +export interface $input extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCProcedures { + "org.tangled.repo.forkSync": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/repo/listRecordVersions.ts b/web/src/lib/api/lexicons/types/org/tangled/repo/listRecordVersions.ts new file mode 100644 index 000000000..b33be5bc8 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/repo/listRecordVersions.ts @@ -0,0 +1,84 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; + +const _mainSchema = /*#__PURE__*/ v.query( + "org.tangled.repo.listRecordVersions", + { + params: /*#__PURE__*/ v.object({ + /** + * Pagination cursor + */ + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + /** + * @minimum 1 + * @maximum 500 + * @default 100 + */ + limit: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.integer(), [ + /*#__PURE__*/ v.integerRange(1, 500), + ]), + 100, + ), + /** + * Record in a repo this knot hosts + */ + uri: /*#__PURE__*/ v.resourceUriString(), + }), + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + /** + * Cursor for the next page, left out when the page already reaches the newest version + */ + cursor: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.string()), + uri: /*#__PURE__*/ v.resourceUriString(), + get versions() { + return /*#__PURE__*/ v.array(versionSchema); + }, + }), + }, + }, +); +const _versionSchema = /*#__PURE__*/ v.object({ + $type: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.literal("org.tangled.repo.listRecordVersions#version"), + ), + /** + * Object ID of the git change that produced this version + */ + changeId: /*#__PURE__*/ v.string(), + /** + * Content id of this version. Missing when the version was removed or the change is a deletion. + */ + cid: /*#__PURE__*/ v.optional(/*#__PURE__*/ v.cidString()), + /** + * When this knot wrote the commit this version rides in. Not the record's own `createdAt`. + */ + createdAt: /*#__PURE__*/ v.datetimeString(), + /** + * The account that authored the change + */ + editor: /*#__PURE__*/ v.didString(), +}); + +type main$schematype = typeof _mainSchema; +type version$schematype = typeof _versionSchema; + +export interface mainSchema extends main$schematype {} +export interface versionSchema extends version$schematype {} + +export const mainSchema = _mainSchema as mainSchema; +export const versionSchema = _versionSchema as versionSchema; + +export interface Version extends v.InferInput {} + +export interface $params extends v.InferInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCQueries { + "org.tangled.repo.listRecordVersions": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/repo/manifest.ts b/web/src/lib/api/lexicons/types/org/tangled/repo/manifest.ts index 3be927ebb..71f364eed 100644 --- a/web/src/lib/api/lexicons/types/org/tangled/repo/manifest.ts +++ b/web/src/lib/api/lexicons/types/org/tangled/repo/manifest.ts @@ -17,10 +17,27 @@ const _mainSchema = /*#__PURE__*/ v.record( /*#__PURE__*/ v.literal("self"), /*#__PURE__*/ v.object({ $type: /*#__PURE__*/ v.literal("org.tangled.repo.manifest"), + /** + * Who may open tickets and patches on this repo. anyone = any DID, members = the knot's member roll, collaborators = the owner plus repo collaborators. Absent means the knot-wide default. + */ + contributionPolicy: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.string< + "anyone" | "collaborators" | "members" | (string & {}) + >(), + ), createdAt: /*#__PURE__*/ v.datetimeString(), get declaration() { return declarationSchema; }, + /** + * Default branch name without the refs/heads/ prefix. The knot will move HEAD to match when this field changes. + * @maxLength 244 + */ + defaultBranch: /*#__PURE__*/ v.optional( + /*#__PURE__*/ v.constrain(/*#__PURE__*/ v.string(), [ + /*#__PURE__*/ v.stringLength(0, 244), + ]), + ), /** * @minGraphemes 1 * @maxGraphemes 140 diff --git a/web/src/lib/api/lexicons/types/org/tangled/repo/mintToken.ts b/web/src/lib/api/lexicons/types/org/tangled/repo/mintToken.ts index 1ecb96e6e..872460542 100644 --- a/web/src/lib/api/lexicons/types/org/tangled/repo/mintToken.ts +++ b/web/src/lib/api/lexicons/types/org/tangled/repo/mintToken.ts @@ -8,19 +8,19 @@ const _mainSchema = /*#__PURE__*/ v.procedure("org.tangled.repo.mintToken", { type: "lex", schema: /*#__PURE__*/ v.object({ /** - * Audience of the minted token: a DID service reference for the service the token is addressed to. The knot checks only well-formedness, as a PDS does. + * Audience of the minted token, a DID service ref for the service, that the token is addressed to. */ aud: /*#__PURE__*/ v.didString(), /** - * Unix seconds. Must be in the future and at most 60 seconds past the minting. + * Unix seconds. Must be in the future, and at most 60s after mint time. */ exp: /*#__PURE__*/ v.integer(), /** - * Lexicon method the minted token binds to. + * Lexicon method to which minted token binds. */ lxm: /*#__PURE__*/ v.nsidString(), /** - * DID of the repo that becomes the token's issuer. Must equal the audience of the calling session. + * DID of the repo that becomes the token's issuer. Must be the audience of a given calling session. */ repo: /*#__PURE__*/ v.didString(), }), diff --git a/web/src/lib/api/lexicons/types/org/tangled/repo/reserveKey.ts b/web/src/lib/api/lexicons/types/org/tangled/repo/reserveKey.ts new file mode 100644 index 000000000..d8bc2f2ef --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/repo/reserveKey.ts @@ -0,0 +1,42 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; + +const _mainSchema = /*#__PURE__*/ v.procedure("org.tangled.repo.reserveKey", { + params: null, + input: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + /** + * The caller-minted DID to reserve + */ + repoDid: /*#__PURE__*/ v.didString(), + }), + }, + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + /** + * Multibase-encoded public signing key the knot holds for this repo identity + */ + key: /*#__PURE__*/ v.string(), + repoDid: /*#__PURE__*/ v.didString(), + }), + }, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params {} +export interface $input extends v.InferXRPCBodyInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCProcedures { + "org.tangled.repo.reserveKey": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/review/mergePatch.ts b/web/src/lib/api/lexicons/types/org/tangled/review/mergePatch.ts new file mode 100644 index 000000000..62078e4a9 --- /dev/null +++ b/web/src/lib/api/lexicons/types/org/tangled/review/mergePatch.ts @@ -0,0 +1,49 @@ +import type {} from "@atcute/lexicons"; +import * as v from "@atcute/lexicons/validations"; +import type {} from "@atcute/lexicons/ambient"; + +const _mainSchema = /*#__PURE__*/ v.procedure("org.tangled.review.mergePatch", { + params: null, + input: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + /** + * Record key of the org.tangled.review.patch record to merge + */ + patch: /*#__PURE__*/ v.cidString(), + /** + * DID of the repository + */ + repo: /*#__PURE__*/ v.didString(), + }), + }, + output: { + type: "lex", + schema: /*#__PURE__*/ v.object({ + /** + * Patch records merged by this call + */ + merged: /*#__PURE__*/ v.array(/*#__PURE__*/ v.resourceUriString()), + /** + * Commit Object ID the target branch ended on; the current tip when no move was needed + */ + tip: /*#__PURE__*/ v.string(), + }), + }, +}); + +type main$schematype = typeof _mainSchema; + +export interface mainSchema extends main$schematype {} + +export const mainSchema = _mainSchema as mainSchema; + +export interface $params {} +export interface $input extends v.InferXRPCBodyInput {} +export interface $output extends v.InferXRPCBodyInput {} + +declare module "@atcute/lexicons/ambient" { + interface XRPCProcedures { + "org.tangled.review.mergePatch": mainSchema; + } +} diff --git a/web/src/lib/api/lexicons/types/org/tangled/temp/git/getBranch.ts b/web/src/lib/api/lexicons/types/org/tangled/temp/git/getBranch.ts index cccc20f0a..a9c7ef02b 100644 --- a/web/src/lib/api/lexicons/types/org/tangled/temp/git/getBranch.ts +++ b/web/src/lib/api/lexicons/types/org/tangled/temp/git/getBranch.ts @@ -1,7 +1,7 @@ import type {} from "@atcute/lexicons"; import * as v from "@atcute/lexicons/validations"; import type {} from "@atcute/lexicons/ambient"; -import * as ShTangledGitDefs from "../../../../sh/tangled/git/defs.js"; +import * as OrgTangledGitDefs from "../../git/defs.js"; const _mainSchema = /*#__PURE__*/ v.query("org.tangled.temp.git.getBranch", { params: /*#__PURE__*/ v.object({ @@ -18,7 +18,7 @@ const _mainSchema = /*#__PURE__*/ v.query("org.tangled.temp.git.getBranch", { type: "lex", schema: /*#__PURE__*/ v.object({ get author() { - return ShTangledGitDefs.signatureSchema; + return OrgTangledGitDefs.signatureSchema; }, /** * Latest commit hash on this branch diff --git a/web/src/lib/api/lexicons/types/org/tangled/temp/git/getEntry.ts b/web/src/lib/api/lexicons/types/org/tangled/temp/git/getEntry.ts index 065cb2a4d..ef87c72fb 100644 --- a/web/src/lib/api/lexicons/types/org/tangled/temp/git/getEntry.ts +++ b/web/src/lib/api/lexicons/types/org/tangled/temp/git/getEntry.ts @@ -1,7 +1,7 @@ import type {} from "@atcute/lexicons"; import * as v from "@atcute/lexicons/validations"; import type {} from "@atcute/lexicons/ambient"; -import * as ShTangledGitTempDefs from "../../../../sh/tangled/git/temp/defs.js"; +import * as OrgTangledGitDefs from "../../git/defs.js"; const _mainSchema = /*#__PURE__*/ v.query("org.tangled.temp.git.getEntry", { params: /*#__PURE__*/ v.object({ @@ -23,7 +23,7 @@ const _mainSchema = /*#__PURE__*/ v.query("org.tangled.temp.git.getEntry", { type: "lex", schema: /*#__PURE__*/ v.object({ get lastCommit() { - return /*#__PURE__*/ v.optional(ShTangledGitTempDefs.commitSchema); + return /*#__PURE__*/ v.optional(OrgTangledGitDefs.commitSchema); }, mode: /*#__PURE__*/ v.literalEnum([ "0040000", @@ -46,7 +46,7 @@ const _mainSchema = /*#__PURE__*/ v.query("org.tangled.temp.git.getEntry", { * Submodule information if path is a submodule */ get submodule() { - return /*#__PURE__*/ v.optional(ShTangledGitTempDefs.submoduleSchema); + return /*#__PURE__*/ v.optional(OrgTangledGitDefs.submoduleSchema); }, }), }, diff --git a/web/src/lib/api/lexicons/types/org/tangled/temp/git/getRef.ts b/web/src/lib/api/lexicons/types/org/tangled/temp/git/getRef.ts index 759276a03..47e9dc56a 100644 --- a/web/src/lib/api/lexicons/types/org/tangled/temp/git/getRef.ts +++ b/web/src/lib/api/lexicons/types/org/tangled/temp/git/getRef.ts @@ -1,8 +1,8 @@ import type {} from "@atcute/lexicons"; import * as v from "@atcute/lexicons/validations"; import type {} from "@atcute/lexicons/ambient"; +import * as OrgTangledGitDefs from "../../git/defs.js"; import * as OrgTangledTempGitListTags from "./listTags.js"; -import * as ShTangledGitDefs from "../../../../sh/tangled/git/defs.js"; const _mainSchema = /*#__PURE__*/ v.query("org.tangled.temp.git.getRef", { params: /*#__PURE__*/ v.object({ @@ -27,7 +27,7 @@ const _mainSchema = /*#__PURE__*/ v.query("org.tangled.temp.git.getRef", { ); }, get author() { - return ShTangledGitDefs.signatureSchema; + return OrgTangledGitDefs.signatureSchema; }, /** * Latest commit message diff --git a/web/src/lib/api/lexicons/types/org/tangled/temp/git/getTag.ts b/web/src/lib/api/lexicons/types/org/tangled/temp/git/getTag.ts index cf184f334..d8e566e63 100644 --- a/web/src/lib/api/lexicons/types/org/tangled/temp/git/getTag.ts +++ b/web/src/lib/api/lexicons/types/org/tangled/temp/git/getTag.ts @@ -1,8 +1,8 @@ import type {} from "@atcute/lexicons"; import * as v from "@atcute/lexicons/validations"; import type {} from "@atcute/lexicons/ambient"; +import * as OrgTangledGitDefs from "../../git/defs.js"; import * as OrgTangledTempGitListTags from "./listTags.js"; -import * as ShTangledGitDefs from "../../../../sh/tangled/git/defs.js"; const _mainSchema = /*#__PURE__*/ v.query("org.tangled.temp.git.getTag", { params: /*#__PURE__*/ v.object({ @@ -27,7 +27,7 @@ const _mainSchema = /*#__PURE__*/ v.query("org.tangled.temp.git.getTag", { ); }, get author() { - return ShTangledGitDefs.signatureSchema; + return OrgTangledGitDefs.signatureSchema; }, /** * Latest commit message diff --git a/web/src/lib/api/lexicons/types/org/tangled/temp/git/getTree.ts b/web/src/lib/api/lexicons/types/org/tangled/temp/git/getTree.ts index ed8497e94..c93ce1326 100644 --- a/web/src/lib/api/lexicons/types/org/tangled/temp/git/getTree.ts +++ b/web/src/lib/api/lexicons/types/org/tangled/temp/git/getTree.ts @@ -1,7 +1,7 @@ import type {} from "@atcute/lexicons"; import * as v from "@atcute/lexicons/validations"; import type {} from "@atcute/lexicons/ambient"; -import * as ShTangledGitTempDefs from "../../../../sh/tangled/git/temp/defs.js"; +import * as OrgTangledGitDefs from "../../git/defs.js"; const _mainSchema = /*#__PURE__*/ v.query("org.tangled.temp.git.getTree", { params: /*#__PURE__*/ v.object({ @@ -27,7 +27,7 @@ const _mainSchema = /*#__PURE__*/ v.query("org.tangled.temp.git.getTree", { return /*#__PURE__*/ v.array(treeEntrySchema); }, get lastCommit() { - return /*#__PURE__*/ v.optional(ShTangledGitTempDefs.commitSchema); + return /*#__PURE__*/ v.optional(OrgTangledGitDefs.commitSchema); }, }), }, @@ -37,7 +37,7 @@ const _treeEntrySchema = /*#__PURE__*/ v.object({ /*#__PURE__*/ v.literal("org.tangled.temp.git.getTree#treeEntry"), ), get lastCommit() { - return /*#__PURE__*/ v.optional(ShTangledGitTempDefs.commitSchema); + return /*#__PURE__*/ v.optional(OrgTangledGitDefs.commitSchema); }, /** * File mode diff --git a/web/src/lib/api/lexicons/types/org/tangled/temp/git/listBranches.ts b/web/src/lib/api/lexicons/types/org/tangled/temp/git/listBranches.ts index 25d2dd6dd..60f7508f4 100644 --- a/web/src/lib/api/lexicons/types/org/tangled/temp/git/listBranches.ts +++ b/web/src/lib/api/lexicons/types/org/tangled/temp/git/listBranches.ts @@ -1,17 +1,17 @@ import type {} from "@atcute/lexicons"; import * as v from "@atcute/lexicons/validations"; import type {} from "@atcute/lexicons/ambient"; -import * as ShTangledGitDefs from "../../../../sh/tangled/git/defs.js"; +import * as OrgTangledGitDefs from "../../git/defs.js"; const _branchInfoSchema = /*#__PURE__*/ v.object({ $type: /*#__PURE__*/ v.optional( /*#__PURE__*/ v.literal("org.tangled.temp.git.listBranches#branchInfo"), ), get author() { - return ShTangledGitDefs.signatureSchema; + return OrgTangledGitDefs.signatureSchema; }, get committer() { - return ShTangledGitDefs.signatureSchema; + return OrgTangledGitDefs.signatureSchema; }, /** * Latest commit message diff --git a/web/src/lib/api/lexicons/types/org/tangled/temp/git/listTags.ts b/web/src/lib/api/lexicons/types/org/tangled/temp/git/listTags.ts index 8974e3fdd..bc337a612 100644 --- a/web/src/lib/api/lexicons/types/org/tangled/temp/git/listTags.ts +++ b/web/src/lib/api/lexicons/types/org/tangled/temp/git/listTags.ts @@ -1,7 +1,7 @@ import type {} from "@atcute/lexicons"; import * as v from "@atcute/lexicons/validations"; import type {} from "@atcute/lexicons/ambient"; -import * as ShTangledGitDefs from "../../../../sh/tangled/git/defs.js"; +import * as OrgTangledGitDefs from "../../git/defs.js"; const _annotationSchema = /*#__PURE__*/ v.object({ $type: /*#__PURE__*/ v.optional( @@ -12,7 +12,7 @@ const _annotationSchema = /*#__PURE__*/ v.object({ */ message: /*#__PURE__*/ v.string(), get tagger() { - return /*#__PURE__*/ v.optional(ShTangledGitDefs.signatureSchema); + return /*#__PURE__*/ v.optional(OrgTangledGitDefs.signatureSchema); }, }); const _mainSchema = /*#__PURE__*/ v.query("org.tangled.temp.git.listTags", { @@ -63,7 +63,7 @@ const _tagInfoSchema = /*#__PURE__*/ v.object({ return /*#__PURE__*/ v.optional(annotationSchema); }, get author() { - return ShTangledGitDefs.signatureSchema; + return OrgTangledGitDefs.signatureSchema; }, /** * Latest commit message diff --git a/web/src/lib/api/lexicons/types/org/tangled/temp/git/mergeCommit.ts b/web/src/lib/api/lexicons/types/org/tangled/temp/git/mergeCommit.ts index 796d335f6..45972d9e7 100644 --- a/web/src/lib/api/lexicons/types/org/tangled/temp/git/mergeCommit.ts +++ b/web/src/lib/api/lexicons/types/org/tangled/temp/git/mergeCommit.ts @@ -1,7 +1,7 @@ import type {} from "@atcute/lexicons"; import * as v from "@atcute/lexicons/validations"; import type {} from "@atcute/lexicons/ambient"; -import * as ShTangledGitDefs from "../../../../sh/tangled/git/defs.js"; +import * as OrgTangledGitDefs from "../../git/defs.js"; const _mainSchema = /*#__PURE__*/ v.procedure( "org.tangled.temp.git.mergeCommit", @@ -42,7 +42,7 @@ const _mergeCommitContentSchema = /*#__PURE__*/ v.object({ ), ), get author() { - return /*#__PURE__*/ v.optional(ShTangledGitDefs.signatureSchema); + return /*#__PURE__*/ v.optional(OrgTangledGitDefs.signatureSchema); }, /** * @maxLength 1000000 diff --git a/web/src/lib/api/lexicons/types/org/tangled/temp/search/searchCode.ts b/web/src/lib/api/lexicons/types/org/tangled/temp/search/searchCode.ts index cafc04da3..4f44725bb 100644 --- a/web/src/lib/api/lexicons/types/org/tangled/temp/search/searchCode.ts +++ b/web/src/lib/api/lexicons/types/org/tangled/temp/search/searchCode.ts @@ -1,7 +1,7 @@ import type {} from "@atcute/lexicons"; import * as v from "@atcute/lexicons/validations"; import type {} from "@atcute/lexicons/ambient"; -import * as ShTangledRepoDefs from "../../../../sh/tangled/repo/defs.js"; +import * as OrgTangledRepoDefs from "../../repo/defs.js"; const _chunkSchema = /*#__PURE__*/ v.object({ $type: /*#__PURE__*/ v.optional( @@ -51,7 +51,7 @@ const _fileResultSchema = /*#__PURE__*/ v.object({ return /*#__PURE__*/ v.optional(/*#__PURE__*/ v.array(highlightSchema)); }, get repo() { - return ShTangledRepoDefs.repoViewBasicSchema; + return OrgTangledRepoDefs.repoViewBasicSchema; }, }); const _highlightSchema = /*#__PURE__*/ v.object({ diff --git a/web/src/lib/api/lexicons/types/org/tangled/track/defs.ts b/web/src/lib/api/lexicons/types/org/tangled/track/defs.ts index e3ec7b576..815dc7ff1 100644 --- a/web/src/lib/api/lexicons/types/org/tangled/track/defs.ts +++ b/web/src/lib/api/lexicons/types/org/tangled/track/defs.ts @@ -1,9 +1,9 @@ import type {} from "@atcute/lexicons"; import * as v from "@atcute/lexicons/validations"; +import * as OrgTangledActorDefs from "../actor/defs.js"; import * as OrgTangledLabelDefs from "../label/defs.js"; import * as OrgTangledMarkupMarkdown from "../markup/markdown.js"; -import * as ShTangledActorDefs from "../../../sh/tangled/actor/defs.js"; -import * as ShTangledRepoDefs from "../../../sh/tangled/repo/defs.js"; +import * as OrgTangledRepoDefs from "../repo/defs.js"; const _ticketStateSchema = /*#__PURE__*/ v.literalEnum([ "closed", @@ -18,7 +18,7 @@ const _ticketViewDetailedSchema = /*#__PURE__*/ v.object({ * Last editor of the ticket record (`x-tngl-editor`). */ get author() { - return ShTangledActorDefs.profileViewBasicSchema; + return OrgTangledActorDefs.profileViewBasicSchema; }, get body() { return /*#__PURE__*/ v.optional( @@ -28,7 +28,7 @@ const _ticketViewDetailedSchema = /*#__PURE__*/ v.object({ cid: /*#__PURE__*/ v.cidString(), createdAt: /*#__PURE__*/ v.datetimeString(), get repo() { - return ShTangledRepoDefs.repoViewBasicSchema; + return OrgTangledRepoDefs.repoViewBasicSchema; }, get state() { return ticketStateSchema; diff --git a/web/src/lib/api/lexicons/types/sh/tangled/repo/setContributionPolicy.ts b/web/src/lib/api/lexicons/types/sh/tangled/repo/setContributionPolicy.ts index 4172f439b..f822d0b63 100644 --- a/web/src/lib/api/lexicons/types/sh/tangled/repo/setContributionPolicy.ts +++ b/web/src/lib/api/lexicons/types/sh/tangled/repo/setContributionPolicy.ts @@ -10,7 +10,7 @@ const _mainSchema = /*#__PURE__*/ v.procedure( type: "lex", schema: /*#__PURE__*/ v.object({ /** - * anyone: any account with a DID can contribute. Members: accounts on this knot's member roll. Collaborators: the owner and the repository's collaborators. + * anyone: any account with a DID can contribute. Members: accounts on this knot's member grant list. Collaborators: the owner and the repository's collaborators. */ contributionPolicy: /*#__PURE__*/ v.literalEnum([ "anyone",