Monorepo for Tangled

[WIP] lexicons, api/tangled: add repoDid field to all repo-scoped lexicons

+1021 -175
+2 -1
api/tangled/actorprofile.go
··· 28 28 // location: Free-form location text. 29 29 Location *string `json:"location,omitempty" cborgen:"location,omitempty"` 30 30 // pinnedRepositories: Any ATURI, it is up to appviews to validate these fields. 31 - PinnedRepositories []string `json:"pinnedRepositories,omitempty" cborgen:"pinnedRepositories,omitempty"` 31 + PinnedRepositories []string `json:"pinnedRepositories,omitempty" cborgen:"pinnedRepositories,omitempty"` 32 + PinnedRepositoryDids []string `json:"pinnedRepositoryDids,omitempty" cborgen:"pinnedRepositoryDids,omitempty"` 32 33 // pronouns: Preferred gender pronouns. 33 34 Pronouns *string `json:"pronouns,omitempty" cborgen:"pronouns,omitempty"` 34 35 Stats []string `json:"stats,omitempty" cborgen:"stats,omitempty"`
+902 -143
api/tangled/cbor_gen.go
··· 26 26 } 27 27 28 28 cw := cbg.NewCborWriter(w) 29 - fieldCount := 9 29 + fieldCount := 10 30 30 31 31 if t.Avatar == nil { 32 32 fieldCount-- ··· 45 45 } 46 46 47 47 if t.PinnedRepositories == nil { 48 + fieldCount-- 49 + } 50 + 51 + if t.PinnedRepositoryDids == nil { 48 52 fieldCount-- 49 53 } 50 54 ··· 317 321 318 322 } 319 323 } 324 + 325 + // t.PinnedRepositoryDids ([]string) (slice) 326 + if t.PinnedRepositoryDids != nil { 327 + 328 + if len("pinnedRepositoryDids") > 1000000 { 329 + return xerrors.Errorf("Value in field \"pinnedRepositoryDids\" was too long") 330 + } 331 + 332 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("pinnedRepositoryDids"))); err != nil { 333 + return err 334 + } 335 + if _, err := cw.WriteString(string("pinnedRepositoryDids")); err != nil { 336 + return err 337 + } 338 + 339 + if len(t.PinnedRepositoryDids) > 8192 { 340 + return xerrors.Errorf("Slice value in field t.PinnedRepositoryDids was too long") 341 + } 342 + 343 + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.PinnedRepositoryDids))); err != nil { 344 + return err 345 + } 346 + for _, v := range t.PinnedRepositoryDids { 347 + if len(v) > 1000000 { 348 + return xerrors.Errorf("Value in field v was too long") 349 + } 350 + 351 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(v))); err != nil { 352 + return err 353 + } 354 + if _, err := cw.WriteString(string(v)); err != nil { 355 + return err 356 + } 357 + 358 + } 359 + } 320 360 return nil 321 361 } 322 362 ··· 345 385 346 386 n := extra 347 387 348 - nameBuf := make([]byte, 18) 388 + nameBuf := make([]byte, 20) 349 389 for i := uint64(0); i < n; i++ { 350 390 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 351 391 if err != nil { ··· 593 633 594 634 } 595 635 } 636 + // t.PinnedRepositoryDids ([]string) (slice) 637 + case "pinnedRepositoryDids": 638 + 639 + maj, extra, err = cr.ReadHeader() 640 + if err != nil { 641 + return err 642 + } 643 + 644 + if extra > 8192 { 645 + return fmt.Errorf("t.PinnedRepositoryDids: array too large (%d)", extra) 646 + } 647 + 648 + if maj != cbg.MajArray { 649 + return fmt.Errorf("expected cbor array") 650 + } 651 + 652 + if extra > 0 { 653 + t.PinnedRepositoryDids = make([]string, extra) 654 + } 655 + 656 + for i := 0; i < int(extra); i++ { 657 + { 658 + var maj byte 659 + var extra uint64 660 + var err error 661 + _ = maj 662 + _ = extra 663 + _ = err 664 + 665 + { 666 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 667 + if err != nil { 668 + return err 669 + } 670 + 671 + t.PinnedRepositoryDids[i] = string(sval) 672 + } 673 + 674 + } 675 + } 596 676 597 677 default: 598 678 // Field doesn't exist on this type, so ignore it ··· 809 889 } 810 890 811 891 cw := cbg.NewCborWriter(w) 892 + fieldCount := 4 812 893 813 - if _, err := cw.Write([]byte{163}); err != nil { 894 + if t.Subject == nil { 895 + fieldCount-- 896 + } 897 + 898 + if t.SubjectDid == nil { 899 + fieldCount-- 900 + } 901 + 902 + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 814 903 return err 815 904 } 816 905 ··· 834 923 } 835 924 836 925 // t.Subject (string) (string) 837 - if len("subject") > 1000000 { 838 - return xerrors.Errorf("Value in field \"subject\" was too long") 839 - } 926 + if t.Subject != nil { 840 927 841 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil { 842 - return err 843 - } 844 - if _, err := cw.WriteString(string("subject")); err != nil { 845 - return err 846 - } 928 + if len("subject") > 1000000 { 929 + return xerrors.Errorf("Value in field \"subject\" was too long") 930 + } 847 931 848 - if len(t.Subject) > 1000000 { 849 - return xerrors.Errorf("Value in field t.Subject was too long") 850 - } 932 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil { 933 + return err 934 + } 935 + if _, err := cw.WriteString(string("subject")); err != nil { 936 + return err 937 + } 938 + 939 + if t.Subject == nil { 940 + if _, err := cw.Write(cbg.CborNull); err != nil { 941 + return err 942 + } 943 + } else { 944 + if len(*t.Subject) > 1000000 { 945 + return xerrors.Errorf("Value in field t.Subject was too long") 946 + } 851 947 852 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Subject))); err != nil { 853 - return err 854 - } 855 - if _, err := cw.WriteString(string(t.Subject)); err != nil { 856 - return err 948 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Subject))); err != nil { 949 + return err 950 + } 951 + if _, err := cw.WriteString(string(*t.Subject)); err != nil { 952 + return err 953 + } 954 + } 857 955 } 858 956 859 957 // t.CreatedAt (string) (string) ··· 878 976 if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { 879 977 return err 880 978 } 979 + 980 + // t.SubjectDid (string) (string) 981 + if t.SubjectDid != nil { 982 + 983 + if len("subjectDid") > 1000000 { 984 + return xerrors.Errorf("Value in field \"subjectDid\" was too long") 985 + } 986 + 987 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subjectDid"))); err != nil { 988 + return err 989 + } 990 + if _, err := cw.WriteString(string("subjectDid")); err != nil { 991 + return err 992 + } 993 + 994 + if t.SubjectDid == nil { 995 + if _, err := cw.Write(cbg.CborNull); err != nil { 996 + return err 997 + } 998 + } else { 999 + if len(*t.SubjectDid) > 1000000 { 1000 + return xerrors.Errorf("Value in field t.SubjectDid was too long") 1001 + } 1002 + 1003 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.SubjectDid))); err != nil { 1004 + return err 1005 + } 1006 + if _, err := cw.WriteString(string(*t.SubjectDid)); err != nil { 1007 + return err 1008 + } 1009 + } 1010 + } 881 1011 return nil 882 1012 } 883 1013 ··· 906 1036 907 1037 n := extra 908 1038 909 - nameBuf := make([]byte, 9) 1039 + nameBuf := make([]byte, 10) 910 1040 for i := uint64(0); i < n; i++ { 911 1041 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 912 1042 if err != nil { ··· 937 1067 case "subject": 938 1068 939 1069 { 940 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 1070 + b, err := cr.ReadByte() 941 1071 if err != nil { 942 1072 return err 943 1073 } 1074 + if b != cbg.CborNull[0] { 1075 + if err := cr.UnreadByte(); err != nil { 1076 + return err 1077 + } 944 1078 945 - t.Subject = string(sval) 1079 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 1080 + if err != nil { 1081 + return err 1082 + } 1083 + 1084 + t.Subject = (*string)(&sval) 1085 + } 946 1086 } 947 1087 // t.CreatedAt (string) (string) 948 1088 case "createdAt": ··· 955 1095 956 1096 t.CreatedAt = string(sval) 957 1097 } 1098 + // t.SubjectDid (string) (string) 1099 + case "subjectDid": 1100 + 1101 + { 1102 + b, err := cr.ReadByte() 1103 + if err != nil { 1104 + return err 1105 + } 1106 + if b != cbg.CborNull[0] { 1107 + if err := cr.UnreadByte(); err != nil { 1108 + return err 1109 + } 1110 + 1111 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 1112 + if err != nil { 1113 + return err 1114 + } 1115 + 1116 + t.SubjectDid = (*string)(&sval) 1117 + } 1118 + } 958 1119 959 1120 default: 960 1121 // Field doesn't exist on this type, so ignore it ··· 973 1134 } 974 1135 975 1136 cw := cbg.NewCborWriter(w) 1137 + fieldCount := 9 976 1138 977 - if _, err := cw.Write([]byte{168}); err != nil { 1139 + if t.OwnerDid == nil { 1140 + fieldCount-- 1141 + } 1142 + 1143 + if t.RepoDid == nil { 1144 + fieldCount-- 1145 + } 1146 + 1147 + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 978 1148 return err 979 1149 } 980 1150 ··· 1083 1253 } 1084 1254 1085 1255 // t.RepoDid (string) (string) 1086 - if len("repoDid") > 1000000 { 1087 - return xerrors.Errorf("Value in field \"repoDid\" was too long") 1256 + if t.RepoDid != nil { 1257 + 1258 + if len("repoDid") > 1000000 { 1259 + return xerrors.Errorf("Value in field \"repoDid\" was too long") 1260 + } 1261 + 1262 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil { 1263 + return err 1264 + } 1265 + if _, err := cw.WriteString(string("repoDid")); err != nil { 1266 + return err 1267 + } 1268 + 1269 + if t.RepoDid == nil { 1270 + if _, err := cw.Write(cbg.CborNull); err != nil { 1271 + return err 1272 + } 1273 + } else { 1274 + if len(*t.RepoDid) > 1000000 { 1275 + return xerrors.Errorf("Value in field t.RepoDid was too long") 1276 + } 1277 + 1278 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.RepoDid))); err != nil { 1279 + return err 1280 + } 1281 + if _, err := cw.WriteString(string(*t.RepoDid)); err != nil { 1282 + return err 1283 + } 1284 + } 1088 1285 } 1089 1286 1090 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil { 1091 - return err 1092 - } 1093 - if _, err := cw.WriteString(string("repoDid")); err != nil { 1094 - return err 1095 - } 1287 + // t.OwnerDid (string) (string) 1288 + if t.OwnerDid != nil { 1096 1289 1097 - if len(t.RepoDid) > 1000000 { 1098 - return xerrors.Errorf("Value in field t.RepoDid was too long") 1099 - } 1290 + if len("ownerDid") > 1000000 { 1291 + return xerrors.Errorf("Value in field \"ownerDid\" was too long") 1292 + } 1100 1293 1101 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RepoDid))); err != nil { 1102 - return err 1103 - } 1104 - if _, err := cw.WriteString(string(t.RepoDid)); err != nil { 1105 - return err 1294 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("ownerDid"))); err != nil { 1295 + return err 1296 + } 1297 + if _, err := cw.WriteString(string("ownerDid")); err != nil { 1298 + return err 1299 + } 1300 + 1301 + if t.OwnerDid == nil { 1302 + if _, err := cw.Write(cbg.CborNull); err != nil { 1303 + return err 1304 + } 1305 + } else { 1306 + if len(*t.OwnerDid) > 1000000 { 1307 + return xerrors.Errorf("Value in field t.OwnerDid was too long") 1308 + } 1309 + 1310 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.OwnerDid))); err != nil { 1311 + return err 1312 + } 1313 + if _, err := cw.WriteString(string(*t.OwnerDid)); err != nil { 1314 + return err 1315 + } 1316 + } 1106 1317 } 1107 1318 1108 1319 // t.RepoName (string) (string) ··· 1262 1473 case "repoDid": 1263 1474 1264 1475 { 1265 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 1476 + b, err := cr.ReadByte() 1477 + if err != nil { 1478 + return err 1479 + } 1480 + if b != cbg.CborNull[0] { 1481 + if err := cr.UnreadByte(); err != nil { 1482 + return err 1483 + } 1484 + 1485 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 1486 + if err != nil { 1487 + return err 1488 + } 1489 + 1490 + t.RepoDid = (*string)(&sval) 1491 + } 1492 + } 1493 + // t.OwnerDid (string) (string) 1494 + case "ownerDid": 1495 + 1496 + { 1497 + b, err := cr.ReadByte() 1266 1498 if err != nil { 1267 1499 return err 1268 1500 } 1501 + if b != cbg.CborNull[0] { 1502 + if err := cr.UnreadByte(); err != nil { 1503 + return err 1504 + } 1269 1505 1270 - t.RepoDid = string(sval) 1506 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 1507 + if err != nil { 1508 + return err 1509 + } 1510 + 1511 + t.OwnerDid = (*string)(&sval) 1512 + } 1271 1513 } 1272 1514 // t.RepoName (string) (string) 1273 1515 case "repoName": ··· 5302 5544 } 5303 5545 5304 5546 cw := cbg.NewCborWriter(w) 5547 + fieldCount := 5 5305 5548 5306 - if _, err := cw.Write([]byte{164}); err != nil { 5549 + if t.Repo == nil { 5550 + fieldCount-- 5551 + } 5552 + 5553 + if t.RepoDid == nil { 5554 + fieldCount-- 5555 + } 5556 + 5557 + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 5307 5558 return err 5308 5559 } 5309 5560 ··· 5354 5605 } 5355 5606 5356 5607 // t.Repo (string) (string) 5357 - if len("repo") > 1000000 { 5358 - return xerrors.Errorf("Value in field \"repo\" was too long") 5608 + if t.Repo != nil { 5609 + 5610 + if len("repo") > 1000000 { 5611 + return xerrors.Errorf("Value in field \"repo\" was too long") 5612 + } 5613 + 5614 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 5615 + return err 5616 + } 5617 + if _, err := cw.WriteString(string("repo")); err != nil { 5618 + return err 5619 + } 5620 + 5621 + if t.Repo == nil { 5622 + if _, err := cw.Write(cbg.CborNull); err != nil { 5623 + return err 5624 + } 5625 + } else { 5626 + if len(*t.Repo) > 1000000 { 5627 + return xerrors.Errorf("Value in field t.Repo was too long") 5628 + } 5629 + 5630 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Repo))); err != nil { 5631 + return err 5632 + } 5633 + if _, err := cw.WriteString(string(*t.Repo)); err != nil { 5634 + return err 5635 + } 5636 + } 5359 5637 } 5360 5638 5361 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 5362 - return err 5363 - } 5364 - if _, err := cw.WriteString(string("repo")); err != nil { 5365 - return err 5366 - } 5639 + // t.RepoDid (string) (string) 5640 + if t.RepoDid != nil { 5641 + 5642 + if len("repoDid") > 1000000 { 5643 + return xerrors.Errorf("Value in field \"repoDid\" was too long") 5644 + } 5645 + 5646 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil { 5647 + return err 5648 + } 5649 + if _, err := cw.WriteString(string("repoDid")); err != nil { 5650 + return err 5651 + } 5367 5652 5368 - if len(t.Repo) > 1000000 { 5369 - return xerrors.Errorf("Value in field t.Repo was too long") 5370 - } 5653 + if t.RepoDid == nil { 5654 + if _, err := cw.Write(cbg.CborNull); err != nil { 5655 + return err 5656 + } 5657 + } else { 5658 + if len(*t.RepoDid) > 1000000 { 5659 + return xerrors.Errorf("Value in field t.RepoDid was too long") 5660 + } 5371 5661 5372 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil { 5373 - return err 5374 - } 5375 - if _, err := cw.WriteString(string(t.Repo)); err != nil { 5376 - return err 5662 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.RepoDid))); err != nil { 5663 + return err 5664 + } 5665 + if _, err := cw.WriteString(string(*t.RepoDid)); err != nil { 5666 + return err 5667 + } 5668 + } 5377 5669 } 5378 5670 5379 5671 // t.DefaultBranch (string) (string) ··· 5468 5760 case "repo": 5469 5761 5470 5762 { 5471 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 5763 + b, err := cr.ReadByte() 5764 + if err != nil { 5765 + return err 5766 + } 5767 + if b != cbg.CborNull[0] { 5768 + if err := cr.UnreadByte(); err != nil { 5769 + return err 5770 + } 5771 + 5772 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 5773 + if err != nil { 5774 + return err 5775 + } 5776 + 5777 + t.Repo = (*string)(&sval) 5778 + } 5779 + } 5780 + // t.RepoDid (string) (string) 5781 + case "repoDid": 5782 + 5783 + { 5784 + b, err := cr.ReadByte() 5472 5785 if err != nil { 5473 5786 return err 5474 5787 } 5788 + if b != cbg.CborNull[0] { 5789 + if err := cr.UnreadByte(); err != nil { 5790 + return err 5791 + } 5475 5792 5476 - t.Repo = string(sval) 5793 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 5794 + if err != nil { 5795 + return err 5796 + } 5797 + 5798 + t.RepoDid = (*string)(&sval) 5799 + } 5477 5800 } 5478 5801 // t.DefaultBranch (string) (string) 5479 5802 case "defaultBranch": ··· 5906 6229 } 5907 6230 5908 6231 cw := cbg.NewCborWriter(w) 5909 - fieldCount := 10 6232 + fieldCount := 11 5910 6233 5911 6234 if t.Description == nil { 5912 6235 fieldCount-- 5913 6236 } 5914 6237 5915 6238 if t.Labels == nil { 6239 + fieldCount-- 6240 + } 6241 + 6242 + if t.RepoDid == nil { 5916 6243 fieldCount-- 5917 6244 } 5918 6245 ··· 6105 6432 } 6106 6433 } 6107 6434 6435 + // t.RepoDid (string) (string) 6436 + if t.RepoDid != nil { 6437 + 6438 + if len("repoDid") > 1000000 { 6439 + return xerrors.Errorf("Value in field \"repoDid\" was too long") 6440 + } 6441 + 6442 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil { 6443 + return err 6444 + } 6445 + if _, err := cw.WriteString(string("repoDid")); err != nil { 6446 + return err 6447 + } 6448 + 6449 + if t.RepoDid == nil { 6450 + if _, err := cw.Write(cbg.CborNull); err != nil { 6451 + return err 6452 + } 6453 + } else { 6454 + if len(*t.RepoDid) > 1000000 { 6455 + return xerrors.Errorf("Value in field t.RepoDid was too long") 6456 + } 6457 + 6458 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.RepoDid))); err != nil { 6459 + return err 6460 + } 6461 + if _, err := cw.WriteString(string(*t.RepoDid)); err != nil { 6462 + return err 6463 + } 6464 + } 6465 + } 6466 + 6108 6467 // t.Spindle (string) (string) 6109 6468 if t.Spindle != nil { 6110 6469 ··· 6401 6760 6402 6761 } 6403 6762 } 6763 + // t.RepoDid (string) (string) 6764 + case "repoDid": 6765 + 6766 + { 6767 + b, err := cr.ReadByte() 6768 + if err != nil { 6769 + return err 6770 + } 6771 + if b != cbg.CborNull[0] { 6772 + if err := cr.UnreadByte(); err != nil { 6773 + return err 6774 + } 6775 + 6776 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 6777 + if err != nil { 6778 + return err 6779 + } 6780 + 6781 + t.RepoDid = (*string)(&sval) 6782 + } 6783 + } 6404 6784 // t.Spindle (string) (string) 6405 6785 case "spindle": 6406 6786 ··· 6493 6873 } 6494 6874 6495 6875 cw := cbg.NewCborWriter(w) 6496 - fieldCount := 6 6876 + fieldCount := 7 6877 + 6878 + if t.Repo == nil { 6879 + fieldCount-- 6880 + } 6881 + 6882 + if t.RepoDid == nil { 6883 + fieldCount-- 6884 + } 6497 6885 6498 6886 if t.Tag == nil { 6499 6887 fieldCount-- ··· 6555 6943 } 6556 6944 6557 6945 // t.Repo (string) (string) 6558 - if len("repo") > 1000000 { 6559 - return xerrors.Errorf("Value in field \"repo\" was too long") 6560 - } 6946 + if t.Repo != nil { 6947 + 6948 + if len("repo") > 1000000 { 6949 + return xerrors.Errorf("Value in field \"repo\" was too long") 6950 + } 6561 6951 6562 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 6563 - return err 6564 - } 6565 - if _, err := cw.WriteString(string("repo")); err != nil { 6566 - return err 6567 - } 6952 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 6953 + return err 6954 + } 6955 + if _, err := cw.WriteString(string("repo")); err != nil { 6956 + return err 6957 + } 6568 6958 6569 - if len(t.Repo) > 1000000 { 6570 - return xerrors.Errorf("Value in field t.Repo was too long") 6571 - } 6959 + if t.Repo == nil { 6960 + if _, err := cw.Write(cbg.CborNull); err != nil { 6961 + return err 6962 + } 6963 + } else { 6964 + if len(*t.Repo) > 1000000 { 6965 + return xerrors.Errorf("Value in field t.Repo was too long") 6966 + } 6572 6967 6573 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil { 6574 - return err 6575 - } 6576 - if _, err := cw.WriteString(string(t.Repo)); err != nil { 6577 - return err 6968 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Repo))); err != nil { 6969 + return err 6970 + } 6971 + if _, err := cw.WriteString(string(*t.Repo)); err != nil { 6972 + return err 6973 + } 6974 + } 6578 6975 } 6579 6976 6580 6977 // t.LexiconTypeID (string) (string) ··· 6594 6991 } 6595 6992 if _, err := cw.WriteString(string("sh.tangled.repo.artifact")); err != nil { 6596 6993 return err 6994 + } 6995 + 6996 + // t.RepoDid (string) (string) 6997 + if t.RepoDid != nil { 6998 + 6999 + if len("repoDid") > 1000000 { 7000 + return xerrors.Errorf("Value in field \"repoDid\" was too long") 7001 + } 7002 + 7003 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil { 7004 + return err 7005 + } 7006 + if _, err := cw.WriteString(string("repoDid")); err != nil { 7007 + return err 7008 + } 7009 + 7010 + if t.RepoDid == nil { 7011 + if _, err := cw.Write(cbg.CborNull); err != nil { 7012 + return err 7013 + } 7014 + } else { 7015 + if len(*t.RepoDid) > 1000000 { 7016 + return xerrors.Errorf("Value in field t.RepoDid was too long") 7017 + } 7018 + 7019 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.RepoDid))); err != nil { 7020 + return err 7021 + } 7022 + if _, err := cw.WriteString(string(*t.RepoDid)); err != nil { 7023 + return err 7024 + } 7025 + } 6597 7026 } 6598 7027 6599 7028 // t.Artifact (util.LexBlob) (struct) ··· 6716 7145 case "repo": 6717 7146 6718 7147 { 6719 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 7148 + b, err := cr.ReadByte() 6720 7149 if err != nil { 6721 7150 return err 6722 7151 } 7152 + if b != cbg.CborNull[0] { 7153 + if err := cr.UnreadByte(); err != nil { 7154 + return err 7155 + } 6723 7156 6724 - t.Repo = string(sval) 7157 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 7158 + if err != nil { 7159 + return err 7160 + } 7161 + 7162 + t.Repo = (*string)(&sval) 7163 + } 6725 7164 } 6726 7165 // t.LexiconTypeID (string) (string) 6727 7166 case "$type": ··· 6734 7173 6735 7174 t.LexiconTypeID = string(sval) 6736 7175 } 7176 + // t.RepoDid (string) (string) 7177 + case "repoDid": 7178 + 7179 + { 7180 + b, err := cr.ReadByte() 7181 + if err != nil { 7182 + return err 7183 + } 7184 + if b != cbg.CborNull[0] { 7185 + if err := cr.UnreadByte(); err != nil { 7186 + return err 7187 + } 7188 + 7189 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 7190 + if err != nil { 7191 + return err 7192 + } 7193 + 7194 + t.RepoDid = (*string)(&sval) 7195 + } 7196 + } 6737 7197 // t.Artifact (util.LexBlob) (struct) 6738 7198 case "artifact": 6739 7199 ··· 6783 7243 } 6784 7244 6785 7245 cw := cbg.NewCborWriter(w) 7246 + fieldCount := 5 6786 7247 6787 - if _, err := cw.Write([]byte{164}); err != nil { 6788 - return err 7248 + if t.Repo == nil { 7249 + fieldCount-- 6789 7250 } 6790 7251 6791 - // t.Repo (string) (string) 6792 - if len("repo") > 1000000 { 6793 - return xerrors.Errorf("Value in field \"repo\" was too long") 7252 + if t.RepoDid == nil { 7253 + fieldCount-- 6794 7254 } 6795 7255 6796 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 7256 + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 6797 7257 return err 6798 7258 } 6799 - if _, err := cw.WriteString(string("repo")); err != nil { 6800 - return err 6801 - } 7259 + 7260 + // t.Repo (string) (string) 7261 + if t.Repo != nil { 7262 + 7263 + if len("repo") > 1000000 { 7264 + return xerrors.Errorf("Value in field \"repo\" was too long") 7265 + } 7266 + 7267 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 7268 + return err 7269 + } 7270 + if _, err := cw.WriteString(string("repo")); err != nil { 7271 + return err 7272 + } 6802 7273 6803 - if len(t.Repo) > 1000000 { 6804 - return xerrors.Errorf("Value in field t.Repo was too long") 6805 - } 7274 + if t.Repo == nil { 7275 + if _, err := cw.Write(cbg.CborNull); err != nil { 7276 + return err 7277 + } 7278 + } else { 7279 + if len(*t.Repo) > 1000000 { 7280 + return xerrors.Errorf("Value in field t.Repo was too long") 7281 + } 6806 7282 6807 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil { 6808 - return err 6809 - } 6810 - if _, err := cw.WriteString(string(t.Repo)); err != nil { 6811 - return err 7283 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Repo))); err != nil { 7284 + return err 7285 + } 7286 + if _, err := cw.WriteString(string(*t.Repo)); err != nil { 7287 + return err 7288 + } 7289 + } 6812 7290 } 6813 7291 6814 7292 // t.LexiconTypeID (string) (string) ··· 6830 7308 return err 6831 7309 } 6832 7310 7311 + // t.RepoDid (string) (string) 7312 + if t.RepoDid != nil { 7313 + 7314 + if len("repoDid") > 1000000 { 7315 + return xerrors.Errorf("Value in field \"repoDid\" was too long") 7316 + } 7317 + 7318 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil { 7319 + return err 7320 + } 7321 + if _, err := cw.WriteString(string("repoDid")); err != nil { 7322 + return err 7323 + } 7324 + 7325 + if t.RepoDid == nil { 7326 + if _, err := cw.Write(cbg.CborNull); err != nil { 7327 + return err 7328 + } 7329 + } else { 7330 + if len(*t.RepoDid) > 1000000 { 7331 + return xerrors.Errorf("Value in field t.RepoDid was too long") 7332 + } 7333 + 7334 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.RepoDid))); err != nil { 7335 + return err 7336 + } 7337 + if _, err := cw.WriteString(string(*t.RepoDid)); err != nil { 7338 + return err 7339 + } 7340 + } 7341 + } 7342 + 6833 7343 // t.Subject (string) (string) 6834 7344 if len("subject") > 1000000 { 6835 7345 return xerrors.Errorf("Value in field \"subject\" was too long") ··· 6923 7433 case "repo": 6924 7434 6925 7435 { 6926 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 7436 + b, err := cr.ReadByte() 6927 7437 if err != nil { 6928 7438 return err 6929 7439 } 7440 + if b != cbg.CborNull[0] { 7441 + if err := cr.UnreadByte(); err != nil { 7442 + return err 7443 + } 6930 7444 6931 - t.Repo = string(sval) 7445 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 7446 + if err != nil { 7447 + return err 7448 + } 7449 + 7450 + t.Repo = (*string)(&sval) 7451 + } 6932 7452 } 6933 7453 // t.LexiconTypeID (string) (string) 6934 7454 case "$type": ··· 6941 7461 6942 7462 t.LexiconTypeID = string(sval) 6943 7463 } 7464 + // t.RepoDid (string) (string) 7465 + case "repoDid": 7466 + 7467 + { 7468 + b, err := cr.ReadByte() 7469 + if err != nil { 7470 + return err 7471 + } 7472 + if b != cbg.CborNull[0] { 7473 + if err := cr.UnreadByte(); err != nil { 7474 + return err 7475 + } 7476 + 7477 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 7478 + if err != nil { 7479 + return err 7480 + } 7481 + 7482 + t.RepoDid = (*string)(&sval) 7483 + } 7484 + } 6944 7485 // t.Subject (string) (string) 6945 7486 case "subject": 6946 7487 ··· 6981 7522 } 6982 7523 6983 7524 cw := cbg.NewCborWriter(w) 6984 - fieldCount := 7 7525 + fieldCount := 8 6985 7526 6986 7527 if t.Body == nil { 6987 7528 fieldCount-- ··· 6995 7536 fieldCount-- 6996 7537 } 6997 7538 7539 + if t.Repo == nil { 7540 + fieldCount-- 7541 + } 7542 + 7543 + if t.RepoDid == nil { 7544 + fieldCount-- 7545 + } 7546 + 6998 7547 if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 6999 7548 return err 7000 7549 } ··· 7032 7581 } 7033 7582 7034 7583 // t.Repo (string) (string) 7035 - if len("repo") > 1000000 { 7036 - return xerrors.Errorf("Value in field \"repo\" was too long") 7037 - } 7584 + if t.Repo != nil { 7038 7585 7039 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 7040 - return err 7041 - } 7042 - if _, err := cw.WriteString(string("repo")); err != nil { 7043 - return err 7044 - } 7586 + if len("repo") > 1000000 { 7587 + return xerrors.Errorf("Value in field \"repo\" was too long") 7588 + } 7045 7589 7046 - if len(t.Repo) > 1000000 { 7047 - return xerrors.Errorf("Value in field t.Repo was too long") 7048 - } 7590 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 7591 + return err 7592 + } 7593 + if _, err := cw.WriteString(string("repo")); err != nil { 7594 + return err 7595 + } 7049 7596 7050 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil { 7051 - return err 7052 - } 7053 - if _, err := cw.WriteString(string(t.Repo)); err != nil { 7054 - return err 7597 + if t.Repo == nil { 7598 + if _, err := cw.Write(cbg.CborNull); err != nil { 7599 + return err 7600 + } 7601 + } else { 7602 + if len(*t.Repo) > 1000000 { 7603 + return xerrors.Errorf("Value in field t.Repo was too long") 7604 + } 7605 + 7606 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Repo))); err != nil { 7607 + return err 7608 + } 7609 + if _, err := cw.WriteString(string(*t.Repo)); err != nil { 7610 + return err 7611 + } 7612 + } 7055 7613 } 7056 7614 7057 7615 // t.LexiconTypeID (string) (string) ··· 7094 7652 } 7095 7653 if _, err := cw.WriteString(string(t.Title)); err != nil { 7096 7654 return err 7655 + } 7656 + 7657 + // t.RepoDid (string) (string) 7658 + if t.RepoDid != nil { 7659 + 7660 + if len("repoDid") > 1000000 { 7661 + return xerrors.Errorf("Value in field \"repoDid\" was too long") 7662 + } 7663 + 7664 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil { 7665 + return err 7666 + } 7667 + if _, err := cw.WriteString(string("repoDid")); err != nil { 7668 + return err 7669 + } 7670 + 7671 + if t.RepoDid == nil { 7672 + if _, err := cw.Write(cbg.CborNull); err != nil { 7673 + return err 7674 + } 7675 + } else { 7676 + if len(*t.RepoDid) > 1000000 { 7677 + return xerrors.Errorf("Value in field t.RepoDid was too long") 7678 + } 7679 + 7680 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.RepoDid))); err != nil { 7681 + return err 7682 + } 7683 + if _, err := cw.WriteString(string(*t.RepoDid)); err != nil { 7684 + return err 7685 + } 7686 + } 7097 7687 } 7098 7688 7099 7689 // t.Mentions ([]string) (slice) ··· 7259 7849 case "repo": 7260 7850 7261 7851 { 7262 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 7852 + b, err := cr.ReadByte() 7263 7853 if err != nil { 7264 7854 return err 7265 7855 } 7856 + if b != cbg.CborNull[0] { 7857 + if err := cr.UnreadByte(); err != nil { 7858 + return err 7859 + } 7266 7860 7267 - t.Repo = string(sval) 7861 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 7862 + if err != nil { 7863 + return err 7864 + } 7865 + 7866 + t.Repo = (*string)(&sval) 7867 + } 7268 7868 } 7269 7869 // t.LexiconTypeID (string) (string) 7270 7870 case "$type": ··· 7287 7887 } 7288 7888 7289 7889 t.Title = string(sval) 7890 + } 7891 + // t.RepoDid (string) (string) 7892 + case "repoDid": 7893 + 7894 + { 7895 + b, err := cr.ReadByte() 7896 + if err != nil { 7897 + return err 7898 + } 7899 + if b != cbg.CborNull[0] { 7900 + if err := cr.UnreadByte(); err != nil { 7901 + return err 7902 + } 7903 + 7904 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 7905 + if err != nil { 7906 + return err 7907 + } 7908 + 7909 + t.RepoDid = (*string)(&sval) 7910 + } 7290 7911 } 7291 7912 // t.Mentions ([]string) (slice) 7292 7913 case "mentions": ··· 8890 9511 } 8891 9512 8892 9513 cw := cbg.NewCborWriter(w) 8893 - fieldCount := 3 9514 + fieldCount := 4 8894 9515 8895 9516 if t.Repo == nil { 9517 + fieldCount-- 9518 + } 9519 + 9520 + if t.RepoDid == nil { 8896 9521 fieldCount-- 8897 9522 } 8898 9523 ··· 8977 9602 if _, err := cw.WriteString(string(t.Branch)); err != nil { 8978 9603 return err 8979 9604 } 9605 + 9606 + // t.RepoDid (string) (string) 9607 + if t.RepoDid != nil { 9608 + 9609 + if len("repoDid") > 1000000 { 9610 + return xerrors.Errorf("Value in field \"repoDid\" was too long") 9611 + } 9612 + 9613 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil { 9614 + return err 9615 + } 9616 + if _, err := cw.WriteString(string("repoDid")); err != nil { 9617 + return err 9618 + } 9619 + 9620 + if t.RepoDid == nil { 9621 + if _, err := cw.Write(cbg.CborNull); err != nil { 9622 + return err 9623 + } 9624 + } else { 9625 + if len(*t.RepoDid) > 1000000 { 9626 + return xerrors.Errorf("Value in field t.RepoDid was too long") 9627 + } 9628 + 9629 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.RepoDid))); err != nil { 9630 + return err 9631 + } 9632 + if _, err := cw.WriteString(string(*t.RepoDid)); err != nil { 9633 + return err 9634 + } 9635 + } 9636 + } 8980 9637 return nil 8981 9638 } 8982 9639 ··· 9005 9662 9006 9663 n := extra 9007 9664 9008 - nameBuf := make([]byte, 6) 9665 + nameBuf := make([]byte, 7) 9009 9666 for i := uint64(0); i < n; i++ { 9010 9667 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 9011 9668 if err != nil { ··· 9064 9721 9065 9722 t.Branch = string(sval) 9066 9723 } 9724 + // t.RepoDid (string) (string) 9725 + case "repoDid": 9726 + 9727 + { 9728 + b, err := cr.ReadByte() 9729 + if err != nil { 9730 + return err 9731 + } 9732 + if b != cbg.CborNull[0] { 9733 + if err := cr.UnreadByte(); err != nil { 9734 + return err 9735 + } 9736 + 9737 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 9738 + if err != nil { 9739 + return err 9740 + } 9741 + 9742 + t.RepoDid = (*string)(&sval) 9743 + } 9744 + } 9067 9745 9068 9746 default: 9069 9747 // Field doesn't exist on this type, so ignore it ··· 9246 9924 } 9247 9925 9248 9926 cw := cbg.NewCborWriter(w) 9927 + fieldCount := 3 9249 9928 9250 - if _, err := cw.Write([]byte{162}); err != nil { 9251 - return err 9929 + if t.Repo == nil { 9930 + fieldCount-- 9252 9931 } 9253 9932 9254 - // t.Repo (string) (string) 9255 - if len("repo") > 1000000 { 9256 - return xerrors.Errorf("Value in field \"repo\" was too long") 9933 + if t.RepoDid == nil { 9934 + fieldCount-- 9257 9935 } 9258 9936 9259 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 9260 - return err 9261 - } 9262 - if _, err := cw.WriteString(string("repo")); err != nil { 9937 + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 9263 9938 return err 9264 9939 } 9265 9940 9266 - if len(t.Repo) > 1000000 { 9267 - return xerrors.Errorf("Value in field t.Repo was too long") 9268 - } 9941 + // t.Repo (string) (string) 9942 + if t.Repo != nil { 9943 + 9944 + if len("repo") > 1000000 { 9945 + return xerrors.Errorf("Value in field \"repo\" was too long") 9946 + } 9269 9947 9270 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil { 9271 - return err 9272 - } 9273 - if _, err := cw.WriteString(string(t.Repo)); err != nil { 9274 - return err 9948 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 9949 + return err 9950 + } 9951 + if _, err := cw.WriteString(string("repo")); err != nil { 9952 + return err 9953 + } 9954 + 9955 + if t.Repo == nil { 9956 + if _, err := cw.Write(cbg.CborNull); err != nil { 9957 + return err 9958 + } 9959 + } else { 9960 + if len(*t.Repo) > 1000000 { 9961 + return xerrors.Errorf("Value in field t.Repo was too long") 9962 + } 9963 + 9964 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Repo))); err != nil { 9965 + return err 9966 + } 9967 + if _, err := cw.WriteString(string(*t.Repo)); err != nil { 9968 + return err 9969 + } 9970 + } 9275 9971 } 9276 9972 9277 9973 // t.Branch (string) (string) ··· 9296 9992 if _, err := cw.WriteString(string(t.Branch)); err != nil { 9297 9993 return err 9298 9994 } 9995 + 9996 + // t.RepoDid (string) (string) 9997 + if t.RepoDid != nil { 9998 + 9999 + if len("repoDid") > 1000000 { 10000 + return xerrors.Errorf("Value in field \"repoDid\" was too long") 10001 + } 10002 + 10003 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil { 10004 + return err 10005 + } 10006 + if _, err := cw.WriteString(string("repoDid")); err != nil { 10007 + return err 10008 + } 10009 + 10010 + if t.RepoDid == nil { 10011 + if _, err := cw.Write(cbg.CborNull); err != nil { 10012 + return err 10013 + } 10014 + } else { 10015 + if len(*t.RepoDid) > 1000000 { 10016 + return xerrors.Errorf("Value in field t.RepoDid was too long") 10017 + } 10018 + 10019 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.RepoDid))); err != nil { 10020 + return err 10021 + } 10022 + if _, err := cw.WriteString(string(*t.RepoDid)); err != nil { 10023 + return err 10024 + } 10025 + } 10026 + } 9299 10027 return nil 9300 10028 } 9301 10029 ··· 9324 10052 9325 10053 n := extra 9326 10054 9327 - nameBuf := make([]byte, 6) 10055 + nameBuf := make([]byte, 7) 9328 10056 for i := uint64(0); i < n; i++ { 9329 10057 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 9330 10058 if err != nil { ··· 9344 10072 case "repo": 9345 10073 9346 10074 { 9347 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 10075 + b, err := cr.ReadByte() 9348 10076 if err != nil { 9349 10077 return err 9350 10078 } 10079 + if b != cbg.CborNull[0] { 10080 + if err := cr.UnreadByte(); err != nil { 10081 + return err 10082 + } 9351 10083 9352 - t.Repo = string(sval) 10084 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 10085 + if err != nil { 10086 + return err 10087 + } 10088 + 10089 + t.Repo = (*string)(&sval) 10090 + } 9353 10091 } 9354 10092 // t.Branch (string) (string) 9355 10093 case "branch": ··· 9361 10099 } 9362 10100 9363 10101 t.Branch = string(sval) 10102 + } 10103 + // t.RepoDid (string) (string) 10104 + case "repoDid": 10105 + 10106 + { 10107 + b, err := cr.ReadByte() 10108 + if err != nil { 10109 + return err 10110 + } 10111 + if b != cbg.CborNull[0] { 10112 + if err := cr.UnreadByte(); err != nil { 10113 + return err 10114 + } 10115 + 10116 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 10117 + if err != nil { 10118 + return err 10119 + } 10120 + 10121 + t.RepoDid = (*string)(&sval) 10122 + } 9364 10123 } 9365 10124 9366 10125 default:
+4 -3
api/tangled/feedstar.go
··· 17 17 } // 18 18 // RECORDTYPE: FeedStar 19 19 type FeedStar struct { 20 - LexiconTypeID string `json:"$type,const=sh.tangled.feed.star" cborgen:"$type,const=sh.tangled.feed.star"` 21 - CreatedAt string `json:"createdAt" cborgen:"createdAt"` 22 - Subject string `json:"subject" cborgen:"subject"` 20 + LexiconTypeID string `json:"$type,const=sh.tangled.feed.star" cborgen:"$type,const=sh.tangled.feed.star"` 21 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 22 + Subject *string `json:"subject,omitempty" cborgen:"subject,omitempty"` 23 + SubjectDid *string `json:"subjectDid,omitempty" cborgen:"subjectDid,omitempty"` 23 24 }
+4 -2
api/tangled/gitrefUpdate.go
··· 25 25 NewSha string `json:"newSha" cborgen:"newSha"` 26 26 // oldSha: old SHA of this ref 27 27 OldSha string `json:"oldSha" cborgen:"oldSha"` 28 + // ownerDid: did of the owner of the repo 29 + OwnerDid *string `json:"ownerDid,omitempty" cborgen:"ownerDid,omitempty"` 28 30 // ref: Ref being updated 29 31 Ref string `json:"ref" cborgen:"ref"` 30 - // repoDid: did of the owner of the repo 31 - RepoDid string `json:"repoDid" cborgen:"repoDid"` 32 + // repoDid: DID of the repo itself 33 + RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 32 34 // repoName: name of the repo 33 35 RepoName string `json:"repoName" cborgen:"repoName"` 34 36 }
+2 -1
api/tangled/repoartifact.go
··· 25 25 // name: name of the artifact 26 26 Name string `json:"name" cborgen:"name"` 27 27 // repo: repo that this artifact is being uploaded to 28 - Repo string `json:"repo" cborgen:"repo"` 28 + Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"` 29 + RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 29 30 // tag: hash of the tag object that this artifact is attached to (only annotated tags are supported) 30 31 Tag util.LexBytes `json:"tag,omitempty" cborgen:"tag,omitempty"` 31 32 }
+3 -2
api/tangled/repocollaborator.go
··· 20 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.collaborator" cborgen:"$type,const=sh.tangled.repo.collaborator"` 21 21 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 22 22 // repo: repo to add this user to 23 - Repo string `json:"repo" cborgen:"repo"` 24 - Subject string `json:"subject" cborgen:"subject"` 23 + Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"` 24 + RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 25 + Subject string `json:"subject" cborgen:"subject"` 25 26 }
+14 -4
api/tangled/repocreate.go
··· 18 18 type RepoCreate_Input struct { 19 19 // defaultBranch: Default branch to push to 20 20 DefaultBranch *string `json:"defaultBranch,omitempty" cborgen:"defaultBranch,omitempty"` 21 + // name: Name of the repository 22 + Name string `json:"name" cborgen:"name"` 23 + // repoDid: Optional user-provided did:web to use as the repo identity instead of minting a did:plc. 24 + RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 21 25 // rkey: Rkey of the repository record 22 26 Rkey string `json:"rkey" cborgen:"rkey"` 23 27 // source: A source URL to clone from, populate this when forking or importing a repository. 24 28 Source *string `json:"source,omitempty" cborgen:"source,omitempty"` 29 + } 30 + 31 + // RepoCreate_Output is the output of a sh.tangled.repo.create call. 32 + type RepoCreate_Output struct { 33 + RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 25 34 } 26 35 27 36 // RepoCreate calls the XRPC method "sh.tangled.repo.create". 28 - func RepoCreate(ctx context.Context, c util.LexClient, input *RepoCreate_Input) error { 29 - if err := c.LexDo(ctx, util.Procedure, "application/json", "sh.tangled.repo.create", nil, input, nil); err != nil { 30 - return err 37 + func RepoCreate(ctx context.Context, c util.LexClient, input *RepoCreate_Input) (*RepoCreate_Output, error) { 38 + var out RepoCreate_Output 39 + if err := c.LexDo(ctx, util.Procedure, "application/json", "sh.tangled.repo.create", nil, input, &out); err != nil { 40 + return nil, err 31 41 } 32 42 33 - return nil 43 + return &out, nil 34 44 }
+2 -1
api/tangled/repoissue.go
··· 22 22 CreatedAt string `json:"createdAt" cborgen:"createdAt"` 23 23 Mentions []string `json:"mentions,omitempty" cborgen:"mentions,omitempty"` 24 24 References []string `json:"references,omitempty" cborgen:"references,omitempty"` 25 - Repo string `json:"repo" cborgen:"repo"` 25 + Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"` 26 + RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 26 27 Title string `json:"title" cborgen:"title"` 27 28 }
+7 -5
api/tangled/repopull.go
··· 33 33 34 34 // RepoPull_Source is a "source" in the sh.tangled.repo.pull schema. 35 35 type RepoPull_Source struct { 36 - Branch string `json:"branch" cborgen:"branch"` 37 - Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"` 38 - Sha string `json:"sha" cborgen:"sha"` 36 + Branch string `json:"branch" cborgen:"branch"` 37 + Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"` 38 + RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 39 + Sha string `json:"sha" cborgen:"sha"` 39 40 } 40 41 41 42 // RepoPull_Target is a "target" in the sh.tangled.repo.pull schema. 42 43 type RepoPull_Target struct { 43 - Branch string `json:"branch" cborgen:"branch"` 44 - Repo string `json:"repo" cborgen:"repo"` 44 + Branch string `json:"branch" cborgen:"branch"` 45 + Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"` 46 + RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 45 47 }
+6 -4
api/tangled/tangledpipeline.go
··· 66 66 67 67 // Pipeline_TriggerRepo is a "triggerRepo" in the sh.tangled.pipeline schema. 68 68 type Pipeline_TriggerRepo struct { 69 - DefaultBranch string `json:"defaultBranch" cborgen:"defaultBranch"` 70 - Did string `json:"did" cborgen:"did"` 71 - Knot string `json:"knot" cborgen:"knot"` 72 - Repo string `json:"repo" cborgen:"repo"` 69 + DefaultBranch string `json:"defaultBranch" cborgen:"defaultBranch"` 70 + Did string `json:"did" cborgen:"did"` 71 + Knot string `json:"knot" cborgen:"knot"` 72 + Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"` 73 + // repoDid: DID of the repo itself 74 + RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 73 75 } 74 76 75 77 // Pipeline_Workflow is a "workflow" in the sh.tangled.pipeline schema.
+2
api/tangled/tangledrepo.go
··· 26 26 Labels []string `json:"labels,omitempty" cborgen:"labels,omitempty"` 27 27 // name: name of the repo 28 28 Name string `json:"name" cborgen:"name"` 29 + // repoDid: DID of the repo itself, if assigned 30 + RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 29 31 // source: source of the repo 30 32 Source *string `json:"source,omitempty" cborgen:"source,omitempty"` 31 33 // spindle: CI runner to send jobs to and receive results from
+9
lexicons/actor/profile.json
··· 60 60 "maxGraphemes": 40, 61 61 "maxLength": 400 62 62 }, 63 + "pinnedRepositoryDids": { 64 + "type": "array", 65 + "minLength": 0, 66 + "maxLength": 6, 67 + "items": { 68 + "type": "string", 69 + "format": "did" 70 + } 71 + }, 63 72 "pinnedRepositories": { 64 73 "type": "array", 65 74 "description": "Any ATURI, it is up to appviews to validate these fields.",
+4 -1
lexicons/feed/star.json
··· 10 10 "record": { 11 11 "type": "object", 12 12 "required": [ 13 - "subject", 14 13 "createdAt" 15 14 ], 16 15 "properties": { 17 16 "subject": { 18 17 "type": "string", 19 18 "format": "at-uri" 19 + }, 20 + "subjectDid": { 21 + "type": "string", 22 + "format": "did" 20 23 }, 21 24 "createdAt": { 22 25 "type": "string",
+6 -2
lexicons/git/refUpdate.json
··· 11 11 "required": [ 12 12 "ref", 13 13 "committerDid", 14 - "repoDid", 15 14 "repoName", 16 15 "oldSha", 17 16 "newSha", ··· 29 28 "description": "did of the user that pushed this ref", 30 29 "format": "did" 31 30 }, 31 + "ownerDid": { 32 + "type": "string", 33 + "description": "did of the owner of the repo", 34 + "format": "did" 35 + }, 32 36 "repoDid": { 33 37 "type": "string", 34 - "description": "did of the owner of the repo", 38 + "description": "DID of the repo itself", 35 39 "format": "did" 36 40 }, 37 41 "repoName": {
+5 -1
lexicons/issue/issue.json
··· 9 9 "key": "tid", 10 10 "record": { 11 11 "type": "object", 12 - "required": ["repo", "title", "createdAt"], 12 + "required": ["title", "createdAt"], 13 13 "properties": { 14 14 "repo": { 15 15 "type": "string", 16 16 "format": "at-uri" 17 + }, 18 + "repoDid": { 19 + "type": "string", 20 + "format": "did" 17 21 }, 18 22 "title": { 19 23 "type": "string"
+5 -1
lexicons/pipeline/pipeline.json
··· 66 66 "required": [ 67 67 "knot", 68 68 "did", 69 - "repo", 70 69 "defaultBranch" 71 70 ], 72 71 "properties": { ··· 75 74 }, 76 75 "did": { 77 76 "type": "string", 77 + "format": "did" 78 + }, 79 + "repoDid": { 80 + "type": "string", 81 + "description": "DID of the repo itself", 78 82 "format": "did" 79 83 }, 80 84 "repo": {
+8 -1
lexicons/pulls/pull.json
··· 65 65 "target": { 66 66 "type": "object", 67 67 "required": [ 68 - "repo", 69 68 "branch" 70 69 ], 71 70 "properties": { 72 71 "repo": { 73 72 "type": "string", 74 73 "format": "at-uri" 74 + }, 75 + "repoDid": { 76 + "type": "string", 77 + "format": "did" 75 78 }, 76 79 "branch": { 77 80 "type": "string" ··· 96 99 "repo": { 97 100 "type": "string", 98 101 "format": "at-uri" 102 + }, 103 + "repoDid": { 104 + "type": "string", 105 + "format": "did" 99 106 } 100 107 } 101 108 }
+4 -1
lexicons/repo/artifact.json
··· 11 11 "type": "object", 12 12 "required": [ 13 13 "name", 14 - "repo", 15 14 "tag", 16 15 "createdAt", 17 16 "artifact" ··· 25 24 "type": "string", 26 25 "format": "at-uri", 27 26 "description": "repo that this artifact is being uploaded to" 27 + }, 28 + "repoDid": { 29 + "type": "string", 30 + "format": "did" 28 31 }, 29 32 "tag": { 30 33 "type": "bytes",
+4 -1
lexicons/repo/collaborator.json
··· 11 11 "type": "object", 12 12 "required": [ 13 13 "subject", 14 - "repo", 15 14 "createdAt" 16 15 ], 17 16 "properties": { ··· 23 22 "type": "string", 24 23 "description": "repo to add this user to", 25 24 "format": "at-uri" 25 + }, 26 + "repoDid": { 27 + "type": "string", 28 + "format": "did" 26 29 }, 27 30 "createdAt": { 28 31 "type": "string",
+23 -1
lexicons/repo/create.json
··· 10 10 "schema": { 11 11 "type": "object", 12 12 "required": [ 13 - "rkey" 13 + "rkey", 14 + "name" 14 15 ], 15 16 "properties": { 16 17 "rkey": { 17 18 "type": "string", 18 19 "description": "Rkey of the repository record" 19 20 }, 21 + "name": { 22 + "type": "string", 23 + "description": "Name of the repository" 24 + }, 20 25 "defaultBranch": { 21 26 "type": "string", 22 27 "description": "Default branch to push to" ··· 24 29 "source": { 25 30 "type": "string", 26 31 "description": "A source URL to clone from, populate this when forking or importing a repository." 32 + }, 33 + "repoDid": { 34 + "type": "string", 35 + "format": "did", 36 + "description": "Optional user-provided did:web to use as the repo identity instead of minting a did:plc." 37 + } 38 + } 39 + } 40 + }, 41 + "output": { 42 + "encoding": "application/json", 43 + "schema": { 44 + "type": "object", 45 + "properties": { 46 + "repoDid": { 47 + "type": "string", 48 + "format": "did" 27 49 } 28 50 } 29 51 }
+5
lexicons/repo/repo.json
··· 60 60 "format": "at-uri" 61 61 } 62 62 }, 63 + "repoDid": { 64 + "type": "string", 65 + "format": "did", 66 + "description": "DID of the repo itself, if assigned" 67 + }, 63 68 "createdAt": { 64 69 "type": "string", 65 70 "format": "datetime"