this repo has no description
0
fork

Configure Feed

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

Run lexgen (#693)

authored by

Jaz and committed by
GitHub
fc60972a d5f797ca

+47 -9
+1 -1
Makefile
··· 69 69 lexgen: ## Run codegen tool for lexicons (lexicon JSON to Go packages) 70 70 go run ./cmd/lexgen/ --package bsky --prefix app.bsky --outdir api/bsky $(LEXDIR) 71 71 go run ./cmd/lexgen/ --package atproto --prefix com.atproto --outdir api/atproto $(LEXDIR) 72 - go run ./cmd/lexgen/ --package ozone --prefix tools.ozone --outdir api/ozone $(LEXDIR) 73 72 go run ./cmd/lexgen/ --package chat --prefix chat.bsky --outdir api/chat $(LEXDIR) 73 + go run ./cmd/lexgen/ --package ozone --prefix tools.ozone --outdir api/ozone $(LEXDIR) 74 74 75 75 .PHONY: cborgen 76 76 cborgen: ## Run codegen tool for CBOR serialization
+39 -1
api/bsky/actordefs.go
··· 20 20 Enabled bool `json:"enabled" cborgen:"enabled"` 21 21 } 22 22 23 + // ActorDefs_BskyAppProgressGuide is a "bskyAppProgressGuide" in the app.bsky.actor.defs schema. 24 + // 25 + // If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress. 26 + type ActorDefs_BskyAppProgressGuide struct { 27 + Guide string `json:"guide" cborgen:"guide"` 28 + } 29 + 30 + // ActorDefs_BskyAppStatePref is a "bskyAppStatePref" in the app.bsky.actor.defs schema. 31 + // 32 + // A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this. 33 + // 34 + // RECORDTYPE: ActorDefs_BskyAppStatePref 35 + type ActorDefs_BskyAppStatePref struct { 36 + LexiconTypeID string `json:"$type,const=app.bsky.actor.defs#bskyAppStatePref" cborgen:"$type,const=app.bsky.actor.defs#bskyAppStatePref"` 37 + ActiveProgressGuide *ActorDefs_BskyAppProgressGuide `json:"activeProgressGuide,omitempty" cborgen:"activeProgressGuide,omitempty"` 38 + // queuedNudges: An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user. 39 + QueuedNudges []string `json:"queuedNudges,omitempty" cborgen:"queuedNudges,omitempty"` 40 + } 41 + 23 42 // ActorDefs_ContentLabelPref is a "contentLabelPref" in the app.bsky.actor.defs schema. 24 43 // 25 44 // RECORDTYPE: ActorDefs_ContentLabelPref ··· 82 101 } 83 102 84 103 // ActorDefs_LabelersPref is a "labelersPref" in the app.bsky.actor.defs schema. 104 + // 105 + // RECORDTYPE: ActorDefs_LabelersPref 85 106 type ActorDefs_LabelersPref struct { 86 - Labelers []*ActorDefs_LabelerPrefItem `json:"labelers" cborgen:"labelers"` 107 + LexiconTypeID string `json:"$type,const=app.bsky.actor.defs#labelersPref" cborgen:"$type,const=app.bsky.actor.defs#labelersPref"` 108 + Labelers []*ActorDefs_LabelerPrefItem `json:"labelers" cborgen:"labelers"` 87 109 } 88 110 89 111 // ActorDefs_MutedWord is a "mutedWord" in the app.bsky.actor.defs schema. ··· 125 147 ActorDefs_InterestsPref *ActorDefs_InterestsPref 126 148 ActorDefs_MutedWordsPref *ActorDefs_MutedWordsPref 127 149 ActorDefs_HiddenPostsPref *ActorDefs_HiddenPostsPref 150 + ActorDefs_BskyAppStatePref *ActorDefs_BskyAppStatePref 151 + ActorDefs_LabelersPref *ActorDefs_LabelersPref 128 152 } 129 153 130 154 func (t *ActorDefs_Preferences_Elem) MarshalJSON() ([]byte, error) { ··· 168 192 t.ActorDefs_HiddenPostsPref.LexiconTypeID = "app.bsky.actor.defs#hiddenPostsPref" 169 193 return json.Marshal(t.ActorDefs_HiddenPostsPref) 170 194 } 195 + if t.ActorDefs_BskyAppStatePref != nil { 196 + t.ActorDefs_BskyAppStatePref.LexiconTypeID = "app.bsky.actor.defs#bskyAppStatePref" 197 + return json.Marshal(t.ActorDefs_BskyAppStatePref) 198 + } 199 + if t.ActorDefs_LabelersPref != nil { 200 + t.ActorDefs_LabelersPref.LexiconTypeID = "app.bsky.actor.defs#labelersPref" 201 + return json.Marshal(t.ActorDefs_LabelersPref) 202 + } 171 203 return nil, fmt.Errorf("cannot marshal empty enum") 172 204 } 173 205 func (t *ActorDefs_Preferences_Elem) UnmarshalJSON(b []byte) error { ··· 207 239 case "app.bsky.actor.defs#hiddenPostsPref": 208 240 t.ActorDefs_HiddenPostsPref = new(ActorDefs_HiddenPostsPref) 209 241 return json.Unmarshal(b, t.ActorDefs_HiddenPostsPref) 242 + case "app.bsky.actor.defs#bskyAppStatePref": 243 + t.ActorDefs_BskyAppStatePref = new(ActorDefs_BskyAppStatePref) 244 + return json.Unmarshal(b, t.ActorDefs_BskyAppStatePref) 245 + case "app.bsky.actor.defs#labelersPref": 246 + t.ActorDefs_LabelersPref = new(ActorDefs_LabelersPref) 247 + return json.Unmarshal(b, t.ActorDefs_LabelersPref) 210 248 211 249 default: 212 250 return nil
+7 -7
api/chat/convodefs.go
··· 239 239 } 240 240 241 241 type ConvoDefs_MessageView_Embed struct { 242 - EmbedRecord *appbskytypes.EmbedRecord 242 + EmbedRecord_View *appbskytypes.EmbedRecord_View 243 243 } 244 244 245 245 func (t *ConvoDefs_MessageView_Embed) MarshalJSON() ([]byte, error) { 246 - if t.EmbedRecord != nil { 247 - t.EmbedRecord.LexiconTypeID = "app.bsky.embed.record" 248 - return json.Marshal(t.EmbedRecord) 246 + if t.EmbedRecord_View != nil { 247 + t.EmbedRecord_View.LexiconTypeID = "app.bsky.embed.record#view" 248 + return json.Marshal(t.EmbedRecord_View) 249 249 } 250 250 return nil, fmt.Errorf("cannot marshal empty enum") 251 251 } ··· 256 256 } 257 257 258 258 switch typ { 259 - case "app.bsky.embed.record": 260 - t.EmbedRecord = new(appbskytypes.EmbedRecord) 261 - return json.Unmarshal(b, t.EmbedRecord) 259 + case "app.bsky.embed.record#view": 260 + t.EmbedRecord_View = new(appbskytypes.EmbedRecord_View) 261 + return json.Unmarshal(b, t.EmbedRecord_View) 262 262 263 263 default: 264 264 return nil