this repo has no description
0
fork

Configure Feed

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

pull in lexicon updates for feed generators (#178)

authored by

Whyrusleeping and committed by
GitHub
dde615f1 8be05e41

+1019 -20
+52 -4
api/atproto/admindefs.go
··· 55 55 } 56 56 57 57 type AdminDefs_ActionViewDetail_Subject struct { 58 - AdminDefs_RepoView *AdminDefs_RepoView 59 - AdminDefs_RecordView *AdminDefs_RecordView 58 + AdminDefs_RepoView *AdminDefs_RepoView 59 + AdminDefs_RepoViewNotFound *AdminDefs_RepoViewNotFound 60 + AdminDefs_RecordView *AdminDefs_RecordView 61 + AdminDefs_RecordViewNotFound *AdminDefs_RecordViewNotFound 60 62 } 61 63 62 64 func (t *AdminDefs_ActionViewDetail_Subject) MarshalJSON() ([]byte, error) { 63 65 if t.AdminDefs_RepoView != nil { 64 66 t.AdminDefs_RepoView.LexiconTypeID = "com.atproto.admin.defs#repoView" 65 67 return json.Marshal(t.AdminDefs_RepoView) 68 + } 69 + if t.AdminDefs_RepoViewNotFound != nil { 70 + t.AdminDefs_RepoViewNotFound.LexiconTypeID = "com.atproto.admin.defs#repoViewNotFound" 71 + return json.Marshal(t.AdminDefs_RepoViewNotFound) 66 72 } 67 73 if t.AdminDefs_RecordView != nil { 68 74 t.AdminDefs_RecordView.LexiconTypeID = "com.atproto.admin.defs#recordView" 69 75 return json.Marshal(t.AdminDefs_RecordView) 70 76 } 77 + if t.AdminDefs_RecordViewNotFound != nil { 78 + t.AdminDefs_RecordViewNotFound.LexiconTypeID = "com.atproto.admin.defs#recordViewNotFound" 79 + return json.Marshal(t.AdminDefs_RecordViewNotFound) 80 + } 71 81 return nil, fmt.Errorf("cannot marshal empty enum") 72 82 } 73 83 func (t *AdminDefs_ActionViewDetail_Subject) UnmarshalJSON(b []byte) error { ··· 80 90 case "com.atproto.admin.defs#repoView": 81 91 t.AdminDefs_RepoView = new(AdminDefs_RepoView) 82 92 return json.Unmarshal(b, t.AdminDefs_RepoView) 93 + case "com.atproto.admin.defs#repoViewNotFound": 94 + t.AdminDefs_RepoViewNotFound = new(AdminDefs_RepoViewNotFound) 95 + return json.Unmarshal(b, t.AdminDefs_RepoViewNotFound) 83 96 case "com.atproto.admin.defs#recordView": 84 97 t.AdminDefs_RecordView = new(AdminDefs_RecordView) 85 98 return json.Unmarshal(b, t.AdminDefs_RecordView) 99 + case "com.atproto.admin.defs#recordViewNotFound": 100 + t.AdminDefs_RecordViewNotFound = new(AdminDefs_RecordViewNotFound) 101 + return json.Unmarshal(b, t.AdminDefs_RecordViewNotFound) 86 102 87 103 default: 88 104 return nil ··· 214 230 Repo *AdminDefs_RepoView `json:"repo" cborgen:"repo"` 215 231 Uri string `json:"uri" cborgen:"uri"` 216 232 Value *util.LexiconTypeDecoder `json:"value" cborgen:"value"` 233 + } 234 + 235 + // AdminDefs_RecordViewNotFound is a "recordViewNotFound" in the com.atproto.admin.defs schema. 236 + // 237 + // RECORDTYPE: AdminDefs_RecordViewNotFound 238 + type AdminDefs_RecordViewNotFound struct { 239 + LexiconTypeID string `json:"$type,const=com.atproto.admin.defs" cborgen:"$type,const=com.atproto.admin.defs"` 240 + Uri string `json:"uri" cborgen:"uri"` 217 241 } 218 242 219 243 // AdminDefs_RepoRef is a "repoRef" in the com.atproto.admin.defs schema. ··· 253 277 RelatedRecords []*util.LexiconTypeDecoder `json:"relatedRecords" cborgen:"relatedRecords"` 254 278 } 255 279 280 + // AdminDefs_RepoViewNotFound is a "repoViewNotFound" in the com.atproto.admin.defs schema. 281 + // 282 + // RECORDTYPE: AdminDefs_RepoViewNotFound 283 + type AdminDefs_RepoViewNotFound struct { 284 + LexiconTypeID string `json:"$type,const=com.atproto.admin.defs" cborgen:"$type,const=com.atproto.admin.defs"` 285 + Did string `json:"did" cborgen:"did"` 286 + } 287 + 256 288 // AdminDefs_ReportView is a "reportView" in the com.atproto.admin.defs schema. 257 289 type AdminDefs_ReportView struct { 258 290 CreatedAt string `json:"createdAt" cborgen:"createdAt"` ··· 276 308 } 277 309 278 310 type AdminDefs_ReportViewDetail_Subject struct { 279 - AdminDefs_RepoView *AdminDefs_RepoView 280 - AdminDefs_RecordView *AdminDefs_RecordView 311 + AdminDefs_RepoView *AdminDefs_RepoView 312 + AdminDefs_RepoViewNotFound *AdminDefs_RepoViewNotFound 313 + AdminDefs_RecordView *AdminDefs_RecordView 314 + AdminDefs_RecordViewNotFound *AdminDefs_RecordViewNotFound 281 315 } 282 316 283 317 func (t *AdminDefs_ReportViewDetail_Subject) MarshalJSON() ([]byte, error) { ··· 285 319 t.AdminDefs_RepoView.LexiconTypeID = "com.atproto.admin.defs#repoView" 286 320 return json.Marshal(t.AdminDefs_RepoView) 287 321 } 322 + if t.AdminDefs_RepoViewNotFound != nil { 323 + t.AdminDefs_RepoViewNotFound.LexiconTypeID = "com.atproto.admin.defs#repoViewNotFound" 324 + return json.Marshal(t.AdminDefs_RepoViewNotFound) 325 + } 288 326 if t.AdminDefs_RecordView != nil { 289 327 t.AdminDefs_RecordView.LexiconTypeID = "com.atproto.admin.defs#recordView" 290 328 return json.Marshal(t.AdminDefs_RecordView) 291 329 } 330 + if t.AdminDefs_RecordViewNotFound != nil { 331 + t.AdminDefs_RecordViewNotFound.LexiconTypeID = "com.atproto.admin.defs#recordViewNotFound" 332 + return json.Marshal(t.AdminDefs_RecordViewNotFound) 333 + } 292 334 return nil, fmt.Errorf("cannot marshal empty enum") 293 335 } 294 336 func (t *AdminDefs_ReportViewDetail_Subject) UnmarshalJSON(b []byte) error { ··· 301 343 case "com.atproto.admin.defs#repoView": 302 344 t.AdminDefs_RepoView = new(AdminDefs_RepoView) 303 345 return json.Unmarshal(b, t.AdminDefs_RepoView) 346 + case "com.atproto.admin.defs#repoViewNotFound": 347 + t.AdminDefs_RepoViewNotFound = new(AdminDefs_RepoViewNotFound) 348 + return json.Unmarshal(b, t.AdminDefs_RepoViewNotFound) 304 349 case "com.atproto.admin.defs#recordView": 305 350 t.AdminDefs_RecordView = new(AdminDefs_RecordView) 306 351 return json.Unmarshal(b, t.AdminDefs_RecordView) 352 + case "com.atproto.admin.defs#recordViewNotFound": 353 + t.AdminDefs_RecordViewNotFound = new(AdminDefs_RecordViewNotFound) 354 + return json.Unmarshal(b, t.AdminDefs_RecordViewNotFound) 307 355 308 356 default: 309 357 return nil
+17
api/bsky/actordefs.go
··· 32 32 type ActorDefs_Preferences_Elem struct { 33 33 ActorDefs_AdultContentPref *ActorDefs_AdultContentPref 34 34 ActorDefs_ContentLabelPref *ActorDefs_ContentLabelPref 35 + ActorDefs_SavedFeedsPref *ActorDefs_SavedFeedsPref 35 36 } 36 37 37 38 func (t *ActorDefs_Preferences_Elem) MarshalJSON() ([]byte, error) { ··· 43 44 t.ActorDefs_ContentLabelPref.LexiconTypeID = "app.bsky.actor.defs#contentLabelPref" 44 45 return json.Marshal(t.ActorDefs_ContentLabelPref) 45 46 } 47 + if t.ActorDefs_SavedFeedsPref != nil { 48 + t.ActorDefs_SavedFeedsPref.LexiconTypeID = "app.bsky.actor.defs#savedFeedsPref" 49 + return json.Marshal(t.ActorDefs_SavedFeedsPref) 50 + } 46 51 return nil, fmt.Errorf("cannot marshal empty enum") 47 52 } 48 53 func (t *ActorDefs_Preferences_Elem) UnmarshalJSON(b []byte) error { ··· 58 63 case "app.bsky.actor.defs#contentLabelPref": 59 64 t.ActorDefs_ContentLabelPref = new(ActorDefs_ContentLabelPref) 60 65 return json.Unmarshal(b, t.ActorDefs_ContentLabelPref) 66 + case "app.bsky.actor.defs#savedFeedsPref": 67 + t.ActorDefs_SavedFeedsPref = new(ActorDefs_SavedFeedsPref) 68 + return json.Unmarshal(b, t.ActorDefs_SavedFeedsPref) 61 69 62 70 default: 63 71 return nil ··· 100 108 Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 101 109 PostsCount *int64 `json:"postsCount,omitempty" cborgen:"postsCount,omitempty"` 102 110 Viewer *ActorDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 111 + } 112 + 113 + // ActorDefs_SavedFeedsPref is a "savedFeedsPref" in the app.bsky.actor.defs schema. 114 + // 115 + // RECORDTYPE: ActorDefs_SavedFeedsPref 116 + type ActorDefs_SavedFeedsPref struct { 117 + LexiconTypeID string `json:"$type,const=app.bsky.actor.defs" cborgen:"$type,const=app.bsky.actor.defs"` 118 + Pinned []string `json:"pinned" cborgen:"pinned"` 119 + Saved []string `json:"saved" cborgen:"saved"` 103 120 } 104 121 105 122 // ActorDefs_ViewerState is a "viewerState" in the app.bsky.actor.defs schema.
+355
api/bsky/cbor_gen.go
··· 3958 3958 3959 3959 return nil 3960 3960 } 3961 + func (t *FeedGenerator) MarshalCBOR(w io.Writer) error { 3962 + if t == nil { 3963 + _, err := w.Write(cbg.CborNull) 3964 + return err 3965 + } 3966 + 3967 + cw := cbg.NewCborWriter(w) 3968 + fieldCount := 7 3969 + 3970 + if t.Avatar == nil { 3971 + fieldCount-- 3972 + } 3973 + 3974 + if t.Description == nil { 3975 + fieldCount-- 3976 + } 3977 + 3978 + if t.DescriptionFacets == nil { 3979 + fieldCount-- 3980 + } 3981 + 3982 + if _, err := cw.Write(cbg.CborEncodeMajorType(cbg.MajMap, uint64(fieldCount))); err != nil { 3983 + return err 3984 + } 3985 + 3986 + // t.Did (string) (string) 3987 + if len("did") > cbg.MaxLength { 3988 + return xerrors.Errorf("Value in field \"did\" was too long") 3989 + } 3990 + 3991 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("did"))); err != nil { 3992 + return err 3993 + } 3994 + if _, err := io.WriteString(w, string("did")); err != nil { 3995 + return err 3996 + } 3997 + 3998 + if len(t.Did) > cbg.MaxLength { 3999 + return xerrors.Errorf("Value in field t.Did was too long") 4000 + } 4001 + 4002 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.Did))); err != nil { 4003 + return err 4004 + } 4005 + if _, err := io.WriteString(w, string(t.Did)); err != nil { 4006 + return err 4007 + } 4008 + 4009 + // t.LexiconTypeID (string) (string) 4010 + if len("$type") > cbg.MaxLength { 4011 + return xerrors.Errorf("Value in field \"$type\" was too long") 4012 + } 4013 + 4014 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("$type"))); err != nil { 4015 + return err 4016 + } 4017 + if _, err := io.WriteString(w, string("$type")); err != nil { 4018 + return err 4019 + } 4020 + 4021 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("app.bsky.feed.generator"))); err != nil { 4022 + return err 4023 + } 4024 + if _, err := io.WriteString(w, string("app.bsky.feed.generator")); err != nil { 4025 + return err 4026 + } 4027 + 4028 + // t.Avatar (util.LexBlob) (struct) 4029 + if t.Avatar != nil { 4030 + 4031 + if len("avatar") > cbg.MaxLength { 4032 + return xerrors.Errorf("Value in field \"avatar\" was too long") 4033 + } 4034 + 4035 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("avatar"))); err != nil { 4036 + return err 4037 + } 4038 + if _, err := io.WriteString(w, string("avatar")); err != nil { 4039 + return err 4040 + } 4041 + 4042 + if err := t.Avatar.MarshalCBOR(cw); err != nil { 4043 + return err 4044 + } 4045 + } 4046 + 4047 + // t.CreatedAt (string) (string) 4048 + if len("createdAt") > cbg.MaxLength { 4049 + return xerrors.Errorf("Value in field \"createdAt\" was too long") 4050 + } 4051 + 4052 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("createdAt"))); err != nil { 4053 + return err 4054 + } 4055 + if _, err := io.WriteString(w, string("createdAt")); err != nil { 4056 + return err 4057 + } 4058 + 4059 + if len(t.CreatedAt) > cbg.MaxLength { 4060 + return xerrors.Errorf("Value in field t.CreatedAt was too long") 4061 + } 4062 + 4063 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.CreatedAt))); err != nil { 4064 + return err 4065 + } 4066 + if _, err := io.WriteString(w, string(t.CreatedAt)); err != nil { 4067 + return err 4068 + } 4069 + 4070 + // t.Description (string) (string) 4071 + if t.Description != nil { 4072 + 4073 + if len("description") > cbg.MaxLength { 4074 + return xerrors.Errorf("Value in field \"description\" was too long") 4075 + } 4076 + 4077 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("description"))); err != nil { 4078 + return err 4079 + } 4080 + if _, err := io.WriteString(w, string("description")); err != nil { 4081 + return err 4082 + } 4083 + 4084 + if t.Description == nil { 4085 + if _, err := cw.Write(cbg.CborNull); err != nil { 4086 + return err 4087 + } 4088 + } else { 4089 + if len(*t.Description) > cbg.MaxLength { 4090 + return xerrors.Errorf("Value in field t.Description was too long") 4091 + } 4092 + 4093 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(*t.Description))); err != nil { 4094 + return err 4095 + } 4096 + if _, err := io.WriteString(w, string(*t.Description)); err != nil { 4097 + return err 4098 + } 4099 + } 4100 + } 4101 + 4102 + // t.DisplayName (string) (string) 4103 + if len("displayName") > cbg.MaxLength { 4104 + return xerrors.Errorf("Value in field \"displayName\" was too long") 4105 + } 4106 + 4107 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("displayName"))); err != nil { 4108 + return err 4109 + } 4110 + if _, err := io.WriteString(w, string("displayName")); err != nil { 4111 + return err 4112 + } 4113 + 4114 + if len(t.DisplayName) > cbg.MaxLength { 4115 + return xerrors.Errorf("Value in field t.DisplayName was too long") 4116 + } 4117 + 4118 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len(t.DisplayName))); err != nil { 4119 + return err 4120 + } 4121 + if _, err := io.WriteString(w, string(t.DisplayName)); err != nil { 4122 + return err 4123 + } 4124 + 4125 + // t.DescriptionFacets ([]*bsky.RichtextFacet) (slice) 4126 + if t.DescriptionFacets != nil { 4127 + 4128 + if len("descriptionFacets") > cbg.MaxLength { 4129 + return xerrors.Errorf("Value in field \"descriptionFacets\" was too long") 4130 + } 4131 + 4132 + if err := cw.WriteMajorTypeHeader(cbg.MajTextString, uint64(len("descriptionFacets"))); err != nil { 4133 + return err 4134 + } 4135 + if _, err := io.WriteString(w, string("descriptionFacets")); err != nil { 4136 + return err 4137 + } 4138 + 4139 + if len(t.DescriptionFacets) > cbg.MaxLength { 4140 + return xerrors.Errorf("Slice value in field t.DescriptionFacets was too long") 4141 + } 4142 + 4143 + if err := cw.WriteMajorTypeHeader(cbg.MajArray, uint64(len(t.DescriptionFacets))); err != nil { 4144 + return err 4145 + } 4146 + for _, v := range t.DescriptionFacets { 4147 + if err := v.MarshalCBOR(cw); err != nil { 4148 + return err 4149 + } 4150 + } 4151 + } 4152 + return nil 4153 + } 4154 + 4155 + func (t *FeedGenerator) UnmarshalCBOR(r io.Reader) (err error) { 4156 + *t = FeedGenerator{} 4157 + 4158 + cr := cbg.NewCborReader(r) 4159 + 4160 + maj, extra, err := cr.ReadHeader() 4161 + if err != nil { 4162 + return err 4163 + } 4164 + defer func() { 4165 + if err == io.EOF { 4166 + err = io.ErrUnexpectedEOF 4167 + } 4168 + }() 4169 + 4170 + if maj != cbg.MajMap { 4171 + return fmt.Errorf("cbor input should be of type map") 4172 + } 4173 + 4174 + if extra > cbg.MaxLength { 4175 + return fmt.Errorf("FeedGenerator: map struct too large (%d)", extra) 4176 + } 4177 + 4178 + var name string 4179 + n := extra 4180 + 4181 + for i := uint64(0); i < n; i++ { 4182 + 4183 + { 4184 + sval, err := cbg.ReadString(cr) 4185 + if err != nil { 4186 + return err 4187 + } 4188 + 4189 + name = string(sval) 4190 + } 4191 + 4192 + switch name { 4193 + // t.Did (string) (string) 4194 + case "did": 4195 + 4196 + { 4197 + sval, err := cbg.ReadString(cr) 4198 + if err != nil { 4199 + return err 4200 + } 4201 + 4202 + t.Did = string(sval) 4203 + } 4204 + // t.LexiconTypeID (string) (string) 4205 + case "$type": 4206 + 4207 + { 4208 + sval, err := cbg.ReadString(cr) 4209 + if err != nil { 4210 + return err 4211 + } 4212 + 4213 + t.LexiconTypeID = string(sval) 4214 + } 4215 + // t.Avatar (util.LexBlob) (struct) 4216 + case "avatar": 4217 + 4218 + { 4219 + 4220 + b, err := cr.ReadByte() 4221 + if err != nil { 4222 + return err 4223 + } 4224 + if b != cbg.CborNull[0] { 4225 + if err := cr.UnreadByte(); err != nil { 4226 + return err 4227 + } 4228 + t.Avatar = new(util.LexBlob) 4229 + if err := t.Avatar.UnmarshalCBOR(cr); err != nil { 4230 + return xerrors.Errorf("unmarshaling t.Avatar pointer: %w", err) 4231 + } 4232 + } 4233 + 4234 + } 4235 + // t.CreatedAt (string) (string) 4236 + case "createdAt": 4237 + 4238 + { 4239 + sval, err := cbg.ReadString(cr) 4240 + if err != nil { 4241 + return err 4242 + } 4243 + 4244 + t.CreatedAt = string(sval) 4245 + } 4246 + // t.Description (string) (string) 4247 + case "description": 4248 + 4249 + { 4250 + b, err := cr.ReadByte() 4251 + if err != nil { 4252 + return err 4253 + } 4254 + if b != cbg.CborNull[0] { 4255 + if err := cr.UnreadByte(); err != nil { 4256 + return err 4257 + } 4258 + 4259 + sval, err := cbg.ReadString(cr) 4260 + if err != nil { 4261 + return err 4262 + } 4263 + 4264 + t.Description = (*string)(&sval) 4265 + } 4266 + } 4267 + // t.DisplayName (string) (string) 4268 + case "displayName": 4269 + 4270 + { 4271 + sval, err := cbg.ReadString(cr) 4272 + if err != nil { 4273 + return err 4274 + } 4275 + 4276 + t.DisplayName = string(sval) 4277 + } 4278 + // t.DescriptionFacets ([]*bsky.RichtextFacet) (slice) 4279 + case "descriptionFacets": 4280 + 4281 + maj, extra, err = cr.ReadHeader() 4282 + if err != nil { 4283 + return err 4284 + } 4285 + 4286 + if extra > cbg.MaxLength { 4287 + return fmt.Errorf("t.DescriptionFacets: array too large (%d)", extra) 4288 + } 4289 + 4290 + if maj != cbg.MajArray { 4291 + return fmt.Errorf("expected cbor array") 4292 + } 4293 + 4294 + if extra > 0 { 4295 + t.DescriptionFacets = make([]*RichtextFacet, extra) 4296 + } 4297 + 4298 + for i := 0; i < int(extra); i++ { 4299 + 4300 + var v RichtextFacet 4301 + if err := v.UnmarshalCBOR(cr); err != nil { 4302 + return err 4303 + } 4304 + 4305 + t.DescriptionFacets[i] = &v 4306 + } 4307 + 4308 + default: 4309 + // Field doesn't exist on this type, so ignore it 4310 + cbg.ScanForLinks(r, func(cid.Cid) {}) 4311 + } 4312 + } 4313 + 4314 + return nil 4315 + }
+8
api/bsky/embedrecord.go
··· 114 114 EmbedRecord_ViewRecord *EmbedRecord_ViewRecord 115 115 EmbedRecord_ViewNotFound *EmbedRecord_ViewNotFound 116 116 EmbedRecord_ViewBlocked *EmbedRecord_ViewBlocked 117 + FeedDefs_GeneratorView *FeedDefs_GeneratorView 117 118 } 118 119 119 120 func (t *EmbedRecord_View_Record) MarshalJSON() ([]byte, error) { ··· 129 130 t.EmbedRecord_ViewBlocked.LexiconTypeID = "app.bsky.embed.record#viewBlocked" 130 131 return json.Marshal(t.EmbedRecord_ViewBlocked) 131 132 } 133 + if t.FeedDefs_GeneratorView != nil { 134 + t.FeedDefs_GeneratorView.LexiconTypeID = "app.bsky.feed.defs#generatorView" 135 + return json.Marshal(t.FeedDefs_GeneratorView) 136 + } 132 137 return nil, fmt.Errorf("cannot marshal empty enum") 133 138 } 134 139 func (t *EmbedRecord_View_Record) UnmarshalJSON(b []byte) error { ··· 147 152 case "app.bsky.embed.record#viewBlocked": 148 153 t.EmbedRecord_ViewBlocked = new(EmbedRecord_ViewBlocked) 149 154 return json.Unmarshal(b, t.EmbedRecord_ViewBlocked) 155 + case "app.bsky.feed.defs#generatorView": 156 + t.FeedDefs_GeneratorView = new(FeedDefs_GeneratorView) 157 + return json.Unmarshal(b, t.FeedDefs_GeneratorView) 150 158 151 159 default: 152 160 return nil
+166 -13
api/bsky/feeddefs.go
··· 55 55 } 56 56 } 57 57 58 + // FeedDefs_GeneratorView is a "generatorView" in the app.bsky.feed.defs schema. 59 + // 60 + // RECORDTYPE: FeedDefs_GeneratorView 61 + type FeedDefs_GeneratorView struct { 62 + LexiconTypeID string `json:"$type,const=app.bsky.feed.defs" cborgen:"$type,const=app.bsky.feed.defs"` 63 + Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 64 + Cid string `json:"cid" cborgen:"cid"` 65 + Creator *ActorDefs_ProfileView `json:"creator" cborgen:"creator"` 66 + Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 67 + DescriptionFacets []*RichtextFacet `json:"descriptionFacets,omitempty" cborgen:"descriptionFacets,omitempty"` 68 + Did *string `json:"did,omitempty" cborgen:"did,omitempty"` 69 + DisplayName string `json:"displayName" cborgen:"displayName"` 70 + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 71 + LikeCount *int64 `json:"likeCount,omitempty" cborgen:"likeCount,omitempty"` 72 + Uri string `json:"uri" cborgen:"uri"` 73 + Viewer *FeedDefs_GeneratorViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 74 + } 75 + 76 + // FeedDefs_GeneratorViewerState is a "generatorViewerState" in the app.bsky.feed.defs schema. 77 + type FeedDefs_GeneratorViewerState struct { 78 + Like *string `json:"like,omitempty" cborgen:"like,omitempty"` 79 + } 80 + 58 81 // FeedDefs_NotFoundPost is a "notFoundPost" in the app.bsky.feed.defs schema. 59 82 // 60 83 // RECORDTYPE: FeedDefs_NotFoundPost ··· 65 88 } 66 89 67 90 // FeedDefs_PostView is a "postView" in the app.bsky.feed.defs schema. 91 + // 92 + // RECORDTYPE: FeedDefs_PostView 68 93 type FeedDefs_PostView struct { 69 - Author *ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` 70 - Cid string `json:"cid" cborgen:"cid"` 71 - Embed *FeedDefs_PostView_Embed `json:"embed,omitempty" cborgen:"embed,omitempty"` 72 - IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 73 - Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 74 - LikeCount *int64 `json:"likeCount,omitempty" cborgen:"likeCount,omitempty"` 75 - Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"` 76 - ReplyCount *int64 `json:"replyCount,omitempty" cborgen:"replyCount,omitempty"` 77 - RepostCount *int64 `json:"repostCount,omitempty" cborgen:"repostCount,omitempty"` 78 - Uri string `json:"uri" cborgen:"uri"` 79 - Viewer *FeedDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 94 + LexiconTypeID string `json:"$type,const=app.bsky.feed.defs" cborgen:"$type,const=app.bsky.feed.defs"` 95 + Author *ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` 96 + Cid string `json:"cid" cborgen:"cid"` 97 + Embed *FeedDefs_PostView_Embed `json:"embed,omitempty" cborgen:"embed,omitempty"` 98 + IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 99 + Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 100 + LikeCount *int64 `json:"likeCount,omitempty" cborgen:"likeCount,omitempty"` 101 + Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"` 102 + ReplyCount *int64 `json:"replyCount,omitempty" cborgen:"replyCount,omitempty"` 103 + RepostCount *int64 `json:"repostCount,omitempty" cborgen:"repostCount,omitempty"` 104 + Uri string `json:"uri" cborgen:"uri"` 105 + Viewer *FeedDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 80 106 } 81 107 82 108 type FeedDefs_PostView_Embed struct { ··· 141 167 142 168 // FeedDefs_ReplyRef is a "replyRef" in the app.bsky.feed.defs schema. 143 169 type FeedDefs_ReplyRef struct { 144 - Parent *FeedDefs_PostView `json:"parent" cborgen:"parent"` 145 - Root *FeedDefs_PostView `json:"root" cborgen:"root"` 170 + Parent *FeedDefs_ReplyRef_Parent `json:"parent" cborgen:"parent"` 171 + Root *FeedDefs_ReplyRef_Root `json:"root" cborgen:"root"` 172 + } 173 + 174 + type FeedDefs_ReplyRef_Parent struct { 175 + FeedDefs_PostView *FeedDefs_PostView 176 + FeedDefs_NotFoundPost *FeedDefs_NotFoundPost 177 + FeedDefs_BlockedPost *FeedDefs_BlockedPost 178 + } 179 + 180 + func (t *FeedDefs_ReplyRef_Parent) MarshalJSON() ([]byte, error) { 181 + if t.FeedDefs_PostView != nil { 182 + t.FeedDefs_PostView.LexiconTypeID = "app.bsky.feed.defs#postView" 183 + return json.Marshal(t.FeedDefs_PostView) 184 + } 185 + if t.FeedDefs_NotFoundPost != nil { 186 + t.FeedDefs_NotFoundPost.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" 187 + return json.Marshal(t.FeedDefs_NotFoundPost) 188 + } 189 + if t.FeedDefs_BlockedPost != nil { 190 + t.FeedDefs_BlockedPost.LexiconTypeID = "app.bsky.feed.defs#blockedPost" 191 + return json.Marshal(t.FeedDefs_BlockedPost) 192 + } 193 + return nil, fmt.Errorf("cannot marshal empty enum") 194 + } 195 + func (t *FeedDefs_ReplyRef_Parent) UnmarshalJSON(b []byte) error { 196 + typ, err := util.TypeExtract(b) 197 + if err != nil { 198 + return err 199 + } 200 + 201 + switch typ { 202 + case "app.bsky.feed.defs#postView": 203 + t.FeedDefs_PostView = new(FeedDefs_PostView) 204 + return json.Unmarshal(b, t.FeedDefs_PostView) 205 + case "app.bsky.feed.defs#notFoundPost": 206 + t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) 207 + return json.Unmarshal(b, t.FeedDefs_NotFoundPost) 208 + case "app.bsky.feed.defs#blockedPost": 209 + t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) 210 + return json.Unmarshal(b, t.FeedDefs_BlockedPost) 211 + 212 + default: 213 + return nil 214 + } 215 + } 216 + 217 + type FeedDefs_ReplyRef_Root struct { 218 + FeedDefs_PostView *FeedDefs_PostView 219 + FeedDefs_NotFoundPost *FeedDefs_NotFoundPost 220 + FeedDefs_BlockedPost *FeedDefs_BlockedPost 221 + } 222 + 223 + func (t *FeedDefs_ReplyRef_Root) MarshalJSON() ([]byte, error) { 224 + if t.FeedDefs_PostView != nil { 225 + t.FeedDefs_PostView.LexiconTypeID = "app.bsky.feed.defs#postView" 226 + return json.Marshal(t.FeedDefs_PostView) 227 + } 228 + if t.FeedDefs_NotFoundPost != nil { 229 + t.FeedDefs_NotFoundPost.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" 230 + return json.Marshal(t.FeedDefs_NotFoundPost) 231 + } 232 + if t.FeedDefs_BlockedPost != nil { 233 + t.FeedDefs_BlockedPost.LexiconTypeID = "app.bsky.feed.defs#blockedPost" 234 + return json.Marshal(t.FeedDefs_BlockedPost) 235 + } 236 + return nil, fmt.Errorf("cannot marshal empty enum") 237 + } 238 + func (t *FeedDefs_ReplyRef_Root) UnmarshalJSON(b []byte) error { 239 + typ, err := util.TypeExtract(b) 240 + if err != nil { 241 + return err 242 + } 243 + 244 + switch typ { 245 + case "app.bsky.feed.defs#postView": 246 + t.FeedDefs_PostView = new(FeedDefs_PostView) 247 + return json.Unmarshal(b, t.FeedDefs_PostView) 248 + case "app.bsky.feed.defs#notFoundPost": 249 + t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) 250 + return json.Unmarshal(b, t.FeedDefs_NotFoundPost) 251 + case "app.bsky.feed.defs#blockedPost": 252 + t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) 253 + return json.Unmarshal(b, t.FeedDefs_BlockedPost) 254 + 255 + default: 256 + return nil 257 + } 258 + } 259 + 260 + // FeedDefs_SkeletonFeedPost is a "skeletonFeedPost" in the app.bsky.feed.defs schema. 261 + type FeedDefs_SkeletonFeedPost struct { 262 + Post string `json:"post" cborgen:"post"` 263 + Reason *FeedDefs_SkeletonFeedPost_Reason `json:"reason,omitempty" cborgen:"reason,omitempty"` 264 + } 265 + 266 + type FeedDefs_SkeletonFeedPost_Reason struct { 267 + FeedDefs_SkeletonReasonRepost *FeedDefs_SkeletonReasonRepost 268 + } 269 + 270 + func (t *FeedDefs_SkeletonFeedPost_Reason) MarshalJSON() ([]byte, error) { 271 + if t.FeedDefs_SkeletonReasonRepost != nil { 272 + t.FeedDefs_SkeletonReasonRepost.LexiconTypeID = "app.bsky.feed.defs#skeletonReasonRepost" 273 + return json.Marshal(t.FeedDefs_SkeletonReasonRepost) 274 + } 275 + return nil, fmt.Errorf("cannot marshal empty enum") 276 + } 277 + func (t *FeedDefs_SkeletonFeedPost_Reason) UnmarshalJSON(b []byte) error { 278 + typ, err := util.TypeExtract(b) 279 + if err != nil { 280 + return err 281 + } 282 + 283 + switch typ { 284 + case "app.bsky.feed.defs#skeletonReasonRepost": 285 + t.FeedDefs_SkeletonReasonRepost = new(FeedDefs_SkeletonReasonRepost) 286 + return json.Unmarshal(b, t.FeedDefs_SkeletonReasonRepost) 287 + 288 + default: 289 + return nil 290 + } 291 + } 292 + 293 + // FeedDefs_SkeletonReasonRepost is a "skeletonReasonRepost" in the app.bsky.feed.defs schema. 294 + // 295 + // RECORDTYPE: FeedDefs_SkeletonReasonRepost 296 + type FeedDefs_SkeletonReasonRepost struct { 297 + LexiconTypeID string `json:"$type,const=app.bsky.feed.defs" cborgen:"$type,const=app.bsky.feed.defs"` 298 + Repost string `json:"repost" cborgen:"repost"` 146 299 } 147 300 148 301 // FeedDefs_ThreadViewPost is a "threadViewPost" in the app.bsky.feed.defs schema.
+39
api/bsky/feeddescribeFeedGenerator.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package bsky 4 + 5 + // schema: app.bsky.feed.describeFeedGenerator 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // FeedDescribeFeedGenerator_Feed is a "feed" in the app.bsky.feed.describeFeedGenerator schema. 14 + type FeedDescribeFeedGenerator_Feed struct { 15 + Uri string `json:"uri" cborgen:"uri"` 16 + } 17 + 18 + // FeedDescribeFeedGenerator_Links is a "links" in the app.bsky.feed.describeFeedGenerator schema. 19 + type FeedDescribeFeedGenerator_Links struct { 20 + PrivacyPolicy *string `json:"privacyPolicy,omitempty" cborgen:"privacyPolicy,omitempty"` 21 + TermsOfService *string `json:"termsOfService,omitempty" cborgen:"termsOfService,omitempty"` 22 + } 23 + 24 + // FeedDescribeFeedGenerator_Output is the output of a app.bsky.feed.describeFeedGenerator call. 25 + type FeedDescribeFeedGenerator_Output struct { 26 + Did string `json:"did" cborgen:"did"` 27 + Feeds []*FeedDescribeFeedGenerator_Feed `json:"feeds" cborgen:"feeds"` 28 + Links *FeedDescribeFeedGenerator_Links `json:"links,omitempty" cborgen:"links,omitempty"` 29 + } 30 + 31 + // FeedDescribeFeedGenerator calls the XRPC method "app.bsky.feed.describeFeedGenerator". 32 + func FeedDescribeFeedGenerator(ctx context.Context, c *xrpc.Client) (*FeedDescribeFeedGenerator_Output, error) { 33 + var out FeedDescribeFeedGenerator_Output 34 + if err := c.Do(ctx, xrpc.Query, "", "app.bsky.feed.describeFeedGenerator", nil, nil, &out); err != nil { 35 + return nil, err 36 + } 37 + 38 + return &out, nil 39 + }
+23
api/bsky/feedgenerator.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package bsky 4 + 5 + // schema: app.bsky.feed.generator 6 + 7 + import ( 8 + "github.com/bluesky-social/indigo/lex/util" 9 + ) 10 + 11 + func init() { 12 + util.RegisterType("app.bsky.feed.generator", &FeedGenerator{}) 13 + } // 14 + // RECORDTYPE: FeedGenerator 15 + type FeedGenerator struct { 16 + LexiconTypeID string `json:"$type,const=app.bsky.feed.generator" cborgen:"$type,const=app.bsky.feed.generator"` 17 + Avatar *util.LexBlob `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 18 + CreatedAt string `json:"createdAt" cborgen:"createdAt"` 19 + Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 20 + DescriptionFacets []*RichtextFacet `json:"descriptionFacets,omitempty" cborgen:"descriptionFacets,omitempty"` 21 + Did string `json:"did" cborgen:"did"` 22 + DisplayName string `json:"displayName" cborgen:"displayName"` 23 + }
+33
api/bsky/feedgetActorFeeds.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package bsky 4 + 5 + // schema: app.bsky.feed.getActorFeeds 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // FeedGetActorFeeds_Output is the output of a app.bsky.feed.getActorFeeds call. 14 + type FeedGetActorFeeds_Output struct { 15 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 + Feeds []*FeedDefs_GeneratorView `json:"feeds" cborgen:"feeds"` 17 + } 18 + 19 + // FeedGetActorFeeds calls the XRPC method "app.bsky.feed.getActorFeeds". 20 + func FeedGetActorFeeds(ctx context.Context, c *xrpc.Client, actor string, cursor string, limit int64) (*FeedGetActorFeeds_Output, error) { 21 + var out FeedGetActorFeeds_Output 22 + 23 + params := map[string]interface{}{ 24 + "actor": actor, 25 + "cursor": cursor, 26 + "limit": limit, 27 + } 28 + if err := c.Do(ctx, xrpc.Query, "", "app.bsky.feed.getActorFeeds", params, nil, &out); err != nil { 29 + return nil, err 30 + } 31 + 32 + return &out, nil 33 + }
+33
api/bsky/feedgetFeed.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package bsky 4 + 5 + // schema: app.bsky.feed.getFeed 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // FeedGetFeed_Output is the output of a app.bsky.feed.getFeed call. 14 + type FeedGetFeed_Output struct { 15 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 + Feed []*FeedDefs_FeedViewPost `json:"feed" cborgen:"feed"` 17 + } 18 + 19 + // FeedGetFeed calls the XRPC method "app.bsky.feed.getFeed". 20 + func FeedGetFeed(ctx context.Context, c *xrpc.Client, cursor string, feed string, limit int64) (*FeedGetFeed_Output, error) { 21 + var out FeedGetFeed_Output 22 + 23 + params := map[string]interface{}{ 24 + "cursor": cursor, 25 + "feed": feed, 26 + "limit": limit, 27 + } 28 + if err := c.Do(ctx, xrpc.Query, "", "app.bsky.feed.getFeed", params, nil, &out); err != nil { 29 + return nil, err 30 + } 31 + 32 + return &out, nil 33 + }
+32
api/bsky/feedgetFeedGenerator.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package bsky 4 + 5 + // schema: app.bsky.feed.getFeedGenerator 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // FeedGetFeedGenerator_Output is the output of a app.bsky.feed.getFeedGenerator call. 14 + type FeedGetFeedGenerator_Output struct { 15 + IsOnline bool `json:"isOnline" cborgen:"isOnline"` 16 + IsValid bool `json:"isValid" cborgen:"isValid"` 17 + View *FeedDefs_GeneratorView `json:"view" cborgen:"view"` 18 + } 19 + 20 + // FeedGetFeedGenerator calls the XRPC method "app.bsky.feed.getFeedGenerator". 21 + func FeedGetFeedGenerator(ctx context.Context, c *xrpc.Client, feed string) (*FeedGetFeedGenerator_Output, error) { 22 + var out FeedGetFeedGenerator_Output 23 + 24 + params := map[string]interface{}{ 25 + "feed": feed, 26 + } 27 + if err := c.Do(ctx, xrpc.Query, "", "app.bsky.feed.getFeedGenerator", params, nil, &out); err != nil { 28 + return nil, err 29 + } 30 + 31 + return &out, nil 32 + }
+30
api/bsky/feedgetFeedGenerators.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package bsky 4 + 5 + // schema: app.bsky.feed.getFeedGenerators 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // FeedGetFeedGenerators_Output is the output of a app.bsky.feed.getFeedGenerators call. 14 + type FeedGetFeedGenerators_Output struct { 15 + Feeds []*FeedDefs_GeneratorView `json:"feeds" cborgen:"feeds"` 16 + } 17 + 18 + // FeedGetFeedGenerators calls the XRPC method "app.bsky.feed.getFeedGenerators". 19 + func FeedGetFeedGenerators(ctx context.Context, c *xrpc.Client, feeds []string) (*FeedGetFeedGenerators_Output, error) { 20 + var out FeedGetFeedGenerators_Output 21 + 22 + params := map[string]interface{}{ 23 + "feeds": feeds, 24 + } 25 + if err := c.Do(ctx, xrpc.Query, "", "app.bsky.feed.getFeedGenerators", params, nil, &out); err != nil { 26 + return nil, err 27 + } 28 + 29 + return &out, nil 30 + }
+33
api/bsky/feedgetFeedSkeleton.go
··· 1 + // Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 + 3 + package bsky 4 + 5 + // schema: app.bsky.feed.getFeedSkeleton 6 + 7 + import ( 8 + "context" 9 + 10 + "github.com/bluesky-social/indigo/xrpc" 11 + ) 12 + 13 + // FeedGetFeedSkeleton_Output is the output of a app.bsky.feed.getFeedSkeleton call. 14 + type FeedGetFeedSkeleton_Output struct { 15 + Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 + Feed []*FeedDefs_SkeletonFeedPost `json:"feed" cborgen:"feed"` 17 + } 18 + 19 + // FeedGetFeedSkeleton calls the XRPC method "app.bsky.feed.getFeedSkeleton". 20 + func FeedGetFeedSkeleton(ctx context.Context, c *xrpc.Client, cursor string, feed string, limit int64) (*FeedGetFeedSkeleton_Output, error) { 21 + var out FeedGetFeedSkeleton_Output 22 + 23 + params := map[string]interface{}{ 24 + "cursor": cursor, 25 + "feed": feed, 26 + "limit": limit, 27 + } 28 + if err := c.Do(ctx, xrpc.Query, "", "app.bsky.feed.getFeedSkeleton", params, nil, &out); err != nil { 29 + return nil, err 30 + } 31 + 32 + return &out, nil 33 + }
+50 -1
cmd/gosky/main.go
··· 13 13 "syscall" 14 14 "time" 15 15 16 + "github.com/bluesky-social/indigo/api/atproto" 16 17 comatproto "github.com/bluesky-social/indigo/api/atproto" 18 + "github.com/bluesky-social/indigo/api/bsky" 17 19 appbsky "github.com/bluesky-social/indigo/api/bsky" 18 20 cliutil "github.com/bluesky-social/indigo/cmd/gosky/util" 19 21 "github.com/bluesky-social/indigo/events" ··· 84 86 getRecordCmd, 85 87 createInviteCmd, 86 88 adminCmd, 89 + createFeedGeneratorCmd, 87 90 } 88 91 89 92 app.RunAndExitOnError() ··· 178 181 Repo: auth.Did, 179 182 Record: &lexutil.LexiconTypeDecoder{&appbsky.FeedPost{ 180 183 Text: text, 181 - CreatedAt: time.Now().Format("2006-01-02T15:04:05.000Z"), 184 + CreatedAt: time.Now().Format(util.ISO8601), 182 185 }}, 183 186 }) 184 187 if err != nil { ··· 1229 1232 } 1230 1233 return out, nil 1231 1234 } 1235 + 1236 + var createFeedGeneratorCmd = &cli.Command{ 1237 + Name: "createFeedGen", 1238 + Flags: []cli.Flag{ 1239 + &cli.StringFlag{ 1240 + Name: "name", 1241 + Required: true, 1242 + }, 1243 + &cli.StringFlag{ 1244 + Name: "did", 1245 + Required: true, 1246 + }, 1247 + }, 1248 + Action: func(cctx *cli.Context) error { 1249 + xrpcc, err := cliutil.GetXrpcClient(cctx, true) 1250 + if err != nil { 1251 + return err 1252 + } 1253 + 1254 + name := cctx.String("name") 1255 + did := cctx.String("did") 1256 + 1257 + var desc *string 1258 + if d := cctx.String("description"); d != "" { 1259 + desc = &d 1260 + } 1261 + 1262 + resp, err := atproto.RepoCreateRecord(context.TODO(), xrpcc, &atproto.RepoCreateRecord_Input{ 1263 + Collection: "app.bsky.feed.generator", 1264 + Repo: xrpcc.Auth.Did, 1265 + Record: &lexutil.LexiconTypeDecoder{&bsky.FeedGenerator{ 1266 + CreatedAt: time.Now().Format(util.ISO8601), 1267 + Description: desc, 1268 + Did: did, 1269 + DisplayName: name, 1270 + }}, 1271 + }) 1272 + if err != nil { 1273 + return err 1274 + } 1275 + 1276 + fmt.Println(resp.Uri) 1277 + 1278 + return nil 1279 + }, 1280 + }
+2 -2
fakedata/generators.go
··· 265 265 root := parent 266 266 if viewPost.Reply != nil { 267 267 root = &comatproto.RepoStrongRef{ 268 - Uri: viewPost.Reply.Root.Uri, 269 - Cid: viewPost.Reply.Root.Cid, 268 + Uri: viewPost.Reply.Root.FeedDefs_PostView.Uri, 269 + Cid: viewPost.Reply.Root.FeedDefs_PostView.Cid, 270 270 } 271 271 } 272 272 replyPost := &appbsky.FeedPost{
+1
gen/main.go
··· 44 44 bsky.GraphBlock{}, 45 45 bsky.GraphList{}, 46 46 bsky.GraphListitem{}, 47 + bsky.FeedGenerator{}, 47 48 /*bsky.EmbedImages_View{}, 48 49 bsky.EmbedRecord_View{}, bsky.EmbedRecordWithMedia_View{}, 49 50 bsky.EmbedExternal_View{}, bsky.EmbedImages_ViewImage{},
+19
pds/handlers.go
··· 799 799 800 800 return s.repoman.DoRebase(ctx, u.ID) 801 801 } 802 + 803 + func (s *Server) handleAppBskyFeedDescribeFeedGenerator(ctx context.Context) (*appbskytypes.FeedDescribeFeedGenerator_Output, error) { 804 + panic("nyi") 805 + } 806 + func (s *Server) handleAppBskyFeedGetActorFeeds(ctx context.Context, actor string, cursor string, limit int) (*appbskytypes.FeedGetActorFeeds_Output, error) { 807 + panic("nyi") 808 + } 809 + func (s *Server) handleAppBskyFeedGetFeed(ctx context.Context, cursor string, feed string, limit int) (*appbskytypes.FeedGetFeed_Output, error) { 810 + panic("nyi") 811 + } 812 + func (s *Server) handleAppBskyFeedGetFeedGenerator(ctx context.Context, feed string) (*appbskytypes.FeedGetFeedGenerator_Output, error) { 813 + panic("nyi") 814 + } 815 + func (s *Server) handleAppBskyFeedGetFeedGenerators(ctx context.Context, feeds []string) (*appbskytypes.FeedGetFeedGenerators_Output, error) { 816 + panic("nyi") 817 + } 818 + func (s *Server) handleAppBskyFeedGetFeedSkeleton(ctx context.Context, cursor string, feed string, limit int) (*appbskytypes.FeedGetFeedSkeleton_Output, error) { 819 + panic("nyi") 820 + }
+126
pds/stubs.go
··· 18 18 e.POST("/xrpc/app.bsky.actor.putPreferences", s.HandleAppBskyActorPutPreferences) 19 19 e.GET("/xrpc/app.bsky.actor.searchActors", s.HandleAppBskyActorSearchActors) 20 20 e.GET("/xrpc/app.bsky.actor.searchActorsTypeahead", s.HandleAppBskyActorSearchActorsTypeahead) 21 + e.GET("/xrpc/app.bsky.feed.describeFeedGenerator", s.HandleAppBskyFeedDescribeFeedGenerator) 22 + e.GET("/xrpc/app.bsky.feed.getActorFeeds", s.HandleAppBskyFeedGetActorFeeds) 21 23 e.GET("/xrpc/app.bsky.feed.getAuthorFeed", s.HandleAppBskyFeedGetAuthorFeed) 24 + e.GET("/xrpc/app.bsky.feed.getFeed", s.HandleAppBskyFeedGetFeed) 25 + e.GET("/xrpc/app.bsky.feed.getFeedGenerator", s.HandleAppBskyFeedGetFeedGenerator) 26 + e.GET("/xrpc/app.bsky.feed.getFeedGenerators", s.HandleAppBskyFeedGetFeedGenerators) 27 + e.GET("/xrpc/app.bsky.feed.getFeedSkeleton", s.HandleAppBskyFeedGetFeedSkeleton) 22 28 e.GET("/xrpc/app.bsky.feed.getLikes", s.HandleAppBskyFeedGetLikes) 23 29 e.GET("/xrpc/app.bsky.feed.getPostThread", s.HandleAppBskyFeedGetPostThread) 24 30 e.GET("/xrpc/app.bsky.feed.getPosts", s.HandleAppBskyFeedGetPosts) ··· 177 183 return c.JSON(200, out) 178 184 } 179 185 186 + func (s *Server) HandleAppBskyFeedDescribeFeedGenerator(c echo.Context) error { 187 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedDescribeFeedGenerator") 188 + defer span.End() 189 + var out *appbskytypes.FeedDescribeFeedGenerator_Output 190 + var handleErr error 191 + // func (s *Server) handleAppBskyFeedDescribeFeedGenerator(ctx context.Context) (*appbskytypes.FeedDescribeFeedGenerator_Output, error) 192 + out, handleErr = s.handleAppBskyFeedDescribeFeedGenerator(ctx) 193 + if handleErr != nil { 194 + return handleErr 195 + } 196 + return c.JSON(200, out) 197 + } 198 + 199 + func (s *Server) HandleAppBskyFeedGetActorFeeds(c echo.Context) error { 200 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetActorFeeds") 201 + defer span.End() 202 + actor := c.QueryParam("actor") 203 + cursor := c.QueryParam("cursor") 204 + 205 + var limit int 206 + if p := c.QueryParam("limit"); p != "" { 207 + var err error 208 + limit, err = strconv.Atoi(p) 209 + if err != nil { 210 + return err 211 + } 212 + } else { 213 + limit = 50 214 + } 215 + var out *appbskytypes.FeedGetActorFeeds_Output 216 + var handleErr error 217 + // func (s *Server) handleAppBskyFeedGetActorFeeds(ctx context.Context,actor string,cursor string,limit int) (*appbskytypes.FeedGetActorFeeds_Output, error) 218 + out, handleErr = s.handleAppBskyFeedGetActorFeeds(ctx, actor, cursor, limit) 219 + if handleErr != nil { 220 + return handleErr 221 + } 222 + return c.JSON(200, out) 223 + } 224 + 180 225 func (s *Server) HandleAppBskyFeedGetAuthorFeed(c echo.Context) error { 181 226 ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetAuthorFeed") 182 227 defer span.End() ··· 197 242 var handleErr error 198 243 // func (s *Server) handleAppBskyFeedGetAuthorFeed(ctx context.Context,actor string,cursor string,limit int) (*appbskytypes.FeedGetAuthorFeed_Output, error) 199 244 out, handleErr = s.handleAppBskyFeedGetAuthorFeed(ctx, actor, cursor, limit) 245 + if handleErr != nil { 246 + return handleErr 247 + } 248 + return c.JSON(200, out) 249 + } 250 + 251 + func (s *Server) HandleAppBskyFeedGetFeed(c echo.Context) error { 252 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetFeed") 253 + defer span.End() 254 + cursor := c.QueryParam("cursor") 255 + feed := c.QueryParam("feed") 256 + 257 + var limit int 258 + if p := c.QueryParam("limit"); p != "" { 259 + var err error 260 + limit, err = strconv.Atoi(p) 261 + if err != nil { 262 + return err 263 + } 264 + } else { 265 + limit = 50 266 + } 267 + var out *appbskytypes.FeedGetFeed_Output 268 + var handleErr error 269 + // func (s *Server) handleAppBskyFeedGetFeed(ctx context.Context,cursor string,feed string,limit int) (*appbskytypes.FeedGetFeed_Output, error) 270 + out, handleErr = s.handleAppBskyFeedGetFeed(ctx, cursor, feed, limit) 271 + if handleErr != nil { 272 + return handleErr 273 + } 274 + return c.JSON(200, out) 275 + } 276 + 277 + func (s *Server) HandleAppBskyFeedGetFeedGenerator(c echo.Context) error { 278 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetFeedGenerator") 279 + defer span.End() 280 + feed := c.QueryParam("feed") 281 + var out *appbskytypes.FeedGetFeedGenerator_Output 282 + var handleErr error 283 + // func (s *Server) handleAppBskyFeedGetFeedGenerator(ctx context.Context,feed string) (*appbskytypes.FeedGetFeedGenerator_Output, error) 284 + out, handleErr = s.handleAppBskyFeedGetFeedGenerator(ctx, feed) 285 + if handleErr != nil { 286 + return handleErr 287 + } 288 + return c.JSON(200, out) 289 + } 290 + 291 + func (s *Server) HandleAppBskyFeedGetFeedGenerators(c echo.Context) error { 292 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetFeedGenerators") 293 + defer span.End() 294 + 295 + feeds := c.QueryParams()["feeds"] 296 + var out *appbskytypes.FeedGetFeedGenerators_Output 297 + var handleErr error 298 + // func (s *Server) handleAppBskyFeedGetFeedGenerators(ctx context.Context,feeds []string) (*appbskytypes.FeedGetFeedGenerators_Output, error) 299 + out, handleErr = s.handleAppBskyFeedGetFeedGenerators(ctx, feeds) 300 + if handleErr != nil { 301 + return handleErr 302 + } 303 + return c.JSON(200, out) 304 + } 305 + 306 + func (s *Server) HandleAppBskyFeedGetFeedSkeleton(c echo.Context) error { 307 + ctx, span := otel.Tracer("server").Start(c.Request().Context(), "HandleAppBskyFeedGetFeedSkeleton") 308 + defer span.End() 309 + cursor := c.QueryParam("cursor") 310 + feed := c.QueryParam("feed") 311 + 312 + var limit int 313 + if p := c.QueryParam("limit"); p != "" { 314 + var err error 315 + limit, err = strconv.Atoi(p) 316 + if err != nil { 317 + return err 318 + } 319 + } else { 320 + limit = 50 321 + } 322 + var out *appbskytypes.FeedGetFeedSkeleton_Output 323 + var handleErr error 324 + // func (s *Server) handleAppBskyFeedGetFeedSkeleton(ctx context.Context,cursor string,feed string,limit int) (*appbskytypes.FeedGetFeedSkeleton_Output, error) 325 + out, handleErr = s.handleAppBskyFeedGetFeedSkeleton(ctx, cursor, feed, limit) 200 326 if handleErr != nil { 201 327 return handleErr 202 328 }