Monorepo for Tangled
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

lexicons,api: migrate stars+issues+pulls+collabs to repoDID

Lewis: May this revision serve well! <lewis@tangled.org>

Lewis a53aa43e 956f97c3

+548 -616
+409 -561
api/tangled/cbor_gen.go
··· 866 866 } 867 867 868 868 cw := cbg.NewCborWriter(w) 869 - fieldCount := 4 870 869 871 - if t.Subject == nil { 872 - fieldCount-- 873 - } 874 - 875 - if t.SubjectDid == nil { 876 - fieldCount-- 877 - } 878 - 879 - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 870 + if _, err := cw.Write([]byte{163}); err != nil { 880 871 return err 881 872 } 882 873 ··· 899 890 return err 900 891 } 901 892 902 - // t.Subject (string) (string) 903 - if t.Subject != nil { 893 + // t.Subject (tangled.FeedStar_Subject) (struct) 894 + if len("subject") > 1000000 { 895 + return xerrors.Errorf("Value in field \"subject\" was too long") 896 + } 904 897 905 - if len("subject") > 1000000 { 906 - return xerrors.Errorf("Value in field \"subject\" was too long") 907 - } 898 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil { 899 + return err 900 + } 901 + if _, err := cw.WriteString(string("subject")); err != nil { 902 + return err 903 + } 908 904 909 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil { 910 - return err 911 - } 912 - if _, err := cw.WriteString(string("subject")); err != nil { 913 - return err 914 - } 915 - 916 - if t.Subject == nil { 917 - if _, err := cw.Write(cbg.CborNull); err != nil { 918 - return err 919 - } 920 - } else { 921 - if len(*t.Subject) > 1000000 { 922 - return xerrors.Errorf("Value in field t.Subject was too long") 923 - } 924 - 925 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Subject))); err != nil { 926 - return err 927 - } 928 - if _, err := cw.WriteString(string(*t.Subject)); err != nil { 929 - return err 930 - } 931 - } 905 + if err := t.Subject.MarshalCBOR(cw); err != nil { 906 + return err 932 907 } 933 908 934 909 // t.CreatedAt (string) (string) ··· 953 928 if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { 954 929 return err 955 930 } 956 - 957 - // t.SubjectDid (string) (string) 958 - if t.SubjectDid != nil { 959 - 960 - if len("subjectDid") > 1000000 { 961 - return xerrors.Errorf("Value in field \"subjectDid\" was too long") 962 - } 963 - 964 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subjectDid"))); err != nil { 965 - return err 966 - } 967 - if _, err := cw.WriteString(string("subjectDid")); err != nil { 968 - return err 969 - } 970 - 971 - if t.SubjectDid == nil { 972 - if _, err := cw.Write(cbg.CborNull); err != nil { 973 - return err 974 - } 975 - } else { 976 - if len(*t.SubjectDid) > 1000000 { 977 - return xerrors.Errorf("Value in field t.SubjectDid was too long") 978 - } 979 - 980 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.SubjectDid))); err != nil { 981 - return err 982 - } 983 - if _, err := cw.WriteString(string(*t.SubjectDid)); err != nil { 984 - return err 985 - } 986 - } 987 - } 988 931 return nil 989 932 } 990 933 ··· 1013 956 1014 957 n := extra 1015 958 1016 - nameBuf := make([]byte, 10) 959 + nameBuf := make([]byte, 9) 1017 960 for i := uint64(0); i < n; i++ { 1018 961 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 1019 962 if err != nil { ··· 1040 983 1041 984 t.LexiconTypeID = string(sval) 1042 985 } 1043 - // t.Subject (string) (string) 986 + // t.Subject (tangled.FeedStar_Subject) (struct) 1044 987 case "subject": 1045 988 1046 989 { 990 + 1047 991 b, err := cr.ReadByte() 1048 992 if err != nil { 1049 993 return err ··· 1052 996 if err := cr.UnreadByte(); err != nil { 1053 997 return err 1054 998 } 1055 - 1056 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 1057 - if err != nil { 1058 - return err 999 + t.Subject = new(FeedStar_Subject) 1000 + if err := t.Subject.UnmarshalCBOR(cr); err != nil { 1001 + return xerrors.Errorf("unmarshaling t.Subject pointer: %w", err) 1059 1002 } 1003 + } 1060 1004 1061 - t.Subject = (*string)(&sval) 1062 - } 1063 1005 } 1064 1006 // t.CreatedAt (string) (string) 1065 1007 case "createdAt": ··· 1072 1014 1073 1015 t.CreatedAt = string(sval) 1074 1016 } 1075 - // t.SubjectDid (string) (string) 1076 - case "subjectDid": 1017 + 1018 + default: 1019 + // Field doesn't exist on this type, so ignore it 1020 + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { 1021 + return err 1022 + } 1023 + } 1024 + } 1025 + 1026 + return nil 1027 + } 1028 + func (t *FeedStar_Repo) MarshalCBOR(w io.Writer) error { 1029 + if t == nil { 1030 + _, err := w.Write(cbg.CborNull) 1031 + return err 1032 + } 1033 + 1034 + cw := cbg.NewCborWriter(w) 1035 + 1036 + if _, err := cw.Write([]byte{162}); err != nil { 1037 + return err 1038 + } 1039 + 1040 + // t.Did (string) (string) 1041 + if len("did") > 1000000 { 1042 + return xerrors.Errorf("Value in field \"did\" was too long") 1043 + } 1044 + 1045 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("did"))); err != nil { 1046 + return err 1047 + } 1048 + if _, err := cw.WriteString(string("did")); err != nil { 1049 + return err 1050 + } 1051 + 1052 + if len(t.Did) > 1000000 { 1053 + return xerrors.Errorf("Value in field t.Did was too long") 1054 + } 1055 + 1056 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Did))); err != nil { 1057 + return err 1058 + } 1059 + if _, err := cw.WriteString(string(t.Did)); err != nil { 1060 + return err 1061 + } 1062 + 1063 + // t.LexiconTypeID (string) (string) 1064 + if len("$type") > 1000000 { 1065 + return xerrors.Errorf("Value in field \"$type\" was too long") 1066 + } 1067 + 1068 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { 1069 + return err 1070 + } 1071 + if _, err := cw.WriteString(string("$type")); err != nil { 1072 + return err 1073 + } 1074 + 1075 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.feed.star#repo"))); err != nil { 1076 + return err 1077 + } 1078 + if _, err := cw.WriteString(string("sh.tangled.feed.star#repo")); err != nil { 1079 + return err 1080 + } 1081 + return nil 1082 + } 1083 + 1084 + func (t *FeedStar_Repo) UnmarshalCBOR(r io.Reader) (err error) { 1085 + *t = FeedStar_Repo{} 1086 + 1087 + cr := cbg.NewCborReader(r) 1088 + 1089 + maj, extra, err := cr.ReadHeader() 1090 + if err != nil { 1091 + return err 1092 + } 1093 + defer func() { 1094 + if err == io.EOF { 1095 + err = io.ErrUnexpectedEOF 1096 + } 1097 + }() 1098 + 1099 + if maj != cbg.MajMap { 1100 + return fmt.Errorf("cbor input should be of type map") 1101 + } 1102 + 1103 + if extra > cbg.MaxLength { 1104 + return fmt.Errorf("FeedStar_Repo: map struct too large (%d)", extra) 1105 + } 1106 + 1107 + n := extra 1108 + 1109 + nameBuf := make([]byte, 5) 1110 + for i := uint64(0); i < n; i++ { 1111 + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 1112 + if err != nil { 1113 + return err 1114 + } 1115 + 1116 + if !ok { 1117 + // Field doesn't exist on this type, so ignore it 1118 + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { 1119 + return err 1120 + } 1121 + continue 1122 + } 1123 + 1124 + switch string(nameBuf[:nameLen]) { 1125 + // t.Did (string) (string) 1126 + case "did": 1077 1127 1078 1128 { 1079 - b, err := cr.ReadByte() 1129 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 1080 1130 if err != nil { 1081 1131 return err 1082 1132 } 1083 - if b != cbg.CborNull[0] { 1084 - if err := cr.UnreadByte(); err != nil { 1085 - return err 1086 - } 1087 1133 1088 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 1089 - if err != nil { 1090 - return err 1091 - } 1134 + t.Did = string(sval) 1135 + } 1136 + // t.LexiconTypeID (string) (string) 1137 + case "$type": 1092 1138 1093 - t.SubjectDid = (*string)(&sval) 1139 + { 1140 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 1141 + if err != nil { 1142 + return err 1094 1143 } 1144 + 1145 + t.LexiconTypeID = string(sval) 1095 1146 } 1096 1147 1097 1148 default: ··· 1104 1155 1105 1156 return nil 1106 1157 } 1107 - func (t *GitRefUpdate) MarshalCBOR(w io.Writer) error { 1158 + func (t *FeedStar_String) MarshalCBOR(w io.Writer) error { 1108 1159 if t == nil { 1109 1160 _, err := w.Write(cbg.CborNull) 1110 1161 return err 1111 1162 } 1112 1163 1113 1164 cw := cbg.NewCborWriter(w) 1114 - fieldCount := 9 1165 + 1166 + if _, err := cw.Write([]byte{162}); err != nil { 1167 + return err 1168 + } 1115 1169 1116 - if t.OwnerDid == nil { 1117 - fieldCount-- 1170 + // t.Uri (string) (string) 1171 + if len("uri") > 1000000 { 1172 + return xerrors.Errorf("Value in field \"uri\" was too long") 1118 1173 } 1119 1174 1120 - if t.RepoDid == nil { 1175 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("uri"))); err != nil { 1176 + return err 1177 + } 1178 + if _, err := cw.WriteString(string("uri")); err != nil { 1179 + return err 1180 + } 1181 + 1182 + if len(t.Uri) > 1000000 { 1183 + return xerrors.Errorf("Value in field t.Uri was too long") 1184 + } 1185 + 1186 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Uri))); err != nil { 1187 + return err 1188 + } 1189 + if _, err := cw.WriteString(string(t.Uri)); err != nil { 1190 + return err 1191 + } 1192 + 1193 + // t.LexiconTypeID (string) (string) 1194 + if len("$type") > 1000000 { 1195 + return xerrors.Errorf("Value in field \"$type\" was too long") 1196 + } 1197 + 1198 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { 1199 + return err 1200 + } 1201 + if _, err := cw.WriteString(string("$type")); err != nil { 1202 + return err 1203 + } 1204 + 1205 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("sh.tangled.feed.star#string"))); err != nil { 1206 + return err 1207 + } 1208 + if _, err := cw.WriteString(string("sh.tangled.feed.star#string")); err != nil { 1209 + return err 1210 + } 1211 + return nil 1212 + } 1213 + 1214 + func (t *FeedStar_String) UnmarshalCBOR(r io.Reader) (err error) { 1215 + *t = FeedStar_String{} 1216 + 1217 + cr := cbg.NewCborReader(r) 1218 + 1219 + maj, extra, err := cr.ReadHeader() 1220 + if err != nil { 1221 + return err 1222 + } 1223 + defer func() { 1224 + if err == io.EOF { 1225 + err = io.ErrUnexpectedEOF 1226 + } 1227 + }() 1228 + 1229 + if maj != cbg.MajMap { 1230 + return fmt.Errorf("cbor input should be of type map") 1231 + } 1232 + 1233 + if extra > cbg.MaxLength { 1234 + return fmt.Errorf("FeedStar_String: map struct too large (%d)", extra) 1235 + } 1236 + 1237 + n := extra 1238 + 1239 + nameBuf := make([]byte, 5) 1240 + for i := uint64(0); i < n; i++ { 1241 + nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 1242 + if err != nil { 1243 + return err 1244 + } 1245 + 1246 + if !ok { 1247 + // Field doesn't exist on this type, so ignore it 1248 + if err := cbg.ScanForLinks(cr, func(cid.Cid) {}); err != nil { 1249 + return err 1250 + } 1251 + continue 1252 + } 1253 + 1254 + switch string(nameBuf[:nameLen]) { 1255 + // t.Uri (string) (string) 1256 + case "uri": 1257 + 1258 + { 1259 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 1260 + if err != nil { 1261 + return err 1262 + } 1263 + 1264 + t.Uri = string(sval) 1265 + } 1266 + // t.LexiconTypeID (string) (string) 1267 + case "$type": 1268 + 1269 + { 1270 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 1271 + if err != nil { 1272 + return err 1273 + } 1274 + 1275 + t.LexiconTypeID = string(sval) 1276 + } 1277 + 1278 + default: 1279 + // Field doesn't exist on this type, so ignore it 1280 + if err := cbg.ScanForLinks(r, func(cid.Cid) {}); err != nil { 1281 + return err 1282 + } 1283 + } 1284 + } 1285 + 1286 + return nil 1287 + } 1288 + func (t *GitRefUpdate) MarshalCBOR(w io.Writer) error { 1289 + if t == nil { 1290 + _, err := w.Write(cbg.CborNull) 1291 + return err 1292 + } 1293 + 1294 + cw := cbg.NewCborWriter(w) 1295 + fieldCount := 8 1296 + 1297 + if t.OwnerDid == nil { 1121 1298 fieldCount-- 1122 1299 } 1123 1300 ··· 1161 1338 } 1162 1339 1163 1340 if err := t.Meta.MarshalCBOR(cw); err != nil { 1341 + return err 1342 + } 1343 + 1344 + // t.Repo (string) (string) 1345 + if len("repo") > 1000000 { 1346 + return xerrors.Errorf("Value in field \"repo\" was too long") 1347 + } 1348 + 1349 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 1350 + return err 1351 + } 1352 + if _, err := cw.WriteString(string("repo")); err != nil { 1353 + return err 1354 + } 1355 + 1356 + if len(t.Repo) > 1000000 { 1357 + return xerrors.Errorf("Value in field t.Repo was too long") 1358 + } 1359 + 1360 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil { 1361 + return err 1362 + } 1363 + if _, err := cw.WriteString(string(t.Repo)); err != nil { 1164 1364 return err 1165 1365 } 1166 1366 ··· 1229 1429 return err 1230 1430 } 1231 1431 1232 - // t.RepoDid (string) (string) 1233 - if t.RepoDid != nil { 1234 - 1235 - if len("repoDid") > 1000000 { 1236 - return xerrors.Errorf("Value in field \"repoDid\" was too long") 1237 - } 1238 - 1239 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil { 1240 - return err 1241 - } 1242 - if _, err := cw.WriteString(string("repoDid")); err != nil { 1243 - return err 1244 - } 1245 - 1246 - if t.RepoDid == nil { 1247 - if _, err := cw.Write(cbg.CborNull); err != nil { 1248 - return err 1249 - } 1250 - } else { 1251 - if len(*t.RepoDid) > 1000000 { 1252 - return xerrors.Errorf("Value in field t.RepoDid was too long") 1253 - } 1254 - 1255 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.RepoDid))); err != nil { 1256 - return err 1257 - } 1258 - if _, err := cw.WriteString(string(*t.RepoDid)); err != nil { 1259 - return err 1260 - } 1261 - } 1262 - } 1263 - 1264 1432 // t.OwnerDid (string) (string) 1265 1433 if t.OwnerDid != nil { 1266 1434 ··· 1293 1461 } 1294 1462 } 1295 1463 1296 - // t.RepoName (string) (string) 1297 - if len("repoName") > 1000000 { 1298 - return xerrors.Errorf("Value in field \"repoName\" was too long") 1299 - } 1300 - 1301 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoName"))); err != nil { 1302 - return err 1303 - } 1304 - if _, err := cw.WriteString(string("repoName")); err != nil { 1305 - return err 1306 - } 1307 - 1308 - if len(t.RepoName) > 1000000 { 1309 - return xerrors.Errorf("Value in field t.RepoName was too long") 1310 - } 1311 - 1312 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.RepoName))); err != nil { 1313 - return err 1314 - } 1315 - if _, err := cw.WriteString(string(t.RepoName)); err != nil { 1316 - return err 1317 - } 1318 - 1319 1464 // t.CommitterDid (string) (string) 1320 1465 if len("committerDid") > 1000000 { 1321 1466 return xerrors.Errorf("Value in field \"committerDid\" was too long") ··· 1413 1558 } 1414 1559 1415 1560 } 1561 + // t.Repo (string) (string) 1562 + case "repo": 1563 + 1564 + { 1565 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 1566 + if err != nil { 1567 + return err 1568 + } 1569 + 1570 + t.Repo = string(sval) 1571 + } 1416 1572 // t.LexiconTypeID (string) (string) 1417 1573 case "$type": 1418 1574 ··· 1446 1602 1447 1603 t.OldSha = string(sval) 1448 1604 } 1449 - // t.RepoDid (string) (string) 1450 - case "repoDid": 1451 - 1452 - { 1453 - b, err := cr.ReadByte() 1454 - if err != nil { 1455 - return err 1456 - } 1457 - if b != cbg.CborNull[0] { 1458 - if err := cr.UnreadByte(); err != nil { 1459 - return err 1460 - } 1461 - 1462 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 1463 - if err != nil { 1464 - return err 1465 - } 1466 - 1467 - t.RepoDid = (*string)(&sval) 1468 - } 1469 - } 1470 1605 // t.OwnerDid (string) (string) 1471 1606 case "ownerDid": 1472 1607 ··· 1487 1622 1488 1623 t.OwnerDid = (*string)(&sval) 1489 1624 } 1490 - } 1491 - // t.RepoName (string) (string) 1492 - case "repoName": 1493 - 1494 - { 1495 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 1496 - if err != nil { 1497 - return err 1498 - } 1499 - 1500 - t.RepoName = string(sval) 1501 1625 } 1502 1626 // t.CommitterDid (string) (string) 1503 1627 case "committerDid": ··· 6216 6340 fieldCount-- 6217 6341 } 6218 6342 6343 + if t.Name == nil { 6344 + fieldCount-- 6345 + } 6346 + 6219 6347 if t.RepoDid == nil { 6220 6348 fieldCount-- 6221 6349 } ··· 6264 6392 } 6265 6393 6266 6394 // t.Name (string) (string) 6267 - if len("name") > 1000000 { 6268 - return xerrors.Errorf("Value in field \"name\" was too long") 6269 - } 6395 + if t.Name != nil { 6270 6396 6271 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil { 6272 - return err 6273 - } 6274 - if _, err := cw.WriteString(string("name")); err != nil { 6275 - return err 6276 - } 6397 + if len("name") > 1000000 { 6398 + return xerrors.Errorf("Value in field \"name\" was too long") 6399 + } 6277 6400 6278 - if len(t.Name) > 1000000 { 6279 - return xerrors.Errorf("Value in field t.Name was too long") 6280 - } 6401 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("name"))); err != nil { 6402 + return err 6403 + } 6404 + if _, err := cw.WriteString(string("name")); err != nil { 6405 + return err 6406 + } 6407 + 6408 + if t.Name == nil { 6409 + if _, err := cw.Write(cbg.CborNull); err != nil { 6410 + return err 6411 + } 6412 + } else { 6413 + if len(*t.Name) > 1000000 { 6414 + return xerrors.Errorf("Value in field t.Name was too long") 6415 + } 6281 6416 6282 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Name))); err != nil { 6283 - return err 6284 - } 6285 - if _, err := cw.WriteString(string(t.Name)); err != nil { 6286 - return err 6417 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Name))); err != nil { 6418 + return err 6419 + } 6420 + if _, err := cw.WriteString(string(*t.Name)); err != nil { 6421 + return err 6422 + } 6423 + } 6287 6424 } 6288 6425 6289 6426 // t.LexiconTypeID (string) (string) ··· 6618 6755 case "name": 6619 6756 6620 6757 { 6621 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 6758 + b, err := cr.ReadByte() 6622 6759 if err != nil { 6623 6760 return err 6624 6761 } 6762 + if b != cbg.CborNull[0] { 6763 + if err := cr.UnreadByte(); err != nil { 6764 + return err 6765 + } 6625 6766 6626 - t.Name = string(sval) 6767 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 6768 + if err != nil { 6769 + return err 6770 + } 6771 + 6772 + t.Name = (*string)(&sval) 6773 + } 6627 6774 } 6628 6775 // t.LexiconTypeID (string) (string) 6629 6776 case "$type": ··· 7220 7367 } 7221 7368 7222 7369 cw := cbg.NewCborWriter(w) 7223 - fieldCount := 5 7224 7370 7225 - if t.Repo == nil { 7226 - fieldCount-- 7371 + if _, err := cw.Write([]byte{164}); err != nil { 7372 + return err 7227 7373 } 7228 7374 7229 - if t.RepoDid == nil { 7230 - fieldCount-- 7375 + // t.Repo (string) (string) 7376 + if len("repo") > 1000000 { 7377 + return xerrors.Errorf("Value in field \"repo\" was too long") 7231 7378 } 7232 7379 7233 - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 7380 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 7234 7381 return err 7235 7382 } 7236 - 7237 - // t.Repo (string) (string) 7238 - if t.Repo != nil { 7239 - 7240 - if len("repo") > 1000000 { 7241 - return xerrors.Errorf("Value in field \"repo\" was too long") 7242 - } 7383 + if _, err := cw.WriteString(string("repo")); err != nil { 7384 + return err 7385 + } 7243 7386 7244 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 7245 - return err 7246 - } 7247 - if _, err := cw.WriteString(string("repo")); err != nil { 7248 - return err 7249 - } 7250 - 7251 - if t.Repo == nil { 7252 - if _, err := cw.Write(cbg.CborNull); err != nil { 7253 - return err 7254 - } 7255 - } else { 7256 - if len(*t.Repo) > 1000000 { 7257 - return xerrors.Errorf("Value in field t.Repo was too long") 7258 - } 7387 + if len(t.Repo) > 1000000 { 7388 + return xerrors.Errorf("Value in field t.Repo was too long") 7389 + } 7259 7390 7260 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Repo))); err != nil { 7261 - return err 7262 - } 7263 - if _, err := cw.WriteString(string(*t.Repo)); err != nil { 7264 - return err 7265 - } 7266 - } 7391 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil { 7392 + return err 7393 + } 7394 + if _, err := cw.WriteString(string(t.Repo)); err != nil { 7395 + return err 7267 7396 } 7268 7397 7269 7398 // t.LexiconTypeID (string) (string) ··· 7285 7414 return err 7286 7415 } 7287 7416 7288 - // t.RepoDid (string) (string) 7289 - if t.RepoDid != nil { 7290 - 7291 - if len("repoDid") > 1000000 { 7292 - return xerrors.Errorf("Value in field \"repoDid\" was too long") 7293 - } 7294 - 7295 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil { 7296 - return err 7297 - } 7298 - if _, err := cw.WriteString(string("repoDid")); err != nil { 7299 - return err 7300 - } 7301 - 7302 - if t.RepoDid == nil { 7303 - if _, err := cw.Write(cbg.CborNull); err != nil { 7304 - return err 7305 - } 7306 - } else { 7307 - if len(*t.RepoDid) > 1000000 { 7308 - return xerrors.Errorf("Value in field t.RepoDid was too long") 7309 - } 7310 - 7311 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.RepoDid))); err != nil { 7312 - return err 7313 - } 7314 - if _, err := cw.WriteString(string(*t.RepoDid)); err != nil { 7315 - return err 7316 - } 7317 - } 7318 - } 7319 - 7320 7417 // t.Subject (string) (string) 7321 7418 if len("subject") > 1000000 { 7322 7419 return xerrors.Errorf("Value in field \"subject\" was too long") ··· 7410 7507 case "repo": 7411 7508 7412 7509 { 7413 - b, err := cr.ReadByte() 7510 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 7414 7511 if err != nil { 7415 7512 return err 7416 7513 } 7417 - if b != cbg.CborNull[0] { 7418 - if err := cr.UnreadByte(); err != nil { 7419 - return err 7420 - } 7421 7514 7422 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 7423 - if err != nil { 7424 - return err 7425 - } 7426 - 7427 - t.Repo = (*string)(&sval) 7428 - } 7515 + t.Repo = string(sval) 7429 7516 } 7430 7517 // t.LexiconTypeID (string) (string) 7431 7518 case "$type": ··· 7437 7524 } 7438 7525 7439 7526 t.LexiconTypeID = string(sval) 7440 - } 7441 - // t.RepoDid (string) (string) 7442 - case "repoDid": 7443 - 7444 - { 7445 - b, err := cr.ReadByte() 7446 - if err != nil { 7447 - return err 7448 - } 7449 - if b != cbg.CborNull[0] { 7450 - if err := cr.UnreadByte(); err != nil { 7451 - return err 7452 - } 7453 - 7454 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 7455 - if err != nil { 7456 - return err 7457 - } 7458 - 7459 - t.RepoDid = (*string)(&sval) 7460 - } 7461 7527 } 7462 7528 // t.Subject (string) (string) 7463 7529 case "subject": ··· 7499 7565 } 7500 7566 7501 7567 cw := cbg.NewCborWriter(w) 7502 - fieldCount := 8 7568 + fieldCount := 7 7503 7569 7504 7570 if t.Body == nil { 7505 7571 fieldCount-- ··· 7510 7576 } 7511 7577 7512 7578 if t.References == nil { 7513 - fieldCount-- 7514 - } 7515 - 7516 - if t.Repo == nil { 7517 - fieldCount-- 7518 - } 7519 - 7520 - if t.RepoDid == nil { 7521 7579 fieldCount-- 7522 7580 } 7523 7581 ··· 7558 7616 } 7559 7617 7560 7618 // t.Repo (string) (string) 7561 - if t.Repo != nil { 7619 + if len("repo") > 1000000 { 7620 + return xerrors.Errorf("Value in field \"repo\" was too long") 7621 + } 7562 7622 7563 - if len("repo") > 1000000 { 7564 - return xerrors.Errorf("Value in field \"repo\" was too long") 7565 - } 7623 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 7624 + return err 7625 + } 7626 + if _, err := cw.WriteString(string("repo")); err != nil { 7627 + return err 7628 + } 7566 7629 7567 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 7568 - return err 7569 - } 7570 - if _, err := cw.WriteString(string("repo")); err != nil { 7571 - return err 7572 - } 7573 - 7574 - if t.Repo == nil { 7575 - if _, err := cw.Write(cbg.CborNull); err != nil { 7576 - return err 7577 - } 7578 - } else { 7579 - if len(*t.Repo) > 1000000 { 7580 - return xerrors.Errorf("Value in field t.Repo was too long") 7581 - } 7630 + if len(t.Repo) > 1000000 { 7631 + return xerrors.Errorf("Value in field t.Repo was too long") 7632 + } 7582 7633 7583 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Repo))); err != nil { 7584 - return err 7585 - } 7586 - if _, err := cw.WriteString(string(*t.Repo)); err != nil { 7587 - return err 7588 - } 7589 - } 7634 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil { 7635 + return err 7636 + } 7637 + if _, err := cw.WriteString(string(t.Repo)); err != nil { 7638 + return err 7590 7639 } 7591 7640 7592 7641 // t.LexiconTypeID (string) (string) ··· 7631 7680 return err 7632 7681 } 7633 7682 7634 - // t.RepoDid (string) (string) 7635 - if t.RepoDid != nil { 7636 - 7637 - if len("repoDid") > 1000000 { 7638 - return xerrors.Errorf("Value in field \"repoDid\" was too long") 7639 - } 7640 - 7641 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil { 7642 - return err 7643 - } 7644 - if _, err := cw.WriteString(string("repoDid")); err != nil { 7645 - return err 7646 - } 7647 - 7648 - if t.RepoDid == nil { 7649 - if _, err := cw.Write(cbg.CborNull); err != nil { 7650 - return err 7651 - } 7652 - } else { 7653 - if len(*t.RepoDid) > 1000000 { 7654 - return xerrors.Errorf("Value in field t.RepoDid was too long") 7655 - } 7656 - 7657 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.RepoDid))); err != nil { 7658 - return err 7659 - } 7660 - if _, err := cw.WriteString(string(*t.RepoDid)); err != nil { 7661 - return err 7662 - } 7663 - } 7664 - } 7665 - 7666 7683 // t.Mentions ([]string) (slice) 7667 7684 if t.Mentions != nil { 7668 7685 ··· 7826 7843 case "repo": 7827 7844 7828 7845 { 7829 - b, err := cr.ReadByte() 7846 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 7830 7847 if err != nil { 7831 7848 return err 7832 7849 } 7833 - if b != cbg.CborNull[0] { 7834 - if err := cr.UnreadByte(); err != nil { 7835 - return err 7836 - } 7837 7850 7838 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 7839 - if err != nil { 7840 - return err 7841 - } 7842 - 7843 - t.Repo = (*string)(&sval) 7844 - } 7851 + t.Repo = string(sval) 7845 7852 } 7846 7853 // t.LexiconTypeID (string) (string) 7847 7854 case "$type": ··· 7864 7871 } 7865 7872 7866 7873 t.Title = string(sval) 7867 - } 7868 - // t.RepoDid (string) (string) 7869 - case "repoDid": 7870 - 7871 - { 7872 - b, err := cr.ReadByte() 7873 - if err != nil { 7874 - return err 7875 - } 7876 - if b != cbg.CborNull[0] { 7877 - if err := cr.UnreadByte(); err != nil { 7878 - return err 7879 - } 7880 - 7881 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 7882 - if err != nil { 7883 - return err 7884 - } 7885 - 7886 - t.RepoDid = (*string)(&sval) 7887 - } 7888 7874 } 7889 7875 // t.Mentions ([]string) (slice) 7890 7876 case "mentions": ··· 9527 9513 } 9528 9514 9529 9515 cw := cbg.NewCborWriter(w) 9530 - fieldCount := 3 9516 + fieldCount := 2 9531 9517 9532 9518 if t.Repo == nil { 9533 - fieldCount-- 9534 - } 9535 - 9536 - if t.RepoDid == nil { 9537 9519 fieldCount-- 9538 9520 } 9539 9521 ··· 9595 9577 if _, err := cw.WriteString(string(t.Branch)); err != nil { 9596 9578 return err 9597 9579 } 9598 - 9599 - // t.RepoDid (string) (string) 9600 - if t.RepoDid != nil { 9601 - 9602 - if len("repoDid") > 1000000 { 9603 - return xerrors.Errorf("Value in field \"repoDid\" was too long") 9604 - } 9605 - 9606 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil { 9607 - return err 9608 - } 9609 - if _, err := cw.WriteString(string("repoDid")); err != nil { 9610 - return err 9611 - } 9612 - 9613 - if t.RepoDid == nil { 9614 - if _, err := cw.Write(cbg.CborNull); err != nil { 9615 - return err 9616 - } 9617 - } else { 9618 - if len(*t.RepoDid) > 1000000 { 9619 - return xerrors.Errorf("Value in field t.RepoDid was too long") 9620 - } 9621 - 9622 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.RepoDid))); err != nil { 9623 - return err 9624 - } 9625 - if _, err := cw.WriteString(string(*t.RepoDid)); err != nil { 9626 - return err 9627 - } 9628 - } 9629 - } 9630 9580 return nil 9631 9581 } 9632 9582 ··· 9655 9605 9656 9606 n := extra 9657 9607 9658 - nameBuf := make([]byte, 7) 9608 + nameBuf := make([]byte, 6) 9659 9609 for i := uint64(0); i < n; i++ { 9660 9610 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 9661 9611 if err != nil { ··· 9702 9652 } 9703 9653 9704 9654 t.Branch = string(sval) 9705 - } 9706 - // t.RepoDid (string) (string) 9707 - case "repoDid": 9708 - 9709 - { 9710 - b, err := cr.ReadByte() 9711 - if err != nil { 9712 - return err 9713 - } 9714 - if b != cbg.CborNull[0] { 9715 - if err := cr.UnreadByte(); err != nil { 9716 - return err 9717 - } 9718 - 9719 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 9720 - if err != nil { 9721 - return err 9722 - } 9723 - 9724 - t.RepoDid = (*string)(&sval) 9725 - } 9726 9655 } 9727 9656 9728 9657 default: ··· 10042 9971 } 10043 9972 10044 9973 cw := cbg.NewCborWriter(w) 10045 - fieldCount := 3 10046 9974 10047 - if t.Repo == nil { 10048 - fieldCount-- 9975 + if _, err := cw.Write([]byte{162}); err != nil { 9976 + return err 10049 9977 } 10050 9978 10051 - if t.RepoDid == nil { 10052 - fieldCount-- 9979 + // t.Repo (string) (string) 9980 + if len("repo") > 1000000 { 9981 + return xerrors.Errorf("Value in field \"repo\" was too long") 10053 9982 } 10054 9983 10055 - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 9984 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 10056 9985 return err 10057 9986 } 10058 - 10059 - // t.Repo (string) (string) 10060 - if t.Repo != nil { 10061 - 10062 - if len("repo") > 1000000 { 10063 - return xerrors.Errorf("Value in field \"repo\" was too long") 10064 - } 9987 + if _, err := cw.WriteString(string("repo")); err != nil { 9988 + return err 9989 + } 10065 9990 10066 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repo"))); err != nil { 10067 - return err 10068 - } 10069 - if _, err := cw.WriteString(string("repo")); err != nil { 10070 - return err 10071 - } 10072 - 10073 - if t.Repo == nil { 10074 - if _, err := cw.Write(cbg.CborNull); err != nil { 10075 - return err 10076 - } 10077 - } else { 10078 - if len(*t.Repo) > 1000000 { 10079 - return xerrors.Errorf("Value in field t.Repo was too long") 10080 - } 9991 + if len(t.Repo) > 1000000 { 9992 + return xerrors.Errorf("Value in field t.Repo was too long") 9993 + } 10081 9994 10082 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Repo))); err != nil { 10083 - return err 10084 - } 10085 - if _, err := cw.WriteString(string(*t.Repo)); err != nil { 10086 - return err 10087 - } 10088 - } 9995 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Repo))); err != nil { 9996 + return err 9997 + } 9998 + if _, err := cw.WriteString(string(t.Repo)); err != nil { 9999 + return err 10089 10000 } 10090 10001 10091 10002 // t.Branch (string) (string) ··· 10110 10021 if _, err := cw.WriteString(string(t.Branch)); err != nil { 10111 10022 return err 10112 10023 } 10113 - 10114 - // t.RepoDid (string) (string) 10115 - if t.RepoDid != nil { 10116 - 10117 - if len("repoDid") > 1000000 { 10118 - return xerrors.Errorf("Value in field \"repoDid\" was too long") 10119 - } 10120 - 10121 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("repoDid"))); err != nil { 10122 - return err 10123 - } 10124 - if _, err := cw.WriteString(string("repoDid")); err != nil { 10125 - return err 10126 - } 10127 - 10128 - if t.RepoDid == nil { 10129 - if _, err := cw.Write(cbg.CborNull); err != nil { 10130 - return err 10131 - } 10132 - } else { 10133 - if len(*t.RepoDid) > 1000000 { 10134 - return xerrors.Errorf("Value in field t.RepoDid was too long") 10135 - } 10136 - 10137 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.RepoDid))); err != nil { 10138 - return err 10139 - } 10140 - if _, err := cw.WriteString(string(*t.RepoDid)); err != nil { 10141 - return err 10142 - } 10143 - } 10144 - } 10145 10024 return nil 10146 10025 } 10147 10026 ··· 10170 10049 10171 10050 n := extra 10172 10051 10173 - nameBuf := make([]byte, 7) 10052 + nameBuf := make([]byte, 6) 10174 10053 for i := uint64(0); i < n; i++ { 10175 10054 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 10176 10055 if err != nil { ··· 10190 10069 case "repo": 10191 10070 10192 10071 { 10193 - b, err := cr.ReadByte() 10072 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 10194 10073 if err != nil { 10195 10074 return err 10196 10075 } 10197 - if b != cbg.CborNull[0] { 10198 - if err := cr.UnreadByte(); err != nil { 10199 - return err 10200 - } 10201 10076 10202 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 10203 - if err != nil { 10204 - return err 10205 - } 10206 - 10207 - t.Repo = (*string)(&sval) 10208 - } 10077 + t.Repo = string(sval) 10209 10078 } 10210 10079 // t.Branch (string) (string) 10211 10080 case "branch": ··· 10217 10086 } 10218 10087 10219 10088 t.Branch = string(sval) 10220 - } 10221 - // t.RepoDid (string) (string) 10222 - case "repoDid": 10223 - 10224 - { 10225 - b, err := cr.ReadByte() 10226 - if err != nil { 10227 - return err 10228 - } 10229 - if b != cbg.CborNull[0] { 10230 - if err := cr.UnreadByte(); err != nil { 10231 - return err 10232 - } 10233 - 10234 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 10235 - if err != nil { 10236 - return err 10237 - } 10238 - 10239 - t.RepoDid = (*string)(&sval) 10240 - } 10241 10089 } 10242 10090 10243 10091 default:
+93 -4
api/tangled/feedstar.go
··· 5 5 // schema: sh.tangled.feed.star 6 6 7 7 import ( 8 + "bytes" 9 + "encoding/json" 10 + "fmt" 11 + "io" 12 + 8 13 "github.com/bluesky-social/indigo/lex/util" 14 + cbg "github.com/whyrusleeping/cbor-gen" 9 15 ) 10 16 11 17 const ( ··· 17 23 } // 18 24 // RECORDTYPE: FeedStar 19 25 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,omitempty" cborgen:"subject,omitempty"` 23 - SubjectDid *string `json:"subjectDid,omitempty" cborgen:"subjectDid,omitempty"` 26 + LexiconTypeID string `json:"$type,const=sh.tangled.feed.star" cborgen:"$type,const=sh.tangled.feed.star"` 27 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 28 + Subject *FeedStar_Subject `json:"subject" cborgen:"subject"` 29 + } 30 + 31 + // FeedStar_Repo is a "repo" in the sh.tangled.feed.star schema. 32 + // 33 + // RECORDTYPE: FeedStar_Repo 34 + type FeedStar_Repo struct { 35 + LexiconTypeID string `json:"$type,const=sh.tangled.feed.star#repo" cborgen:"$type,const=sh.tangled.feed.star#repo"` 36 + Did string `json:"did" cborgen:"did"` 37 + } 38 + 39 + // FeedStar_String is a "string" in the sh.tangled.feed.star schema. 40 + // 41 + // RECORDTYPE: FeedStar_String 42 + type FeedStar_String struct { 43 + LexiconTypeID string `json:"$type,const=sh.tangled.feed.star#string" cborgen:"$type,const=sh.tangled.feed.star#string"` 44 + Uri string `json:"uri" cborgen:"uri"` 45 + } 46 + 47 + type FeedStar_Subject struct { 48 + FeedStar_Repo *FeedStar_Repo 49 + FeedStar_String *FeedStar_String 50 + } 51 + 52 + func (t *FeedStar_Subject) MarshalJSON() ([]byte, error) { 53 + if t.FeedStar_Repo != nil { 54 + t.FeedStar_Repo.LexiconTypeID = "sh.tangled.feed.star#repo" 55 + return json.Marshal(t.FeedStar_Repo) 56 + } 57 + if t.FeedStar_String != nil { 58 + t.FeedStar_String.LexiconTypeID = "sh.tangled.feed.star#string" 59 + return json.Marshal(t.FeedStar_String) 60 + } 61 + return nil, fmt.Errorf("cannot marshal empty enum") 62 + } 63 + func (t *FeedStar_Subject) UnmarshalJSON(b []byte) error { 64 + typ, err := util.TypeExtract(b) 65 + if err != nil { 66 + return err 67 + } 68 + 69 + switch typ { 70 + case "sh.tangled.feed.star#repo": 71 + t.FeedStar_Repo = new(FeedStar_Repo) 72 + return json.Unmarshal(b, t.FeedStar_Repo) 73 + case "sh.tangled.feed.star#string": 74 + t.FeedStar_String = new(FeedStar_String) 75 + return json.Unmarshal(b, t.FeedStar_String) 76 + 77 + default: 78 + return fmt.Errorf("closed enums must have a matching value") 79 + } 80 + } 81 + 82 + func (t *FeedStar_Subject) MarshalCBOR(w io.Writer) error { 83 + 84 + if t == nil { 85 + _, err := w.Write(cbg.CborNull) 86 + return err 87 + } 88 + if t.FeedStar_Repo != nil { 89 + return t.FeedStar_Repo.MarshalCBOR(w) 90 + } 91 + if t.FeedStar_String != nil { 92 + return t.FeedStar_String.MarshalCBOR(w) 93 + } 94 + return fmt.Errorf("cannot cbor marshal empty enum") 95 + } 96 + func (t *FeedStar_Subject) UnmarshalCBOR(r io.Reader) error { 97 + typ, b, err := util.CborTypeExtractReader(r) 98 + if err != nil { 99 + return err 100 + } 101 + 102 + switch typ { 103 + case "sh.tangled.feed.star#repo": 104 + t.FeedStar_Repo = new(FeedStar_Repo) 105 + return t.FeedStar_Repo.UnmarshalCBOR(bytes.NewReader(b)) 106 + case "sh.tangled.feed.star#string": 107 + t.FeedStar_String = new(FeedStar_String) 108 + return t.FeedStar_String.UnmarshalCBOR(bytes.NewReader(b)) 109 + 110 + default: 111 + return fmt.Errorf("closed enums must have a matching value") 112 + } 24 113 }
+2 -4
api/tangled/gitrefUpdate.go
··· 29 29 OwnerDid *string `json:"ownerDid,omitempty" cborgen:"ownerDid,omitempty"` 30 30 // ref: Ref being updated 31 31 Ref string `json:"ref" cborgen:"ref"` 32 - // repoDid: DID of the repo itself 33 - RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 34 - // repoName: name of the repo 35 - RepoName string `json:"repoName" cborgen:"repoName"` 32 + // repo: DID of the repo itself 33 + Repo string `json:"repo" cborgen:"repo"` 36 34 } 37 35 38 36 // GitRefUpdate_CommitCountBreakdown is a "commitCountBreakdown" in the sh.tangled.git.refUpdate schema.
+3 -4
api/tangled/repocollaborator.go
··· 19 19 type RepoCollaborator struct { 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 - // repo: repo to add this user to 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"` 22 + // repo: repo DID to add this user to 23 + Repo string `json:"repo" cborgen:"repo"` 24 + Subject string `json:"subject" cborgen:"subject"` 26 25 }
+1 -2
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,omitempty" cborgen:"repo,omitempty"` 26 - RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 25 + Repo string `json:"repo" cborgen:"repo"` 27 26 Title string `json:"title" cborgen:"title"` 28 27 }
+4 -6
api/tangled/repopull.go
··· 39 39 40 40 // RepoPull_Source is a "source" in the sh.tangled.repo.pull schema. 41 41 type RepoPull_Source struct { 42 - Branch string `json:"branch" cborgen:"branch"` 43 - Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"` 44 - RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 42 + Branch string `json:"branch" cborgen:"branch"` 43 + Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"` 45 44 } 46 45 47 46 // RepoPull_Target is a "target" in the sh.tangled.repo.pull schema. 48 47 type RepoPull_Target struct { 49 - Branch string `json:"branch" cborgen:"branch"` 50 - Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"` 51 - RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 48 + Branch string `json:"branch" cborgen:"branch"` 49 + Repo string `json:"repo" cborgen:"repo"` 52 50 }
+2 -2
api/tangled/tangledrepo.go
··· 24 24 Knot string `json:"knot" cborgen:"knot"` 25 25 // labels: List of labels that this repo subscribes to 26 26 Labels []string `json:"labels,omitempty" cborgen:"labels,omitempty"` 27 - // name: name of the repo 28 - Name string `json:"name" cborgen:"name"` 27 + // name: Cosmetic name of the repo. 28 + Name *string `json:"name,omitempty" cborgen:"name,omitempty"` 29 29 // repoDid: DID of the repo itself, if assigned 30 30 RepoDid *string `json:"repoDid,omitempty" cborgen:"repoDid,omitempty"` 31 31 // source: source of the repo
+2
cmd/cborgen/cborgen.go
··· 17 17 tangled.ActorProfile{}, 18 18 tangled.FeedReaction{}, 19 19 tangled.FeedStar{}, 20 + tangled.FeedStar_Repo{}, 21 + tangled.FeedStar_String{}, 20 22 tangled.GitRefUpdate{}, 21 23 tangled.GitRefUpdate_CommitCountBreakdown{}, 22 24 tangled.GitRefUpdate_IndividualEmailCommitCount{},
+24 -6
lexicons/feed/star.json
··· 10 10 "record": { 11 11 "type": "object", 12 12 "required": [ 13 + "subject", 13 14 "createdAt" 14 15 ], 15 16 "properties": { 16 17 "subject": { 17 - "type": "string", 18 - "format": "at-uri" 19 - }, 20 - "subjectDid": { 21 - "type": "string", 22 - "format": "did" 18 + "type": "union", 19 + "refs": ["#repo", "#string"], 20 + "closed": true 23 21 }, 24 22 "createdAt": { 25 23 "type": "string", 26 24 "format": "datetime" 27 25 } 26 + } 27 + } 28 + }, 29 + "repo": { 30 + "type": "object", 31 + "required": ["did"], 32 + "properties": { 33 + "did": { 34 + "type": "string", 35 + "format": "did" 36 + } 37 + } 38 + }, 39 + "string": { 40 + "type": "object", 41 + "required": ["uri"], 42 + "properties": { 43 + "uri": { 44 + "type": "string", 45 + "format": "at-uri" 28 46 } 29 47 } 30 48 }
+2 -6
lexicons/git/refUpdate.json
··· 11 11 "required": [ 12 12 "ref", 13 13 "committerDid", 14 - "repoName", 14 + "repo", 15 15 "oldSha", 16 16 "newSha", 17 17 "meta" ··· 33 33 "description": "did of the owner of the repo", 34 34 "format": "did" 35 35 }, 36 - "repoDid": { 36 + "repo": { 37 37 "type": "string", 38 38 "description": "DID of the repo itself", 39 39 "format": "did" 40 - }, 41 - "repoName": { 42 - "type": "string", 43 - "description": "name of the repo" 44 40 }, 45 41 "oldSha": { 46 42 "type": "string",
+1 -5
lexicons/issue/issue.json
··· 9 9 "key": "tid", 10 10 "record": { 11 11 "type": "object", 12 - "required": ["title", "createdAt"], 12 + "required": ["repo", "title", "createdAt"], 13 13 "properties": { 14 14 "repo": { 15 - "type": "string", 16 - "format": "at-uri" 17 - }, 18 - "repoDid": { 19 15 "type": "string", 20 16 "format": "did" 21 17 },
+1 -8
lexicons/pulls/pull.json
··· 65 65 "target": { 66 66 "type": "object", 67 67 "required": [ 68 + "repo", 68 69 "branch" 69 70 ], 70 71 "properties": { 71 72 "repo": { 72 - "type": "string", 73 - "format": "at-uri" 74 - }, 75 - "repoDid": { 76 73 "type": "string", 77 74 "format": "did" 78 75 }, ··· 91 88 "type": "string" 92 89 }, 93 90 "repo": { 94 - "type": "string", 95 - "format": "at-uri" 96 - }, 97 - "repoDid": { 98 91 "type": "string", 99 92 "format": "did" 100 93 }
+2 -5
lexicons/repo/collaborator.json
··· 11 11 "type": "object", 12 12 "required": [ 13 13 "subject", 14 + "repo", 14 15 "createdAt" 15 16 ], 16 17 "properties": { ··· 20 21 }, 21 22 "repo": { 22 23 "type": "string", 23 - "description": "repo to add this user to", 24 - "format": "at-uri" 25 - }, 26 - "repoDid": { 27 - "type": "string", 24 + "description": "repo DID to add this user to", 28 25 "format": "did" 29 26 }, 30 27 "createdAt": {
+2 -3
lexicons/repo/repo.json
··· 6 6 "defs": { 7 7 "main": { 8 8 "type": "record", 9 - "key": "tid", 9 + "key": "any", 10 10 "record": { 11 11 "type": "object", 12 12 "required": [ 13 - "name", 14 13 "knot", 15 14 "createdAt" 16 15 ], 17 16 "properties": { 18 17 "name": { 19 18 "type": "string", 20 - "description": "name of the repo" 19 + "description": "Cosmetic name of the repo." 21 20 }, 22 21 "knot": { 23 22 "type": "string",