+2
-122
api/tangled/cbor_gen.go
+2
-122
api/tangled/cbor_gen.go
···
5512
}
5513
5514
cw := cbg.NewCborWriter(w)
5515
-
fieldCount := 7
5516
5517
if t.Body == nil {
5518
fieldCount--
···
5642
return err
5643
}
5644
5645
-
// t.IssueId (int64) (int64)
5646
-
if len("issueId") > 1000000 {
5647
-
return xerrors.Errorf("Value in field \"issueId\" was too long")
5648
-
}
5649
-
5650
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("issueId"))); err != nil {
5651
-
return err
5652
-
}
5653
-
if _, err := cw.WriteString(string("issueId")); err != nil {
5654
-
return err
5655
-
}
5656
-
5657
-
if t.IssueId >= 0 {
5658
-
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(t.IssueId)); err != nil {
5659
-
return err
5660
-
}
5661
-
} else {
5662
-
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-t.IssueId-1)); err != nil {
5663
-
return err
5664
-
}
5665
-
}
5666
-
5667
// t.CreatedAt (string) (string)
5668
if len("createdAt") > 1000000 {
5669
return xerrors.Errorf("Value in field \"createdAt\" was too long")
···
5795
5796
t.Title = string(sval)
5797
}
5798
-
// t.IssueId (int64) (int64)
5799
-
case "issueId":
5800
-
{
5801
-
maj, extra, err := cr.ReadHeader()
5802
-
if err != nil {
5803
-
return err
5804
-
}
5805
-
var extraI int64
5806
-
switch maj {
5807
-
case cbg.MajUnsignedInt:
5808
-
extraI = int64(extra)
5809
-
if extraI < 0 {
5810
-
return fmt.Errorf("int64 positive overflow")
5811
-
}
5812
-
case cbg.MajNegativeInt:
5813
-
extraI = int64(extra)
5814
-
if extraI < 0 {
5815
-
return fmt.Errorf("int64 negative overflow")
5816
-
}
5817
-
extraI = -1 - extraI
5818
-
default:
5819
-
return fmt.Errorf("wrong type for int64 field: %d", maj)
5820
-
}
5821
-
5822
-
t.IssueId = int64(extraI)
5823
-
}
5824
// t.CreatedAt (string) (string)
5825
case "createdAt":
5826
···
5850
}
5851
5852
cw := cbg.NewCborWriter(w)
5853
-
fieldCount := 7
5854
-
5855
-
if t.CommentId == nil {
5856
-
fieldCount--
5857
-
}
5858
5859
if t.Owner == nil {
5860
fieldCount--
···
5997
}
5998
}
5999
6000
-
// t.CommentId (int64) (int64)
6001
-
if t.CommentId != nil {
6002
-
6003
-
if len("commentId") > 1000000 {
6004
-
return xerrors.Errorf("Value in field \"commentId\" was too long")
6005
-
}
6006
-
6007
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("commentId"))); err != nil {
6008
-
return err
6009
-
}
6010
-
if _, err := cw.WriteString(string("commentId")); err != nil {
6011
-
return err
6012
-
}
6013
-
6014
-
if t.CommentId == nil {
6015
-
if _, err := cw.Write(cbg.CborNull); err != nil {
6016
-
return err
6017
-
}
6018
-
} else {
6019
-
if *t.CommentId >= 0 {
6020
-
if err := cw.WriteMajorTypeHeader(cbg.MajUnsignedInt, uint64(*t.CommentId)); err != nil {
6021
-
return err
6022
-
}
6023
-
} else {
6024
-
if err := cw.WriteMajorTypeHeader(cbg.MajNegativeInt, uint64(-*t.CommentId-1)); err != nil {
6025
-
return err
6026
-
}
6027
-
}
6028
-
}
6029
-
6030
-
}
6031
-
6032
// t.CreatedAt (string) (string)
6033
if len("createdAt") > 1000000 {
6034
return xerrors.Errorf("Value in field \"createdAt\" was too long")
···
6168
}
6169
6170
t.Owner = (*string)(&sval)
6171
-
}
6172
-
}
6173
-
// t.CommentId (int64) (int64)
6174
-
case "commentId":
6175
-
{
6176
-
6177
-
b, err := cr.ReadByte()
6178
-
if err != nil {
6179
-
return err
6180
-
}
6181
-
if b != cbg.CborNull[0] {
6182
-
if err := cr.UnreadByte(); err != nil {
6183
-
return err
6184
-
}
6185
-
maj, extra, err := cr.ReadHeader()
6186
-
if err != nil {
6187
-
return err
6188
-
}
6189
-
var extraI int64
6190
-
switch maj {
6191
-
case cbg.MajUnsignedInt:
6192
-
extraI = int64(extra)
6193
-
if extraI < 0 {
6194
-
return fmt.Errorf("int64 positive overflow")
6195
-
}
6196
-
case cbg.MajNegativeInt:
6197
-
extraI = int64(extra)
6198
-
if extraI < 0 {
6199
-
return fmt.Errorf("int64 negative overflow")
6200
-
}
6201
-
extraI = -1 - extraI
6202
-
default:
6203
-
return fmt.Errorf("wrong type for int64 field: %d", maj)
6204
-
}
6205
-
6206
-
t.CommentId = (*int64)(&extraI)
6207
}
6208
}
6209
// t.CreatedAt (string) (string)
···
5512
}
5513
5514
cw := cbg.NewCborWriter(w)
5515
+
fieldCount := 6
5516
5517
if t.Body == nil {
5518
fieldCount--
···
5642
return err
5643
}
5644
5645
// t.CreatedAt (string) (string)
5646
if len("createdAt") > 1000000 {
5647
return xerrors.Errorf("Value in field \"createdAt\" was too long")
···
5773
5774
t.Title = string(sval)
5775
}
5776
// t.CreatedAt (string) (string)
5777
case "createdAt":
5778
···
5802
}
5803
5804
cw := cbg.NewCborWriter(w)
5805
+
fieldCount := 6
5806
5807
if t.Owner == nil {
5808
fieldCount--
···
5945
}
5946
}
5947
5948
// t.CreatedAt (string) (string)
5949
if len("createdAt") > 1000000 {
5950
return xerrors.Errorf("Value in field \"createdAt\" was too long")
···
6084
}
6085
6086
t.Owner = (*string)(&sval)
6087
}
6088
}
6089
// t.CreatedAt (string) (string)
-1
api/tangled/issuecomment.go
-1
api/tangled/issuecomment.go
···
19
type RepoIssueComment struct {
20
LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue.comment" cborgen:"$type,const=sh.tangled.repo.issue.comment"`
21
Body string `json:"body" cborgen:"body"`
22
-
CommentId *int64 `json:"commentId,omitempty" cborgen:"commentId,omitempty"`
23
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
24
Issue string `json:"issue" cborgen:"issue"`
25
Owner *string `json:"owner,omitempty" cborgen:"owner,omitempty"`
···
19
type RepoIssueComment struct {
20
LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue.comment" cborgen:"$type,const=sh.tangled.repo.issue.comment"`
21
Body string `json:"body" cborgen:"body"`
22
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
23
Issue string `json:"issue" cborgen:"issue"`
24
Owner *string `json:"owner,omitempty" cborgen:"owner,omitempty"`
-1
api/tangled/repoissue.go
-1
api/tangled/repoissue.go
···
20
LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue" cborgen:"$type,const=sh.tangled.repo.issue"`
21
Body *string `json:"body,omitempty" cborgen:"body,omitempty"`
22
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
23
-
IssueId int64 `json:"issueId" cborgen:"issueId"`
24
Owner string `json:"owner" cborgen:"owner"`
25
Repo string `json:"repo" cborgen:"repo"`
26
Title string `json:"title" cborgen:"title"`
···
20
LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue" cborgen:"$type,const=sh.tangled.repo.issue"`
21
Body *string `json:"body,omitempty" cborgen:"body,omitempty"`
22
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
23
Owner string `json:"owner" cborgen:"owner"`
24
Repo string `json:"repo" cborgen:"repo"`
25
Title string `json:"title" cborgen:"title"`
+4
-9
appview/issues/issues.go
+4
-9
appview/issues/issues.go
···
278
}
279
280
createdAt := time.Now().Format(time.RFC3339)
281
-
commentIdInt64 := int64(commentId)
282
ownerDid := user.Did
283
issueAt, err := db.GetIssueAt(rp.db, f.RepoAt(), issueIdInt)
284
if err != nil {
···
302
Val: &tangled.RepoIssueComment{
303
Repo: &atUri,
304
Issue: issueAt,
305
-
CommentId: &commentIdInt64,
306
Owner: &ownerDid,
307
Body: body,
308
CreatedAt: createdAt,
···
451
repoAt := record["repo"].(string)
452
issueAt := record["issue"].(string)
453
createdAt := record["createdAt"].(string)
454
-
commentIdInt64 := int64(commentIdInt)
455
456
_, err = client.RepoPutRecord(r.Context(), &comatproto.RepoPutRecord_Input{
457
Collection: tangled.RepoIssueCommentNSID,
···
462
Val: &tangled.RepoIssueComment{
463
Repo: &repoAt,
464
Issue: issueAt,
465
-
CommentId: &commentIdInt64,
466
Owner: &comment.OwnerDid,
467
Body: newBody,
468
CreatedAt: createdAt,
···
687
Rkey: issue.Rkey,
688
Record: &lexutil.LexiconTypeDecoder{
689
Val: &tangled.RepoIssue{
690
-
Repo: atUri,
691
-
Title: title,
692
-
Body: &body,
693
-
Owner: user.Did,
694
-
IssueId: int64(issue.IssueId),
695
},
696
},
697
})
···
278
}
279
280
createdAt := time.Now().Format(time.RFC3339)
281
ownerDid := user.Did
282
issueAt, err := db.GetIssueAt(rp.db, f.RepoAt(), issueIdInt)
283
if err != nil {
···
301
Val: &tangled.RepoIssueComment{
302
Repo: &atUri,
303
Issue: issueAt,
304
Owner: &ownerDid,
305
Body: body,
306
CreatedAt: createdAt,
···
449
repoAt := record["repo"].(string)
450
issueAt := record["issue"].(string)
451
createdAt := record["createdAt"].(string)
452
453
_, err = client.RepoPutRecord(r.Context(), &comatproto.RepoPutRecord_Input{
454
Collection: tangled.RepoIssueCommentNSID,
···
459
Val: &tangled.RepoIssueComment{
460
Repo: &repoAt,
461
Issue: issueAt,
462
Owner: &comment.OwnerDid,
463
Body: newBody,
464
CreatedAt: createdAt,
···
683
Rkey: issue.Rkey,
684
Record: &lexutil.LexiconTypeDecoder{
685
Val: &tangled.RepoIssue{
686
+
Repo: atUri,
687
+
Title: title,
688
+
Body: &body,
689
+
Owner: user.Did,
690
},
691
},
692
})
+1
-8
lexicons/issue/comment.json
+1
-8
lexicons/issue/comment.json
···
9
"key": "tid",
10
"record": {
11
"type": "object",
12
-
"required": [
13
-
"issue",
14
-
"body",
15
-
"createdAt"
16
-
],
17
"properties": {
18
"issue": {
19
"type": "string",
···
22
"repo": {
23
"type": "string",
24
"format": "at-uri"
25
-
},
26
-
"commentId": {
27
-
"type": "integer"
28
},
29
"owner": {
30
"type": "string",
+1
-10
lexicons/issue/issue.json
+1
-10
lexicons/issue/issue.json
···
9
"key": "tid",
10
"record": {
11
"type": "object",
12
-
"required": [
13
-
"repo",
14
-
"issueId",
15
-
"owner",
16
-
"title",
17
-
"createdAt"
18
-
],
19
"properties": {
20
"repo": {
21
"type": "string",
22
"format": "at-uri"
23
-
},
24
-
"issueId": {
25
-
"type": "integer"
26
},
27
"owner": {
28
"type": "string",