From 5d021119d9469fd6f3012fcf1afe472bb90e19b0 Mon Sep 17 00:00:00 2001 From: nelind Date: Fri, 25 Apr 2025 21:25:07 +0000 Subject: [PATCH] lexicons: rename, format and other required changes --- api/tangled/cbor_gen.go | 683 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- api/tangled/issuecomment.go | 4 ++-- api/tangled/issuestate.go | 2 +- api/tangled/knotmember.go | 8 ++++---- api/tangled/pullcomment.go | 4 ++-- api/tangled/pullstatus.go | 2 +- api/tangled/repoissue.go | 2 +- api/tangled/repopull.go | 2 +- api/tangled/tangledpublicKey.go | 4 ++-- api/tangled/tangledrepo.go | 2 +- appview/pages/templates/knot.html | 4 ++-- appview/settings/settings.go | 6 +++--- appview/state/pull.go | 4 ++-- appview/state/repo.go | 30 +++++++++++++++--------------- appview/state/repo_util.go | 2 +- appview/state/state.go | 32 ++++++++++++++++---------------- knotserver/db/pubkeys.go | 18 +++++++++--------- knotserver/jetstream.go | 4 ++-- lexicons/follow.json | 13 ++++++------- lexicons/issue/comment.json | 6 +++++- lexicons/issue/issue.json | 8 +++++++- lexicons/issue/state.json | 5 ++++- lexicons/member.json | 9 +++++---- lexicons/publicKey.json | 5 ++--- lexicons/pulls/comment.json | 6 +++++- lexicons/pulls/pull.json | 15 +++++++++------ lexicons/pulls/state.json | 5 ++++- lexicons/repo.json | 19 ++++++++++++------- lexicons/star.json | 14 ++++++-------- 29 file(s) changed, 355 insertion(s)(+), 563 deletion(s)(-) diff --git a/api/tangled/cbor_gen.go b/api/tangled/cbor_gen.go --- a/api/tangled/cbor_gen.go +++ b/api/tangled/cbor_gen.go @@ -353,13 +353,8 @@ return err } cw := cbg.NewCborWriter(w) - fieldCount := 4 - if t.AddedAt == nil { - fieldCount-- - } - - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + if _, err := cw.Write([]byte{164}); err != nil { return err } @@ -405,59 +400,50 @@ if _, err := cw.WriteString(string(t.Domain)); err != nil { return err } - // t.Member (string) (string) - if len("member") > 1000000 { - return xerrors.Errorf("Value in field \"member\" was too long") + // 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("member"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil { return err } - if _, err := cw.WriteString(string("member")); err != nil { + if _, err := cw.WriteString(string("subject")); err != nil { return err } - if len(t.Member) > 1000000 { - return xerrors.Errorf("Value in field t.Member was too long") + 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.Member))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Subject))); err != nil { return err } - if _, err := cw.WriteString(string(t.Member)); err != nil { + if _, err := cw.WriteString(string(t.Subject)); err != nil { return err } - // t.AddedAt (string) (string) - if t.AddedAt != nil { - - if len("addedAt") > 1000000 { - return xerrors.Errorf("Value in field \"addedAt\" 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("addedAt"))); err != nil { - return err - } - if _, err := cw.WriteString(string("addedAt")); err != nil { - return err - } + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { + return err + } + if _, err := cw.WriteString(string("createdAt")); err != nil { + return err + } - if t.AddedAt == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - if len(*t.AddedAt) > 1000000 { - return xerrors.Errorf("Value in field t.AddedAt 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(*t.AddedAt))); err != nil { - return err - } - if _, err := cw.WriteString(string(*t.AddedAt)); err != nil { - return err - } - } + 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 } @@ -487,7 +473,7 @@ } n := extra - nameBuf := make([]byte, 7) + nameBuf := make([]byte, 9) for i := uint64(0); i < n; i++ { nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) if err != nil { @@ -525,8 +511,8 @@ } t.Domain = string(sval) } - // t.Member (string) (string) - case "member": + // t.Subject (string) (string) + case "subject": { sval, err := cbg.ReadStringWithMax(cr, 1000000) @@ -534,28 +520,18 @@ if err != nil { return err } - t.Member = string(sval) + t.Subject = string(sval) } - // t.AddedAt (string) (string) - case "addedAt": + // t.CreatedAt (string) (string) + case "createdAt": { - 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.AddedAt = (*string)(&sval) - } + t.CreatedAt = string(sval) } default: @@ -645,26 +621,26 @@ if _, err := cw.WriteString(string("sh.tangled.publicKey")); err != nil { return err } - // t.Created (string) (string) - if len("created") > 1000000 { - return xerrors.Errorf("Value in field \"created\" 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("created"))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { return err } - if _, err := cw.WriteString(string("created")); err != nil { + if _, err := cw.WriteString(string("createdAt")); err != nil { return err } - if len(t.Created) > 1000000 { - return xerrors.Errorf("Value in field t.Created 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(t.Created))); err != nil { + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { return err } - if _, err := cw.WriteString(string(t.Created)); err != nil { + if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { return err } return nil @@ -695,7 +671,7 @@ } n := extra - nameBuf := make([]byte, 7) + nameBuf := make([]byte, 9) for i := uint64(0); i < n; i++ { nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) if err != nil { @@ -744,8 +720,8 @@ } t.LexiconTypeID = string(sval) } - // t.Created (string) (string) - case "created": + // t.CreatedAt (string) (string) + case "createdAt": { sval, err := cbg.ReadStringWithMax(cr, 1000000) @@ -753,7 +729,7 @@ if err != nil { return err } - t.Created = string(sval) + t.CreatedAt = string(sval) } default: @@ -775,18 +751,10 @@ cw := cbg.NewCborWriter(w) fieldCount := 7 - if t.Body == nil { - fieldCount-- - } - if t.CommentId == nil { fieldCount-- } - if t.CreatedAt == nil { - fieldCount-- - } - if t.Owner == nil { fieldCount-- } @@ -800,35 +768,26 @@ return err } // t.Body (string) (string) - if t.Body != nil { - - if len("body") > 1000000 { - return xerrors.Errorf("Value in field \"body\" was too long") - } + 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 := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil { + return err + } + if _, err := cw.WriteString(string("body")); err != nil { + return err + } - if t.Body == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - if len(*t.Body) > 1000000 { - return xerrors.Errorf("Value in field t.Body was too long") - } + if len(t.Body) > 1000000 { + return xerrors.Errorf("Value in field t.Body was too long") + } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Body))); err != nil { - return err - } - if _, err := cw.WriteString(string(*t.Body)); err != nil { - return err - } - } + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Body))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Body)); err != nil { + return err } // t.Repo (string) (string) @@ -970,35 +929,26 @@ } // t.CreatedAt (string) (string) - if t.CreatedAt != nil { + if len("createdAt") > 1000000 { + return xerrors.Errorf("Value in field \"createdAt\" was too long") + } - 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 err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { - return err - } - if _, err := cw.WriteString(string("createdAt")); err != nil { - return err - } - - if t.CreatedAt == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - if len(*t.CreatedAt) > 1000000 { - return xerrors.Errorf("Value in field t.CreatedAt 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(*t.CreatedAt))); err != nil { - return err - } - if _, err := cw.WriteString(string(*t.CreatedAt)); err != nil { - return err - } - } + 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 } @@ -1048,22 +998,12 @@ // t.Body (string) (string) case "body": { - 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.Body = (*string)(&sval) - } + t.Body = string(sval) } // t.Repo (string) (string) case "repo": @@ -1169,22 +1109,12 @@ // t.CreatedAt (string) (string) case "createdAt": { - 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.CreatedAt = (*string)(&sval) - } + t.CreatedAt = string(sval) } default: @@ -1204,13 +1134,8 @@ return err } cw := cbg.NewCborWriter(w) - fieldCount := 3 - if t.State == nil { - fieldCount-- - } - - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + if _, err := cw.Write([]byte{163}); err != nil { return err } @@ -1257,35 +1182,26 @@ return err } // t.State (string) (string) - if t.State != nil { + if len("state") > 1000000 { + return xerrors.Errorf("Value in field \"state\" was too long") + } - 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 err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("state"))); err != nil { - return err - } - if _, err := cw.WriteString(string("state")); err != nil { - return err - } + if len(t.State) > 1000000 { + return xerrors.Errorf("Value in field t.State was too long") + } - 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 - } - } + 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 } return nil } @@ -1357,22 +1273,12 @@ // t.State (string) (string) case "state": { - 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.State = (*string)(&sval) - } + t.State = string(sval) } default: @@ -1395,10 +1301,6 @@ cw := cbg.NewCborWriter(w) fieldCount := 7 if t.Body == nil { - fieldCount-- - } - - if t.CreatedAt == nil { fieldCount-- } @@ -1549,35 +1451,26 @@ } } // t.CreatedAt (string) (string) - if t.CreatedAt != nil { + if len("createdAt") > 1000000 { + return xerrors.Errorf("Value in field \"createdAt\" was too long") + } - 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 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 t.CreatedAt == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - 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 - } - } + 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 } @@ -1718,22 +1611,12 @@ // t.CreatedAt (string) (string) case "createdAt": { - 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.CreatedAt = (*string)(&sval) - } + t.CreatedAt = string(sval) } default: @@ -1754,10 +1637,6 @@ } cw := cbg.NewCborWriter(w) fieldCount := 7 - - if t.AddedAt == nil { - fieldCount-- - } if t.Description == nil { fieldCount-- @@ -1891,36 +1770,27 @@ } } } - // t.AddedAt (string) (string) - if t.AddedAt != nil { - - if len("addedAt") > 1000000 { - return xerrors.Errorf("Value in field \"addedAt\" 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("addedAt"))); err != nil { - return err - } - if _, err := cw.WriteString(string("addedAt")); err != nil { - return err - } + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { + return err + } + if _, err := cw.WriteString(string("createdAt")); err != nil { + return err + } - if t.AddedAt == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - if len(*t.AddedAt) > 1000000 { - return xerrors.Errorf("Value in field t.AddedAt 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(*t.AddedAt))); err != nil { - return err - } - if _, err := cw.WriteString(string(*t.AddedAt)); err != nil { - return err - } - } + 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) @@ -2063,26 +1933,16 @@ t.Source = (*string)(&sval) } } - // t.AddedAt (string) (string) - case "addedAt": + // t.CreatedAt (string) (string) + case "createdAt": { - 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.AddedAt = (*string)(&sval) - } + t.CreatedAt = string(sval) } // t.Description (string) (string) case "description": @@ -2126,10 +1986,6 @@ cw := cbg.NewCborWriter(w) fieldCount := 9 if t.Body == nil { - fieldCount-- - } - - if t.CreatedAt == nil { fieldCount-- } @@ -2280,35 +2136,26 @@ } } // t.CreatedAt (string) (string) - if t.CreatedAt != nil { + if len("createdAt") > 1000000 { + return xerrors.Errorf("Value in field \"createdAt\" was too long") + } - 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 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 t.CreatedAt == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - 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 - } - } + 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.TargetRepo (string) (string) @@ -2504,22 +2351,12 @@ // t.CreatedAt (string) (string) case "createdAt": { - 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.CreatedAt = (*string)(&sval) - } + t.CreatedAt = string(sval) } // t.TargetRepo (string) (string) case "targetRepo": @@ -2719,13 +2556,8 @@ return err } cw := cbg.NewCborWriter(w) - fieldCount := 3 - if t.Status == nil { - fieldCount-- - } - - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { + if _, err := cw.Write([]byte{163}); err != nil { return err } @@ -2772,35 +2604,26 @@ 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 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 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 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 - } - } + 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 } return nil } @@ -2872,22 +2695,12 @@ // t.Status (string) (string) case "status": { - 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.Status = (*string)(&sval) - } + t.Status = string(sval) } default: @@ -2909,18 +2722,10 @@ cw := cbg.NewCborWriter(w) fieldCount := 7 - if t.Body == nil { - fieldCount-- - } - if t.CommentId == nil { fieldCount-- } - if t.CreatedAt == nil { - fieldCount-- - } - if t.Owner == nil { fieldCount-- } @@ -2934,35 +2739,26 @@ return err } // t.Body (string) (string) - if t.Body != nil { - - if len("body") > 1000000 { - return xerrors.Errorf("Value in field \"body\" was too long") - } + 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 := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil { + return err + } + if _, err := cw.WriteString(string("body")); err != nil { + return err + } - if t.Body == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - if len(*t.Body) > 1000000 { - return xerrors.Errorf("Value in field t.Body was too long") - } + if len(t.Body) > 1000000 { + return xerrors.Errorf("Value in field t.Body was too long") + } - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Body))); err != nil { - return err - } - if _, err := cw.WriteString(string(*t.Body)); err != nil { - return err - } - } + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Body))); err != nil { + return err + } + if _, err := cw.WriteString(string(t.Body)); err != nil { + return err } // t.Pull (string) (string) @@ -3104,35 +2900,26 @@ } // t.CreatedAt (string) (string) - if t.CreatedAt != nil { + if len("createdAt") > 1000000 { + return xerrors.Errorf("Value in field \"createdAt\" was too long") + } - 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 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 t.CreatedAt == nil { - if _, err := cw.Write(cbg.CborNull); err != nil { - return err - } - } else { - 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 - } - } + 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 } @@ -3182,22 +2969,12 @@ // t.Body (string) (string) case "body": { - 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.Body = (*string)(&sval) - } + t.Body = string(sval) } // t.Pull (string) (string) case "pull": @@ -3303,22 +3080,12 @@ // t.CreatedAt (string) (string) case "createdAt": { - 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.CreatedAt = (*string)(&sval) - } + t.CreatedAt = string(sval) } default: diff --git a/api/tangled/issuecomment.go b/api/tangled/issuecomment.go --- a/api/tangled/issuecomment.go +++ b/api/tangled/issuecomment.go @@ -18,9 +18,9 @@ } // // RECORDTYPE: RepoIssueComment type RepoIssueComment struct { LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue.comment" cborgen:"$type,const=sh.tangled.repo.issue.comment"` - Body *string `json:"body,omitempty" cborgen:"body,omitempty"` + Body string `json:"body" cborgen:"body"` CommentId *int64 `json:"commentId,omitempty" cborgen:"commentId,omitempty"` - CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` Issue string `json:"issue" cborgen:"issue"` Owner *string `json:"owner,omitempty" cborgen:"owner,omitempty"` Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"` diff --git a/api/tangled/issuestate.go b/api/tangled/issuestate.go --- a/api/tangled/issuestate.go +++ b/api/tangled/issuestate.go @@ -20,5 +20,5 @@ type RepoIssueState struct { LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue.state" cborgen:"$type,const=sh.tangled.repo.issue.state"` Issue string `json:"issue" cborgen:"issue"` // state: state of the issue - State *string `json:"state,omitempty" cborgen:"state,omitempty"` + State string `json:"state" cborgen:"state"` } diff --git a/api/tangled/knotmember.go b/api/tangled/knotmember.go --- a/api/tangled/knotmember.go +++ b/api/tangled/knotmember.go @@ -17,9 +17,9 @@ util.RegisterType("sh.tangled.knot.member", &KnotMember{}) } // // RECORDTYPE: KnotMember type KnotMember struct { - LexiconTypeID string `json:"$type,const=sh.tangled.knot.member" cborgen:"$type,const=sh.tangled.knot.member"` - AddedAt *string `json:"addedAt,omitempty" cborgen:"addedAt,omitempty"` + LexiconTypeID string `json:"$type,const=sh.tangled.knot.member" cborgen:"$type,const=sh.tangled.knot.member"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` // domain: domain that this member now belongs to - Domain string `json:"domain" cborgen:"domain"` - Member string `json:"member" cborgen:"member"` + Domain string `json:"domain" cborgen:"domain"` + Subject string `json:"subject" cborgen:"subject"` } diff --git a/api/tangled/pullcomment.go b/api/tangled/pullcomment.go --- a/api/tangled/pullcomment.go +++ b/api/tangled/pullcomment.go @@ -18,9 +18,9 @@ } // // RECORDTYPE: RepoPullComment type RepoPullComment struct { LexiconTypeID string `json:"$type,const=sh.tangled.repo.pull.comment" cborgen:"$type,const=sh.tangled.repo.pull.comment"` - Body *string `json:"body,omitempty" cborgen:"body,omitempty"` + Body string `json:"body" cborgen:"body"` CommentId *int64 `json:"commentId,omitempty" cborgen:"commentId,omitempty"` - CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` Owner *string `json:"owner,omitempty" cborgen:"owner,omitempty"` Pull string `json:"pull" cborgen:"pull"` Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"` diff --git a/api/tangled/pullstatus.go b/api/tangled/pullstatus.go --- a/api/tangled/pullstatus.go +++ b/api/tangled/pullstatus.go @@ -20,5 +20,5 @@ type RepoPullStatus struct { LexiconTypeID string `json:"$type,const=sh.tangled.repo.pull.status" cborgen:"$type,const=sh.tangled.repo.pull.status"` Pull string `json:"pull" cborgen:"pull"` // status: status of the pull request - Status *string `json:"status,omitempty" cborgen:"status,omitempty"` + Status string `json:"status" cborgen:"status"` } diff --git a/api/tangled/repoissue.go b/api/tangled/repoissue.go --- a/api/tangled/repoissue.go +++ b/api/tangled/repoissue.go @@ -19,7 +19,7 @@ // RECORDTYPE: RepoIssue type RepoIssue struct { LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue" cborgen:"$type,const=sh.tangled.repo.issue"` Body *string `json:"body,omitempty" cborgen:"body,omitempty"` - CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` IssueId int64 `json:"issueId" cborgen:"issueId"` Owner string `json:"owner" cborgen:"owner"` Repo string `json:"repo" cborgen:"repo"` diff --git a/api/tangled/repopull.go b/api/tangled/repopull.go --- a/api/tangled/repopull.go +++ b/api/tangled/repopull.go @@ -19,7 +19,7 @@ // RECORDTYPE: RepoPull type RepoPull struct { LexiconTypeID string `json:"$type,const=sh.tangled.repo.pull" cborgen:"$type,const=sh.tangled.repo.pull"` Body *string `json:"body,omitempty" cborgen:"body,omitempty"` - CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` Patch string `json:"patch" cborgen:"patch"` PullId int64 `json:"pullId" cborgen:"pullId"` Source *RepoPull_Source `json:"source,omitempty" cborgen:"source,omitempty"` diff --git a/api/tangled/tangledpublicKey.go b/api/tangled/tangledpublicKey.go --- a/api/tangled/tangledpublicKey.go +++ b/api/tangled/tangledpublicKey.go @@ -18,8 +18,8 @@ } // // RECORDTYPE: PublicKey type PublicKey struct { LexiconTypeID string `json:"$type,const=sh.tangled.publicKey" cborgen:"$type,const=sh.tangled.publicKey"` - // created: key upload timestamp - Created string `json:"created" cborgen:"created"` + // createdAt: key upload timestamp + CreatedAt string `json:"createdAt" cborgen:"createdAt"` // key: public key contents Key string `json:"key" cborgen:"key"` // name: human-readable name for this key diff --git a/api/tangled/tangledrepo.go b/api/tangled/tangledrepo.go --- a/api/tangled/tangledrepo.go +++ b/api/tangled/tangledrepo.go @@ -18,7 +18,7 @@ } // // RECORDTYPE: Repo type Repo struct { LexiconTypeID string `json:"$type,const=sh.tangled.repo" cborgen:"$type,const=sh.tangled.repo"` - AddedAt *string `json:"addedAt,omitempty" cborgen:"addedAt,omitempty"` + CreatedAt string `json:"createdAt" cborgen:"createdAt"` Description *string `json:"description,omitempty" cborgen:"description,omitempty"` // knot: knot where the repo was created Knot string `json:"knot" cborgen:"knot"` diff --git a/appview/pages/templates/knot.html b/appview/pages/templates/knot.html --- a/appview/pages/templates/knot.html +++ b/appview/pages/templates/knot.html @@ -83,8 +83,8 @@ hx-put="/knots/{{.Registration.Domain}}/member" class="max-w-2xl space-y-4"> diff --git a/appview/settings/settings.go b/appview/settings/settings.go --- a/appview/settings/settings.go +++ b/appview/settings/settings.go @@ -384,9 +384,9 @@ Repo: did, Rkey: rkey, Record: &lexutil.LexiconTypeDecoder{ Val: &tangled.PublicKey{ - Created: time.Now().Format(time.RFC3339), - Key: key, - Name: name, + CreatedAt: time.Now().Format(time.RFC3339), + Key: key, + Name: name, }}, }) // invalid record diff --git a/appview/state/pull.go b/appview/state/pull.go --- a/appview/state/pull.go +++ b/appview/state/pull.go @@ -530,8 +530,8 @@ Val: &tangled.RepoPullComment{ Repo: &atUri, Pull: string(pullAt), Owner: &ownerDid, - Body: &body, - CreatedAt: &createdAt, + Body: body, + CreatedAt: createdAt, }, }, }) diff --git a/appview/state/repo.go b/appview/state/repo.go --- a/appview/state/repo.go +++ b/appview/state/repo.go @@ -217,7 +217,7 @@ Val: &tangled.Repo{ Knot: f.Knot, Name: f.RepoName, Owner: user.Did, - AddedAt: &f.AddedAt, + CreatedAt: f.CreatedAt, Description: &newDescription, }, }, @@ -851,7 +851,7 @@ OwnerId identity.Identity RepoName string RepoAt syntax.ATURI Description string - AddedAt string + CreatedAt string } func (f *FullyResolvedRepo) OwnerDid() string { @@ -1122,7 +1122,7 @@ Rkey: appview.TID(), Record: &lexutil.LexiconTypeDecoder{ Val: &tangled.RepoIssueState{ Issue: issue.IssueAt, - State: &closed, + State: closed, }, }, }) @@ -1260,8 +1260,8 @@ Repo: &atUri, Issue: issueAt, CommentId: &commentIdInt64, Owner: &ownerDid, - Body: &body, - CreatedAt: &createdAt, + Body: body, + CreatedAt: createdAt, }, }, }) @@ -1429,8 +1429,8 @@ Repo: &repoAt, Issue: issueAt, CommentId: &commentIdInt64, Owner: &comment.OwnerDid, - Body: &newBody, - CreatedAt: &createdAt, + Body: newBody, + CreatedAt: createdAt, }, }, }) @@ -1760,7 +1760,7 @@ uri = "http" } else { uri = "https" } - sourceUrl := fmt.Sprintf("%s://%s/%s/%s", uri, f.Knot, f.OwnerDid(), f.RepoName) + forkSourceUrl := fmt.Sprintf("%s://%s/%s/%s", uri, f.Knot, f.OwnerDid(), f.RepoName) sourceAt := f.RepoAt.String() rkey := appview.TID() @@ -1786,7 +1786,7 @@ log.Println("failed to rollback policies") } }() - resp, err := client.ForkRepo(user.Did, sourceUrl, forkName) + resp, err := client.ForkRepo(user.Did, forkSourceUrl, forkName) if err != nil { s.pages.Notice(w, "repo", "Failed to create repository on knot server.") return @@ -1804,18 +1804,18 @@ } xrpcClient, _ := s.auth.AuthorizedClient(r) - addedAt := time.Now().Format(time.RFC3339) + createdAt := time.Now().Format(time.RFC3339) atresp, err := comatproto.RepoPutRecord(r.Context(), xrpcClient, &comatproto.RepoPutRecord_Input{ Collection: tangled.RepoNSID, Repo: user.Did, Rkey: rkey, Record: &lexutil.LexiconTypeDecoder{ Val: &tangled.Repo{ - Knot: repo.Knot, - Name: repo.Name, - AddedAt: &addedAt, - Owner: user.Did, - Source: &sourceAt, + Knot: repo.Knot, + Name: repo.Name, + CreatedAt: createdAt, + Owner: user.Did, + Source: &sourceAt, }}, }) if err != nil { diff --git a/appview/state/repo_util.go b/appview/state/repo_util.go --- a/appview/state/repo_util.go +++ b/appview/state/repo_util.go @@ -52,7 +52,7 @@ OwnerId: id, RepoName: repoName, RepoAt: parsedRepoAt, Description: description, - AddedAt: addedAt, + CreatedAt: addedAt, }, nil } diff --git a/appview/state/state.go b/appview/state/state.go --- a/appview/state/state.go +++ b/appview/state/state.go @@ -502,32 +502,32 @@ http.Error(w, "malformed url", http.StatusBadRequest) return } - memberDid := r.FormValue("member") - if memberDid == "" { + subjectIdentifier := r.FormValue("subject") + if subjectIdentifier == "" { http.Error(w, "malformed form", http.StatusBadRequest) return } - memberIdent, err := s.resolver.ResolveIdent(r.Context(), memberDid) + subjectIdentity, err := s.resolver.ResolveIdent(r.Context(), subjectIdentifier) if err != nil { w.Write([]byte("failed to resolve member did to a handle")) return } - log.Printf("adding %s to %s\n", memberIdent.Handle.String(), domain) + log.Printf("adding %s to %s\n", subjectIdentity.Handle.String(), domain) // announce this relation into the firehose, store into owners' pds client, _ := s.auth.AuthorizedClient(r) currentUser := s.auth.GetUser(r) - addedAt := time.Now().Format(time.RFC3339) + createdAt := time.Now().Format(time.RFC3339) resp, err := comatproto.RepoPutRecord(r.Context(), client, &comatproto.RepoPutRecord_Input{ Collection: tangled.KnotMemberNSID, Repo: currentUser.Did, Rkey: appview.TID(), Record: &lexutil.LexiconTypeDecoder{ Val: &tangled.KnotMember{ - Member: memberIdent.DID.String(), - Domain: domain, - AddedAt: &addedAt, + Subject: subjectIdentity.DID.String(), + Domain: domain, + CreatedAt: createdAt, }}, }) @@ -550,7 +550,7 @@ log.Println("failed to create client to ", domain) return } - ksResp, err := ksClient.AddMember(memberIdent.DID.String()) + ksResp, err := ksClient.AddMember(subjectIdentity.DID.String()) if err != nil { log.Printf("failed to make request to %s: %s", domain, err) return @@ -561,13 +561,13 @@ w.Write([]byte(fmt.Sprint("knotserver failed to add member: ", err))) return } - err = s.enforcer.AddMember(domain, memberIdent.DID.String()) + err = s.enforcer.AddMember(domain, subjectIdentity.DID.String()) if err != nil { w.Write([]byte(fmt.Sprint("failed to add member: ", err))) return } - w.Write([]byte(fmt.Sprint("added member: ", memberIdent.Handle.String()))) + w.Write([]byte(fmt.Sprint("added member: ", subjectIdentity.Handle.String()))) } func (s *State) RemoveMember(w http.ResponseWriter, r *http.Request) { @@ -657,17 +657,17 @@ } xrpcClient, _ := s.auth.AuthorizedClient(r) - addedAt := time.Now().Format(time.RFC3339) + createdAt := time.Now().Format(time.RFC3339) atresp, err := comatproto.RepoPutRecord(r.Context(), xrpcClient, &comatproto.RepoPutRecord_Input{ Collection: tangled.RepoNSID, Repo: user.Did, Rkey: rkey, Record: &lexutil.LexiconTypeDecoder{ Val: &tangled.Repo{ - Knot: repo.Knot, - Name: repoName, - AddedAt: &addedAt, - Owner: user.Did, + Knot: repo.Knot, + Name: repoName, + CreatedAt: createdAt, + Owner: user.Did, }}, }) if err != nil { diff --git a/knotserver/db/pubkeys.go b/knotserver/db/pubkeys.go --- a/knotserver/db/pubkeys.go +++ b/knotserver/db/pubkeys.go @@ -23,18 +23,18 @@ pk := PublicKey{ Did: did, } pk.Key = record["key"] - pk.Created = record["created"] + pk.CreatedAt = record["createdAt"] return d.AddPublicKey(pk) } func (d *DB) AddPublicKey(pk PublicKey) error { - if pk.Created == "" { - pk.Created = time.Now().Format(time.RFC3339) + if pk.CreatedAt == "" { + pk.CreatedAt = time.Now().Format(time.RFC3339) } query := `insert or ignore into public_keys (did, key, created) values (?, ?, ?)` - _, err := d.db.Exec(query, pk.Did, pk.Key, pk.Created) + _, err := d.db.Exec(query, pk.Did, pk.Key, pk.CreatedAt) return err } @@ -46,9 +46,9 @@ } func (pk *PublicKey) JSON() map[string]any { return map[string]any{ - "did": pk.Did, - "key": pk.Key, - "created": pk.Created, + "did": pk.Did, + "key": pk.Key, + "createdAt": pk.CreatedAt, } } @@ -63,7 +63,7 @@ defer rows.Close() for rows.Next() { var publicKey PublicKey - if err := rows.Scan(&publicKey.Key, &publicKey.Did, &publicKey.Created); err != nil { + if err := rows.Scan(&publicKey.Key, &publicKey.Did, &publicKey.CreatedAt); err != nil { return nil, err } keys = append(keys, publicKey) @@ -87,7 +87,7 @@ defer rows.Close() for rows.Next() { var publicKey PublicKey - if err := rows.Scan(&publicKey.Did, &publicKey.Key, &publicKey.Created); err != nil { + if err := rows.Scan(&publicKey.Did, &publicKey.Key, &publicKey.CreatedAt); err != nil { return nil, err } keys = append(keys, publicKey) diff --git a/knotserver/jetstream.go b/knotserver/jetstream.go --- a/knotserver/jetstream.go +++ b/knotserver/jetstream.go @@ -43,11 +43,11 @@ l.Error("failed to add member", "did", did) return fmt.Errorf("failed to enforce permissions: %w", err) } - if err := h.e.AddMember(ThisServer, record.Member); err != nil { + if err := h.e.AddMember(ThisServer, record.Subject); err != nil { l.Error("failed to add member", "error", err) return fmt.Errorf("failed to add member: %w", err) } - l.Info("added member from firehose", "member", record.Member) + l.Info("added member from firehose", "member", record.Subject) if err := h.db.AddDid(did); err != nil { l.Error("failed to add did", "error", err) diff --git a/lexicons/follow.json b/lexicons/follow.json --- a/lexicons/follow.json +++ b/lexicons/follow.json @@ -10,21 +10,20 @@ "key": "tid", "record": { "type": "object", "required": [ - "createdAt", - "subject" + "subject", + "createdAt" ], "properties": { + "subject": { + "type": "string", + "format": "did" + }, "createdAt": { "type": "string", "format": "datetime" - }, - "subject": { - "type": "string", - "format": "did" } } } } } } - diff --git a/lexicons/issue/comment.json b/lexicons/issue/comment.json --- a/lexicons/issue/comment.json +++ b/lexicons/issue/comment.json @@ -9,7 +9,11 @@ "type": "record", "key": "tid", "record": { "type": "object", - "required": ["issue"], + "required": [ + "issue", + "body", + "createdAt" + ], "properties": { "issue": { "type": "string", diff --git a/lexicons/issue/issue.json b/lexicons/issue/issue.json --- a/lexicons/issue/issue.json +++ b/lexicons/issue/issue.json @@ -9,7 +9,13 @@ "type": "record", "key": "tid", "record": { "type": "object", - "required": ["repo", "issueId", "owner", "title"], + "required": [ + "repo", + "issueId", + "owner", + "title", + "createdAt" + ], "properties": { "repo": { "type": "string", diff --git a/lexicons/issue/state.json b/lexicons/issue/state.json --- a/lexicons/issue/state.json +++ b/lexicons/issue/state.json @@ -9,7 +9,10 @@ "type": "record", "key": "tid", "record": { "type": "object", - "required": ["issue"], + "required": [ + "issue", + "state" + ], "properties": { "issue": { "type": "string", diff --git a/lexicons/member.json b/lexicons/member.json --- a/lexicons/member.json +++ b/lexicons/member.json @@ -10,11 +10,12 @@ "key": "tid", "record": { "type": "object", "required": [ - "member", - "domain" + "subject", + "domain", + "createdAt" ], "properties": { - "member": { + "subject": { "type": "string", "format": "did" }, @@ -22,7 +23,7 @@ "domain": { "type": "string", "description": "domain that this member now belongs to" }, - "addedAt": { + "createdAt": { "type": "string", "format": "datetime" } diff --git a/lexicons/publicKey.json b/lexicons/publicKey.json --- a/lexicons/publicKey.json +++ b/lexicons/publicKey.json @@ -12,13 +12,12 @@ "type": "object", "required": [ "key", "name", - "created" + "createdAt" ], "properties": { "key": { "type": "string", "maxLength": 4096, - "maxGraphemes": 4096, "description": "public key contents" }, "name": { @@ -26,7 +25,7 @@ "type": "string", "format": "string", "description": "human-readable name for this key" }, - "created": { + "createdAt": { "type": "string", "format": "datetime", "description": "key upload timestamp" diff --git a/lexicons/pulls/comment.json b/lexicons/pulls/comment.json --- a/lexicons/pulls/comment.json +++ b/lexicons/pulls/comment.json @@ -9,7 +9,11 @@ "type": "record", "key": "tid", "record": { "type": "object", - "required": ["pull"], + "required": [ + "pull", + "body", + "createdAt" + ], "properties": { "pull": { "type": "string", diff --git a/lexicons/pulls/pull.json b/lexicons/pulls/pull.json --- a/lexicons/pulls/pull.json +++ b/lexicons/pulls/pull.json @@ -14,7 +14,8 @@ "targetRepo", "targetBranch", "pullId", "title", - "patch" + "patch", + "createdAt" ], "properties": { "targetRepo": { @@ -33,23 +34,25 @@ }, "body": { "type": "string" }, - "createdAt": { - "type": "string", - "format": "datetime" - }, "patch": { "type": "string" }, "source": { "type": "ref", "ref": "#source" + }, + "createdAt": { + "type": "string", + "format": "datetime" } } } }, "source": { "type": "object", - "required": ["branch"], + "required": [ + "branch" + ], "properties": { "branch": { "type": "string" diff --git a/lexicons/pulls/state.json b/lexicons/pulls/state.json --- a/lexicons/pulls/state.json +++ b/lexicons/pulls/state.json @@ -9,7 +9,10 @@ "type": "record", "key": "tid", "record": { "type": "object", - "required": ["pull"], + "required": [ + "pull", + "status" + ], "properties": { "pull": { "type": "string", diff --git a/lexicons/repo.json b/lexicons/repo.json --- a/lexicons/repo.json +++ b/lexicons/repo.json @@ -9,7 +9,12 @@ "type": "record", "key": "tid", "record": { "type": "object", - "required": ["name", "knot", "owner"], + "required": [ + "name", + "knot", + "owner", + "createdAt" + ], "properties": { "name": { "type": "string", @@ -23,20 +28,20 @@ "knot": { "type": "string", "description": "knot where the repo was created" }, - "addedAt": { - "type": "string", - "format": "datetime" - }, "description": { "type": "string", "format": "datetime", - "minLength": 1, - "maxLength": 140 + "minGraphemes": 1, + "maxGraphemes": 140 }, "source": { "type": "string", "format": "uri", "description": "source of the repo" + }, + "createdAt": { + "type": "string", + "format": "datetime" } } } diff --git a/lexicons/star.json b/lexicons/star.json --- a/lexicons/star.json +++ b/lexicons/star.json @@ -10,22 +10,20 @@ "key": "tid", "record": { "type": "object", "required": [ - "createdAt", - "subject" + "subject", + "createdAt" ], "properties": { - "createdAt": { - "type": "string", - "format": "datetime" - }, "subject": { "type": "string", "format": "at-uri" + }, + "createdAt": { + "type": "string", + "format": "datetime" } } } } } } - - -- tangled.sh