forked from tangled.org/core
this repo has no description

lexicons: rename, format and other required changes

authored by nel.pet and committed by anirudh.fi 5d021119 79ed2d0a

+225 -458
api/tangled/cbor_gen.go
··· 353 } 354 355 cw := cbg.NewCborWriter(w) 356 - fieldCount := 4 357 358 - if t.AddedAt == nil { 359 - fieldCount-- 360 - } 361 - 362 - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 363 return err 364 } 365 ··· 405 return err 406 } 407 408 - // t.Member (string) (string) 409 - if len("member") > 1000000 { 410 - return xerrors.Errorf("Value in field \"member\" was too long") 411 } 412 413 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("member"))); err != nil { 414 return err 415 } 416 - if _, err := cw.WriteString(string("member")); err != nil { 417 return err 418 } 419 420 - if len(t.Member) > 1000000 { 421 - return xerrors.Errorf("Value in field t.Member was too long") 422 } 423 424 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Member))); err != nil { 425 return err 426 } 427 - if _, err := cw.WriteString(string(t.Member)); err != nil { 428 return err 429 } 430 431 - // t.AddedAt (string) (string) 432 - if t.AddedAt != nil { 433 - 434 - if len("addedAt") > 1000000 { 435 - return xerrors.Errorf("Value in field \"addedAt\" was too long") 436 - } 437 438 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("addedAt"))); err != nil { 439 - return err 440 - } 441 - if _, err := cw.WriteString(string("addedAt")); err != nil { 442 - return err 443 - } 444 445 - if t.AddedAt == nil { 446 - if _, err := cw.Write(cbg.CborNull); err != nil { 447 - return err 448 - } 449 - } else { 450 - if len(*t.AddedAt) > 1000000 { 451 - return xerrors.Errorf("Value in field t.AddedAt was too long") 452 - } 453 454 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.AddedAt))); err != nil { 455 - return err 456 - } 457 - if _, err := cw.WriteString(string(*t.AddedAt)); err != nil { 458 - return err 459 - } 460 - } 461 } 462 return nil 463 } ··· 487 488 n := extra 489 490 - nameBuf := make([]byte, 7) 491 for i := uint64(0); i < n; i++ { 492 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 493 if err != nil { ··· 525 526 t.Domain = string(sval) 527 } 528 - // t.Member (string) (string) 529 - case "member": 530 531 { 532 sval, err := cbg.ReadStringWithMax(cr, 1000000) ··· 534 return err 535 } 536 537 - t.Member = string(sval) 538 } 539 - // t.AddedAt (string) (string) 540 - case "addedAt": 541 542 { 543 - b, err := cr.ReadByte() 544 if err != nil { 545 return err 546 } 547 - if b != cbg.CborNull[0] { 548 - if err := cr.UnreadByte(); err != nil { 549 - return err 550 - } 551 552 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 553 - if err != nil { 554 - return err 555 - } 556 - 557 - t.AddedAt = (*string)(&sval) 558 - } 559 } 560 561 default: ··· 645 return err 646 } 647 648 - // t.Created (string) (string) 649 - if len("created") > 1000000 { 650 - return xerrors.Errorf("Value in field \"created\" was too long") 651 } 652 653 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("created"))); err != nil { 654 return err 655 } 656 - if _, err := cw.WriteString(string("created")); err != nil { 657 return err 658 } 659 660 - if len(t.Created) > 1000000 { 661 - return xerrors.Errorf("Value in field t.Created was too long") 662 } 663 664 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Created))); err != nil { 665 return err 666 } 667 - if _, err := cw.WriteString(string(t.Created)); err != nil { 668 return err 669 } 670 return nil ··· 695 696 n := extra 697 698 - nameBuf := make([]byte, 7) 699 for i := uint64(0); i < n; i++ { 700 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 701 if err != nil { ··· 744 745 t.LexiconTypeID = string(sval) 746 } 747 - // t.Created (string) (string) 748 - case "created": 749 750 { 751 sval, err := cbg.ReadStringWithMax(cr, 1000000) ··· 753 return err 754 } 755 756 - t.Created = string(sval) 757 } 758 759 default: ··· 775 cw := cbg.NewCborWriter(w) 776 fieldCount := 7 777 778 - if t.Body == nil { 779 - fieldCount-- 780 - } 781 - 782 if t.CommentId == nil { 783 fieldCount-- 784 } 785 786 - if t.CreatedAt == nil { 787 - fieldCount-- 788 - } 789 - 790 if t.Owner == nil { 791 fieldCount-- 792 } ··· 800 } 801 802 // t.Body (string) (string) 803 - if t.Body != nil { 804 - 805 - if len("body") > 1000000 { 806 - return xerrors.Errorf("Value in field \"body\" was too long") 807 - } 808 809 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil { 810 - return err 811 - } 812 - if _, err := cw.WriteString(string("body")); err != nil { 813 - return err 814 - } 815 816 - if t.Body == nil { 817 - if _, err := cw.Write(cbg.CborNull); err != nil { 818 - return err 819 - } 820 - } else { 821 - if len(*t.Body) > 1000000 { 822 - return xerrors.Errorf("Value in field t.Body was too long") 823 - } 824 825 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Body))); err != nil { 826 - return err 827 - } 828 - if _, err := cw.WriteString(string(*t.Body)); err != nil { 829 - return err 830 - } 831 - } 832 } 833 834 // t.Repo (string) (string) ··· 970 } 971 972 // t.CreatedAt (string) (string) 973 - if t.CreatedAt != nil { 974 975 - if len("createdAt") > 1000000 { 976 - return xerrors.Errorf("Value in field \"createdAt\" was too long") 977 - } 978 979 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { 980 - return err 981 - } 982 - if _, err := cw.WriteString(string("createdAt")); err != nil { 983 - return err 984 - } 985 - 986 - if t.CreatedAt == nil { 987 - if _, err := cw.Write(cbg.CborNull); err != nil { 988 - return err 989 - } 990 - } else { 991 - if len(*t.CreatedAt) > 1000000 { 992 - return xerrors.Errorf("Value in field t.CreatedAt was too long") 993 - } 994 995 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.CreatedAt))); err != nil { 996 - return err 997 - } 998 - if _, err := cw.WriteString(string(*t.CreatedAt)); err != nil { 999 - return err 1000 - } 1001 - } 1002 } 1003 return nil 1004 } ··· 1048 case "body": 1049 1050 { 1051 - b, err := cr.ReadByte() 1052 if err != nil { 1053 return err 1054 } 1055 - if b != cbg.CborNull[0] { 1056 - if err := cr.UnreadByte(); err != nil { 1057 - return err 1058 - } 1059 1060 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 1061 - if err != nil { 1062 - return err 1063 - } 1064 - 1065 - t.Body = (*string)(&sval) 1066 - } 1067 } 1068 // t.Repo (string) (string) 1069 case "repo": ··· 1169 case "createdAt": 1170 1171 { 1172 - b, err := cr.ReadByte() 1173 if err != nil { 1174 return err 1175 } 1176 - if b != cbg.CborNull[0] { 1177 - if err := cr.UnreadByte(); err != nil { 1178 - return err 1179 - } 1180 1181 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 1182 - if err != nil { 1183 - return err 1184 - } 1185 - 1186 - t.CreatedAt = (*string)(&sval) 1187 - } 1188 } 1189 1190 default: ··· 1204 } 1205 1206 cw := cbg.NewCborWriter(w) 1207 - fieldCount := 3 1208 1209 - if t.State == nil { 1210 - fieldCount-- 1211 - } 1212 - 1213 - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 1214 return err 1215 } 1216 ··· 1257 } 1258 1259 // t.State (string) (string) 1260 - if t.State != nil { 1261 1262 - if len("state") > 1000000 { 1263 - return xerrors.Errorf("Value in field \"state\" was too long") 1264 - } 1265 1266 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("state"))); err != nil { 1267 - return err 1268 - } 1269 - if _, err := cw.WriteString(string("state")); err != nil { 1270 - return err 1271 - } 1272 1273 - if t.State == nil { 1274 - if _, err := cw.Write(cbg.CborNull); err != nil { 1275 - return err 1276 - } 1277 - } else { 1278 - if len(*t.State) > 1000000 { 1279 - return xerrors.Errorf("Value in field t.State was too long") 1280 - } 1281 - 1282 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.State))); err != nil { 1283 - return err 1284 - } 1285 - if _, err := cw.WriteString(string(*t.State)); err != nil { 1286 - return err 1287 - } 1288 - } 1289 } 1290 return nil 1291 } ··· 1357 case "state": 1358 1359 { 1360 - b, err := cr.ReadByte() 1361 if err != nil { 1362 return err 1363 } 1364 - if b != cbg.CborNull[0] { 1365 - if err := cr.UnreadByte(); err != nil { 1366 - return err 1367 - } 1368 1369 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 1370 - if err != nil { 1371 - return err 1372 - } 1373 - 1374 - t.State = (*string)(&sval) 1375 - } 1376 } 1377 1378 default: ··· 1395 fieldCount := 7 1396 1397 if t.Body == nil { 1398 - fieldCount-- 1399 - } 1400 - 1401 - if t.CreatedAt == nil { 1402 fieldCount-- 1403 } 1404 ··· 1549 } 1550 1551 // t.CreatedAt (string) (string) 1552 - if t.CreatedAt != nil { 1553 1554 - if len("createdAt") > 1000000 { 1555 - return xerrors.Errorf("Value in field \"createdAt\" was too long") 1556 - } 1557 1558 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { 1559 - return err 1560 - } 1561 - if _, err := cw.WriteString(string("createdAt")); err != nil { 1562 - return err 1563 - } 1564 1565 - if t.CreatedAt == nil { 1566 - if _, err := cw.Write(cbg.CborNull); err != nil { 1567 - return err 1568 - } 1569 - } else { 1570 - if len(*t.CreatedAt) > 1000000 { 1571 - return xerrors.Errorf("Value in field t.CreatedAt was too long") 1572 - } 1573 - 1574 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.CreatedAt))); err != nil { 1575 - return err 1576 - } 1577 - if _, err := cw.WriteString(string(*t.CreatedAt)); err != nil { 1578 - return err 1579 - } 1580 - } 1581 } 1582 return nil 1583 } ··· 1718 case "createdAt": 1719 1720 { 1721 - b, err := cr.ReadByte() 1722 if err != nil { 1723 return err 1724 } 1725 - if b != cbg.CborNull[0] { 1726 - if err := cr.UnreadByte(); err != nil { 1727 - return err 1728 - } 1729 1730 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 1731 - if err != nil { 1732 - return err 1733 - } 1734 - 1735 - t.CreatedAt = (*string)(&sval) 1736 - } 1737 } 1738 1739 default: ··· 1754 1755 cw := cbg.NewCborWriter(w) 1756 fieldCount := 7 1757 - 1758 - if t.AddedAt == nil { 1759 - fieldCount-- 1760 - } 1761 1762 if t.Description == nil { 1763 fieldCount-- ··· 1891 } 1892 } 1893 1894 - // t.AddedAt (string) (string) 1895 - if t.AddedAt != nil { 1896 - 1897 - if len("addedAt") > 1000000 { 1898 - return xerrors.Errorf("Value in field \"addedAt\" was too long") 1899 - } 1900 1901 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("addedAt"))); err != nil { 1902 - return err 1903 - } 1904 - if _, err := cw.WriteString(string("addedAt")); err != nil { 1905 - return err 1906 - } 1907 1908 - if t.AddedAt == nil { 1909 - if _, err := cw.Write(cbg.CborNull); err != nil { 1910 - return err 1911 - } 1912 - } else { 1913 - if len(*t.AddedAt) > 1000000 { 1914 - return xerrors.Errorf("Value in field t.AddedAt was too long") 1915 - } 1916 1917 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.AddedAt))); err != nil { 1918 - return err 1919 - } 1920 - if _, err := cw.WriteString(string(*t.AddedAt)); err != nil { 1921 - return err 1922 - } 1923 - } 1924 } 1925 1926 // t.Description (string) (string) ··· 2063 t.Source = (*string)(&sval) 2064 } 2065 } 2066 - // t.AddedAt (string) (string) 2067 - case "addedAt": 2068 2069 { 2070 - b, err := cr.ReadByte() 2071 if err != nil { 2072 return err 2073 } 2074 - if b != cbg.CborNull[0] { 2075 - if err := cr.UnreadByte(); err != nil { 2076 - return err 2077 - } 2078 2079 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 2080 - if err != nil { 2081 - return err 2082 - } 2083 - 2084 - t.AddedAt = (*string)(&sval) 2085 - } 2086 } 2087 // t.Description (string) (string) 2088 case "description": ··· 2126 fieldCount := 9 2127 2128 if t.Body == nil { 2129 - fieldCount-- 2130 - } 2131 - 2132 - if t.CreatedAt == nil { 2133 fieldCount-- 2134 } 2135 ··· 2280 } 2281 2282 // t.CreatedAt (string) (string) 2283 - if t.CreatedAt != nil { 2284 2285 - if len("createdAt") > 1000000 { 2286 - return xerrors.Errorf("Value in field \"createdAt\" was too long") 2287 - } 2288 2289 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { 2290 - return err 2291 - } 2292 - if _, err := cw.WriteString(string("createdAt")); err != nil { 2293 - return err 2294 - } 2295 2296 - if t.CreatedAt == nil { 2297 - if _, err := cw.Write(cbg.CborNull); err != nil { 2298 - return err 2299 - } 2300 - } else { 2301 - if len(*t.CreatedAt) > 1000000 { 2302 - return xerrors.Errorf("Value in field t.CreatedAt was too long") 2303 - } 2304 - 2305 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.CreatedAt))); err != nil { 2306 - return err 2307 - } 2308 - if _, err := cw.WriteString(string(*t.CreatedAt)); err != nil { 2309 - return err 2310 - } 2311 - } 2312 } 2313 2314 // t.TargetRepo (string) (string) ··· 2504 case "createdAt": 2505 2506 { 2507 - b, err := cr.ReadByte() 2508 if err != nil { 2509 return err 2510 } 2511 - if b != cbg.CborNull[0] { 2512 - if err := cr.UnreadByte(); err != nil { 2513 - return err 2514 - } 2515 2516 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 2517 - if err != nil { 2518 - return err 2519 - } 2520 - 2521 - t.CreatedAt = (*string)(&sval) 2522 - } 2523 } 2524 // t.TargetRepo (string) (string) 2525 case "targetRepo": ··· 2719 } 2720 2721 cw := cbg.NewCborWriter(w) 2722 - fieldCount := 3 2723 2724 - if t.Status == nil { 2725 - fieldCount-- 2726 - } 2727 - 2728 - if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 2729 return err 2730 } 2731 ··· 2772 } 2773 2774 // t.Status (string) (string) 2775 - if t.Status != nil { 2776 2777 - if len("status") > 1000000 { 2778 - return xerrors.Errorf("Value in field \"status\" was too long") 2779 - } 2780 2781 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil { 2782 - return err 2783 - } 2784 - if _, err := cw.WriteString(string("status")); err != nil { 2785 - return err 2786 - } 2787 - 2788 - if t.Status == nil { 2789 - if _, err := cw.Write(cbg.CborNull); err != nil { 2790 - return err 2791 - } 2792 - } else { 2793 - if len(*t.Status) > 1000000 { 2794 - return xerrors.Errorf("Value in field t.Status was too long") 2795 - } 2796 2797 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Status))); err != nil { 2798 - return err 2799 - } 2800 - if _, err := cw.WriteString(string(*t.Status)); err != nil { 2801 - return err 2802 - } 2803 - } 2804 } 2805 return nil 2806 } ··· 2872 case "status": 2873 2874 { 2875 - b, err := cr.ReadByte() 2876 if err != nil { 2877 return err 2878 } 2879 - if b != cbg.CborNull[0] { 2880 - if err := cr.UnreadByte(); err != nil { 2881 - return err 2882 - } 2883 2884 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 2885 - if err != nil { 2886 - return err 2887 - } 2888 - 2889 - t.Status = (*string)(&sval) 2890 - } 2891 } 2892 2893 default: ··· 2909 cw := cbg.NewCborWriter(w) 2910 fieldCount := 7 2911 2912 - if t.Body == nil { 2913 - fieldCount-- 2914 - } 2915 - 2916 if t.CommentId == nil { 2917 fieldCount-- 2918 } 2919 2920 - if t.CreatedAt == nil { 2921 - fieldCount-- 2922 - } 2923 - 2924 if t.Owner == nil { 2925 fieldCount-- 2926 } ··· 2934 } 2935 2936 // t.Body (string) (string) 2937 - if t.Body != nil { 2938 - 2939 - if len("body") > 1000000 { 2940 - return xerrors.Errorf("Value in field \"body\" was too long") 2941 - } 2942 2943 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil { 2944 - return err 2945 - } 2946 - if _, err := cw.WriteString(string("body")); err != nil { 2947 - return err 2948 - } 2949 2950 - if t.Body == nil { 2951 - if _, err := cw.Write(cbg.CborNull); err != nil { 2952 - return err 2953 - } 2954 - } else { 2955 - if len(*t.Body) > 1000000 { 2956 - return xerrors.Errorf("Value in field t.Body was too long") 2957 - } 2958 2959 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Body))); err != nil { 2960 - return err 2961 - } 2962 - if _, err := cw.WriteString(string(*t.Body)); err != nil { 2963 - return err 2964 - } 2965 - } 2966 } 2967 2968 // t.Pull (string) (string) ··· 3104 } 3105 3106 // t.CreatedAt (string) (string) 3107 - if t.CreatedAt != nil { 3108 3109 - if len("createdAt") > 1000000 { 3110 - return xerrors.Errorf("Value in field \"createdAt\" was too long") 3111 - } 3112 3113 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { 3114 - return err 3115 - } 3116 - if _, err := cw.WriteString(string("createdAt")); err != nil { 3117 - return err 3118 - } 3119 3120 - if t.CreatedAt == nil { 3121 - if _, err := cw.Write(cbg.CborNull); err != nil { 3122 - return err 3123 - } 3124 - } else { 3125 - if len(*t.CreatedAt) > 1000000 { 3126 - return xerrors.Errorf("Value in field t.CreatedAt was too long") 3127 - } 3128 - 3129 - if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.CreatedAt))); err != nil { 3130 - return err 3131 - } 3132 - if _, err := cw.WriteString(string(*t.CreatedAt)); err != nil { 3133 - return err 3134 - } 3135 - } 3136 } 3137 return nil 3138 } ··· 3182 case "body": 3183 3184 { 3185 - b, err := cr.ReadByte() 3186 if err != nil { 3187 return err 3188 } 3189 - if b != cbg.CborNull[0] { 3190 - if err := cr.UnreadByte(); err != nil { 3191 - return err 3192 - } 3193 3194 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 3195 - if err != nil { 3196 - return err 3197 - } 3198 - 3199 - t.Body = (*string)(&sval) 3200 - } 3201 } 3202 // t.Pull (string) (string) 3203 case "pull": ··· 3303 case "createdAt": 3304 3305 { 3306 - b, err := cr.ReadByte() 3307 if err != nil { 3308 return err 3309 } 3310 - if b != cbg.CborNull[0] { 3311 - if err := cr.UnreadByte(); err != nil { 3312 - return err 3313 - } 3314 3315 - sval, err := cbg.ReadStringWithMax(cr, 1000000) 3316 - if err != nil { 3317 - return err 3318 - } 3319 - 3320 - t.CreatedAt = (*string)(&sval) 3321 - } 3322 } 3323 3324 default:
··· 353 } 354 355 cw := cbg.NewCborWriter(w) 356 357 + if _, err := cw.Write([]byte{164}); err != nil { 358 return err 359 } 360 ··· 400 return err 401 } 402 403 + // t.Subject (string) (string) 404 + if len("subject") > 1000000 { 405 + return xerrors.Errorf("Value in field \"subject\" was too long") 406 } 407 408 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("subject"))); err != nil { 409 return err 410 } 411 + if _, err := cw.WriteString(string("subject")); err != nil { 412 return err 413 } 414 415 + if len(t.Subject) > 1000000 { 416 + return xerrors.Errorf("Value in field t.Subject was too long") 417 } 418 419 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Subject))); err != nil { 420 return err 421 } 422 + if _, err := cw.WriteString(string(t.Subject)); err != nil { 423 return err 424 } 425 426 + // t.CreatedAt (string) (string) 427 + if len("createdAt") > 1000000 { 428 + return xerrors.Errorf("Value in field \"createdAt\" was too long") 429 + } 430 431 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { 432 + return err 433 + } 434 + if _, err := cw.WriteString(string("createdAt")); err != nil { 435 + return err 436 + } 437 438 + if len(t.CreatedAt) > 1000000 { 439 + return xerrors.Errorf("Value in field t.CreatedAt was too long") 440 + } 441 442 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { 443 + return err 444 + } 445 + if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { 446 + return err 447 } 448 return nil 449 } ··· 473 474 n := extra 475 476 + nameBuf := make([]byte, 9) 477 for i := uint64(0); i < n; i++ { 478 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 479 if err != nil { ··· 511 512 t.Domain = string(sval) 513 } 514 + // t.Subject (string) (string) 515 + case "subject": 516 517 { 518 sval, err := cbg.ReadStringWithMax(cr, 1000000) ··· 520 return err 521 } 522 523 + t.Subject = string(sval) 524 } 525 + // t.CreatedAt (string) (string) 526 + case "createdAt": 527 528 { 529 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 530 if err != nil { 531 return err 532 } 533 534 + t.CreatedAt = string(sval) 535 } 536 537 default: ··· 621 return err 622 } 623 624 + // t.CreatedAt (string) (string) 625 + if len("createdAt") > 1000000 { 626 + return xerrors.Errorf("Value in field \"createdAt\" was too long") 627 } 628 629 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { 630 return err 631 } 632 + if _, err := cw.WriteString(string("createdAt")); err != nil { 633 return err 634 } 635 636 + if len(t.CreatedAt) > 1000000 { 637 + return xerrors.Errorf("Value in field t.CreatedAt was too long") 638 } 639 640 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { 641 return err 642 } 643 + if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { 644 return err 645 } 646 return nil ··· 671 672 n := extra 673 674 + nameBuf := make([]byte, 9) 675 for i := uint64(0); i < n; i++ { 676 nameLen, ok, err := cbg.ReadFullStringIntoBuf(cr, nameBuf, 1000000) 677 if err != nil { ··· 720 721 t.LexiconTypeID = string(sval) 722 } 723 + // t.CreatedAt (string) (string) 724 + case "createdAt": 725 726 { 727 sval, err := cbg.ReadStringWithMax(cr, 1000000) ··· 729 return err 730 } 731 732 + t.CreatedAt = string(sval) 733 } 734 735 default: ··· 751 cw := cbg.NewCborWriter(w) 752 fieldCount := 7 753 754 if t.CommentId == nil { 755 fieldCount-- 756 } 757 758 if t.Owner == nil { 759 fieldCount-- 760 } ··· 768 } 769 770 // t.Body (string) (string) 771 + if len("body") > 1000000 { 772 + return xerrors.Errorf("Value in field \"body\" was too long") 773 + } 774 775 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil { 776 + return err 777 + } 778 + if _, err := cw.WriteString(string("body")); err != nil { 779 + return err 780 + } 781 782 + if len(t.Body) > 1000000 { 783 + return xerrors.Errorf("Value in field t.Body was too long") 784 + } 785 786 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Body))); err != nil { 787 + return err 788 + } 789 + if _, err := cw.WriteString(string(t.Body)); err != nil { 790 + return err 791 } 792 793 // t.Repo (string) (string) ··· 929 } 930 931 // t.CreatedAt (string) (string) 932 + if len("createdAt") > 1000000 { 933 + return xerrors.Errorf("Value in field \"createdAt\" was too long") 934 + } 935 936 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { 937 + return err 938 + } 939 + if _, err := cw.WriteString(string("createdAt")); err != nil { 940 + return err 941 + } 942 943 + if len(t.CreatedAt) > 1000000 { 944 + return xerrors.Errorf("Value in field t.CreatedAt was too long") 945 + } 946 947 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { 948 + return err 949 + } 950 + if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { 951 + return err 952 } 953 return nil 954 } ··· 998 case "body": 999 1000 { 1001 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 1002 if err != nil { 1003 return err 1004 } 1005 1006 + t.Body = string(sval) 1007 } 1008 // t.Repo (string) (string) 1009 case "repo": ··· 1109 case "createdAt": 1110 1111 { 1112 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 1113 if err != nil { 1114 return err 1115 } 1116 1117 + t.CreatedAt = string(sval) 1118 } 1119 1120 default: ··· 1134 } 1135 1136 cw := cbg.NewCborWriter(w) 1137 1138 + if _, err := cw.Write([]byte{163}); err != nil { 1139 return err 1140 } 1141 ··· 1182 } 1183 1184 // t.State (string) (string) 1185 + if len("state") > 1000000 { 1186 + return xerrors.Errorf("Value in field \"state\" was too long") 1187 + } 1188 1189 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("state"))); err != nil { 1190 + return err 1191 + } 1192 + if _, err := cw.WriteString(string("state")); err != nil { 1193 + return err 1194 + } 1195 1196 + if len(t.State) > 1000000 { 1197 + return xerrors.Errorf("Value in field t.State was too long") 1198 + } 1199 1200 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.State))); err != nil { 1201 + return err 1202 + } 1203 + if _, err := cw.WriteString(string(t.State)); err != nil { 1204 + return err 1205 } 1206 return nil 1207 } ··· 1273 case "state": 1274 1275 { 1276 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 1277 if err != nil { 1278 return err 1279 } 1280 1281 + t.State = string(sval) 1282 } 1283 1284 default: ··· 1301 fieldCount := 7 1302 1303 if t.Body == nil { 1304 fieldCount-- 1305 } 1306 ··· 1451 } 1452 1453 // t.CreatedAt (string) (string) 1454 + if len("createdAt") > 1000000 { 1455 + return xerrors.Errorf("Value in field \"createdAt\" was too long") 1456 + } 1457 1458 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { 1459 + return err 1460 + } 1461 + if _, err := cw.WriteString(string("createdAt")); err != nil { 1462 + return err 1463 + } 1464 1465 + if len(t.CreatedAt) > 1000000 { 1466 + return xerrors.Errorf("Value in field t.CreatedAt was too long") 1467 + } 1468 1469 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { 1470 + return err 1471 + } 1472 + if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { 1473 + return err 1474 } 1475 return nil 1476 } ··· 1611 case "createdAt": 1612 1613 { 1614 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 1615 if err != nil { 1616 return err 1617 } 1618 1619 + t.CreatedAt = string(sval) 1620 } 1621 1622 default: ··· 1637 1638 cw := cbg.NewCborWriter(w) 1639 fieldCount := 7 1640 1641 if t.Description == nil { 1642 fieldCount-- ··· 1770 } 1771 } 1772 1773 + // t.CreatedAt (string) (string) 1774 + if len("createdAt") > 1000000 { 1775 + return xerrors.Errorf("Value in field \"createdAt\" was too long") 1776 + } 1777 1778 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { 1779 + return err 1780 + } 1781 + if _, err := cw.WriteString(string("createdAt")); err != nil { 1782 + return err 1783 + } 1784 1785 + if len(t.CreatedAt) > 1000000 { 1786 + return xerrors.Errorf("Value in field t.CreatedAt was too long") 1787 + } 1788 1789 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { 1790 + return err 1791 + } 1792 + if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { 1793 + return err 1794 } 1795 1796 // t.Description (string) (string) ··· 1933 t.Source = (*string)(&sval) 1934 } 1935 } 1936 + // t.CreatedAt (string) (string) 1937 + case "createdAt": 1938 1939 { 1940 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 1941 if err != nil { 1942 return err 1943 } 1944 1945 + t.CreatedAt = string(sval) 1946 } 1947 // t.Description (string) (string) 1948 case "description": ··· 1986 fieldCount := 9 1987 1988 if t.Body == nil { 1989 fieldCount-- 1990 } 1991 ··· 2136 } 2137 2138 // t.CreatedAt (string) (string) 2139 + if len("createdAt") > 1000000 { 2140 + return xerrors.Errorf("Value in field \"createdAt\" was too long") 2141 + } 2142 2143 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { 2144 + return err 2145 + } 2146 + if _, err := cw.WriteString(string("createdAt")); err != nil { 2147 + return err 2148 + } 2149 2150 + if len(t.CreatedAt) > 1000000 { 2151 + return xerrors.Errorf("Value in field t.CreatedAt was too long") 2152 + } 2153 2154 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { 2155 + return err 2156 + } 2157 + if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { 2158 + return err 2159 } 2160 2161 // t.TargetRepo (string) (string) ··· 2351 case "createdAt": 2352 2353 { 2354 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 2355 if err != nil { 2356 return err 2357 } 2358 2359 + t.CreatedAt = string(sval) 2360 } 2361 // t.TargetRepo (string) (string) 2362 case "targetRepo": ··· 2556 } 2557 2558 cw := cbg.NewCborWriter(w) 2559 2560 + if _, err := cw.Write([]byte{163}); err != nil { 2561 return err 2562 } 2563 ··· 2604 } 2605 2606 // t.Status (string) (string) 2607 + if len("status") > 1000000 { 2608 + return xerrors.Errorf("Value in field \"status\" was too long") 2609 + } 2610 2611 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("status"))); err != nil { 2612 + return err 2613 + } 2614 + if _, err := cw.WriteString(string("status")); err != nil { 2615 + return err 2616 + } 2617 2618 + if len(t.Status) > 1000000 { 2619 + return xerrors.Errorf("Value in field t.Status was too long") 2620 + } 2621 2622 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Status))); err != nil { 2623 + return err 2624 + } 2625 + if _, err := cw.WriteString(string(t.Status)); err != nil { 2626 + return err 2627 } 2628 return nil 2629 } ··· 2695 case "status": 2696 2697 { 2698 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 2699 if err != nil { 2700 return err 2701 } 2702 2703 + t.Status = string(sval) 2704 } 2705 2706 default: ··· 2722 cw := cbg.NewCborWriter(w) 2723 fieldCount := 7 2724 2725 if t.CommentId == nil { 2726 fieldCount-- 2727 } 2728 2729 if t.Owner == nil { 2730 fieldCount-- 2731 } ··· 2739 } 2740 2741 // t.Body (string) (string) 2742 + if len("body") > 1000000 { 2743 + return xerrors.Errorf("Value in field \"body\" was too long") 2744 + } 2745 2746 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("body"))); err != nil { 2747 + return err 2748 + } 2749 + if _, err := cw.WriteString(string("body")); err != nil { 2750 + return err 2751 + } 2752 2753 + if len(t.Body) > 1000000 { 2754 + return xerrors.Errorf("Value in field t.Body was too long") 2755 + } 2756 2757 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Body))); err != nil { 2758 + return err 2759 + } 2760 + if _, err := cw.WriteString(string(t.Body)); err != nil { 2761 + return err 2762 } 2763 2764 // t.Pull (string) (string) ··· 2900 } 2901 2902 // t.CreatedAt (string) (string) 2903 + if len("createdAt") > 1000000 { 2904 + return xerrors.Errorf("Value in field \"createdAt\" was too long") 2905 + } 2906 2907 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { 2908 + return err 2909 + } 2910 + if _, err := cw.WriteString(string("createdAt")); err != nil { 2911 + return err 2912 + } 2913 2914 + if len(t.CreatedAt) > 1000000 { 2915 + return xerrors.Errorf("Value in field t.CreatedAt was too long") 2916 + } 2917 2918 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { 2919 + return err 2920 + } 2921 + if _, err := cw.WriteString(string(t.CreatedAt)); err != nil { 2922 + return err 2923 } 2924 return nil 2925 } ··· 2969 case "body": 2970 2971 { 2972 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 2973 if err != nil { 2974 return err 2975 } 2976 2977 + t.Body = string(sval) 2978 } 2979 // t.Pull (string) (string) 2980 case "pull": ··· 3080 case "createdAt": 3081 3082 { 3083 + sval, err := cbg.ReadStringWithMax(cr, 1000000) 3084 if err != nil { 3085 return err 3086 } 3087 3088 + t.CreatedAt = string(sval) 3089 } 3090 3091 default:
+2 -2
api/tangled/issuecomment.go
··· 18 // RECORDTYPE: RepoIssueComment 19 type RepoIssueComment struct { 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue.comment" cborgen:"$type,const=sh.tangled.repo.issue.comment"` 21 - Body *string `json:"body,omitempty" cborgen:"body,omitempty"` 22 CommentId *int64 `json:"commentId,omitempty" cborgen:"commentId,omitempty"` 23 - CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"` 24 Issue string `json:"issue" cborgen:"issue"` 25 Owner *string `json:"owner,omitempty" cborgen:"owner,omitempty"` 26 Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"`
··· 18 // RECORDTYPE: RepoIssueComment 19 type RepoIssueComment struct { 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue.comment" cborgen:"$type,const=sh.tangled.repo.issue.comment"` 21 + Body string `json:"body" cborgen:"body"` 22 CommentId *int64 `json:"commentId,omitempty" cborgen:"commentId,omitempty"` 23 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 24 Issue string `json:"issue" cborgen:"issue"` 25 Owner *string `json:"owner,omitempty" cborgen:"owner,omitempty"` 26 Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"`
+1 -1
api/tangled/issuestate.go
··· 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue.state" cborgen:"$type,const=sh.tangled.repo.issue.state"` 21 Issue string `json:"issue" cborgen:"issue"` 22 // state: state of the issue 23 - State *string `json:"state,omitempty" cborgen:"state,omitempty"` 24 }
··· 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue.state" cborgen:"$type,const=sh.tangled.repo.issue.state"` 21 Issue string `json:"issue" cborgen:"issue"` 22 // state: state of the issue 23 + State string `json:"state" cborgen:"state"` 24 }
+4 -4
api/tangled/knotmember.go
··· 17 } // 18 // RECORDTYPE: KnotMember 19 type KnotMember struct { 20 - LexiconTypeID string `json:"$type,const=sh.tangled.knot.member" cborgen:"$type,const=sh.tangled.knot.member"` 21 - AddedAt *string `json:"addedAt,omitempty" cborgen:"addedAt,omitempty"` 22 // domain: domain that this member now belongs to 23 - Domain string `json:"domain" cborgen:"domain"` 24 - Member string `json:"member" cborgen:"member"` 25 }
··· 17 } // 18 // RECORDTYPE: KnotMember 19 type KnotMember struct { 20 + LexiconTypeID string `json:"$type,const=sh.tangled.knot.member" cborgen:"$type,const=sh.tangled.knot.member"` 21 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 22 // domain: domain that this member now belongs to 23 + Domain string `json:"domain" cborgen:"domain"` 24 + Subject string `json:"subject" cborgen:"subject"` 25 }
+2 -2
api/tangled/pullcomment.go
··· 18 // RECORDTYPE: RepoPullComment 19 type RepoPullComment struct { 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.pull.comment" cborgen:"$type,const=sh.tangled.repo.pull.comment"` 21 - Body *string `json:"body,omitempty" cborgen:"body,omitempty"` 22 CommentId *int64 `json:"commentId,omitempty" cborgen:"commentId,omitempty"` 23 - CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"` 24 Owner *string `json:"owner,omitempty" cborgen:"owner,omitempty"` 25 Pull string `json:"pull" cborgen:"pull"` 26 Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"`
··· 18 // RECORDTYPE: RepoPullComment 19 type RepoPullComment struct { 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.pull.comment" cborgen:"$type,const=sh.tangled.repo.pull.comment"` 21 + Body string `json:"body" cborgen:"body"` 22 CommentId *int64 `json:"commentId,omitempty" cborgen:"commentId,omitempty"` 23 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 24 Owner *string `json:"owner,omitempty" cborgen:"owner,omitempty"` 25 Pull string `json:"pull" cborgen:"pull"` 26 Repo *string `json:"repo,omitempty" cborgen:"repo,omitempty"`
+1 -1
api/tangled/pullstatus.go
··· 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.pull.status" cborgen:"$type,const=sh.tangled.repo.pull.status"` 21 Pull string `json:"pull" cborgen:"pull"` 22 // status: status of the pull request 23 - Status *string `json:"status,omitempty" cborgen:"status,omitempty"` 24 }
··· 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.pull.status" cborgen:"$type,const=sh.tangled.repo.pull.status"` 21 Pull string `json:"pull" cborgen:"pull"` 22 // status: status of the pull request 23 + Status string `json:"status" cborgen:"status"` 24 }
+1 -1
api/tangled/repoissue.go
··· 19 type RepoIssue struct { 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue" cborgen:"$type,const=sh.tangled.repo.issue"` 21 Body *string `json:"body,omitempty" cborgen:"body,omitempty"` 22 - CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"` 23 IssueId int64 `json:"issueId" cborgen:"issueId"` 24 Owner string `json:"owner" cborgen:"owner"` 25 Repo string `json:"repo" cborgen:"repo"`
··· 19 type RepoIssue struct { 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.issue" cborgen:"$type,const=sh.tangled.repo.issue"` 21 Body *string `json:"body,omitempty" cborgen:"body,omitempty"` 22 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 23 IssueId int64 `json:"issueId" cborgen:"issueId"` 24 Owner string `json:"owner" cborgen:"owner"` 25 Repo string `json:"repo" cborgen:"repo"`
+1 -1
api/tangled/repopull.go
··· 19 type RepoPull struct { 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.pull" cborgen:"$type,const=sh.tangled.repo.pull"` 21 Body *string `json:"body,omitempty" cborgen:"body,omitempty"` 22 - CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"` 23 Patch string `json:"patch" cborgen:"patch"` 24 PullId int64 `json:"pullId" cborgen:"pullId"` 25 Source *RepoPull_Source `json:"source,omitempty" cborgen:"source,omitempty"`
··· 19 type RepoPull struct { 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo.pull" cborgen:"$type,const=sh.tangled.repo.pull"` 21 Body *string `json:"body,omitempty" cborgen:"body,omitempty"` 22 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 23 Patch string `json:"patch" cborgen:"patch"` 24 PullId int64 `json:"pullId" cborgen:"pullId"` 25 Source *RepoPull_Source `json:"source,omitempty" cborgen:"source,omitempty"`
+2 -2
api/tangled/tangledpublicKey.go
··· 18 // RECORDTYPE: PublicKey 19 type PublicKey struct { 20 LexiconTypeID string `json:"$type,const=sh.tangled.publicKey" cborgen:"$type,const=sh.tangled.publicKey"` 21 - // created: key upload timestamp 22 - Created string `json:"created" cborgen:"created"` 23 // key: public key contents 24 Key string `json:"key" cborgen:"key"` 25 // name: human-readable name for this key
··· 18 // RECORDTYPE: PublicKey 19 type PublicKey struct { 20 LexiconTypeID string `json:"$type,const=sh.tangled.publicKey" cborgen:"$type,const=sh.tangled.publicKey"` 21 + // createdAt: key upload timestamp 22 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 23 // key: public key contents 24 Key string `json:"key" cborgen:"key"` 25 // name: human-readable name for this key
+1 -1
api/tangled/tangledrepo.go
··· 18 // RECORDTYPE: Repo 19 type Repo struct { 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo" cborgen:"$type,const=sh.tangled.repo"` 21 - AddedAt *string `json:"addedAt,omitempty" cborgen:"addedAt,omitempty"` 22 Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 23 // knot: knot where the repo was created 24 Knot string `json:"knot" cborgen:"knot"`
··· 18 // RECORDTYPE: Repo 19 type Repo struct { 20 LexiconTypeID string `json:"$type,const=sh.tangled.repo" cborgen:"$type,const=sh.tangled.repo"` 21 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 22 Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 23 // knot: knot where the repo was created 24 Knot string `json:"knot" cborgen:"knot"`
+2 -2
appview/pages/templates/knot.html
··· 83 class="max-w-2xl space-y-4"> 84 <input 85 type="text" 86 - id="member" 87 - name="member" 88 placeholder="did or handle" 89 required 90 class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:placeholder-gray-400"/>
··· 83 class="max-w-2xl space-y-4"> 84 <input 85 type="text" 86 + id="subject" 87 + name="subject" 88 placeholder="did or handle" 89 required 90 class="w-full dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:placeholder-gray-400"/>
+3 -3
appview/settings/settings.go
··· 384 Rkey: rkey, 385 Record: &lexutil.LexiconTypeDecoder{ 386 Val: &tangled.PublicKey{ 387 - Created: time.Now().Format(time.RFC3339), 388 - Key: key, 389 - Name: name, 390 }}, 391 }) 392 // invalid record
··· 384 Rkey: rkey, 385 Record: &lexutil.LexiconTypeDecoder{ 386 Val: &tangled.PublicKey{ 387 + CreatedAt: time.Now().Format(time.RFC3339), 388 + Key: key, 389 + Name: name, 390 }}, 391 }) 392 // invalid record
+2 -2
appview/state/pull.go
··· 530 Repo: &atUri, 531 Pull: string(pullAt), 532 Owner: &ownerDid, 533 - Body: &body, 534 - CreatedAt: &createdAt, 535 }, 536 }, 537 })
··· 530 Repo: &atUri, 531 Pull: string(pullAt), 532 Owner: &ownerDid, 533 + Body: body, 534 + CreatedAt: createdAt, 535 }, 536 }, 537 })
+15 -15
appview/state/repo.go
··· 217 Knot: f.Knot, 218 Name: f.RepoName, 219 Owner: user.Did, 220 - AddedAt: &f.AddedAt, 221 Description: &newDescription, 222 }, 223 }, ··· 851 RepoName string 852 RepoAt syntax.ATURI 853 Description string 854 - AddedAt string 855 } 856 857 func (f *FullyResolvedRepo) OwnerDid() string { ··· 1122 Record: &lexutil.LexiconTypeDecoder{ 1123 Val: &tangled.RepoIssueState{ 1124 Issue: issue.IssueAt, 1125 - State: &closed, 1126 }, 1127 }, 1128 }) ··· 1260 Issue: issueAt, 1261 CommentId: &commentIdInt64, 1262 Owner: &ownerDid, 1263 - Body: &body, 1264 - CreatedAt: &createdAt, 1265 }, 1266 }, 1267 }) ··· 1429 Issue: issueAt, 1430 CommentId: &commentIdInt64, 1431 Owner: &comment.OwnerDid, 1432 - Body: &newBody, 1433 - CreatedAt: &createdAt, 1434 }, 1435 }, 1436 }) ··· 1760 } else { 1761 uri = "https" 1762 } 1763 - sourceUrl := fmt.Sprintf("%s://%s/%s/%s", uri, f.Knot, f.OwnerDid(), f.RepoName) 1764 sourceAt := f.RepoAt.String() 1765 1766 rkey := appview.TID() ··· 1786 } 1787 }() 1788 1789 - resp, err := client.ForkRepo(user.Did, sourceUrl, forkName) 1790 if err != nil { 1791 s.pages.Notice(w, "repo", "Failed to create repository on knot server.") 1792 return ··· 1804 1805 xrpcClient, _ := s.auth.AuthorizedClient(r) 1806 1807 - addedAt := time.Now().Format(time.RFC3339) 1808 atresp, err := comatproto.RepoPutRecord(r.Context(), xrpcClient, &comatproto.RepoPutRecord_Input{ 1809 Collection: tangled.RepoNSID, 1810 Repo: user.Did, 1811 Rkey: rkey, 1812 Record: &lexutil.LexiconTypeDecoder{ 1813 Val: &tangled.Repo{ 1814 - Knot: repo.Knot, 1815 - Name: repo.Name, 1816 - AddedAt: &addedAt, 1817 - Owner: user.Did, 1818 - Source: &sourceAt, 1819 }}, 1820 }) 1821 if err != nil {
··· 217 Knot: f.Knot, 218 Name: f.RepoName, 219 Owner: user.Did, 220 + CreatedAt: f.CreatedAt, 221 Description: &newDescription, 222 }, 223 }, ··· 851 RepoName string 852 RepoAt syntax.ATURI 853 Description string 854 + CreatedAt string 855 } 856 857 func (f *FullyResolvedRepo) OwnerDid() string { ··· 1122 Record: &lexutil.LexiconTypeDecoder{ 1123 Val: &tangled.RepoIssueState{ 1124 Issue: issue.IssueAt, 1125 + State: closed, 1126 }, 1127 }, 1128 }) ··· 1260 Issue: issueAt, 1261 CommentId: &commentIdInt64, 1262 Owner: &ownerDid, 1263 + Body: body, 1264 + CreatedAt: createdAt, 1265 }, 1266 }, 1267 }) ··· 1429 Issue: issueAt, 1430 CommentId: &commentIdInt64, 1431 Owner: &comment.OwnerDid, 1432 + Body: newBody, 1433 + CreatedAt: createdAt, 1434 }, 1435 }, 1436 }) ··· 1760 } else { 1761 uri = "https" 1762 } 1763 + forkSourceUrl := fmt.Sprintf("%s://%s/%s/%s", uri, f.Knot, f.OwnerDid(), f.RepoName) 1764 sourceAt := f.RepoAt.String() 1765 1766 rkey := appview.TID() ··· 1786 } 1787 }() 1788 1789 + resp, err := client.ForkRepo(user.Did, forkSourceUrl, forkName) 1790 if err != nil { 1791 s.pages.Notice(w, "repo", "Failed to create repository on knot server.") 1792 return ··· 1804 1805 xrpcClient, _ := s.auth.AuthorizedClient(r) 1806 1807 + createdAt := time.Now().Format(time.RFC3339) 1808 atresp, err := comatproto.RepoPutRecord(r.Context(), xrpcClient, &comatproto.RepoPutRecord_Input{ 1809 Collection: tangled.RepoNSID, 1810 Repo: user.Did, 1811 Rkey: rkey, 1812 Record: &lexutil.LexiconTypeDecoder{ 1813 Val: &tangled.Repo{ 1814 + Knot: repo.Knot, 1815 + Name: repo.Name, 1816 + CreatedAt: createdAt, 1817 + Owner: user.Did, 1818 + Source: &sourceAt, 1819 }}, 1820 }) 1821 if err != nil {
+1 -1
appview/state/repo_util.go
··· 52 RepoName: repoName, 53 RepoAt: parsedRepoAt, 54 Description: description, 55 - AddedAt: addedAt, 56 }, nil 57 } 58
··· 52 RepoName: repoName, 53 RepoAt: parsedRepoAt, 54 Description: description, 55 + CreatedAt: addedAt, 56 }, nil 57 } 58
+16 -16
appview/state/state.go
··· 502 return 503 } 504 505 - memberDid := r.FormValue("member") 506 - if memberDid == "" { 507 http.Error(w, "malformed form", http.StatusBadRequest) 508 return 509 } 510 511 - memberIdent, err := s.resolver.ResolveIdent(r.Context(), memberDid) 512 if err != nil { 513 w.Write([]byte("failed to resolve member did to a handle")) 514 return 515 } 516 - log.Printf("adding %s to %s\n", memberIdent.Handle.String(), domain) 517 518 // announce this relation into the firehose, store into owners' pds 519 client, _ := s.auth.AuthorizedClient(r) 520 currentUser := s.auth.GetUser(r) 521 - addedAt := time.Now().Format(time.RFC3339) 522 resp, err := comatproto.RepoPutRecord(r.Context(), client, &comatproto.RepoPutRecord_Input{ 523 Collection: tangled.KnotMemberNSID, 524 Repo: currentUser.Did, 525 Rkey: appview.TID(), 526 Record: &lexutil.LexiconTypeDecoder{ 527 Val: &tangled.KnotMember{ 528 - Member: memberIdent.DID.String(), 529 - Domain: domain, 530 - AddedAt: &addedAt, 531 }}, 532 }) 533 ··· 550 return 551 } 552 553 - ksResp, err := ksClient.AddMember(memberIdent.DID.String()) 554 if err != nil { 555 log.Printf("failed to make request to %s: %s", domain, err) 556 return ··· 561 return 562 } 563 564 - err = s.enforcer.AddMember(domain, memberIdent.DID.String()) 565 if err != nil { 566 w.Write([]byte(fmt.Sprint("failed to add member: ", err))) 567 return 568 } 569 570 - w.Write([]byte(fmt.Sprint("added member: ", memberIdent.Handle.String()))) 571 } 572 573 func (s *State) RemoveMember(w http.ResponseWriter, r *http.Request) { ··· 657 658 xrpcClient, _ := s.auth.AuthorizedClient(r) 659 660 - addedAt := time.Now().Format(time.RFC3339) 661 atresp, err := comatproto.RepoPutRecord(r.Context(), xrpcClient, &comatproto.RepoPutRecord_Input{ 662 Collection: tangled.RepoNSID, 663 Repo: user.Did, 664 Rkey: rkey, 665 Record: &lexutil.LexiconTypeDecoder{ 666 Val: &tangled.Repo{ 667 - Knot: repo.Knot, 668 - Name: repoName, 669 - AddedAt: &addedAt, 670 - Owner: user.Did, 671 }}, 672 }) 673 if err != nil {
··· 502 return 503 } 504 505 + subjectIdentifier := r.FormValue("subject") 506 + if subjectIdentifier == "" { 507 http.Error(w, "malformed form", http.StatusBadRequest) 508 return 509 } 510 511 + subjectIdentity, err := s.resolver.ResolveIdent(r.Context(), subjectIdentifier) 512 if err != nil { 513 w.Write([]byte("failed to resolve member did to a handle")) 514 return 515 } 516 + log.Printf("adding %s to %s\n", subjectIdentity.Handle.String(), domain) 517 518 // announce this relation into the firehose, store into owners' pds 519 client, _ := s.auth.AuthorizedClient(r) 520 currentUser := s.auth.GetUser(r) 521 + createdAt := time.Now().Format(time.RFC3339) 522 resp, err := comatproto.RepoPutRecord(r.Context(), client, &comatproto.RepoPutRecord_Input{ 523 Collection: tangled.KnotMemberNSID, 524 Repo: currentUser.Did, 525 Rkey: appview.TID(), 526 Record: &lexutil.LexiconTypeDecoder{ 527 Val: &tangled.KnotMember{ 528 + Subject: subjectIdentity.DID.String(), 529 + Domain: domain, 530 + CreatedAt: createdAt, 531 }}, 532 }) 533 ··· 550 return 551 } 552 553 + ksResp, err := ksClient.AddMember(subjectIdentity.DID.String()) 554 if err != nil { 555 log.Printf("failed to make request to %s: %s", domain, err) 556 return ··· 561 return 562 } 563 564 + err = s.enforcer.AddMember(domain, subjectIdentity.DID.String()) 565 if err != nil { 566 w.Write([]byte(fmt.Sprint("failed to add member: ", err))) 567 return 568 } 569 570 + w.Write([]byte(fmt.Sprint("added member: ", subjectIdentity.Handle.String()))) 571 } 572 573 func (s *State) RemoveMember(w http.ResponseWriter, r *http.Request) { ··· 657 658 xrpcClient, _ := s.auth.AuthorizedClient(r) 659 660 + createdAt := time.Now().Format(time.RFC3339) 661 atresp, err := comatproto.RepoPutRecord(r.Context(), xrpcClient, &comatproto.RepoPutRecord_Input{ 662 Collection: tangled.RepoNSID, 663 Repo: user.Did, 664 Rkey: rkey, 665 Record: &lexutil.LexiconTypeDecoder{ 666 Val: &tangled.Repo{ 667 + Knot: repo.Knot, 668 + Name: repoName, 669 + CreatedAt: createdAt, 670 + Owner: user.Did, 671 }}, 672 }) 673 if err != nil {
+9 -9
knotserver/db/pubkeys.go
··· 23 Did: did, 24 } 25 pk.Key = record["key"] 26 - pk.Created = record["created"] 27 28 return d.AddPublicKey(pk) 29 } 30 31 func (d *DB) AddPublicKey(pk PublicKey) error { 32 - if pk.Created == "" { 33 - pk.Created = time.Now().Format(time.RFC3339) 34 } 35 36 query := `insert or ignore into public_keys (did, key, created) values (?, ?, ?)` 37 - _, err := d.db.Exec(query, pk.Did, pk.Key, pk.Created) 38 return err 39 } 40 ··· 46 47 func (pk *PublicKey) JSON() map[string]any { 48 return map[string]any{ 49 - "did": pk.Did, 50 - "key": pk.Key, 51 - "created": pk.Created, 52 } 53 } 54 ··· 63 64 for rows.Next() { 65 var publicKey PublicKey 66 - if err := rows.Scan(&publicKey.Key, &publicKey.Did, &publicKey.Created); err != nil { 67 return nil, err 68 } 69 keys = append(keys, publicKey) ··· 87 88 for rows.Next() { 89 var publicKey PublicKey 90 - if err := rows.Scan(&publicKey.Did, &publicKey.Key, &publicKey.Created); err != nil { 91 return nil, err 92 } 93 keys = append(keys, publicKey)
··· 23 Did: did, 24 } 25 pk.Key = record["key"] 26 + pk.CreatedAt = record["createdAt"] 27 28 return d.AddPublicKey(pk) 29 } 30 31 func (d *DB) AddPublicKey(pk PublicKey) error { 32 + if pk.CreatedAt == "" { 33 + pk.CreatedAt = time.Now().Format(time.RFC3339) 34 } 35 36 query := `insert or ignore into public_keys (did, key, created) values (?, ?, ?)` 37 + _, err := d.db.Exec(query, pk.Did, pk.Key, pk.CreatedAt) 38 return err 39 } 40 ··· 46 47 func (pk *PublicKey) JSON() map[string]any { 48 return map[string]any{ 49 + "did": pk.Did, 50 + "key": pk.Key, 51 + "createdAt": pk.CreatedAt, 52 } 53 } 54 ··· 63 64 for rows.Next() { 65 var publicKey PublicKey 66 + if err := rows.Scan(&publicKey.Key, &publicKey.Did, &publicKey.CreatedAt); err != nil { 67 return nil, err 68 } 69 keys = append(keys, publicKey) ··· 87 88 for rows.Next() { 89 var publicKey PublicKey 90 + if err := rows.Scan(&publicKey.Did, &publicKey.Key, &publicKey.CreatedAt); err != nil { 91 return nil, err 92 } 93 keys = append(keys, publicKey)
+2 -2
knotserver/jetstream.go
··· 43 return fmt.Errorf("failed to enforce permissions: %w", err) 44 } 45 46 - if err := h.e.AddMember(ThisServer, record.Member); err != nil { 47 l.Error("failed to add member", "error", err) 48 return fmt.Errorf("failed to add member: %w", err) 49 } 50 - l.Info("added member from firehose", "member", record.Member) 51 52 if err := h.db.AddDid(did); err != nil { 53 l.Error("failed to add did", "error", err)
··· 43 return fmt.Errorf("failed to enforce permissions: %w", err) 44 } 45 46 + if err := h.e.AddMember(ThisServer, record.Subject); err != nil { 47 l.Error("failed to add member", "error", err) 48 return fmt.Errorf("failed to add member: %w", err) 49 } 50 + l.Info("added member from firehose", "member", record.Subject) 51 52 if err := h.db.AddDid(did); err != nil { 53 l.Error("failed to add did", "error", err)
+6 -7
lexicons/follow.json
··· 10 "record": { 11 "type": "object", 12 "required": [ 13 - "createdAt", 14 - "subject" 15 ], 16 "properties": { 17 "createdAt": { 18 "type": "string", 19 "format": "datetime" 20 - }, 21 - "subject": { 22 - "type": "string", 23 - "format": "did" 24 } 25 } 26 } 27 } 28 } 29 } 30 -
··· 10 "record": { 11 "type": "object", 12 "required": [ 13 + "subject", 14 + "createdAt" 15 ], 16 "properties": { 17 + "subject": { 18 + "type": "string", 19 + "format": "did" 20 + }, 21 "createdAt": { 22 "type": "string", 23 "format": "datetime" 24 } 25 } 26 } 27 } 28 } 29 }
+5 -1
lexicons/issue/comment.json
··· 9 "key": "tid", 10 "record": { 11 "type": "object", 12 - "required": ["issue"], 13 "properties": { 14 "issue": { 15 "type": "string",
··· 9 "key": "tid", 10 "record": { 11 "type": "object", 12 + "required": [ 13 + "issue", 14 + "body", 15 + "createdAt" 16 + ], 17 "properties": { 18 "issue": { 19 "type": "string",
+7 -1
lexicons/issue/issue.json
··· 9 "key": "tid", 10 "record": { 11 "type": "object", 12 - "required": ["repo", "issueId", "owner", "title"], 13 "properties": { 14 "repo": { 15 "type": "string",
··· 9 "key": "tid", 10 "record": { 11 "type": "object", 12 + "required": [ 13 + "repo", 14 + "issueId", 15 + "owner", 16 + "title", 17 + "createdAt" 18 + ], 19 "properties": { 20 "repo": { 21 "type": "string",
+4 -1
lexicons/issue/state.json
··· 9 "key": "tid", 10 "record": { 11 "type": "object", 12 - "required": ["issue"], 13 "properties": { 14 "issue": { 15 "type": "string",
··· 9 "key": "tid", 10 "record": { 11 "type": "object", 12 + "required": [ 13 + "issue", 14 + "state" 15 + ], 16 "properties": { 17 "issue": { 18 "type": "string",
+5 -4
lexicons/member.json
··· 10 "record": { 11 "type": "object", 12 "required": [ 13 - "member", 14 - "domain" 15 ], 16 "properties": { 17 - "member": { 18 "type": "string", 19 "format": "did" 20 }, ··· 22 "type": "string", 23 "description": "domain that this member now belongs to" 24 }, 25 - "addedAt": { 26 "type": "string", 27 "format": "datetime" 28 }
··· 10 "record": { 11 "type": "object", 12 "required": [ 13 + "subject", 14 + "domain", 15 + "createdAt" 16 ], 17 "properties": { 18 + "subject": { 19 "type": "string", 20 "format": "did" 21 }, ··· 23 "type": "string", 24 "description": "domain that this member now belongs to" 25 }, 26 + "createdAt": { 27 "type": "string", 28 "format": "datetime" 29 }
+2 -3
lexicons/publicKey.json
··· 12 "required": [ 13 "key", 14 "name", 15 - "created" 16 ], 17 "properties": { 18 "key": { 19 "type": "string", 20 "maxLength": 4096, 21 - "maxGraphemes": 4096, 22 "description": "public key contents" 23 }, 24 "name": { ··· 26 "format": "string", 27 "description": "human-readable name for this key" 28 }, 29 - "created": { 30 "type": "string", 31 "format": "datetime", 32 "description": "key upload timestamp"
··· 12 "required": [ 13 "key", 14 "name", 15 + "createdAt" 16 ], 17 "properties": { 18 "key": { 19 "type": "string", 20 "maxLength": 4096, 21 "description": "public key contents" 22 }, 23 "name": { ··· 25 "format": "string", 26 "description": "human-readable name for this key" 27 }, 28 + "createdAt": { 29 "type": "string", 30 "format": "datetime", 31 "description": "key upload timestamp"
+5 -1
lexicons/pulls/comment.json
··· 9 "key": "tid", 10 "record": { 11 "type": "object", 12 - "required": ["pull"], 13 "properties": { 14 "pull": { 15 "type": "string",
··· 9 "key": "tid", 10 "record": { 11 "type": "object", 12 + "required": [ 13 + "pull", 14 + "body", 15 + "createdAt" 16 + ], 17 "properties": { 18 "pull": { 19 "type": "string",
+9 -6
lexicons/pulls/pull.json
··· 14 "targetBranch", 15 "pullId", 16 "title", 17 - "patch" 18 ], 19 "properties": { 20 "targetRepo": { ··· 33 "body": { 34 "type": "string" 35 }, 36 - "createdAt": { 37 - "type": "string", 38 - "format": "datetime" 39 - }, 40 "patch": { 41 "type": "string" 42 }, 43 "source": { 44 "type": "ref", 45 "ref": "#source" 46 } 47 } 48 } 49 }, 50 "source": { 51 "type": "object", 52 - "required": ["branch"], 53 "properties": { 54 "branch": { 55 "type": "string"
··· 14 "targetBranch", 15 "pullId", 16 "title", 17 + "patch", 18 + "createdAt" 19 ], 20 "properties": { 21 "targetRepo": { ··· 34 "body": { 35 "type": "string" 36 }, 37 "patch": { 38 "type": "string" 39 }, 40 "source": { 41 "type": "ref", 42 "ref": "#source" 43 + }, 44 + "createdAt": { 45 + "type": "string", 46 + "format": "datetime" 47 } 48 } 49 } 50 }, 51 "source": { 52 "type": "object", 53 + "required": [ 54 + "branch" 55 + ], 56 "properties": { 57 "branch": { 58 "type": "string"
+4 -1
lexicons/pulls/state.json
··· 9 "key": "tid", 10 "record": { 11 "type": "object", 12 - "required": ["pull"], 13 "properties": { 14 "pull": { 15 "type": "string",
··· 9 "key": "tid", 10 "record": { 11 "type": "object", 12 + "required": [ 13 + "pull", 14 + "status" 15 + ], 16 "properties": { 17 "pull": { 18 "type": "string",
+12 -7
lexicons/repo.json
··· 9 "key": "tid", 10 "record": { 11 "type": "object", 12 - "required": ["name", "knot", "owner"], 13 "properties": { 14 "name": { 15 "type": "string", ··· 23 "type": "string", 24 "description": "knot where the repo was created" 25 }, 26 - "addedAt": { 27 - "type": "string", 28 - "format": "datetime" 29 - }, 30 "description": { 31 "type": "string", 32 "format": "datetime", 33 - "minLength": 1, 34 - "maxLength": 140 35 }, 36 "source": { 37 "type": "string", 38 "format": "uri", 39 "description": "source of the repo" 40 } 41 } 42 }
··· 9 "key": "tid", 10 "record": { 11 "type": "object", 12 + "required": [ 13 + "name", 14 + "knot", 15 + "owner", 16 + "createdAt" 17 + ], 18 "properties": { 19 "name": { 20 "type": "string", ··· 28 "type": "string", 29 "description": "knot where the repo was created" 30 }, 31 "description": { 32 "type": "string", 33 "format": "datetime", 34 + "minGraphemes": 1, 35 + "maxGraphemes": 140 36 }, 37 "source": { 38 "type": "string", 39 "format": "uri", 40 "description": "source of the repo" 41 + }, 42 + "createdAt": { 43 + "type": "string", 44 + "format": "datetime" 45 } 46 } 47 }
+6 -8
lexicons/star.json
··· 10 "record": { 11 "type": "object", 12 "required": [ 13 - "createdAt", 14 - "subject" 15 ], 16 "properties": { 17 - "createdAt": { 18 - "type": "string", 19 - "format": "datetime" 20 - }, 21 "subject": { 22 "type": "string", 23 "format": "at-uri" 24 } 25 } 26 } 27 } 28 } 29 } 30 - 31 -
··· 10 "record": { 11 "type": "object", 12 "required": [ 13 + "subject", 14 + "createdAt" 15 ], 16 "properties": { 17 "subject": { 18 "type": "string", 19 "format": "at-uri" 20 + }, 21 + "createdAt": { 22 + "type": "string", 23 + "format": "datetime" 24 } 25 } 26 } 27 } 28 } 29 }