+64
-30
api/tangled/cbor_gen.go
+64
-30
api/tangled/cbor_gen.go
···
2059
2060
return nil
2061
}
2062
-
func (t *RepoPullPatch) MarshalCBOR(w io.Writer) error {
2063
if t == nil {
2064
_, err := w.Write(cbg.CborNull)
2065
return err
2066
}
2067
2068
cw := cbg.NewCborWriter(w)
2069
-
fieldCount := 8
2070
2071
if t.Body == nil {
2072
fieldCount--
···
2128
return err
2129
}
2130
2131
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull.patch"))); err != nil {
2132
return err
2133
}
2134
-
if _, err := cw.WriteString(string("sh.tangled.repo.pull.patch")); err != nil {
2135
return err
2136
}
2137
···
2289
if _, err := cw.WriteString(string(t.TargetRepo)); err != nil {
2290
return err
2291
}
2292
return nil
2293
}
2294
2295
-
func (t *RepoPullPatch) UnmarshalCBOR(r io.Reader) (err error) {
2296
-
*t = RepoPullPatch{}
2297
2298
cr := cbg.NewCborReader(r)
2299
···
2312
}
2313
2314
if extra > cbg.MaxLength {
2315
-
return fmt.Errorf("RepoPullPatch: map struct too large (%d)", extra)
2316
}
2317
2318
n := extra
2319
2320
-
nameBuf := make([]byte, 10)
2321
for i := uint64(0); i < n; i++ {
2322
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
2323
if err != nil {
···
2466
2467
t.TargetRepo = string(sval)
2468
}
2469
2470
default:
2471
// Field doesn't exist on this type, so ignore it
···
2477
2478
return nil
2479
}
2480
-
func (t *RepoPullState) MarshalCBOR(w io.Writer) error {
2481
if t == nil {
2482
_, err := w.Write(cbg.CborNull)
2483
return err
···
2486
cw := cbg.NewCborWriter(w)
2487
fieldCount := 3
2488
2489
-
if t.State == nil {
2490
fieldCount--
2491
}
2492
···
2529
return err
2530
}
2531
2532
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull.state"))); err != nil {
2533
return err
2534
}
2535
-
if _, err := cw.WriteString(string("sh.tangled.repo.pull.state")); err != nil {
2536
return err
2537
}
2538
2539
-
// t.State (string) (string)
2540
-
if t.State != nil {
2541
2542
-
if len("state") > 1000000 {
2543
-
return xerrors.Errorf("Value in field \"state\" was too long")
2544
}
2545
2546
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("state"))); err != nil {
2547
return err
2548
}
2549
-
if _, err := cw.WriteString(string("state")); err != nil {
2550
return err
2551
}
2552
2553
-
if t.State == nil {
2554
if _, err := cw.Write(cbg.CborNull); err != nil {
2555
return err
2556
}
2557
} else {
2558
-
if len(*t.State) > 1000000 {
2559
-
return xerrors.Errorf("Value in field t.State was too long")
2560
}
2561
2562
-
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.State))); err != nil {
2563
return err
2564
}
2565
-
if _, err := cw.WriteString(string(*t.State)); err != nil {
2566
return err
2567
}
2568
}
···
2570
return nil
2571
}
2572
2573
-
func (t *RepoPullState) UnmarshalCBOR(r io.Reader) (err error) {
2574
-
*t = RepoPullState{}
2575
2576
cr := cbg.NewCborReader(r)
2577
···
2590
}
2591
2592
if extra > cbg.MaxLength {
2593
-
return fmt.Errorf("RepoPullState: map struct too large (%d)", extra)
2594
}
2595
2596
n := extra
2597
2598
-
nameBuf := make([]byte, 5)
2599
for i := uint64(0); i < n; i++ {
2600
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
2601
if err != nil {
···
2633
2634
t.LexiconTypeID = string(sval)
2635
}
2636
-
// t.State (string) (string)
2637
-
case "state":
2638
2639
{
2640
b, err := cr.ReadByte()
···
2651
return err
2652
}
2653
2654
-
t.State = (*string)(&sval)
2655
}
2656
}
2657
···
2059
2060
return nil
2061
}
2062
+
func (t *RepoPull) MarshalCBOR(w io.Writer) error {
2063
if t == nil {
2064
_, err := w.Write(cbg.CborNull)
2065
return err
2066
}
2067
2068
cw := cbg.NewCborWriter(w)
2069
+
fieldCount := 9
2070
2071
if t.Body == nil {
2072
fieldCount--
···
2128
return err
2129
}
2130
2131
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull"))); err != nil {
2132
return err
2133
}
2134
+
if _, err := cw.WriteString(string("sh.tangled.repo.pull")); err != nil {
2135
return err
2136
}
2137
···
2289
if _, err := cw.WriteString(string(t.TargetRepo)); err != nil {
2290
return err
2291
}
2292
+
2293
+
// t.TargetBranch (string) (string)
2294
+
if len("targetBranch") > 1000000 {
2295
+
return xerrors.Errorf("Value in field \"targetBranch\" was too long")
2296
+
}
2297
+
2298
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("targetBranch"))); err != nil {
2299
+
return err
2300
+
}
2301
+
if _, err := cw.WriteString(string("targetBranch")); err != nil {
2302
+
return err
2303
+
}
2304
+
2305
+
if len(t.TargetBranch) > 1000000 {
2306
+
return xerrors.Errorf("Value in field t.TargetBranch was too long")
2307
+
}
2308
+
2309
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.TargetBranch))); err != nil {
2310
+
return err
2311
+
}
2312
+
if _, err := cw.WriteString(string(t.TargetBranch)); err != nil {
2313
+
return err
2314
+
}
2315
return nil
2316
}
2317
2318
+
func (t *RepoPull) UnmarshalCBOR(r io.Reader) (err error) {
2319
+
*t = RepoPull{}
2320
2321
cr := cbg.NewCborReader(r)
2322
···
2335
}
2336
2337
if extra > cbg.MaxLength {
2338
+
return fmt.Errorf("RepoPull: map struct too large (%d)", extra)
2339
}
2340
2341
n := extra
2342
2343
+
nameBuf := make([]byte, 12)
2344
for i := uint64(0); i < n; i++ {
2345
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
2346
if err != nil {
···
2489
2490
t.TargetRepo = string(sval)
2491
}
2492
+
// t.TargetBranch (string) (string)
2493
+
case "targetBranch":
2494
+
2495
+
{
2496
+
sval, err := cbg.ReadStringWithMax(cr, 1000000)
2497
+
if err != nil {
2498
+
return err
2499
+
}
2500
+
2501
+
t.TargetBranch = string(sval)
2502
+
}
2503
2504
default:
2505
// Field doesn't exist on this type, so ignore it
···
2511
2512
return nil
2513
}
2514
+
func (t *RepoPullStatus) MarshalCBOR(w io.Writer) error {
2515
if t == nil {
2516
_, err := w.Write(cbg.CborNull)
2517
return err
···
2520
cw := cbg.NewCborWriter(w)
2521
fieldCount := 3
2522
2523
+
if t.Status == nil {
2524
fieldCount--
2525
}
2526
···
2563
return err
2564
}
2565
2566
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.repo.pull.status"))); err != nil {
2567
return err
2568
}
2569
+
if _, err := cw.WriteString(string("sh.tangled.repo.pull.status")); err != nil {
2570
return err
2571
}
2572
2573
+
// t.Status (string) (string)
2574
+
if t.Status != nil {
2575
2576
+
if len("status") > 1000000 {
2577
+
return xerrors.Errorf("Value in field \"status\" was too long")
2578
}
2579
2580
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil {
2581
return err
2582
}
2583
+
if _, err := cw.WriteString(string("status")); err != nil {
2584
return err
2585
}
2586
2587
+
if t.Status == nil {
2588
if _, err := cw.Write(cbg.CborNull); err != nil {
2589
return err
2590
}
2591
} else {
2592
+
if len(*t.Status) > 1000000 {
2593
+
return xerrors.Errorf("Value in field t.Status was too long")
2594
}
2595
2596
+
if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Status))); err != nil {
2597
return err
2598
}
2599
+
if _, err := cw.WriteString(string(*t.Status)); err != nil {
2600
return err
2601
}
2602
}
···
2604
return nil
2605
}
2606
2607
+
func (t *RepoPullStatus) UnmarshalCBOR(r io.Reader) (err error) {
2608
+
*t = RepoPullStatus{}
2609
2610
cr := cbg.NewCborReader(r)
2611
···
2624
}
2625
2626
if extra > cbg.MaxLength {
2627
+
return fmt.Errorf("RepoPullStatus: map struct too large (%d)", extra)
2628
}
2629
2630
n := extra
2631
2632
+
nameBuf := make([]byte, 6)
2633
for i := uint64(0); i < n; i++ {
2634
nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000)
2635
if err != nil {
···
2667
2668
t.LexiconTypeID = string(sval)
2669
}
2670
+
// t.Status (string) (string)
2671
+
case "status":
2672
2673
{
2674
b, err := cr.ReadByte()
···
2685
return err
2686
}
2687
2688
+
t.Status = (*string)(&sval)
2689
}
2690
}
2691
+2
-2
api/tangled/pullcomment.go
+2
-2
api/tangled/pullcomment.go
···
5
// schema: sh.tangled.repo.pull.comment
6
7
import (
8
-
//"github.com/bluesky-social/indigo/lex/util"
9
)
10
11
const (
···
13
)
14
15
func init() {
16
-
//util.RegisterType("sh.tangled.repo.pull.comment", &RepoPullComment{})
17
} //
18
// RECORDTYPE: RepoPullComment
19
type RepoPullComment struct {
···
5
// schema: sh.tangled.repo.pull.comment
6
7
import (
8
+
"github.com/bluesky-social/indigo/lex/util"
9
)
10
11
const (
···
13
)
14
15
func init() {
16
+
util.RegisterType("sh.tangled.repo.pull.comment", &RepoPullComment{})
17
} //
18
// RECORDTYPE: RepoPullComment
19
type RepoPullComment struct {
+7
-6
api/tangled/pullpatch.go
api/tangled/repopull.go
+7
-6
api/tangled/pullpatch.go
api/tangled/repopull.go
···
2
3
package tangled
4
5
-
// schema: sh.tangled.repo.pull.patch
6
7
import (
8
"github.com/bluesky-social/indigo/lex/util"
9
)
10
11
const (
12
-
RepoPullPatchNSID = "sh.tangled.repo.pull.patch"
13
)
14
15
func init() {
16
-
util.RegisterType("sh.tangled.repo.pull.patch", &RepoPullPatch{})
17
} //
18
-
// RECORDTYPE: RepoPullPatch
19
-
type RepoPullPatch struct {
20
-
LexiconTypeID string `json:"$type,const=sh.tangled.repo.pull.patch" cborgen:"$type,const=sh.tangled.repo.pull.patch"`
21
Body *string `json:"body,omitempty" cborgen:"body,omitempty"`
22
CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"`
23
Patch string `json:"patch" cborgen:"patch"`
24
PullId int64 `json:"pullId" cborgen:"pullId"`
25
SourceRepo *string `json:"sourceRepo,omitempty" cborgen:"sourceRepo,omitempty"`
26
TargetRepo string `json:"targetRepo" cborgen:"targetRepo"`
27
Title string `json:"title" cborgen:"title"`
28
}
···
2
3
package tangled
4
5
+
// schema: sh.tangled.repo.pull
6
7
import (
8
"github.com/bluesky-social/indigo/lex/util"
9
)
10
11
const (
12
+
RepoPullNSID = "sh.tangled.repo.pull"
13
)
14
15
func init() {
16
+
util.RegisterType("sh.tangled.repo.pull", &RepoPull{})
17
} //
18
+
// RECORDTYPE: RepoPull
19
+
type RepoPull struct {
20
+
LexiconTypeID string `json:"$type,const=sh.tangled.repo.pull" cborgen:"$type,const=sh.tangled.repo.pull"`
21
Body *string `json:"body,omitempty" cborgen:"body,omitempty"`
22
CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"`
23
Patch string `json:"patch" cborgen:"patch"`
24
PullId int64 `json:"pullId" cborgen:"pullId"`
25
SourceRepo *string `json:"sourceRepo,omitempty" cborgen:"sourceRepo,omitempty"`
26
+
TargetBranch string `json:"targetBranch" cborgen:"targetBranch"`
27
TargetRepo string `json:"targetRepo" cborgen:"targetRepo"`
28
Title string `json:"title" cborgen:"title"`
29
}
-24
api/tangled/pullstate.go
-24
api/tangled/pullstate.go
···
1
-
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
-
3
-
package tangled
4
-
5
-
// schema: sh.tangled.repo.pull.state
6
-
7
-
import (
8
-
//"github.com/bluesky-social/indigo/lex/util"
9
-
)
10
-
11
-
const (
12
-
RepoPullStateNSID = "sh.tangled.repo.pull.state"
13
-
)
14
-
15
-
func init() {
16
-
//util.RegisterType("sh.tangled.repo.pull.state", &RepoPullState{})
17
-
} //
18
-
// RECORDTYPE: RepoPullState
19
-
type RepoPullState struct {
20
-
LexiconTypeID string `json:"$type,const=sh.tangled.repo.pull.state" cborgen:"$type,const=sh.tangled.repo.pull.state"`
21
-
Pull string `json:"pull" cborgen:"pull"`
22
-
// state: state of the pull request
23
-
State *string `json:"state,omitempty" cborgen:"state,omitempty"`
24
-
}
···
+24
api/tangled/pullstatus.go
+24
api/tangled/pullstatus.go
···
···
1
+
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
+
3
+
package tangled
4
+
5
+
// schema: sh.tangled.repo.pull.status
6
+
7
+
import (
8
+
"github.com/bluesky-social/indigo/lex/util"
9
+
)
10
+
11
+
const (
12
+
RepoPullStatusNSID = "sh.tangled.repo.pull.status"
13
+
)
14
+
15
+
func init() {
16
+
util.RegisterType("sh.tangled.repo.pull.status", &RepoPullStatus{})
17
+
} //
18
+
// RECORDTYPE: RepoPullStatus
19
+
type RepoPullStatus struct {
20
+
LexiconTypeID string `json:"$type,const=sh.tangled.repo.pull.status" cborgen:"$type,const=sh.tangled.repo.pull.status"`
21
+
Pull string `json:"pull" cborgen:"pull"`
22
+
// status: status of the pull request
23
+
Status *string `json:"status,omitempty" cborgen:"status,omitempty"`
24
+
}
+2
-2
api/tangled/stateclosed.go
+2
-2
api/tangled/stateclosed.go
-9
api/tangled/statemerged.go
-9
api/tangled/statemerged.go
+2
-2
api/tangled/stateopen.go
+2
-2
api/tangled/stateopen.go
+9
api/tangled/statusclosed.go
+9
api/tangled/statusclosed.go
+9
api/tangled/statusmerged.go
+9
api/tangled/statusmerged.go
+9
api/tangled/statusopen.go
+9
api/tangled/statusopen.go
+1
-1
lexicons/pulls/closed.json
+1
-1
lexicons/pulls/closed.json
+1
-1
lexicons/pulls/merged.json
+1
-1
lexicons/pulls/merged.json
+1
-1
lexicons/pulls/open.json
+1
-1
lexicons/pulls/open.json
+5
-2
lexicons/pulls/patch.json
lexicons/pulls/pull.json
+5
-2
lexicons/pulls/patch.json
lexicons/pulls/pull.json
···
1
{
2
"lexicon": 1,
3
-
"id": "sh.tangled.repo.pull.patch",
4
"needsCbor": true,
5
"needsType": true,
6
"defs": {
···
9
"key": "tid",
10
"record": {
11
"type": "object",
12
-
"required": ["targetRepo", "pullId", "title", "patch"],
13
"properties": {
14
"targetRepo": {
15
"type": "string",
16
"format": "at-uri"
17
},
18
"sourceRepo": {
19
"type": "string",
···
1
{
2
"lexicon": 1,
3
+
"id": "sh.tangled.repo.pull",
4
"needsCbor": true,
5
"needsType": true,
6
"defs": {
···
9
"key": "tid",
10
"record": {
11
"type": "object",
12
+
"required": ["targetRepo", "targetBranch", "pullId", "title", "patch"],
13
"properties": {
14
"targetRepo": {
15
"type": "string",
16
"format": "at-uri"
17
+
},
18
+
"targetBranch": {
19
+
"type": "string"
20
},
21
"sourceRepo": {
22
"type": "string",
+7
-7
lexicons/pulls/state.json
+7
-7
lexicons/pulls/state.json
···
1
{
2
"lexicon": 1,
3
-
"id": "sh.tangled.repo.pull.state",
4
"needsCbor": true,
5
"needsType": true,
6
"defs": {
···
15
"type": "string",
16
"format": "at-uri"
17
},
18
-
"state": {
19
"type": "string",
20
-
"description": "state of the pull request",
21
"knownValues": [
22
-
"sh.tangled.repo.pull.state.open",
23
-
"sh.tangled.repo.pull.state.closed",
24
-
"sh.tangled.repo.pull.state.merged"
25
],
26
-
"default": "sh.tangled.repo.pull.state.open"
27
}
28
}
29
}
···
1
{
2
"lexicon": 1,
3
+
"id": "sh.tangled.repo.pull.status",
4
"needsCbor": true,
5
"needsType": true,
6
"defs": {
···
15
"type": "string",
16
"format": "at-uri"
17
},
18
+
"status": {
19
"type": "string",
20
+
"description": "status of the pull request",
21
"knownValues": [
22
+
"sh.tangled.repo.pull.status.open",
23
+
"sh.tangled.repo.pull.status.closed",
24
+
"sh.tangled.repo.pull.status.merged"
25
],
26
+
"default": "sh.tangled.repo.pull.status.open"
27
}
28
}
29
}