diff --git a/go.mod b/go.mod index a2d72e0e..5098dc4a 100644 --- a/go.mod +++ b/go.mod @@ -69,7 +69,7 @@ require ( github.com/starttoaster/prometheus-exporter-scraper v0.0.1 github.com/streamplace/atmoq-go v0.0.2 github.com/streamplace/atproto-oauth-golang v0.0.0-20260413212710-98956064d06c - github.com/streamplace/glex v0.0.0-20260712172208-84746cabd547 + github.com/streamplace/glex v0.0.0-20260712184244-6c74782635ae github.com/streamplace/muxl/go v0.3.4 github.com/streamplace/oatproxy v0.0.0-20260710202406-60d97b9d780b github.com/stretchr/testify v1.11.1 diff --git a/go.sum b/go.sum index 8eb83aa3..f907e448 100644 --- a/go.sum +++ b/go.sum @@ -1376,6 +1376,10 @@ github.com/streamplace/atproto-oauth-golang v0.0.0-20250619231223-a9c04fb888ac h github.com/streamplace/atproto-oauth-golang v0.0.0-20250619231223-a9c04fb888ac/go.mod h1:9LlKkqciiO5lRfbX0n4Wn5KNY9nvFb4R3by8FdW2TWc= github.com/streamplace/glex v0.0.0-20260712172208-84746cabd547 h1:qxRoLqHc/KJedqV1iNQ41CWv/n4+kmUzV5lyBE6ScI8= github.com/streamplace/glex v0.0.0-20260712172208-84746cabd547/go.mod h1:LRaoeSMvSgOrhFX8s7ygjRlyka7wXdDa1s7JJ9o1IzY= +github.com/streamplace/glex v0.0.0-20260712182903-68af4226a1f4 h1:3mU4qcrmaVzCf7rgwCnT1rSz05ZdE6S2X/xuvHu5oVs= +github.com/streamplace/glex v0.0.0-20260712182903-68af4226a1f4/go.mod h1:LRaoeSMvSgOrhFX8s7ygjRlyka7wXdDa1s7JJ9o1IzY= +github.com/streamplace/glex v0.0.0-20260712184244-6c74782635ae h1:raCkXf/Wz4T19du2H0zLz+GLk2/efSgUWPaS5iEL7q8= +github.com/streamplace/glex v0.0.0-20260712184244-6c74782635ae/go.mod h1:LRaoeSMvSgOrhFX8s7ygjRlyka7wXdDa1s7JJ9o1IzY= github.com/streamplace/go-dpop v0.0.0-20250510031900-c897158a8ad4 h1:L1fS4HJSaAyNnkwfuZubgfeZy8rkWmA0cMtH5Z0HqNc= github.com/streamplace/go-dpop v0.0.0-20250510031900-c897158a8ad4/go.mod h1:bGUXY9Wd4mnd+XUrOYZr358J2f6z9QO/dLhL1SsiD+0= github.com/streamplace/indigo v0.0.0-20260218231908-939cdaf0c507 h1:e8M3qPLr37NxEjlr18TaAwGP+OVyherVjgUG5VVmgWI= diff --git a/lexicons.json b/lexicons.json index c5d31c0c..f41c8325 100644 --- a/lexicons.json +++ b/lexicons.json @@ -2,18 +2,43 @@ "version": 1, "lexicons": [ "app.bsky.actor.defs", + "app.bsky.actor.getProfile", + "app.bsky.actor.profile", + "app.bsky.feed.getFeedSkeleton", + "app.bsky.feed.post", "app.bsky.graph.block", + "app.bsky.graph.follow", "app.bsky.richtext.facet", + "com.atproto.identity.updateHandle", "com.atproto.label.defs", "com.atproto.moderation.defs", + "com.atproto.repo.createRecord", + "com.atproto.repo.deleteRecord", + "com.atproto.repo.describeRepo", + "com.atproto.repo.getRecord", + "com.atproto.repo.listRecords", + "com.atproto.repo.putRecord", "com.atproto.repo.strongRef", - "games.gamesgamesgamesgames.defs" + "com.atproto.repo.uploadBlob", + "com.atproto.server.createSession", + "com.atproto.sync.getRepo", + "com.atproto.sync.subscribeRepos", + "games.gamesgamesgamesgames.defs", + "games.gamesgamesgamesgames.search" ], "resolutions": { "app.bsky.actor.defs": { "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.actor.defs", "cid": "bafyreiel3mr6hz7g4wy5l6pkrwqh7affgluhfszvrrduc7p66os5cfkqdq" }, + "app.bsky.actor.getProfile": { + "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.actor.getProfile", + "cid": "bafyreigrtosreva7e5m7bwbbfsmw77gkdnieizgxwpobw5iobuck3j54xa" + }, + "app.bsky.actor.profile": { + "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.actor.profile", + "cid": "bafyreia6umzg3a6d7mjbow4p57tviey45muohklhgsvjoamcctoiusr4pe" + }, "app.bsky.actor.status": { "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.actor.status", "cid": "bafyreifdg4b64wohpwkh5lydc6tckvol2rspnpni6dec6recy2rhvlnz4a" @@ -46,6 +71,14 @@ "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.defs", "cid": "bafyreiadwvxawxifsnm7ae6l56aq23qs7ndih7npgs6pxmkoin7gi3k6pu" }, + "app.bsky.feed.getFeedSkeleton": { + "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.getFeedSkeleton", + "cid": "bafyreidmn4nltqygzpd3vzobfkrkxcypbfirremfhzuluhlavwp5ht637m" + }, + "app.bsky.feed.post": { + "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.post", + "cid": "bafyreidgbehqwweghrrddfu6jgj7lyr6fwhzgazhirnszdb5lvr7iynkiy" + }, "app.bsky.feed.postgate": { "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.feed.postgate", "cid": "bafyreiai5efexyluyptv5tbl6kqbqlnneczqzexcqnxmitmulyjfaftgva" @@ -62,6 +95,10 @@ "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.graph.defs", "cid": "bafyreifcipomli7yggtl46xufgxlnrw7se6xmsdxmzgfcz2tiu76ljatxm" }, + "app.bsky.graph.follow": { + "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.graph.follow", + "cid": "bafyreiav7u7jchqtsxr2yy3gsazfqqziw5tcrfniuprrmoariruj3cft5u" + }, "app.bsky.labeler.defs": { "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.labeler.defs", "cid": "bafyreicxx5i36v5dbqk5vvfzhnta5gajrvc544mnepux4wksrkid7mw3q4" @@ -74,6 +111,10 @@ "uri": "at://did:plc:4v4y5r3lwsbtmsxhile2ljac/com.atproto.lexicon.schema/app.bsky.richtext.facet", "cid": "bafyreidg56eo7zynf6ihz4xb627vwoqf5idnevkmwp7sxc4tijg6xngbu4" }, + "com.atproto.identity.updateHandle": { + "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.identity.updateHandle", + "cid": "bafyreibzqwkofzc7g5j7vatyyzolgnarm3zd2g6swegkc3ivz4xivm2buu" + }, "com.atproto.label.defs": { "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.label.defs", "cid": "bafyreidp2wpcbzl2qiob2uwoc7lhntojx3tjcr553mmahw2f5cumtm3wpm" @@ -82,14 +123,62 @@ "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.moderation.defs", "cid": "bafyreideawy4rlpgces2oebk5q4kpurbonhb5qtl4pes7dvxsc5osaiksy" }, + "com.atproto.repo.createRecord": { + "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.createRecord", + "cid": "bafyreihyvpmy2l4ou2v5etx25j5lbqty6tvna7gsxdqge76rbb7gltulei" + }, + "com.atproto.repo.defs": { + "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.defs", + "cid": "bafyreigmp5xfpkhnmwr3l5o626ued2gc2ouioykj2tpgqjqqajvbvm3wlm" + }, + "com.atproto.repo.deleteRecord": { + "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.deleteRecord", + "cid": "bafyreibwdxbyhuuljujl7g4ylwdso2x2ov6yv6nk3ext3sr7kjvvubkula" + }, + "com.atproto.repo.describeRepo": { + "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.describeRepo", + "cid": "bafyreif5ho6rtknjmiqjclrfogiqyzxnix2fzpwxyftfebplkj4q23pnrm" + }, + "com.atproto.repo.getRecord": { + "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.getRecord", + "cid": "bafyreihdnm3v25uaptt5vjvnpfsfgb6fbhxew2ye3l6q4ndm7xi5wpc4vy" + }, + "com.atproto.repo.listRecords": { + "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.listRecords", + "cid": "bafyreihv666jp6lxncj6amcgsu5qrvwq4rwmtc7xbxzndxqdwxamlsatee" + }, + "com.atproto.repo.putRecord": { + "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.putRecord", + "cid": "bafyreigevzo2cypxpaj5re2u35so36df4rkgx6oh4zpi4zwicfvzqfdqpa" + }, "com.atproto.repo.strongRef": { "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.strongRef", "cid": "bafyreifrkdbnkvfjujntdaeigolnrjj3srrs53tfixjhmacclps72qlov4" }, + "com.atproto.repo.uploadBlob": { + "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.uploadBlob", + "cid": "bafyreifj5rusrt7rd763rqcnyh7srwukrdn427m7qrhwyb5hiayyyq4lxe" + }, + "com.atproto.server.createSession": { + "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.server.createSession", + "cid": "bafyreieftxrfcsudzvfk5l73r2cukzwa6axzkfjs2l7dxtieyqnkdngwsq" + }, + "com.atproto.sync.getRepo": { + "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.sync.getRepo", + "cid": "bafyreieyt5x6wf4pgcn56tb2724uplmwcqjivkubmi25km3xrvroz6dw5q" + }, + "com.atproto.sync.subscribeRepos": { + "uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.sync.subscribeRepos", + "cid": "bafyreid5fdkjulxpnbfqwi4hjehx7ibzzj2h5ln7nachurdzqcpihytbuu" + }, "games.gamesgamesgamesgames.defs": { "uri": "at://did:web:gamesgamesgamesgames.games/com.atproto.lexicon.schema/games.gamesgamesgamesgames.defs", "cid": "bafyreigvy76eudxageywwu6rqweupl6xzd6ofja6tfvi4c5zxa54z5iraa" }, + "games.gamesgamesgamesgames.search": { + "uri": "at://did:web:gamesgamesgamesgames.games/com.atproto.lexicon.schema/games.gamesgamesgamesgames.search", + "cid": "bafyreia7beuc4t5imjqk7mznfzzjo73rkqvxcpmbmodo6lex7nwigft5qe" + }, "tools.ozone.report.defs": { "uri": "at://did:plc:33dt5kftu3jq2h5h4jjlqezt/com.atproto.lexicon.schema/tools.ozone.report.defs", "cid": "bafyreic3l2rmh2ugirt3jz372wcvy333m7t2ynlyzj2k54oshijs6lxdfu" diff --git a/pkg/api/api.go b/pkg/api/api.go index c33115f1..cbdaa86c 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -452,10 +452,10 @@ func (a *StreamplaceAPI) writeVideoCard(ctx context.Context, w http.ResponseWrit log.Error(ctx, "error fetching video view for card", "uri", uri, "error", err) return false } - if false { + if vv == nil { return false } - bs, err := linker.GenerateVideoCard(ctx, req.URL, &vv, a.CLI.SentryDSN) + bs, err := linker.GenerateVideoCard(ctx, req.URL, vv, a.CLI.SentryDSN) if err != nil { log.Error(ctx, "error generating video card", "uri", uri, "error", err) return false diff --git a/pkg/api/vod_transfer.go b/pkg/api/vod_transfer.go index 48acb9f4..49c54beb 100644 --- a/pkg/api/vod_transfer.go +++ b/pkg/api/vod_transfer.go @@ -151,19 +151,19 @@ func (a *StreamplaceAPI) resolveVideoContentBlob(ctx context.Context, rawURI str if err != nil { return "", "", fmt.Errorf("get video: %w", err) } - if false { + if rec == nil { return "", "", fmt.Errorf("video not indexed locally (pass cid + did instead)") } switch { - case rec.Source.MediaDefs_SourceTracks != nil && rec.Source.MediaDefs_SourceClip != nil && rec.Source.MediaDefs_SourceTracks != nil: + case rec.Source.MediaDefs_SourceTracks != nil: cid, err = a.firstTrackBlobCID(ctx, rec.Source.MediaDefs_SourceTracks.Tracks) if err != nil { return "", "", err } return cid, aturi.Authority().String(), nil - case rec.Source.MediaDefs_SourceTracks != nil && rec.Source.MediaDefs_SourceClip != nil && rec.Source.MediaDefs_SourceClip != nil: + case rec.Source.MediaDefs_SourceClip != nil: clip := rec.Source.MediaDefs_SourceClip if clip.Video == "" { return "", "", fmt.Errorf("sourceClip missing parent video URI") @@ -176,10 +176,10 @@ func (a *StreamplaceAPI) resolveVideoContentBlob(ctx context.Context, rawURI str if err != nil { return "", "", fmt.Errorf("get parent video: %w", err) } - if false { + if parent == nil { return "", "", fmt.Errorf("parent video %s not indexed locally", parentURI.String()) } - if parent.Source.MediaDefs_SourceTracks == nil && parent.Source.MediaDefs_SourceClip == nil || parent.Source.MediaDefs_SourceTracks == nil { + if parent.Source.MediaDefs_SourceTracks == nil { return "", "", fmt.Errorf("sourceClip parent must be a sourceTracks video (clip-of-clip unsupported)") } cid, err = a.firstTrackBlobCID(ctx, parent.Source.MediaDefs_SourceTracks.Tracks) @@ -202,14 +202,14 @@ func (a *StreamplaceAPI) firstTrackBlobCID(ctx context.Context, tracks []comatpr return "", fmt.Errorf("video record has no tracks") } first := tracks[0] - if first.Uri == "" || first.Uri == "" { + if first.Uri == "" { return "", fmt.Errorf("first track ref is empty") } track, err := a.Model.GetMediaTrackByURI(ctx, first.Uri) if err != nil { return "", fmt.Errorf("get track %s: %w", first.Uri, err) } - if track.Track.MediaDefs_MuxlTrack == nil || track.Track.MediaDefs_MuxlTrack == nil { + if track == nil || track.Track.MediaDefs_MuxlTrack == nil { return "", fmt.Errorf("track %s not indexed or not a muxlTrack", first.Uri) } blob := track.Track.MediaDefs_MuxlTrack.Blob diff --git a/pkg/appbsky/actordefs.go b/pkg/appbsky/actordefs.go index c38932b4..b6a4ec0a 100644 --- a/pkg/appbsky/actordefs.go +++ b/pkg/appbsky/actordefs.go @@ -10,7 +10,7 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) @@ -21,17 +21,22 @@ type ActorDefs_AdultContentPref struct { Enabled bool `json:"enabled"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_AdultContentPref) RecordTypeID() string { + return "app.bsky.actor.defs#adultContentPref" +} + func (t *ActorDefs_AdultContentPref) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#adultContentPref" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_AdultContentPref) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_BskyAppProgressGuide is a "bskyAppProgressGuide" in the app.bsky.actor.defs schema. @@ -42,17 +47,22 @@ type ActorDefs_BskyAppProgressGuide struct { Guide string `json:"guide"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_BskyAppProgressGuide) RecordTypeID() string { + return "app.bsky.actor.defs#bskyAppProgressGuide" +} + func (t *ActorDefs_BskyAppProgressGuide) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#bskyAppProgressGuide" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_BskyAppProgressGuide) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_BskyAppStatePref is a "bskyAppStatePref" in the app.bsky.actor.defs schema. @@ -67,17 +77,22 @@ type ActorDefs_BskyAppStatePref struct { QueuedNudges []string `json:"queuedNudges,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_BskyAppStatePref) RecordTypeID() string { + return "app.bsky.actor.defs#bskyAppStatePref" +} + func (t *ActorDefs_BskyAppStatePref) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#bskyAppStatePref" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_BskyAppStatePref) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_ContentLabelPref is a "contentLabelPref" in the app.bsky.actor.defs schema. @@ -89,17 +104,22 @@ type ActorDefs_ContentLabelPref struct { Visibility string `json:"visibility"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_ContentLabelPref) RecordTypeID() string { + return "app.bsky.actor.defs#contentLabelPref" +} + func (t *ActorDefs_ContentLabelPref) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#contentLabelPref" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_ContentLabelPref) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_DeclaredAgePref is a "declaredAgePref" in the app.bsky.actor.defs schema. @@ -115,17 +135,22 @@ type ActorDefs_DeclaredAgePref struct { IsOverAge18 *bool `json:"isOverAge18,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_DeclaredAgePref) RecordTypeID() string { + return "app.bsky.actor.defs#declaredAgePref" +} + func (t *ActorDefs_DeclaredAgePref) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#declaredAgePref" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_DeclaredAgePref) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_FeedViewPref is a "feedViewPref" in the app.bsky.actor.defs schema. @@ -145,17 +170,20 @@ type ActorDefs_FeedViewPref struct { HideReposts *bool `json:"hideReposts,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_FeedViewPref) RecordTypeID() string { return "app.bsky.actor.defs#feedViewPref" } + func (t *ActorDefs_FeedViewPref) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#feedViewPref" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_FeedViewPref) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_HiddenPostsPref is a "hiddenPostsPref" in the app.bsky.actor.defs schema. @@ -165,17 +193,22 @@ type ActorDefs_HiddenPostsPref struct { Items []string `json:"items"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_HiddenPostsPref) RecordTypeID() string { + return "app.bsky.actor.defs#hiddenPostsPref" +} + func (t *ActorDefs_HiddenPostsPref) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#hiddenPostsPref" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_HiddenPostsPref) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_InterestsPref is a "interestsPref" in the app.bsky.actor.defs schema. @@ -185,17 +218,20 @@ type ActorDefs_InterestsPref struct { Tags []string `json:"tags"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_InterestsPref) RecordTypeID() string { return "app.bsky.actor.defs#interestsPref" } + func (t *ActorDefs_InterestsPref) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#interestsPref" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_InterestsPref) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_KnownFollowers is a "knownFollowers" in the app.bsky.actor.defs schema. @@ -207,17 +243,20 @@ type ActorDefs_KnownFollowers struct { Followers []ActorDefs_ProfileViewBasic `json:"followers"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_KnownFollowers) RecordTypeID() string { return "app.bsky.actor.defs#knownFollowers" } + func (t *ActorDefs_KnownFollowers) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#knownFollowers" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_KnownFollowers) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_LabelerPrefItem is a "labelerPrefItem" in the app.bsky.actor.defs schema. @@ -226,17 +265,22 @@ type ActorDefs_LabelerPrefItem struct { Did string `json:"did"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_LabelerPrefItem) RecordTypeID() string { + return "app.bsky.actor.defs#labelerPrefItem" +} + func (t *ActorDefs_LabelerPrefItem) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#labelerPrefItem" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_LabelerPrefItem) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_LabelersPref is a "labelersPref" in the app.bsky.actor.defs schema. @@ -245,17 +289,20 @@ type ActorDefs_LabelersPref struct { Labelers []ActorDefs_LabelerPrefItem `json:"labelers"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_LabelersPref) RecordTypeID() string { return "app.bsky.actor.defs#labelersPref" } + func (t *ActorDefs_LabelersPref) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#labelersPref" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_LabelersPref) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_LiveEventPreferences is a "liveEventPreferences" in the app.bsky.actor.defs schema. @@ -269,17 +316,22 @@ type ActorDefs_LiveEventPreferences struct { HideAllFeeds *bool `json:"hideAllFeeds,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_LiveEventPreferences) RecordTypeID() string { + return "app.bsky.actor.defs#liveEventPreferences" +} + func (t *ActorDefs_LiveEventPreferences) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#liveEventPreferences" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_LiveEventPreferences) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_MutedWord is a "mutedWord" in the app.bsky.actor.defs schema. @@ -298,17 +350,20 @@ type ActorDefs_MutedWord struct { Value string `json:"value"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_MutedWord) RecordTypeID() string { return "app.bsky.actor.defs#mutedWord" } + func (t *ActorDefs_MutedWord) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#mutedWord" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_MutedWord) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_MutedWordsPref is a "mutedWordsPref" in the app.bsky.actor.defs schema. @@ -318,17 +373,20 @@ type ActorDefs_MutedWordsPref struct { Items []ActorDefs_MutedWord `json:"items"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_MutedWordsPref) RecordTypeID() string { return "app.bsky.actor.defs#mutedWordsPref" } + func (t *ActorDefs_MutedWordsPref) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#mutedWordsPref" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_MutedWordsPref) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_Nux is a "nux" in the app.bsky.actor.defs schema. @@ -344,17 +402,20 @@ type ActorDefs_Nux struct { Id string `json:"id"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_Nux) RecordTypeID() string { return "app.bsky.actor.defs#nux" } + func (t *ActorDefs_Nux) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#nux" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_Nux) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_PersonalDetailsPref is a "personalDetailsPref" in the app.bsky.actor.defs schema. @@ -364,17 +425,22 @@ type ActorDefs_PersonalDetailsPref struct { BirthDate *string `json:"birthDate,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_PersonalDetailsPref) RecordTypeID() string { + return "app.bsky.actor.defs#personalDetailsPref" +} + func (t *ActorDefs_PersonalDetailsPref) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#personalDetailsPref" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_PersonalDetailsPref) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_PostInteractionSettingsPref is a "postInteractionSettingsPref" in the app.bsky.actor.defs schema. @@ -388,17 +454,22 @@ type ActorDefs_PostInteractionSettingsPref struct { ThreadgateAllowRules []ActorDefs_PostInteractionSettingsPref_ThreadgateAllowRules_Elem `json:"threadgateAllowRules,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_PostInteractionSettingsPref) RecordTypeID() string { + return "app.bsky.actor.defs#postInteractionSettingsPref" +} + func (t *ActorDefs_PostInteractionSettingsPref) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#postInteractionSettingsPref" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_PostInteractionSettingsPref) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ActorDefs_PostInteractionSettingsPref_PostgateEmbeddingRules_Elem struct { @@ -414,7 +485,7 @@ func (t *ActorDefs_PostInteractionSettingsPref_PostgateEmbeddingRules_Elem) Mars } func (t *ActorDefs_PostInteractionSettingsPref_PostgateEmbeddingRules_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -441,7 +512,7 @@ func (t *ActorDefs_PostInteractionSettingsPref_PostgateEmbeddingRules_Elem) Mars } func (t *ActorDefs_PostInteractionSettingsPref_PostgateEmbeddingRules_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -483,7 +554,7 @@ func (t *ActorDefs_PostInteractionSettingsPref_ThreadgateAllowRules_Elem) Marsha } func (t *ActorDefs_PostInteractionSettingsPref_ThreadgateAllowRules_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -528,7 +599,7 @@ func (t *ActorDefs_PostInteractionSettingsPref_ThreadgateAllowRules_Elem) Marsha } func (t *ActorDefs_PostInteractionSettingsPref_ThreadgateAllowRules_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -639,7 +710,7 @@ func (t *ActorDefs_Preferences) MarshalJSON() ([]byte, error) { } func (t *ActorDefs_Preferences) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -756,7 +827,7 @@ func (t *ActorDefs_Preferences) MarshalCBOR(w io.Writer) error { } func (t *ActorDefs_Preferences) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -827,17 +898,22 @@ type ActorDefs_ProfileAssociated struct { StarterPacks *int64 `json:"starterPacks,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_ProfileAssociated) RecordTypeID() string { + return "app.bsky.actor.defs#profileAssociated" +} + func (t *ActorDefs_ProfileAssociated) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#profileAssociated" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_ProfileAssociated) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_ProfileAssociatedActivitySubscription is a "profileAssociatedActivitySubscription" in the app.bsky.actor.defs schema. @@ -846,17 +922,22 @@ type ActorDefs_ProfileAssociatedActivitySubscription struct { AllowSubscriptions string `json:"allowSubscriptions"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_ProfileAssociatedActivitySubscription) RecordTypeID() string { + return "app.bsky.actor.defs#profileAssociatedActivitySubscription" +} + func (t *ActorDefs_ProfileAssociatedActivitySubscription) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#profileAssociatedActivitySubscription" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_ProfileAssociatedActivitySubscription) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_ProfileAssociatedChat is a "profileAssociatedChat" in the app.bsky.actor.defs schema. @@ -865,17 +946,22 @@ type ActorDefs_ProfileAssociatedChat struct { AllowIncoming string `json:"allowIncoming"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_ProfileAssociatedChat) RecordTypeID() string { + return "app.bsky.actor.defs#profileAssociatedChat" +} + func (t *ActorDefs_ProfileAssociatedChat) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#profileAssociatedChat" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_ProfileAssociatedChat) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_ProfileAssociatedGerm is a "profileAssociatedGerm" in the app.bsky.actor.defs schema. @@ -885,17 +971,22 @@ type ActorDefs_ProfileAssociatedGerm struct { ShowButtonTo string `json:"showButtonTo"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_ProfileAssociatedGerm) RecordTypeID() string { + return "app.bsky.actor.defs#profileAssociatedGerm" +} + func (t *ActorDefs_ProfileAssociatedGerm) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#profileAssociatedGerm" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_ProfileAssociatedGerm) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_ProfileView is a "profileView" in the app.bsky.actor.defs schema. @@ -905,7 +996,7 @@ type ActorDefs_ProfileView struct { Avatar *string `json:"avatar,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` // debug: Debug information for internal development - Debug *glexrt.LexiconTypeDecoder `json:"debug,omitempty"` + Debug *glex.LexiconTypeDecoder `json:"debug,omitempty"` Description *string `json:"description,omitempty"` Did string `json:"did"` DisplayName *string `json:"displayName,omitempty"` @@ -918,17 +1009,20 @@ type ActorDefs_ProfileView struct { Viewer *ActorDefs_ViewerState `json:"viewer,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_ProfileView) RecordTypeID() string { return "app.bsky.actor.defs#profileView" } + func (t *ActorDefs_ProfileView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#profileView" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_ProfileView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_ProfileViewBasic is a "profileViewBasic" in the app.bsky.actor.defs schema. @@ -938,7 +1032,7 @@ type ActorDefs_ProfileViewBasic struct { Avatar *string `json:"avatar,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` // debug: Debug information for internal development - Debug *glexrt.LexiconTypeDecoder `json:"debug,omitempty"` + Debug *glex.LexiconTypeDecoder `json:"debug,omitempty"` Did string `json:"did"` DisplayName *string `json:"displayName,omitempty"` Handle string `json:"handle"` @@ -949,17 +1043,22 @@ type ActorDefs_ProfileViewBasic struct { Viewer *ActorDefs_ViewerState `json:"viewer,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_ProfileViewBasic) RecordTypeID() string { + return "app.bsky.actor.defs#profileViewBasic" +} + func (t *ActorDefs_ProfileViewBasic) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#profileViewBasic" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_ProfileViewBasic) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_ProfileViewDetailed is a "profileViewDetailed" in the app.bsky.actor.defs schema. @@ -970,7 +1069,7 @@ type ActorDefs_ProfileViewDetailed struct { Banner *string `json:"banner,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` // debug: Debug information for internal development - Debug *glexrt.LexiconTypeDecoder `json:"debug,omitempty"` + Debug *glex.LexiconTypeDecoder `json:"debug,omitempty"` Description *string `json:"description,omitempty"` Did string `json:"did"` DisplayName *string `json:"displayName,omitempty"` @@ -989,17 +1088,22 @@ type ActorDefs_ProfileViewDetailed struct { Website *string `json:"website,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_ProfileViewDetailed) RecordTypeID() string { + return "app.bsky.actor.defs#profileViewDetailed" +} + func (t *ActorDefs_ProfileViewDetailed) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#profileViewDetailed" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_ProfileViewDetailed) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_SavedFeed is a "savedFeed" in the app.bsky.actor.defs schema. @@ -1011,17 +1115,20 @@ type ActorDefs_SavedFeed struct { Value string `json:"value"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_SavedFeed) RecordTypeID() string { return "app.bsky.actor.defs#savedFeed" } + func (t *ActorDefs_SavedFeed) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#savedFeed" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_SavedFeed) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_SavedFeedsPref is a "savedFeedsPref" in the app.bsky.actor.defs schema. @@ -1032,17 +1139,20 @@ type ActorDefs_SavedFeedsPref struct { TimelineIndex *int64 `json:"timelineIndex,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_SavedFeedsPref) RecordTypeID() string { return "app.bsky.actor.defs#savedFeedsPref" } + func (t *ActorDefs_SavedFeedsPref) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#savedFeedsPref" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_SavedFeedsPref) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_SavedFeedsPrefV2 is a "savedFeedsPrefV2" in the app.bsky.actor.defs schema. @@ -1051,17 +1161,22 @@ type ActorDefs_SavedFeedsPrefV2 struct { Items []ActorDefs_SavedFeed `json:"items"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_SavedFeedsPrefV2) RecordTypeID() string { + return "app.bsky.actor.defs#savedFeedsPrefV2" +} + func (t *ActorDefs_SavedFeedsPrefV2) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#savedFeedsPrefV2" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_SavedFeedsPrefV2) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_StatusView is a "statusView" in the app.bsky.actor.defs schema. @@ -1077,23 +1192,26 @@ type ActorDefs_StatusView struct { // isDisabled: True if the user's go-live access has been disabled by a moderator, false otherwise. IsDisabled *bool `json:"isDisabled,omitempty"` Labels []comatproto.LabelDefs_Label `json:"labels,omitempty"` - Record *glexrt.LexiconTypeDecoder `json:"record"` + Record *glex.LexiconTypeDecoder `json:"record"` // status: The status for the account. Status string `json:"status"` Uri *string `json:"uri,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_StatusView) RecordTypeID() string { return "app.bsky.actor.defs#statusView" } + func (t *ActorDefs_StatusView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#statusView" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_StatusView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // An optional embed associated with the status. @@ -1110,7 +1228,7 @@ func (t *ActorDefs_StatusView_Embed) MarshalJSON() ([]byte, error) { } func (t *ActorDefs_StatusView_Embed) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -1137,7 +1255,7 @@ func (t *ActorDefs_StatusView_Embed) MarshalCBOR(w io.Writer) error { } func (t *ActorDefs_StatusView_Embed) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -1158,17 +1276,20 @@ type ActorDefs_ThreadViewPref struct { Sort *string `json:"sort,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_ThreadViewPref) RecordTypeID() string { return "app.bsky.actor.defs#threadViewPref" } + func (t *ActorDefs_ThreadViewPref) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#threadViewPref" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_ThreadViewPref) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_VerificationPrefs is a "verificationPrefs" in the app.bsky.actor.defs schema. @@ -1180,17 +1301,22 @@ type ActorDefs_VerificationPrefs struct { HideBadges *bool `json:"hideBadges,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_VerificationPrefs) RecordTypeID() string { + return "app.bsky.actor.defs#verificationPrefs" +} + func (t *ActorDefs_VerificationPrefs) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#verificationPrefs" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_VerificationPrefs) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_VerificationState is a "verificationState" in the app.bsky.actor.defs schema. @@ -1206,17 +1332,22 @@ type ActorDefs_VerificationState struct { VerifiedStatus string `json:"verifiedStatus"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_VerificationState) RecordTypeID() string { + return "app.bsky.actor.defs#verificationState" +} + func (t *ActorDefs_VerificationState) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#verificationState" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_VerificationState) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_VerificationView is a "verificationView" in the app.bsky.actor.defs schema. @@ -1234,17 +1365,22 @@ type ActorDefs_VerificationView struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_VerificationView) RecordTypeID() string { + return "app.bsky.actor.defs#verificationView" +} + func (t *ActorDefs_VerificationView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#verificationView" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_VerificationView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ActorDefs_ViewerState is a "viewerState" in the app.bsky.actor.defs schema. @@ -1265,15 +1401,18 @@ type ActorDefs_ViewerState struct { MutedByList *GraphDefs_ListViewBasic `json:"mutedByList,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorDefs_ViewerState) RecordTypeID() string { return "app.bsky.actor.defs#viewerState" } + func (t *ActorDefs_ViewerState) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.actor.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.actor.defs#viewerState" + return glex.MarshalCBOR(w, t) } func (t *ActorDefs_ViewerState) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/actorgetpreferences.go b/pkg/appbsky/actorgetpreferences.go deleted file mode 100644 index 1dc18eda..00000000 --- a/pkg/appbsky/actorgetpreferences.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.actor.getPreferences - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ActorGetPreferences_Output struct { - LexiconTypeID string `json:"$type"` - Preferences ActorDefs_Preferences `json:"preferences"` -} - -func (t *ActorGetPreferences_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.actor.getPreferences#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ActorGetPreferences_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ActorGetPreferences calls the XRPC method "app.bsky.actor.getPreferences". -// -// Get private preferences attached to the current account. Expected use is synchronization between multiple devices, and import/export during account migration. Requires auth. -func ActorGetPreferences(ctx context.Context, c glexrt.LexClient) (*ActorGetPreferences_Output, error) { - var out ActorGetPreferences_Output - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.actor.getPreferences", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/actorgetprofile.go b/pkg/appbsky/actorgetprofile.go index 2d48759e..a8674b7f 100644 --- a/pkg/appbsky/actorgetprofile.go +++ b/pkg/appbsky/actorgetprofile.go @@ -7,7 +7,7 @@ package appbsky import ( "context" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" ) // ActorGetProfile calls the XRPC method "app.bsky.actor.getProfile". @@ -15,13 +15,13 @@ import ( // Get detailed profile view of an actor. Does not require auth, but contains relevant metadata with auth. // // actor: Handle or DID of account to fetch profile of. -func ActorGetProfile(ctx context.Context, c glexrt.LexClient, actor string) (*ActorDefs_ProfileViewDetailed, error) { +func ActorGetProfile(ctx context.Context, c glex.LexClient, actor string) (*ActorDefs_ProfileViewDetailed, error) { var out ActorDefs_ProfileViewDetailed params := map[string]interface{}{} params["actor"] = actor - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.actor.getProfile", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "app.bsky.actor.getProfile", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/appbsky/actorgetprofiles.go b/pkg/appbsky/actorgetprofiles.go deleted file mode 100644 index a7c4f460..00000000 --- a/pkg/appbsky/actorgetprofiles.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.actor.getProfiles - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ActorGetProfiles_Output struct { - LexiconTypeID string `json:"$type"` - Profiles []ActorDefs_ProfileViewDetailed `json:"profiles"` -} - -func (t *ActorGetProfiles_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.actor.getProfiles#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ActorGetProfiles_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ActorGetProfiles calls the XRPC method "app.bsky.actor.getProfiles". -// -// Get detailed profile views of multiple actors. -func ActorGetProfiles(ctx context.Context, c glexrt.LexClient, actors []string) (*ActorGetProfiles_Output, error) { - var out ActorGetProfiles_Output - - params := map[string]interface{}{} - params["actors"] = actors - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.actor.getProfiles", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/actorgetsuggestions.go b/pkg/appbsky/actorgetsuggestions.go deleted file mode 100644 index 114e4ae2..00000000 --- a/pkg/appbsky/actorgetsuggestions.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.actor.getSuggestions - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ActorGetSuggestions_Output struct { - LexiconTypeID string `json:"$type"` - Actors []ActorDefs_ProfileView `json:"actors"` - Cursor *string `json:"cursor,omitempty"` - // recId: Snowflake for this recommendation, use when submitting recommendation events. - RecId *int64 `json:"recId,omitempty"` -} - -func (t *ActorGetSuggestions_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.actor.getSuggestions#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ActorGetSuggestions_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ActorGetSuggestions calls the XRPC method "app.bsky.actor.getSuggestions". -// -// Get a list of suggested actors. Expected use is discovery of accounts to follow during new account onboarding. -func ActorGetSuggestions(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64) (*ActorGetSuggestions_Output, error) { - var out ActorGetSuggestions_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.actor.getSuggestions", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/actorprofile.go b/pkg/appbsky/actorprofile.go index c4313662..517d9d27 100644 --- a/pkg/appbsky/actorprofile.go +++ b/pkg/appbsky/actorprofile.go @@ -10,23 +10,23 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) func init() { - glexrt.RegisterType("app.bsky.actor.profile", &ActorProfile{}) + glex.RegisterType("app.bsky.actor.profile", &ActorProfile{}) } // A declaration of a Bluesky account profile. type ActorProfile struct { LexiconTypeID string `json:"$type"` // avatar: Small image to be displayed next to posts from account. AKA, 'profile picture' - Avatar *glexrt.Blob `json:"avatar,omitempty"` + Avatar *glex.Blob `json:"avatar,omitempty"` // banner: Larger horizontal image to display behind profile view. - Banner *glexrt.Blob `json:"banner,omitempty"` - CreatedAt *string `json:"createdAt,omitempty"` + Banner *glex.Blob `json:"banner,omitempty"` + CreatedAt *string `json:"createdAt,omitempty"` // description: Free-form profile description text. Description *string `json:"description,omitempty"` DisplayName *string `json:"displayName,omitempty"` @@ -39,17 +39,20 @@ type ActorProfile struct { Website *string `json:"website,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ActorProfile) RecordTypeID() string { return "app.bsky.actor.profile" } + func (t *ActorProfile) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "app.bsky.actor.profile" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *ActorProfile) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Self-label values, specific to the Bluesky application, on the overall account. @@ -66,7 +69,7 @@ func (t *ActorProfile_Labels) MarshalJSON() ([]byte, error) { } func (t *ActorProfile_Labels) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -93,7 +96,7 @@ func (t *ActorProfile_Labels) MarshalCBOR(w io.Writer) error { } func (t *ActorProfile_Labels) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } diff --git a/pkg/appbsky/actorputpreferences.go b/pkg/appbsky/actorputpreferences.go deleted file mode 100644 index b63848e1..00000000 --- a/pkg/appbsky/actorputpreferences.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.actor.putPreferences - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ActorPutPreferences_Input struct { - LexiconTypeID string `json:"$type"` - Preferences ActorDefs_Preferences `json:"preferences"` -} - -func (t *ActorPutPreferences_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.actor.putPreferences#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ActorPutPreferences_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ActorPutPreferences calls the XRPC method "app.bsky.actor.putPreferences". -// -// Set the private preferences attached to the account. -func ActorPutPreferences(ctx context.Context, c glexrt.LexClient, input *ActorPutPreferences_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.actor.putPreferences", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/appbsky/actorsearchactors.go b/pkg/appbsky/actorsearchactors.go deleted file mode 100644 index 654dab41..00000000 --- a/pkg/appbsky/actorsearchactors.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.actor.searchActors - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ActorSearchActors_Output struct { - LexiconTypeID string `json:"$type"` - Actors []ActorDefs_ProfileView `json:"actors"` - Cursor *string `json:"cursor,omitempty"` -} - -func (t *ActorSearchActors_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.actor.searchActors#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ActorSearchActors_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ActorSearchActors calls the XRPC method "app.bsky.actor.searchActors". -// -// Find actors (profiles) matching search criteria. Does not require auth. -// -// q: Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. -// term: DEPRECATED: use 'q' instead. -func ActorSearchActors(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, q string, term string) (*ActorSearchActors_Output, error) { - var out ActorSearchActors_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - if q != "" { - params["q"] = q - } - if term != "" { - params["term"] = term - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.actor.searchActors", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/actorsearchactorstypeahead.go b/pkg/appbsky/actorsearchactorstypeahead.go deleted file mode 100644 index 93660ee3..00000000 --- a/pkg/appbsky/actorsearchactorstypeahead.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.actor.searchActorsTypeahead - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ActorSearchActorsTypeahead_Output struct { - LexiconTypeID string `json:"$type"` - Actors []ActorDefs_ProfileViewBasic `json:"actors"` -} - -func (t *ActorSearchActorsTypeahead_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.actor.searchActorsTypeahead#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ActorSearchActorsTypeahead_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ActorSearchActorsTypeahead calls the XRPC method "app.bsky.actor.searchActorsTypeahead". -// -// Find actor suggestions for a prefix search term. Expected use is for auto-completion during text field entry. Does not require auth. -// -// q: Search query prefix; not a full query string. -// term: DEPRECATED: use 'q' instead. -func ActorSearchActorsTypeahead(ctx context.Context, c glexrt.LexClient, limit *int64, q string, term string) (*ActorSearchActorsTypeahead_Output, error) { - var out ActorSearchActorsTypeahead_Output - - params := map[string]interface{}{} - if limit != nil { - params["limit"] = *limit - } - if q != "" { - params["q"] = q - } - if term != "" { - params["term"] = term - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.actor.searchActorsTypeahead", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/actorstatus.go b/pkg/appbsky/actorstatus.go index 541b239e..75a04970 100644 --- a/pkg/appbsky/actorstatus.go +++ b/pkg/appbsky/actorstatus.go @@ -10,12 +10,12 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("app.bsky.actor.status", &ActorStatus{}) + glex.RegisterType("app.bsky.actor.status", &ActorStatus{}) } // A declaration of a Bluesky account status. @@ -30,17 +30,20 @@ type ActorStatus struct { Status string `json:"status"` } +// RecordTypeID implements glex.Record. +func (t *ActorStatus) RecordTypeID() string { return "app.bsky.actor.status" } + func (t *ActorStatus) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "app.bsky.actor.status" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *ActorStatus) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // An optional embed associated with the status. @@ -57,7 +60,7 @@ func (t *ActorStatus_Embed) MarshalJSON() ([]byte, error) { } func (t *ActorStatus_Embed) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -84,7 +87,7 @@ func (t *ActorStatus_Embed) MarshalCBOR(w io.Writer) error { } func (t *ActorStatus_Embed) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } diff --git a/pkg/appbsky/ageassurancebegin.go b/pkg/appbsky/ageassurancebegin.go deleted file mode 100644 index 67d99569..00000000 --- a/pkg/appbsky/ageassurancebegin.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.ageassurance.begin - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AgeassuranceBegin_Input struct { - LexiconTypeID string `json:"$type"` - // countryCode: An ISO 3166-1 alpha-2 code of the user's location. - CountryCode string `json:"countryCode"` - // email: The user's email address to receive Age Assurance instructions. - Email string `json:"email"` - // language: The user's preferred language for communication during the Age Assurance process. - Language string `json:"language"` - // regionCode: An optional ISO 3166-2 code of the user's region or state within the country. - RegionCode *string `json:"regionCode,omitempty"` -} - -func (t *AgeassuranceBegin_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.ageassurance.begin#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AgeassuranceBegin_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AgeassuranceBegin calls the XRPC method "app.bsky.ageassurance.begin". -// -// Initiate Age Assurance for an account. -func AgeassuranceBegin(ctx context.Context, c glexrt.LexClient, input *AgeassuranceBegin_Input) (*AgeassuranceDefs_State, error) { - var out AgeassuranceDefs_State - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.ageassurance.begin", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/ageassurancedefs.go b/pkg/appbsky/ageassurancedefs.go deleted file mode 100644 index b3715bb4..00000000 --- a/pkg/appbsky/ageassurancedefs.go +++ /dev/null @@ -1,446 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.ageassurance.defs - -package appbsky - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -// AgeassuranceDefs_Config is a "config" in the app.bsky.ageassurance.defs schema. -type AgeassuranceDefs_Config struct { - LexiconTypeID string `json:"$type"` - // regions: The per-region Age Assurance configuration. - Regions []AgeassuranceDefs_ConfigRegion `json:"regions"` -} - -func (t *AgeassuranceDefs_Config) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.ageassurance.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AgeassuranceDefs_Config) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AgeassuranceDefs_ConfigRegion is a "configRegion" in the app.bsky.ageassurance.defs schema. -// -// The Age Assurance configuration for a specific region. -type AgeassuranceDefs_ConfigRegion struct { - LexiconTypeID string `json:"$type"` - // countryCode: The ISO 3166-1 alpha-2 country code this configuration applies to. - CountryCode string `json:"countryCode"` - // regionCode: The ISO 3166-2 region code this configuration applies to. If omitted, the configuration applies to the entire country. - RegionCode *string `json:"regionCode,omitempty"` - // rules: The ordered list of Age Assurance rules that apply to this region. Rules should be applied in order, and the first matching rule determines the access level granted. The rules array should always include a default rule as the last item. - Rules []AgeassuranceDefs_ConfigRegion_Rules_Elem `json:"rules"` -} - -func (t *AgeassuranceDefs_ConfigRegion) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.ageassurance.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AgeassuranceDefs_ConfigRegion) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type AgeassuranceDefs_ConfigRegion_Rules_Elem struct { - AgeassuranceDefs_ConfigRegionRuleDefault *AgeassuranceDefs_ConfigRegionRuleDefault - AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan *AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan - AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan *AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan - AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge *AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge - AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge *AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge - AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge *AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge - AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge *AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge -} - -func (t *AgeassuranceDefs_ConfigRegion_Rules_Elem) MarshalJSON() ([]byte, error) { - if t.AgeassuranceDefs_ConfigRegionRuleDefault != nil { - t.AgeassuranceDefs_ConfigRegionRuleDefault.LexiconTypeID = "app.bsky.ageassurance.defs#configRegionRuleDefault" - return json.Marshal(t.AgeassuranceDefs_ConfigRegionRuleDefault) - } - if t.AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan != nil { - t.AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan.LexiconTypeID = "app.bsky.ageassurance.defs#configRegionRuleIfAccountNewerThan" - return json.Marshal(t.AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan) - } - if t.AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan != nil { - t.AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan.LexiconTypeID = "app.bsky.ageassurance.defs#configRegionRuleIfAccountOlderThan" - return json.Marshal(t.AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan) - } - if t.AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge != nil { - t.AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge.LexiconTypeID = "app.bsky.ageassurance.defs#configRegionRuleIfAssuredOverAge" - return json.Marshal(t.AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge) - } - if t.AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge != nil { - t.AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge.LexiconTypeID = "app.bsky.ageassurance.defs#configRegionRuleIfAssuredUnderAge" - return json.Marshal(t.AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge) - } - if t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge != nil { - t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge.LexiconTypeID = "app.bsky.ageassurance.defs#configRegionRuleIfDeclaredOverAge" - return json.Marshal(t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge) - } - if t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge != nil { - t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge.LexiconTypeID = "app.bsky.ageassurance.defs#configRegionRuleIfDeclaredUnderAge" - return json.Marshal(t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *AgeassuranceDefs_ConfigRegion_Rules_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "app.bsky.ageassurance.defs#configRegionRuleDefault": - t.AgeassuranceDefs_ConfigRegionRuleDefault = new(AgeassuranceDefs_ConfigRegionRuleDefault) - return json.Unmarshal(b, t.AgeassuranceDefs_ConfigRegionRuleDefault) - case "app.bsky.ageassurance.defs#configRegionRuleIfAccountNewerThan": - t.AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan = new(AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan) - return json.Unmarshal(b, t.AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan) - case "app.bsky.ageassurance.defs#configRegionRuleIfAccountOlderThan": - t.AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan = new(AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan) - return json.Unmarshal(b, t.AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan) - case "app.bsky.ageassurance.defs#configRegionRuleIfAssuredOverAge": - t.AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge = new(AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge) - return json.Unmarshal(b, t.AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge) - case "app.bsky.ageassurance.defs#configRegionRuleIfAssuredUnderAge": - t.AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge = new(AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge) - return json.Unmarshal(b, t.AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge) - case "app.bsky.ageassurance.defs#configRegionRuleIfDeclaredOverAge": - t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge = new(AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge) - return json.Unmarshal(b, t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge) - case "app.bsky.ageassurance.defs#configRegionRuleIfDeclaredUnderAge": - t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge = new(AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge) - return json.Unmarshal(b, t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge) - default: - return nil - } -} - -func (t *AgeassuranceDefs_ConfigRegion_Rules_Elem) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.AgeassuranceDefs_ConfigRegionRuleDefault != nil { - return t.AgeassuranceDefs_ConfigRegionRuleDefault.MarshalCBOR(w) - } - if t.AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan != nil { - return t.AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan.MarshalCBOR(w) - } - if t.AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan != nil { - return t.AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan.MarshalCBOR(w) - } - if t.AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge != nil { - return t.AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge.MarshalCBOR(w) - } - if t.AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge != nil { - return t.AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge.MarshalCBOR(w) - } - if t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge != nil { - return t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge.MarshalCBOR(w) - } - if t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge != nil { - return t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *AgeassuranceDefs_ConfigRegion_Rules_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "app.bsky.ageassurance.defs#configRegionRuleDefault": - t.AgeassuranceDefs_ConfigRegionRuleDefault = new(AgeassuranceDefs_ConfigRegionRuleDefault) - return t.AgeassuranceDefs_ConfigRegionRuleDefault.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.ageassurance.defs#configRegionRuleIfAccountNewerThan": - t.AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan = new(AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan) - return t.AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.ageassurance.defs#configRegionRuleIfAccountOlderThan": - t.AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan = new(AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan) - return t.AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.ageassurance.defs#configRegionRuleIfAssuredOverAge": - t.AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge = new(AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge) - return t.AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.ageassurance.defs#configRegionRuleIfAssuredUnderAge": - t.AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge = new(AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge) - return t.AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.ageassurance.defs#configRegionRuleIfDeclaredOverAge": - t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge = new(AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge) - return t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.ageassurance.defs#configRegionRuleIfDeclaredUnderAge": - t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge = new(AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge) - return t.AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} - -// AgeassuranceDefs_ConfigRegionRuleDefault is a "configRegionRuleDefault" in the app.bsky.ageassurance.defs schema. -// -// Age Assurance rule that applies by default. -type AgeassuranceDefs_ConfigRegionRuleDefault struct { - LexiconTypeID string `json:"$type"` - Access string `json:"access"` -} - -func (t *AgeassuranceDefs_ConfigRegionRuleDefault) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.ageassurance.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AgeassuranceDefs_ConfigRegionRuleDefault) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan is a "configRegionRuleIfAccountNewerThan" in the app.bsky.ageassurance.defs schema. -// -// Age Assurance rule that applies if the account is equal-to or newer than a certain date. -type AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan struct { - LexiconTypeID string `json:"$type"` - Access string `json:"access"` - // date: The date threshold as a datetime string. - Date string `json:"date"` -} - -func (t *AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.ageassurance.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AgeassuranceDefs_ConfigRegionRuleIfAccountNewerThan) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan is a "configRegionRuleIfAccountOlderThan" in the app.bsky.ageassurance.defs schema. -// -// Age Assurance rule that applies if the account is older than a certain date. -type AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan struct { - LexiconTypeID string `json:"$type"` - Access string `json:"access"` - // date: The date threshold as a datetime string. - Date string `json:"date"` -} - -func (t *AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.ageassurance.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AgeassuranceDefs_ConfigRegionRuleIfAccountOlderThan) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge is a "configRegionRuleIfAssuredOverAge" in the app.bsky.ageassurance.defs schema. -// -// Age Assurance rule that applies if the user has been assured to be equal-to or over a certain age. -type AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge struct { - LexiconTypeID string `json:"$type"` - Access string `json:"access"` - // age: The age threshold as a whole integer. - Age int64 `json:"age"` -} - -func (t *AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.ageassurance.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AgeassuranceDefs_ConfigRegionRuleIfAssuredOverAge) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge is a "configRegionRuleIfAssuredUnderAge" in the app.bsky.ageassurance.defs schema. -// -// Age Assurance rule that applies if the user has been assured to be under a certain age. -type AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge struct { - LexiconTypeID string `json:"$type"` - Access string `json:"access"` - // age: The age threshold as a whole integer. - Age int64 `json:"age"` -} - -func (t *AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.ageassurance.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AgeassuranceDefs_ConfigRegionRuleIfAssuredUnderAge) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge is a "configRegionRuleIfDeclaredOverAge" in the app.bsky.ageassurance.defs schema. -// -// Age Assurance rule that applies if the user has declared themselves equal-to or over a certain age. -type AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge struct { - LexiconTypeID string `json:"$type"` - Access string `json:"access"` - // age: The age threshold as a whole integer. - Age int64 `json:"age"` -} - -func (t *AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.ageassurance.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AgeassuranceDefs_ConfigRegionRuleIfDeclaredOverAge) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge is a "configRegionRuleIfDeclaredUnderAge" in the app.bsky.ageassurance.defs schema. -// -// Age Assurance rule that applies if the user has declared themselves under a certain age. -type AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge struct { - LexiconTypeID string `json:"$type"` - Access string `json:"access"` - // age: The age threshold as a whole integer. - Age int64 `json:"age"` -} - -func (t *AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.ageassurance.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AgeassuranceDefs_ConfigRegionRuleIfDeclaredUnderAge) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AgeassuranceDefs_Event is a "event" in the app.bsky.ageassurance.defs schema. -// -// Object used to store Age Assurance data in stash. -type AgeassuranceDefs_Event struct { - LexiconTypeID string `json:"$type"` - // access: The access level granted based on Age Assurance data we've processed. - Access string `json:"access"` - // attemptId: The unique identifier for this instance of the Age Assurance flow, in UUID format. - AttemptId string `json:"attemptId"` - // completeIp: The IP address used when completing the Age Assurance flow. - CompleteIp *string `json:"completeIp,omitempty"` - // completeUa: The user agent used when completing the Age Assurance flow. - CompleteUa *string `json:"completeUa,omitempty"` - // countryCode: The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow. - CountryCode string `json:"countryCode"` - // createdAt: The date and time of this write operation. - CreatedAt string `json:"createdAt"` - // email: The email used for Age Assurance. - Email *string `json:"email,omitempty"` - // initIp: The IP address used when initiating the Age Assurance flow. - InitIp *string `json:"initIp,omitempty"` - // initUa: The user agent used when initiating the Age Assurance flow. - InitUa *string `json:"initUa,omitempty"` - // regionCode: The ISO 3166-2 region code provided when beginning the Age Assurance flow. - RegionCode *string `json:"regionCode,omitempty"` - // status: The status of the Age Assurance process. - Status string `json:"status"` -} - -func (t *AgeassuranceDefs_Event) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.ageassurance.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AgeassuranceDefs_Event) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AgeassuranceDefs_State is a "state" in the app.bsky.ageassurance.defs schema. -// -// The user's computed Age Assurance state. -type AgeassuranceDefs_State struct { - LexiconTypeID string `json:"$type"` - Access string `json:"access"` - // lastInitiatedAt: The timestamp when this state was last updated. - LastInitiatedAt *string `json:"lastInitiatedAt,omitempty"` - Status string `json:"status"` -} - -func (t *AgeassuranceDefs_State) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.ageassurance.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AgeassuranceDefs_State) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AgeassuranceDefs_StateMetadata is a "stateMetadata" in the app.bsky.ageassurance.defs schema. -// -// Additional metadata needed to compute Age Assurance state client-side. -type AgeassuranceDefs_StateMetadata struct { - LexiconTypeID string `json:"$type"` - // accountCreatedAt: The account creation timestamp. - AccountCreatedAt *string `json:"accountCreatedAt,omitempty"` -} - -func (t *AgeassuranceDefs_StateMetadata) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.ageassurance.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AgeassuranceDefs_StateMetadata) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/ageassurancegetconfig.go b/pkg/appbsky/ageassurancegetconfig.go deleted file mode 100644 index 05da9af7..00000000 --- a/pkg/appbsky/ageassurancegetconfig.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.ageassurance.getConfig - -package appbsky - -import ( - "context" - - glexrt "github.com/streamplace/glex/runtime" -) - -// AgeassuranceGetConfig calls the XRPC method "app.bsky.ageassurance.getConfig". -// -// Returns Age Assurance configuration for use on the client. -func AgeassuranceGetConfig(ctx context.Context, c glexrt.LexClient) (*AgeassuranceDefs_Config, error) { - var out AgeassuranceDefs_Config - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.ageassurance.getConfig", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/ageassurancegetstate.go b/pkg/appbsky/ageassurancegetstate.go deleted file mode 100644 index af974089..00000000 --- a/pkg/appbsky/ageassurancegetstate.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.ageassurance.getState - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AgeassuranceGetState_Output struct { - LexiconTypeID string `json:"$type"` - Metadata AgeassuranceDefs_StateMetadata `json:"metadata"` - State AgeassuranceDefs_State `json:"state"` -} - -func (t *AgeassuranceGetState_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.ageassurance.getState#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AgeassuranceGetState_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AgeassuranceGetState calls the XRPC method "app.bsky.ageassurance.getState". -// -// Returns server-computed Age Assurance state, if available, and any additional metadata needed to compute Age Assurance state client-side. -func AgeassuranceGetState(ctx context.Context, c glexrt.LexClient, countryCode string, regionCode string) (*AgeassuranceGetState_Output, error) { - var out AgeassuranceGetState_Output - - params := map[string]interface{}{} - if regionCode != "" { - params["regionCode"] = regionCode - } - params["countryCode"] = countryCode - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.ageassurance.getState", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/bookmarkcreatebookmark.go b/pkg/appbsky/bookmarkcreatebookmark.go deleted file mode 100644 index 2053a6c3..00000000 --- a/pkg/appbsky/bookmarkcreatebookmark.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.bookmark.createBookmark - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type BookmarkCreateBookmark_Input struct { - LexiconTypeID string `json:"$type"` - Cid string `json:"cid"` - Uri string `json:"uri"` -} - -func (t *BookmarkCreateBookmark_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.bookmark.createBookmark#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *BookmarkCreateBookmark_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// BookmarkCreateBookmark calls the XRPC method "app.bsky.bookmark.createBookmark". -// -// Creates a private bookmark for the specified record. Currently, only `app.bsky.feed.post` records are supported. Requires authentication. -func BookmarkCreateBookmark(ctx context.Context, c glexrt.LexClient, input *BookmarkCreateBookmark_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.bookmark.createBookmark", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/appbsky/bookmarkdefs.go b/pkg/appbsky/bookmarkdefs.go deleted file mode 100644 index 5d17a51c..00000000 --- a/pkg/appbsky/bookmarkdefs.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.bookmark.defs - -package appbsky - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" - comatproto "stream.place/streamplace/pkg/comatproto" -) - -// BookmarkDefs_Bookmark is a "bookmark" in the app.bsky.bookmark.defs schema. -// -// Object used to store bookmark data in stash. -type BookmarkDefs_Bookmark struct { - LexiconTypeID string `json:"$type"` - // subject: A strong ref to the record to be bookmarked. Currently, only `app.bsky.feed.post` records are supported. - Subject comatproto.RepoStrongRef `json:"subject"` -} - -func (t *BookmarkDefs_Bookmark) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.bookmark.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *BookmarkDefs_Bookmark) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// BookmarkDefs_BookmarkView is a "bookmarkView" in the app.bsky.bookmark.defs schema. -type BookmarkDefs_BookmarkView struct { - LexiconTypeID string `json:"$type"` - CreatedAt *string `json:"createdAt,omitempty"` - Item BookmarkDefs_BookmarkView_Item `json:"item"` - // subject: A strong ref to the bookmarked record. - Subject comatproto.RepoStrongRef `json:"subject"` -} - -func (t *BookmarkDefs_BookmarkView) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.bookmark.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *BookmarkDefs_BookmarkView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type BookmarkDefs_BookmarkView_Item struct { - FeedDefs_BlockedPost *FeedDefs_BlockedPost - FeedDefs_NotFoundPost *FeedDefs_NotFoundPost - FeedDefs_PostView *FeedDefs_PostView -} - -func (t *BookmarkDefs_BookmarkView_Item) MarshalJSON() ([]byte, error) { - if t.FeedDefs_BlockedPost != nil { - t.FeedDefs_BlockedPost.LexiconTypeID = "app.bsky.feed.defs#blockedPost" - return json.Marshal(t.FeedDefs_BlockedPost) - } - if t.FeedDefs_NotFoundPost != nil { - t.FeedDefs_NotFoundPost.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" - return json.Marshal(t.FeedDefs_NotFoundPost) - } - if t.FeedDefs_PostView != nil { - t.FeedDefs_PostView.LexiconTypeID = "app.bsky.feed.defs#postView" - return json.Marshal(t.FeedDefs_PostView) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *BookmarkDefs_BookmarkView_Item) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "app.bsky.feed.defs#blockedPost": - t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) - return json.Unmarshal(b, t.FeedDefs_BlockedPost) - case "app.bsky.feed.defs#notFoundPost": - t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) - return json.Unmarshal(b, t.FeedDefs_NotFoundPost) - case "app.bsky.feed.defs#postView": - t.FeedDefs_PostView = new(FeedDefs_PostView) - return json.Unmarshal(b, t.FeedDefs_PostView) - default: - return nil - } -} - -func (t *BookmarkDefs_BookmarkView_Item) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.FeedDefs_BlockedPost != nil { - return t.FeedDefs_BlockedPost.MarshalCBOR(w) - } - if t.FeedDefs_NotFoundPost != nil { - return t.FeedDefs_NotFoundPost.MarshalCBOR(w) - } - if t.FeedDefs_PostView != nil { - return t.FeedDefs_PostView.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *BookmarkDefs_BookmarkView_Item) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "app.bsky.feed.defs#blockedPost": - t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) - return t.FeedDefs_BlockedPost.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.feed.defs#notFoundPost": - t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) - return t.FeedDefs_NotFoundPost.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.feed.defs#postView": - t.FeedDefs_PostView = new(FeedDefs_PostView) - return t.FeedDefs_PostView.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} diff --git a/pkg/appbsky/bookmarkdeletebookmark.go b/pkg/appbsky/bookmarkdeletebookmark.go deleted file mode 100644 index 1576cbe1..00000000 --- a/pkg/appbsky/bookmarkdeletebookmark.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.bookmark.deleteBookmark - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type BookmarkDeleteBookmark_Input struct { - LexiconTypeID string `json:"$type"` - Uri string `json:"uri"` -} - -func (t *BookmarkDeleteBookmark_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.bookmark.deleteBookmark#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *BookmarkDeleteBookmark_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// BookmarkDeleteBookmark calls the XRPC method "app.bsky.bookmark.deleteBookmark". -// -// Deletes a private bookmark for the specified record. Currently, only `app.bsky.feed.post` records are supported. Requires authentication. -func BookmarkDeleteBookmark(ctx context.Context, c glexrt.LexClient, input *BookmarkDeleteBookmark_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.bookmark.deleteBookmark", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/appbsky/bookmarkgetbookmarks.go b/pkg/appbsky/bookmarkgetbookmarks.go deleted file mode 100644 index fd851646..00000000 --- a/pkg/appbsky/bookmarkgetbookmarks.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.bookmark.getBookmarks - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type BookmarkGetBookmarks_Output struct { - LexiconTypeID string `json:"$type"` - Bookmarks []BookmarkDefs_BookmarkView `json:"bookmarks"` - Cursor *string `json:"cursor,omitempty"` -} - -func (t *BookmarkGetBookmarks_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.bookmark.getBookmarks#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *BookmarkGetBookmarks_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// BookmarkGetBookmarks calls the XRPC method "app.bsky.bookmark.getBookmarks". -// -// Gets views of records bookmarked by the authenticated user. Requires authentication. -func BookmarkGetBookmarks(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64) (*BookmarkGetBookmarks_Output, error) { - var out BookmarkGetBookmarks_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.bookmark.getBookmarks", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/embeddefs.go b/pkg/appbsky/embeddefs.go index 4b74991a..0a24d726 100644 --- a/pkg/appbsky/embeddefs.go +++ b/pkg/appbsky/embeddefs.go @@ -7,7 +7,7 @@ package appbsky import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -20,15 +20,18 @@ type EmbedDefs_AspectRatio struct { Width int64 `json:"width"` } +// RecordTypeID implements glex.Record. +func (t *EmbedDefs_AspectRatio) RecordTypeID() string { return "app.bsky.embed.defs#aspectRatio" } + func (t *EmbedDefs_AspectRatio) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.defs#aspectRatio" + return glex.MarshalCBOR(w, t) } func (t *EmbedDefs_AspectRatio) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/embedexternal.go b/pkg/appbsky/embedexternal.go index b6b1bfc6..5c10fe24 100644 --- a/pkg/appbsky/embedexternal.go +++ b/pkg/appbsky/embedexternal.go @@ -7,12 +7,12 @@ package appbsky import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("app.bsky.embed.external#main", &EmbedExternal{}) + glex.RegisterType("app.bsky.embed.external#main", &EmbedExternal{}) } // A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post). @@ -21,39 +21,45 @@ type EmbedExternal struct { External EmbedExternal_External `json:"external"` } +// RecordTypeID implements glex.Record. +func (t *EmbedExternal) RecordTypeID() string { return "app.bsky.embed.external" } + func (t *EmbedExternal) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "app.bsky.embed.external" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *EmbedExternal) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // EmbedExternal_External is a "external" in the app.bsky.embed.external schema. type EmbedExternal_External struct { - LexiconTypeID string `json:"$type"` - Description string `json:"description"` - Thumb *glexrt.Blob `json:"thumb,omitempty"` - Title string `json:"title"` - Uri string `json:"uri"` + LexiconTypeID string `json:"$type"` + Description string `json:"description"` + Thumb *glex.Blob `json:"thumb,omitempty"` + Title string `json:"title"` + Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *EmbedExternal_External) RecordTypeID() string { return "app.bsky.embed.external#external" } + func (t *EmbedExternal_External) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.external" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.external#external" + return glex.MarshalCBOR(w, t) } func (t *EmbedExternal_External) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // EmbedExternal_View is a "view" in the app.bsky.embed.external schema. @@ -62,17 +68,20 @@ type EmbedExternal_View struct { External EmbedExternal_ViewExternal `json:"external"` } +// RecordTypeID implements glex.Record. +func (t *EmbedExternal_View) RecordTypeID() string { return "app.bsky.embed.external#view" } + func (t *EmbedExternal_View) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.external" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.external#view" + return glex.MarshalCBOR(w, t) } func (t *EmbedExternal_View) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // EmbedExternal_ViewExternal is a "viewExternal" in the app.bsky.embed.external schema. @@ -84,15 +93,20 @@ type EmbedExternal_ViewExternal struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *EmbedExternal_ViewExternal) RecordTypeID() string { + return "app.bsky.embed.external#viewExternal" +} + func (t *EmbedExternal_ViewExternal) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.external" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.external#viewExternal" + return glex.MarshalCBOR(w, t) } func (t *EmbedExternal_ViewExternal) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/embedimages.go b/pkg/appbsky/embedimages.go index 835a3a5e..8982d4c3 100644 --- a/pkg/appbsky/embedimages.go +++ b/pkg/appbsky/embedimages.go @@ -7,12 +7,12 @@ package appbsky import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("app.bsky.embed.images#main", &EmbedImages{}) + glex.RegisterType("app.bsky.embed.images#main", &EmbedImages{}) } type EmbedImages struct { @@ -20,17 +20,20 @@ type EmbedImages struct { Images []EmbedImages_Image `json:"images"` } +// RecordTypeID implements glex.Record. +func (t *EmbedImages) RecordTypeID() string { return "app.bsky.embed.images" } + func (t *EmbedImages) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "app.bsky.embed.images" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *EmbedImages) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // EmbedImages_Image is a "image" in the app.bsky.embed.images schema. @@ -40,20 +43,23 @@ type EmbedImages_Image struct { Alt string `json:"alt"` AspectRatio *EmbedDefs_AspectRatio `json:"aspectRatio,omitempty"` // image: The raw image file. May be up to 2 MB, formerly limited to 1 MB. - Image glexrt.Blob `json:"image"` + Image glex.Blob `json:"image"` } +// RecordTypeID implements glex.Record. +func (t *EmbedImages_Image) RecordTypeID() string { return "app.bsky.embed.images#image" } + func (t *EmbedImages_Image) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.images" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.images#image" + return glex.MarshalCBOR(w, t) } func (t *EmbedImages_Image) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // EmbedImages_View is a "view" in the app.bsky.embed.images schema. @@ -62,17 +68,20 @@ type EmbedImages_View struct { Images []EmbedImages_ViewImage `json:"images"` } +// RecordTypeID implements glex.Record. +func (t *EmbedImages_View) RecordTypeID() string { return "app.bsky.embed.images#view" } + func (t *EmbedImages_View) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.images" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.images#view" + return glex.MarshalCBOR(w, t) } func (t *EmbedImages_View) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // EmbedImages_ViewImage is a "viewImage" in the app.bsky.embed.images schema. @@ -87,15 +96,18 @@ type EmbedImages_ViewImage struct { Thumb string `json:"thumb"` } +// RecordTypeID implements glex.Record. +func (t *EmbedImages_ViewImage) RecordTypeID() string { return "app.bsky.embed.images#viewImage" } + func (t *EmbedImages_ViewImage) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.images" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.images#viewImage" + return glex.MarshalCBOR(w, t) } func (t *EmbedImages_ViewImage) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/embedrecord.go b/pkg/appbsky/embedrecord.go index 7dfd8bba..b274af0e 100644 --- a/pkg/appbsky/embedrecord.go +++ b/pkg/appbsky/embedrecord.go @@ -10,13 +10,13 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) func init() { - glexrt.RegisterType("app.bsky.embed.record#main", &EmbedRecord{}) + glex.RegisterType("app.bsky.embed.record#main", &EmbedRecord{}) } type EmbedRecord struct { @@ -24,17 +24,20 @@ type EmbedRecord struct { Record comatproto.RepoStrongRef `json:"record"` } +// RecordTypeID implements glex.Record. +func (t *EmbedRecord) RecordTypeID() string { return "app.bsky.embed.record" } + func (t *EmbedRecord) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "app.bsky.embed.record" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *EmbedRecord) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // EmbedRecord_View is a "view" in the app.bsky.embed.record schema. @@ -43,17 +46,20 @@ type EmbedRecord_View struct { Record EmbedRecord_View_Record `json:"record"` } +// RecordTypeID implements glex.Record. +func (t *EmbedRecord_View) RecordTypeID() string { return "app.bsky.embed.record#view" } + func (t *EmbedRecord_View) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.record" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.record#view" + return glex.MarshalCBOR(w, t) } func (t *EmbedRecord_View) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type EmbedRecord_View_Record struct { @@ -104,7 +110,7 @@ func (t *EmbedRecord_View_Record) MarshalJSON() ([]byte, error) { } func (t *EmbedRecord_View_Record) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -173,7 +179,7 @@ func (t *EmbedRecord_View_Record) MarshalCBOR(w io.Writer) error { } func (t *EmbedRecord_View_Record) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -216,17 +222,20 @@ type EmbedRecord_ViewBlocked struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *EmbedRecord_ViewBlocked) RecordTypeID() string { return "app.bsky.embed.record#viewBlocked" } + func (t *EmbedRecord_ViewBlocked) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.record" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.record#viewBlocked" + return glex.MarshalCBOR(w, t) } func (t *EmbedRecord_ViewBlocked) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // EmbedRecord_ViewDetached is a "viewDetached" in the app.bsky.embed.record schema. @@ -236,17 +245,20 @@ type EmbedRecord_ViewDetached struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *EmbedRecord_ViewDetached) RecordTypeID() string { return "app.bsky.embed.record#viewDetached" } + func (t *EmbedRecord_ViewDetached) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.record" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.record#viewDetached" + return glex.MarshalCBOR(w, t) } func (t *EmbedRecord_ViewDetached) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // EmbedRecord_ViewNotFound is a "viewNotFound" in the app.bsky.embed.record schema. @@ -256,17 +268,20 @@ type EmbedRecord_ViewNotFound struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *EmbedRecord_ViewNotFound) RecordTypeID() string { return "app.bsky.embed.record#viewNotFound" } + func (t *EmbedRecord_ViewNotFound) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.record" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.record#viewNotFound" + return glex.MarshalCBOR(w, t) } func (t *EmbedRecord_ViewNotFound) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // EmbedRecord_ViewRecord is a "viewRecord" in the app.bsky.embed.record schema. @@ -283,20 +298,23 @@ type EmbedRecord_ViewRecord struct { RepostCount *int64 `json:"repostCount,omitempty"` Uri string `json:"uri"` // value: The record data itself. - Value *glexrt.LexiconTypeDecoder `json:"value"` + Value *glex.LexiconTypeDecoder `json:"value"` } +// RecordTypeID implements glex.Record. +func (t *EmbedRecord_ViewRecord) RecordTypeID() string { return "app.bsky.embed.record#viewRecord" } + func (t *EmbedRecord_ViewRecord) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.record" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.record#viewRecord" + return glex.MarshalCBOR(w, t) } func (t *EmbedRecord_ViewRecord) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type EmbedRecord_ViewRecord_Embeds_Elem struct { @@ -332,7 +350,7 @@ func (t *EmbedRecord_ViewRecord_Embeds_Elem) MarshalJSON() ([]byte, error) { } func (t *EmbedRecord_ViewRecord_Embeds_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -383,7 +401,7 @@ func (t *EmbedRecord_ViewRecord_Embeds_Elem) MarshalCBOR(w io.Writer) error { } func (t *EmbedRecord_ViewRecord_Embeds_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } diff --git a/pkg/appbsky/embedrecordwithmedia.go b/pkg/appbsky/embedrecordwithmedia.go index 24ccfb3c..249c6e66 100644 --- a/pkg/appbsky/embedrecordwithmedia.go +++ b/pkg/appbsky/embedrecordwithmedia.go @@ -10,12 +10,12 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("app.bsky.embed.recordWithMedia#main", &EmbedRecordWithMedia{}) + glex.RegisterType("app.bsky.embed.recordWithMedia#main", &EmbedRecordWithMedia{}) } type EmbedRecordWithMedia struct { @@ -24,17 +24,20 @@ type EmbedRecordWithMedia struct { Record EmbedRecord `json:"record"` } +// RecordTypeID implements glex.Record. +func (t *EmbedRecordWithMedia) RecordTypeID() string { return "app.bsky.embed.recordWithMedia" } + func (t *EmbedRecordWithMedia) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "app.bsky.embed.recordWithMedia" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *EmbedRecordWithMedia) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type EmbedRecordWithMedia_Media struct { @@ -60,7 +63,7 @@ func (t *EmbedRecordWithMedia_Media) MarshalJSON() ([]byte, error) { } func (t *EmbedRecordWithMedia_Media) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -99,7 +102,7 @@ func (t *EmbedRecordWithMedia_Media) MarshalCBOR(w io.Writer) error { } func (t *EmbedRecordWithMedia_Media) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -126,17 +129,22 @@ type EmbedRecordWithMedia_View struct { Record EmbedRecord_View `json:"record"` } +// RecordTypeID implements glex.Record. +func (t *EmbedRecordWithMedia_View) RecordTypeID() string { + return "app.bsky.embed.recordWithMedia#view" +} + func (t *EmbedRecordWithMedia_View) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.recordWithMedia" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.recordWithMedia#view" + return glex.MarshalCBOR(w, t) } func (t *EmbedRecordWithMedia_View) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type EmbedRecordWithMedia_View_Media struct { @@ -162,7 +170,7 @@ func (t *EmbedRecordWithMedia_View_Media) MarshalJSON() ([]byte, error) { } func (t *EmbedRecordWithMedia_View_Media) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -201,7 +209,7 @@ func (t *EmbedRecordWithMedia_View_Media) MarshalCBOR(w io.Writer) error { } func (t *EmbedRecordWithMedia_View_Media) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } diff --git a/pkg/appbsky/embedvideo.go b/pkg/appbsky/embedvideo.go index 4f526c89..8c61536f 100644 --- a/pkg/appbsky/embedvideo.go +++ b/pkg/appbsky/embedvideo.go @@ -7,12 +7,12 @@ package appbsky import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("app.bsky.embed.video#main", &EmbedVideo{}) + glex.RegisterType("app.bsky.embed.video#main", &EmbedVideo{}) } type EmbedVideo struct { @@ -24,40 +24,46 @@ type EmbedVideo struct { // presentation: A hint to the client about how to present the video. Presentation *string `json:"presentation,omitempty"` // video: The mp4 video file. May be up to 100mb, formerly limited to 50mb. - Video glexrt.Blob `json:"video"` + Video glex.Blob `json:"video"` } +// RecordTypeID implements glex.Record. +func (t *EmbedVideo) RecordTypeID() string { return "app.bsky.embed.video" } + func (t *EmbedVideo) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "app.bsky.embed.video" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *EmbedVideo) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // EmbedVideo_Caption is a "caption" in the app.bsky.embed.video schema. type EmbedVideo_Caption struct { - LexiconTypeID string `json:"$type"` - File glexrt.Blob `json:"file"` - Lang string `json:"lang"` + LexiconTypeID string `json:"$type"` + File glex.Blob `json:"file"` + Lang string `json:"lang"` } +// RecordTypeID implements glex.Record. +func (t *EmbedVideo_Caption) RecordTypeID() string { return "app.bsky.embed.video#caption" } + func (t *EmbedVideo_Caption) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.video" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.video#caption" + return glex.MarshalCBOR(w, t) } func (t *EmbedVideo_Caption) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // EmbedVideo_View is a "view" in the app.bsky.embed.video schema. @@ -72,15 +78,18 @@ type EmbedVideo_View struct { Thumbnail *string `json:"thumbnail,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *EmbedVideo_View) RecordTypeID() string { return "app.bsky.embed.video#view" } + func (t *EmbedVideo_View) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.embed.video" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.embed.video#view" + return glex.MarshalCBOR(w, t) } func (t *EmbedVideo_View) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/feeddefs.go b/pkg/appbsky/feeddefs.go index 91bdac52..1d65f6fa 100644 --- a/pkg/appbsky/feeddefs.go +++ b/pkg/appbsky/feeddefs.go @@ -10,7 +10,7 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) @@ -22,17 +22,20 @@ type FeedDefs_BlockedAuthor struct { Viewer *ActorDefs_ViewerState `json:"viewer,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_BlockedAuthor) RecordTypeID() string { return "app.bsky.feed.defs#blockedAuthor" } + func (t *FeedDefs_BlockedAuthor) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#blockedAuthor" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_BlockedAuthor) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedDefs_BlockedPost is a "blockedPost" in the app.bsky.feed.defs schema. @@ -43,17 +46,20 @@ type FeedDefs_BlockedPost struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_BlockedPost) RecordTypeID() string { return "app.bsky.feed.defs#blockedPost" } + func (t *FeedDefs_BlockedPost) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#blockedPost" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_BlockedPost) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedDefs_FeedViewPost is a "feedViewPost" in the app.bsky.feed.defs schema. @@ -68,17 +74,20 @@ type FeedDefs_FeedViewPost struct { ReqId *string `json:"reqId,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_FeedViewPost) RecordTypeID() string { return "app.bsky.feed.defs#feedViewPost" } + func (t *FeedDefs_FeedViewPost) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#feedViewPost" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_FeedViewPost) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type FeedDefs_FeedViewPost_Reason struct { @@ -99,7 +108,7 @@ func (t *FeedDefs_FeedViewPost_Reason) MarshalJSON() ([]byte, error) { } func (t *FeedDefs_FeedViewPost_Reason) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -132,7 +141,7 @@ func (t *FeedDefs_FeedViewPost_Reason) MarshalCBOR(w io.Writer) error { } func (t *FeedDefs_FeedViewPost_Reason) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -168,17 +177,20 @@ type FeedDefs_GeneratorView struct { Viewer *FeedDefs_GeneratorViewerState `json:"viewer,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_GeneratorView) RecordTypeID() string { return "app.bsky.feed.defs#generatorView" } + func (t *FeedDefs_GeneratorView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#generatorView" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_GeneratorView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedDefs_GeneratorViewerState is a "generatorViewerState" in the app.bsky.feed.defs schema. @@ -187,17 +199,22 @@ type FeedDefs_GeneratorViewerState struct { Like *string `json:"like,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_GeneratorViewerState) RecordTypeID() string { + return "app.bsky.feed.defs#generatorViewerState" +} + func (t *FeedDefs_GeneratorViewerState) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#generatorViewerState" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_GeneratorViewerState) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedDefs_Interaction is a "interaction" in the app.bsky.feed.defs schema. @@ -211,17 +228,20 @@ type FeedDefs_Interaction struct { ReqId *string `json:"reqId,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_Interaction) RecordTypeID() string { return "app.bsky.feed.defs#interaction" } + func (t *FeedDefs_Interaction) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#interaction" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_Interaction) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedDefs_NotFoundPost is a "notFoundPost" in the app.bsky.feed.defs schema. @@ -231,17 +251,20 @@ type FeedDefs_NotFoundPost struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_NotFoundPost) RecordTypeID() string { return "app.bsky.feed.defs#notFoundPost" } + func (t *FeedDefs_NotFoundPost) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_NotFoundPost) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedDefs_PostView is a "postView" in the app.bsky.feed.defs schema. @@ -251,13 +274,13 @@ type FeedDefs_PostView struct { BookmarkCount *int64 `json:"bookmarkCount,omitempty"` Cid string `json:"cid"` // debug: Debug information for internal development - Debug *glexrt.LexiconTypeDecoder `json:"debug,omitempty"` + Debug *glex.LexiconTypeDecoder `json:"debug,omitempty"` Embed *FeedDefs_PostView_Embed `json:"embed,omitempty"` IndexedAt string `json:"indexedAt"` Labels []comatproto.LabelDefs_Label `json:"labels,omitempty"` LikeCount *int64 `json:"likeCount,omitempty"` QuoteCount *int64 `json:"quoteCount,omitempty"` - Record *glexrt.LexiconTypeDecoder `json:"record"` + Record *glex.LexiconTypeDecoder `json:"record"` ReplyCount *int64 `json:"replyCount,omitempty"` RepostCount *int64 `json:"repostCount,omitempty"` Threadgate *FeedDefs_ThreadgateView `json:"threadgate,omitempty"` @@ -265,17 +288,20 @@ type FeedDefs_PostView struct { Viewer *FeedDefs_ViewerState `json:"viewer,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_PostView) RecordTypeID() string { return "app.bsky.feed.defs#postView" } + func (t *FeedDefs_PostView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#postView" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_PostView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type FeedDefs_PostView_Embed struct { @@ -311,7 +337,7 @@ func (t *FeedDefs_PostView_Embed) MarshalJSON() ([]byte, error) { } func (t *FeedDefs_PostView_Embed) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -362,7 +388,7 @@ func (t *FeedDefs_PostView_Embed) MarshalCBOR(w io.Writer) error { } func (t *FeedDefs_PostView_Embed) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -393,17 +419,20 @@ type FeedDefs_ReasonPin struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_ReasonPin) RecordTypeID() string { return "app.bsky.feed.defs#reasonPin" } + func (t *FeedDefs_ReasonPin) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#reasonPin" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_ReasonPin) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedDefs_ReasonRepost is a "reasonRepost" in the app.bsky.feed.defs schema. @@ -415,17 +444,20 @@ type FeedDefs_ReasonRepost struct { Uri *string `json:"uri,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_ReasonRepost) RecordTypeID() string { return "app.bsky.feed.defs#reasonRepost" } + func (t *FeedDefs_ReasonRepost) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#reasonRepost" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_ReasonRepost) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedDefs_ReplyRef is a "replyRef" in the app.bsky.feed.defs schema. @@ -437,17 +469,20 @@ type FeedDefs_ReplyRef struct { Root FeedDefs_ReplyRef_Root `json:"root"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_ReplyRef) RecordTypeID() string { return "app.bsky.feed.defs#replyRef" } + func (t *FeedDefs_ReplyRef) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#replyRef" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_ReplyRef) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type FeedDefs_ReplyRef_Parent struct { @@ -473,7 +508,7 @@ func (t *FeedDefs_ReplyRef_Parent) MarshalJSON() ([]byte, error) { } func (t *FeedDefs_ReplyRef_Parent) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -512,7 +547,7 @@ func (t *FeedDefs_ReplyRef_Parent) MarshalCBOR(w io.Writer) error { } func (t *FeedDefs_ReplyRef_Parent) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -555,7 +590,7 @@ func (t *FeedDefs_ReplyRef_Root) MarshalJSON() ([]byte, error) { } func (t *FeedDefs_ReplyRef_Root) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -594,7 +629,7 @@ func (t *FeedDefs_ReplyRef_Root) MarshalCBOR(w io.Writer) error { } func (t *FeedDefs_ReplyRef_Root) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -623,17 +658,22 @@ type FeedDefs_SkeletonFeedPost struct { Reason *FeedDefs_SkeletonFeedPost_Reason `json:"reason,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_SkeletonFeedPost) RecordTypeID() string { + return "app.bsky.feed.defs#skeletonFeedPost" +} + func (t *FeedDefs_SkeletonFeedPost) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#skeletonFeedPost" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_SkeletonFeedPost) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type FeedDefs_SkeletonFeedPost_Reason struct { @@ -654,7 +694,7 @@ func (t *FeedDefs_SkeletonFeedPost_Reason) MarshalJSON() ([]byte, error) { } func (t *FeedDefs_SkeletonFeedPost_Reason) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -687,7 +727,7 @@ func (t *FeedDefs_SkeletonFeedPost_Reason) MarshalCBOR(w io.Writer) error { } func (t *FeedDefs_SkeletonFeedPost_Reason) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -709,17 +749,22 @@ type FeedDefs_SkeletonReasonPin struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_SkeletonReasonPin) RecordTypeID() string { + return "app.bsky.feed.defs#skeletonReasonPin" +} + func (t *FeedDefs_SkeletonReasonPin) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#skeletonReasonPin" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_SkeletonReasonPin) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedDefs_SkeletonReasonRepost is a "skeletonReasonRepost" in the app.bsky.feed.defs schema. @@ -728,17 +773,22 @@ type FeedDefs_SkeletonReasonRepost struct { Repost string `json:"repost"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_SkeletonReasonRepost) RecordTypeID() string { + return "app.bsky.feed.defs#skeletonReasonRepost" +} + func (t *FeedDefs_SkeletonReasonRepost) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#skeletonReasonRepost" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_SkeletonReasonRepost) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedDefs_ThreadContext is a "threadContext" in the app.bsky.feed.defs schema. @@ -749,17 +799,20 @@ type FeedDefs_ThreadContext struct { RootAuthorLike *string `json:"rootAuthorLike,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_ThreadContext) RecordTypeID() string { return "app.bsky.feed.defs#threadContext" } + func (t *FeedDefs_ThreadContext) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#threadContext" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_ThreadContext) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedDefs_ThreadViewPost is a "threadViewPost" in the app.bsky.feed.defs schema. @@ -771,17 +824,20 @@ type FeedDefs_ThreadViewPost struct { ThreadContext *FeedDefs_ThreadContext `json:"threadContext,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_ThreadViewPost) RecordTypeID() string { return "app.bsky.feed.defs#threadViewPost" } + func (t *FeedDefs_ThreadViewPost) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#threadViewPost" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_ThreadViewPost) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type FeedDefs_ThreadViewPost_Parent struct { @@ -807,7 +863,7 @@ func (t *FeedDefs_ThreadViewPost_Parent) MarshalJSON() ([]byte, error) { } func (t *FeedDefs_ThreadViewPost_Parent) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -846,7 +902,7 @@ func (t *FeedDefs_ThreadViewPost_Parent) MarshalCBOR(w io.Writer) error { } func (t *FeedDefs_ThreadViewPost_Parent) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -889,7 +945,7 @@ func (t *FeedDefs_ThreadViewPost_Replies_Elem) MarshalJSON() ([]byte, error) { } func (t *FeedDefs_ThreadViewPost_Replies_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -928,7 +984,7 @@ func (t *FeedDefs_ThreadViewPost_Replies_Elem) MarshalCBOR(w io.Writer) error { } func (t *FeedDefs_ThreadViewPost_Replies_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -950,24 +1006,27 @@ func (t *FeedDefs_ThreadViewPost_Replies_Elem) UnmarshalCBOR(r io.Reader) error // FeedDefs_ThreadgateView is a "threadgateView" in the app.bsky.feed.defs schema. type FeedDefs_ThreadgateView struct { - LexiconTypeID string `json:"$type"` - Cid *string `json:"cid,omitempty"` - Lists []GraphDefs_ListViewBasic `json:"lists,omitempty"` - Record *glexrt.LexiconTypeDecoder `json:"record,omitempty"` - Uri *string `json:"uri,omitempty"` + LexiconTypeID string `json:"$type"` + Cid *string `json:"cid,omitempty"` + Lists []GraphDefs_ListViewBasic `json:"lists,omitempty"` + Record *glex.LexiconTypeDecoder `json:"record,omitempty"` + Uri *string `json:"uri,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_ThreadgateView) RecordTypeID() string { return "app.bsky.feed.defs#threadgateView" } + func (t *FeedDefs_ThreadgateView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#threadgateView" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_ThreadgateView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedDefs_ViewerState is a "viewerState" in the app.bsky.feed.defs schema. @@ -984,15 +1043,18 @@ type FeedDefs_ViewerState struct { ThreadMuted *bool `json:"threadMuted,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *FeedDefs_ViewerState) RecordTypeID() string { return "app.bsky.feed.defs#viewerState" } + func (t *FeedDefs_ViewerState) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.defs#viewerState" + return glex.MarshalCBOR(w, t) } func (t *FeedDefs_ViewerState) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/feeddescribefeedgenerator.go b/pkg/appbsky/feeddescribefeedgenerator.go deleted file mode 100644 index 6e215a53..00000000 --- a/pkg/appbsky/feeddescribefeedgenerator.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.describeFeedGenerator - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedDescribeFeedGenerator_Output struct { - LexiconTypeID string `json:"$type"` - Did string `json:"did"` - Feeds []FeedDescribeFeedGenerator_Feed `json:"feeds"` - Links *FeedDescribeFeedGenerator_Links `json:"links,omitempty"` -} - -func (t *FeedDescribeFeedGenerator_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.describeFeedGenerator#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedDescribeFeedGenerator_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedDescribeFeedGenerator calls the XRPC method "app.bsky.feed.describeFeedGenerator". -// -// Get information about a feed generator, including policies and offered feed URIs. Does not require auth; implemented by Feed Generator services (not App View). -func FeedDescribeFeedGenerator(ctx context.Context, c glexrt.LexClient) (*FeedDescribeFeedGenerator_Output, error) { - var out FeedDescribeFeedGenerator_Output - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.describeFeedGenerator", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// FeedDescribeFeedGenerator_Feed is a "feed" in the app.bsky.feed.describeFeedGenerator schema. -type FeedDescribeFeedGenerator_Feed struct { - LexiconTypeID string `json:"$type"` - Uri string `json:"uri"` -} - -func (t *FeedDescribeFeedGenerator_Feed) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.describeFeedGenerator" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedDescribeFeedGenerator_Feed) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedDescribeFeedGenerator_Links is a "links" in the app.bsky.feed.describeFeedGenerator schema. -type FeedDescribeFeedGenerator_Links struct { - LexiconTypeID string `json:"$type"` - PrivacyPolicy *string `json:"privacyPolicy,omitempty"` - TermsOfService *string `json:"termsOfService,omitempty"` -} - -func (t *FeedDescribeFeedGenerator_Links) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.describeFeedGenerator" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedDescribeFeedGenerator_Links) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/feedgenerator.go b/pkg/appbsky/feedgenerator.go deleted file mode 100644 index b83721b1..00000000 --- a/pkg/appbsky/feedgenerator.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.generator - -package appbsky - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" - comatproto "stream.place/streamplace/pkg/comatproto" -) - -func init() { - glexrt.RegisterType("app.bsky.feed.generator", &FeedGenerator{}) -} - -// Record declaring of the existence of a feed generator, and containing metadata about it. The record can exist in any repository. -type FeedGenerator struct { - LexiconTypeID string `json:"$type"` - // acceptsInteractions: Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions - AcceptsInteractions *bool `json:"acceptsInteractions,omitempty"` - Avatar *glexrt.Blob `json:"avatar,omitempty"` - ContentMode *string `json:"contentMode,omitempty"` - CreatedAt string `json:"createdAt"` - Description *string `json:"description,omitempty"` - DescriptionFacets []RichtextFacet `json:"descriptionFacets,omitempty"` - Did string `json:"did"` - DisplayName string `json:"displayName"` - // labels: Self-label values - Labels *FeedGenerator_Labels `json:"labels,omitempty"` -} - -func (t *FeedGenerator) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.generator" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGenerator) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// Self-label values -type FeedGenerator_Labels struct { - LabelDefs_SelfLabels *comatproto.LabelDefs_SelfLabels -} - -func (t *FeedGenerator_Labels) MarshalJSON() ([]byte, error) { - if t.LabelDefs_SelfLabels != nil { - t.LabelDefs_SelfLabels.LexiconTypeID = "com.atproto.label.defs#selfLabels" - return json.Marshal(t.LabelDefs_SelfLabels) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *FeedGenerator_Labels) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "com.atproto.label.defs#selfLabels": - t.LabelDefs_SelfLabels = new(comatproto.LabelDefs_SelfLabels) - return json.Unmarshal(b, t.LabelDefs_SelfLabels) - default: - return nil - } -} - -func (t *FeedGenerator_Labels) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.LabelDefs_SelfLabels != nil { - return t.LabelDefs_SelfLabels.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *FeedGenerator_Labels) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "com.atproto.label.defs#selfLabels": - t.LabelDefs_SelfLabels = new(comatproto.LabelDefs_SelfLabels) - return t.LabelDefs_SelfLabels.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} diff --git a/pkg/appbsky/feedgetactorfeeds.go b/pkg/appbsky/feedgetactorfeeds.go deleted file mode 100644 index e2a89853..00000000 --- a/pkg/appbsky/feedgetactorfeeds.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.getActorFeeds - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedGetActorFeeds_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Feeds []FeedDefs_GeneratorView `json:"feeds"` -} - -func (t *FeedGetActorFeeds_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getActorFeeds#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetActorFeeds_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedGetActorFeeds calls the XRPC method "app.bsky.feed.getActorFeeds". -// -// Get a list of feeds (feed generator records) created by the actor (in the actor's repo). -func FeedGetActorFeeds(ctx context.Context, c glexrt.LexClient, actor string, cursor string, limit *int64) (*FeedGetActorFeeds_Output, error) { - var out FeedGetActorFeeds_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["actor"] = actor - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getActorFeeds", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedgetactorlikes.go b/pkg/appbsky/feedgetactorlikes.go deleted file mode 100644 index 04f08eb5..00000000 --- a/pkg/appbsky/feedgetactorlikes.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.getActorLikes - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedGetActorLikes_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Feed []FeedDefs_FeedViewPost `json:"feed"` -} - -func (t *FeedGetActorLikes_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getActorLikes#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetActorLikes_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedGetActorLikes calls the XRPC method "app.bsky.feed.getActorLikes". -// -// Get a list of posts liked by an actor. Requires auth, actor must be the requesting account. -func FeedGetActorLikes(ctx context.Context, c glexrt.LexClient, actor string, cursor string, limit *int64) (*FeedGetActorLikes_Output, error) { - var out FeedGetActorLikes_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["actor"] = actor - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getActorLikes", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedgetauthorfeed.go b/pkg/appbsky/feedgetauthorfeed.go deleted file mode 100644 index 7236446e..00000000 --- a/pkg/appbsky/feedgetauthorfeed.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.getAuthorFeed - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedGetAuthorFeed_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Feed []FeedDefs_FeedViewPost `json:"feed"` -} - -func (t *FeedGetAuthorFeed_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getAuthorFeed#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetAuthorFeed_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedGetAuthorFeed calls the XRPC method "app.bsky.feed.getAuthorFeed". -// -// Get a view of an actor's 'author feed' (post and reposts by the author). Does not require auth. -// -// filter: Combinations of post/repost types to include in response. -func FeedGetAuthorFeed(ctx context.Context, c glexrt.LexClient, actor string, cursor string, filter string, includePins *bool, limit *int64) (*FeedGetAuthorFeed_Output, error) { - var out FeedGetAuthorFeed_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if filter != "" { - params["filter"] = filter - } - if includePins != nil { - params["includePins"] = *includePins - } - if limit != nil { - params["limit"] = *limit - } - params["actor"] = actor - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getAuthorFeed", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedgetfeed.go b/pkg/appbsky/feedgetfeed.go deleted file mode 100644 index 8f0443fd..00000000 --- a/pkg/appbsky/feedgetfeed.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.getFeed - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedGetFeed_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Feed []FeedDefs_FeedViewPost `json:"feed"` -} - -func (t *FeedGetFeed_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getFeed#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetFeed_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedGetFeed calls the XRPC method "app.bsky.feed.getFeed". -// -// Get a hydrated feed from an actor's selected feed generator. Implemented by App View. -func FeedGetFeed(ctx context.Context, c glexrt.LexClient, cursor string, feed string, limit *int64) (*FeedGetFeed_Output, error) { - var out FeedGetFeed_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["feed"] = feed - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getFeed", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedgetfeedgenerator.go b/pkg/appbsky/feedgetfeedgenerator.go deleted file mode 100644 index e97edd0c..00000000 --- a/pkg/appbsky/feedgetfeedgenerator.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.getFeedGenerator - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedGetFeedGenerator_Output struct { - LexiconTypeID string `json:"$type"` - // isOnline: Indicates whether the feed generator service has been online recently, or else seems to be inactive. - IsOnline bool `json:"isOnline"` - // isValid: Indicates whether the feed generator service is compatible with the record declaration. - IsValid bool `json:"isValid"` - View FeedDefs_GeneratorView `json:"view"` -} - -func (t *FeedGetFeedGenerator_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getFeedGenerator#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetFeedGenerator_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedGetFeedGenerator calls the XRPC method "app.bsky.feed.getFeedGenerator". -// -// Get information about a feed generator. Implemented by AppView. -// -// feed: AT-URI of the feed generator record. -func FeedGetFeedGenerator(ctx context.Context, c glexrt.LexClient, feed string) (*FeedGetFeedGenerator_Output, error) { - var out FeedGetFeedGenerator_Output - - params := map[string]interface{}{} - params["feed"] = feed - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getFeedGenerator", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedgetfeedgenerators.go b/pkg/appbsky/feedgetfeedgenerators.go deleted file mode 100644 index f751dac6..00000000 --- a/pkg/appbsky/feedgetfeedgenerators.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.getFeedGenerators - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedGetFeedGenerators_Output struct { - LexiconTypeID string `json:"$type"` - Feeds []FeedDefs_GeneratorView `json:"feeds"` -} - -func (t *FeedGetFeedGenerators_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getFeedGenerators#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetFeedGenerators_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedGetFeedGenerators calls the XRPC method "app.bsky.feed.getFeedGenerators". -// -// Get information about a list of feed generators. -func FeedGetFeedGenerators(ctx context.Context, c glexrt.LexClient, feeds []string) (*FeedGetFeedGenerators_Output, error) { - var out FeedGetFeedGenerators_Output - - params := map[string]interface{}{} - params["feeds"] = feeds - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getFeedGenerators", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedgetfeedskeleton.go b/pkg/appbsky/feedgetfeedskeleton.go index 2a6a1aee..e7e40847 100644 --- a/pkg/appbsky/feedgetfeedskeleton.go +++ b/pkg/appbsky/feedgetfeedskeleton.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -16,19 +16,24 @@ type FeedGetFeedSkeleton_Output struct { LexiconTypeID string `json:"$type"` Cursor *string `json:"cursor,omitempty"` Feed []FeedDefs_SkeletonFeedPost `json:"feed"` + // reqId: Unique identifier per request that may be passed back alongside interactions. + ReqId *string `json:"reqId,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *FeedGetFeedSkeleton_Output) RecordTypeID() string { return "app.bsky.feed.getFeedSkeleton" } + func (t *FeedGetFeedSkeleton_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.getFeedSkeleton#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.getFeedSkeleton" + return glex.MarshalCBOR(w, t) } func (t *FeedGetFeedSkeleton_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedGetFeedSkeleton calls the XRPC method "app.bsky.feed.getFeedSkeleton". @@ -36,7 +41,7 @@ func (t *FeedGetFeedSkeleton_Output) UnmarshalCBOR(r io.Reader) error { // Get a skeleton of a feed provided by a feed generator. Auth is optional, depending on provider requirements, and provides the DID of the requester. Implemented by Feed Generator Service. // // feed: Reference to feed generator record describing the specific feed being requested. -func FeedGetFeedSkeleton(ctx context.Context, c glexrt.LexClient, cursor string, feed string, limit *int64) (*FeedGetFeedSkeleton_Output, error) { +func FeedGetFeedSkeleton(ctx context.Context, c glex.LexClient, cursor string, feed string, limit *int64) (*FeedGetFeedSkeleton_Output, error) { var out FeedGetFeedSkeleton_Output params := map[string]interface{}{} @@ -48,7 +53,7 @@ func FeedGetFeedSkeleton(ctx context.Context, c glexrt.LexClient, cursor string, } params["feed"] = feed - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getFeedSkeleton", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "app.bsky.feed.getFeedSkeleton", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/appbsky/feedgetlikes.go b/pkg/appbsky/feedgetlikes.go deleted file mode 100644 index e7f0a711..00000000 --- a/pkg/appbsky/feedgetlikes.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.getLikes - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedGetLikes_Output struct { - LexiconTypeID string `json:"$type"` - Cid *string `json:"cid,omitempty"` - Cursor *string `json:"cursor,omitempty"` - Likes []FeedGetLikes_Like `json:"likes"` - Uri string `json:"uri"` -} - -func (t *FeedGetLikes_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getLikes#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetLikes_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedGetLikes calls the XRPC method "app.bsky.feed.getLikes". -// -// Get like records which reference a subject (by AT-URI and CID). -// -// cid: CID of the subject record (aka, specific version of record), to filter likes. -// uri: AT-URI of the subject (eg, a post record). -func FeedGetLikes(ctx context.Context, c glexrt.LexClient, cid string, cursor string, limit *int64, uri string) (*FeedGetLikes_Output, error) { - var out FeedGetLikes_Output - - params := map[string]interface{}{} - if cid != "" { - params["cid"] = cid - } - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["uri"] = uri - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getLikes", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// FeedGetLikes_Like is a "like" in the app.bsky.feed.getLikes schema. -type FeedGetLikes_Like struct { - LexiconTypeID string `json:"$type"` - Actor ActorDefs_ProfileView `json:"actor"` - CreatedAt string `json:"createdAt"` - IndexedAt string `json:"indexedAt"` -} - -func (t *FeedGetLikes_Like) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getLikes" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetLikes_Like) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/feedgetlistfeed.go b/pkg/appbsky/feedgetlistfeed.go deleted file mode 100644 index b079d56c..00000000 --- a/pkg/appbsky/feedgetlistfeed.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.getListFeed - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedGetListFeed_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Feed []FeedDefs_FeedViewPost `json:"feed"` -} - -func (t *FeedGetListFeed_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getListFeed#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetListFeed_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedGetListFeed calls the XRPC method "app.bsky.feed.getListFeed". -// -// Get a feed of recent posts from a list (posts and reposts from any actors on the list). Does not require auth. -// -// list: Reference (AT-URI) to the list record. -func FeedGetListFeed(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, list string) (*FeedGetListFeed_Output, error) { - var out FeedGetListFeed_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["list"] = list - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getListFeed", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedgetposts.go b/pkg/appbsky/feedgetposts.go deleted file mode 100644 index a7a616b2..00000000 --- a/pkg/appbsky/feedgetposts.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.getPosts - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedGetPosts_Output struct { - LexiconTypeID string `json:"$type"` - Posts []FeedDefs_PostView `json:"posts"` -} - -func (t *FeedGetPosts_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getPosts#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetPosts_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedGetPosts calls the XRPC method "app.bsky.feed.getPosts". -// -// Gets post views for a specified list of posts (by AT-URI). This is sometimes referred to as 'hydrating' a 'feed skeleton'. -// -// uris[]: List of post AT-URIs to return hydrated views for. -func FeedGetPosts(ctx context.Context, c glexrt.LexClient, uris []string) (*FeedGetPosts_Output, error) { - var out FeedGetPosts_Output - - params := map[string]interface{}{} - params["uris"] = uris - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getPosts", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedgetpostthread.go b/pkg/appbsky/feedgetpostthread.go deleted file mode 100644 index 3752ab06..00000000 --- a/pkg/appbsky/feedgetpostthread.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.getPostThread - -package appbsky - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedGetPostThread_Output struct { - LexiconTypeID string `json:"$type"` - Thread FeedGetPostThread_Output_Thread `json:"thread"` - Threadgate *FeedDefs_ThreadgateView `json:"threadgate,omitempty"` -} - -func (t *FeedGetPostThread_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getPostThread#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetPostThread_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type FeedGetPostThread_Output_Thread struct { - FeedDefs_BlockedPost *FeedDefs_BlockedPost - FeedDefs_NotFoundPost *FeedDefs_NotFoundPost - FeedDefs_ThreadViewPost *FeedDefs_ThreadViewPost -} - -func (t *FeedGetPostThread_Output_Thread) MarshalJSON() ([]byte, error) { - if t.FeedDefs_BlockedPost != nil { - t.FeedDefs_BlockedPost.LexiconTypeID = "app.bsky.feed.defs#blockedPost" - return json.Marshal(t.FeedDefs_BlockedPost) - } - if t.FeedDefs_NotFoundPost != nil { - t.FeedDefs_NotFoundPost.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" - return json.Marshal(t.FeedDefs_NotFoundPost) - } - if t.FeedDefs_ThreadViewPost != nil { - t.FeedDefs_ThreadViewPost.LexiconTypeID = "app.bsky.feed.defs#threadViewPost" - return json.Marshal(t.FeedDefs_ThreadViewPost) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *FeedGetPostThread_Output_Thread) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "app.bsky.feed.defs#blockedPost": - t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) - return json.Unmarshal(b, t.FeedDefs_BlockedPost) - case "app.bsky.feed.defs#notFoundPost": - t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) - return json.Unmarshal(b, t.FeedDefs_NotFoundPost) - case "app.bsky.feed.defs#threadViewPost": - t.FeedDefs_ThreadViewPost = new(FeedDefs_ThreadViewPost) - return json.Unmarshal(b, t.FeedDefs_ThreadViewPost) - default: - return nil - } -} - -func (t *FeedGetPostThread_Output_Thread) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.FeedDefs_BlockedPost != nil { - return t.FeedDefs_BlockedPost.MarshalCBOR(w) - } - if t.FeedDefs_NotFoundPost != nil { - return t.FeedDefs_NotFoundPost.MarshalCBOR(w) - } - if t.FeedDefs_ThreadViewPost != nil { - return t.FeedDefs_ThreadViewPost.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *FeedGetPostThread_Output_Thread) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "app.bsky.feed.defs#blockedPost": - t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) - return t.FeedDefs_BlockedPost.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.feed.defs#notFoundPost": - t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) - return t.FeedDefs_NotFoundPost.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.feed.defs#threadViewPost": - t.FeedDefs_ThreadViewPost = new(FeedDefs_ThreadViewPost) - return t.FeedDefs_ThreadViewPost.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} - -// FeedGetPostThread calls the XRPC method "app.bsky.feed.getPostThread". -// -// Get posts in a thread. Does not require auth, but additional metadata and filtering will be applied for authed requests. -// -// depth: How many levels of reply depth should be included in response. -// parentHeight: How many levels of parent (and grandparent, etc) post to include. -// uri: Reference (AT-URI) to post record. -func FeedGetPostThread(ctx context.Context, c glexrt.LexClient, depth *int64, parentHeight *int64, uri string) (*FeedGetPostThread_Output, error) { - var out FeedGetPostThread_Output - - params := map[string]interface{}{} - if depth != nil { - params["depth"] = *depth - } - if parentHeight != nil { - params["parentHeight"] = *parentHeight - } - params["uri"] = uri - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getPostThread", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedgetquotes.go b/pkg/appbsky/feedgetquotes.go deleted file mode 100644 index 7d839fbd..00000000 --- a/pkg/appbsky/feedgetquotes.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.getQuotes - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedGetQuotes_Output struct { - LexiconTypeID string `json:"$type"` - Cid *string `json:"cid,omitempty"` - Cursor *string `json:"cursor,omitempty"` - Posts []FeedDefs_PostView `json:"posts"` - Uri string `json:"uri"` -} - -func (t *FeedGetQuotes_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getQuotes#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetQuotes_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedGetQuotes calls the XRPC method "app.bsky.feed.getQuotes". -// -// Get a list of quotes for a given post. -// -// cid: If supplied, filters to quotes of specific version (by CID) of the post record. -// uri: Reference (AT-URI) of post record -func FeedGetQuotes(ctx context.Context, c glexrt.LexClient, cid string, cursor string, limit *int64, uri string) (*FeedGetQuotes_Output, error) { - var out FeedGetQuotes_Output - - params := map[string]interface{}{} - if cid != "" { - params["cid"] = cid - } - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["uri"] = uri - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getQuotes", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedgetrepostedby.go b/pkg/appbsky/feedgetrepostedby.go deleted file mode 100644 index 4fba231d..00000000 --- a/pkg/appbsky/feedgetrepostedby.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.getRepostedBy - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedGetRepostedBy_Output struct { - LexiconTypeID string `json:"$type"` - Cid *string `json:"cid,omitempty"` - Cursor *string `json:"cursor,omitempty"` - RepostedBy []ActorDefs_ProfileView `json:"repostedBy"` - Uri string `json:"uri"` -} - -func (t *FeedGetRepostedBy_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getRepostedBy#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetRepostedBy_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedGetRepostedBy calls the XRPC method "app.bsky.feed.getRepostedBy". -// -// Get a list of reposts for a given post. -// -// cid: If supplied, filters to reposts of specific version (by CID) of the post record. -// uri: Reference (AT-URI) of post record -func FeedGetRepostedBy(ctx context.Context, c glexrt.LexClient, cid string, cursor string, limit *int64, uri string) (*FeedGetRepostedBy_Output, error) { - var out FeedGetRepostedBy_Output - - params := map[string]interface{}{} - if cid != "" { - params["cid"] = cid - } - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["uri"] = uri - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getRepostedBy", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedgetsuggestedfeeds.go b/pkg/appbsky/feedgetsuggestedfeeds.go deleted file mode 100644 index 53ca99e3..00000000 --- a/pkg/appbsky/feedgetsuggestedfeeds.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.getSuggestedFeeds - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedGetSuggestedFeeds_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Feeds []FeedDefs_GeneratorView `json:"feeds"` -} - -func (t *FeedGetSuggestedFeeds_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getSuggestedFeeds#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetSuggestedFeeds_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedGetSuggestedFeeds calls the XRPC method "app.bsky.feed.getSuggestedFeeds". -// -// Get a list of suggested feeds (feed generators) for the requesting account. -func FeedGetSuggestedFeeds(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64) (*FeedGetSuggestedFeeds_Output, error) { - var out FeedGetSuggestedFeeds_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getSuggestedFeeds", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedgettimeline.go b/pkg/appbsky/feedgettimeline.go deleted file mode 100644 index 7fe17ab3..00000000 --- a/pkg/appbsky/feedgettimeline.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.getTimeline - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedGetTimeline_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Feed []FeedDefs_FeedViewPost `json:"feed"` -} - -func (t *FeedGetTimeline_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.getTimeline#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedGetTimeline_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedGetTimeline calls the XRPC method "app.bsky.feed.getTimeline". -// -// Get a view of the requesting account's home timeline. This is expected to be some form of reverse-chronological feed. -// -// algorithm: Variant 'algorithm' for timeline. Implementation-specific. NOTE: most feed flexibility has been moved to feed generator mechanism. -func FeedGetTimeline(ctx context.Context, c glexrt.LexClient, algorithm string, cursor string, limit *int64) (*FeedGetTimeline_Output, error) { - var out FeedGetTimeline_Output - - params := map[string]interface{}{} - if algorithm != "" { - params["algorithm"] = algorithm - } - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.getTimeline", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedlike.go b/pkg/appbsky/feedlike.go deleted file mode 100644 index d23590bd..00000000 --- a/pkg/appbsky/feedlike.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.like - -package appbsky - -import ( - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" - comatproto "stream.place/streamplace/pkg/comatproto" -) - -func init() { - glexrt.RegisterType("app.bsky.feed.like", &FeedLike{}) -} - -// Record declaring a 'like' of a piece of subject content. -type FeedLike struct { - LexiconTypeID string `json:"$type"` - CreatedAt string `json:"createdAt"` - Subject comatproto.RepoStrongRef `json:"subject"` - Via *comatproto.RepoStrongRef `json:"via,omitempty"` -} - -func (t *FeedLike) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.like" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedLike) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/feedpost.go b/pkg/appbsky/feedpost.go index a732057f..17488a8f 100644 --- a/pkg/appbsky/feedpost.go +++ b/pkg/appbsky/feedpost.go @@ -10,13 +10,13 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) func init() { - glexrt.RegisterType("app.bsky.feed.post", &FeedPost{}) + glex.RegisterType("app.bsky.feed.post", &FeedPost{}) } // Record containing a Bluesky post. @@ -40,17 +40,20 @@ type FeedPost struct { Text string `json:"text"` } +// RecordTypeID implements glex.Record. +func (t *FeedPost) RecordTypeID() string { return "app.bsky.feed.post" } + func (t *FeedPost) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "app.bsky.feed.post" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *FeedPost) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type FeedPost_Embed struct { @@ -86,7 +89,7 @@ func (t *FeedPost_Embed) MarshalJSON() ([]byte, error) { } func (t *FeedPost_Embed) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -137,7 +140,7 @@ func (t *FeedPost_Embed) MarshalCBOR(w io.Writer) error { } func (t *FeedPost_Embed) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -177,7 +180,7 @@ func (t *FeedPost_Labels) MarshalJSON() ([]byte, error) { } func (t *FeedPost_Labels) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -204,7 +207,7 @@ func (t *FeedPost_Labels) MarshalCBOR(w io.Writer) error { } func (t *FeedPost_Labels) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -229,17 +232,20 @@ type FeedPost_Entity struct { Value string `json:"value"` } +// RecordTypeID implements glex.Record. +func (t *FeedPost_Entity) RecordTypeID() string { return "app.bsky.feed.post#entity" } + func (t *FeedPost_Entity) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.post" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.post#entity" + return glex.MarshalCBOR(w, t) } func (t *FeedPost_Entity) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedPost_ReplyRef is a "replyRef" in the app.bsky.feed.post schema. @@ -249,17 +255,20 @@ type FeedPost_ReplyRef struct { Root comatproto.RepoStrongRef `json:"root"` } +// RecordTypeID implements glex.Record. +func (t *FeedPost_ReplyRef) RecordTypeID() string { return "app.bsky.feed.post#replyRef" } + func (t *FeedPost_ReplyRef) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.post" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.post#replyRef" + return glex.MarshalCBOR(w, t) } func (t *FeedPost_ReplyRef) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedPost_TextSlice is a "textSlice" in the app.bsky.feed.post schema. @@ -271,15 +280,18 @@ type FeedPost_TextSlice struct { Start int64 `json:"start"` } +// RecordTypeID implements glex.Record. +func (t *FeedPost_TextSlice) RecordTypeID() string { return "app.bsky.feed.post#textSlice" } + func (t *FeedPost_TextSlice) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.post" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.post#textSlice" + return glex.MarshalCBOR(w, t) } func (t *FeedPost_TextSlice) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/feedpostgate.go b/pkg/appbsky/feedpostgate.go index f5c13ed7..a056141a 100644 --- a/pkg/appbsky/feedpostgate.go +++ b/pkg/appbsky/feedpostgate.go @@ -10,12 +10,12 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("app.bsky.feed.postgate", &FeedPostgate{}) + glex.RegisterType("app.bsky.feed.postgate", &FeedPostgate{}) } // Record defining interaction rules for a post. The record key (rkey) of the postgate record must match the record key of the post, and that record must be in the same repository. @@ -30,17 +30,20 @@ type FeedPostgate struct { Post string `json:"post"` } +// RecordTypeID implements glex.Record. +func (t *FeedPostgate) RecordTypeID() string { return "app.bsky.feed.postgate" } + func (t *FeedPostgate) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "app.bsky.feed.postgate" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *FeedPostgate) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type FeedPostgate_EmbeddingRules_Elem struct { @@ -56,7 +59,7 @@ func (t *FeedPostgate_EmbeddingRules_Elem) MarshalJSON() ([]byte, error) { } func (t *FeedPostgate_EmbeddingRules_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -83,7 +86,7 @@ func (t *FeedPostgate_EmbeddingRules_Elem) MarshalCBOR(w io.Writer) error { } func (t *FeedPostgate_EmbeddingRules_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -104,15 +107,18 @@ type FeedPostgate_DisableRule struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *FeedPostgate_DisableRule) RecordTypeID() string { return "app.bsky.feed.postgate#disableRule" } + func (t *FeedPostgate_DisableRule) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.postgate" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.postgate#disableRule" + return glex.MarshalCBOR(w, t) } func (t *FeedPostgate_DisableRule) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/feedrepost.go b/pkg/appbsky/feedrepost.go deleted file mode 100644 index 8fa346d0..00000000 --- a/pkg/appbsky/feedrepost.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.repost - -package appbsky - -import ( - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" - comatproto "stream.place/streamplace/pkg/comatproto" -) - -func init() { - glexrt.RegisterType("app.bsky.feed.repost", &FeedRepost{}) -} - -// Record representing a 'repost' of an existing Bluesky post. -type FeedRepost struct { - LexiconTypeID string `json:"$type"` - CreatedAt string `json:"createdAt"` - Subject comatproto.RepoStrongRef `json:"subject"` - Via *comatproto.RepoStrongRef `json:"via,omitempty"` -} - -func (t *FeedRepost) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.repost" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedRepost) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/feedsearchposts.go b/pkg/appbsky/feedsearchposts.go deleted file mode 100644 index 40696f6c..00000000 --- a/pkg/appbsky/feedsearchposts.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.searchPosts - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedSearchPosts_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - // hitsTotal: Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. - HitsTotal *int64 `json:"hitsTotal,omitempty"` - Posts []FeedDefs_PostView `json:"posts"` -} - -func (t *FeedSearchPosts_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.searchPosts#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedSearchPosts_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedSearchPosts calls the XRPC method "app.bsky.feed.searchPosts". -// -// Find posts matching search criteria, returning views of those posts. Note that this API endpoint may require authentication (eg, not public) for some service providers and implementations. -// -// author: Filter to posts by the given account. Handles are resolved to DID before query-time. -// cursor: Optional pagination mechanism; may not necessarily allow scrolling through entire result set. -// domain: Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization. -// lang: Filter to posts in the given language. Expected to be based on post language field, though server may override language detection. -// mentions: Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions. -// q: Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. -// since: Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD). -// sort: Specifies the ranking order of results. -// tag[]: Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching. -// until: Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD). -// url: Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching. -func FeedSearchPosts(ctx context.Context, c glexrt.LexClient, author string, cursor string, domain string, lang string, limit *int64, mentions string, q string, since string, sort string, tag []string, until string, url string) (*FeedSearchPosts_Output, error) { - var out FeedSearchPosts_Output - - params := map[string]interface{}{} - if author != "" { - params["author"] = author - } - if cursor != "" { - params["cursor"] = cursor - } - if domain != "" { - params["domain"] = domain - } - if lang != "" { - params["lang"] = lang - } - if limit != nil { - params["limit"] = *limit - } - if mentions != "" { - params["mentions"] = mentions - } - if since != "" { - params["since"] = since - } - if sort != "" { - params["sort"] = sort - } - if len(tag) != 0 { - params["tag"] = tag - } - if until != "" { - params["until"] = until - } - if url != "" { - params["url"] = url - } - params["q"] = q - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.feed.searchPosts", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedsendinteractions.go b/pkg/appbsky/feedsendinteractions.go deleted file mode 100644 index f09fc561..00000000 --- a/pkg/appbsky/feedsendinteractions.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.feed.sendInteractions - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type FeedSendInteractions_Input struct { - LexiconTypeID string `json:"$type"` - Interactions []FeedDefs_Interaction `json:"interactions"` -} - -func (t *FeedSendInteractions_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.sendInteractions#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedSendInteractions_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type FeedSendInteractions_Output struct { - LexiconTypeID string `json:"$type"` -} - -func (t *FeedSendInteractions_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.feed.sendInteractions#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *FeedSendInteractions_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// FeedSendInteractions calls the XRPC method "app.bsky.feed.sendInteractions". -// -// Send information about interactions with feed items back to the feed generator that served them. -func FeedSendInteractions(ctx context.Context, c glexrt.LexClient, input *FeedSendInteractions_Input) (*FeedSendInteractions_Output, error) { - var out FeedSendInteractions_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.feed.sendInteractions", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/feedthreadgate.go b/pkg/appbsky/feedthreadgate.go index a1fe014d..0919b8cd 100644 --- a/pkg/appbsky/feedthreadgate.go +++ b/pkg/appbsky/feedthreadgate.go @@ -10,12 +10,12 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("app.bsky.feed.threadgate", &FeedThreadgate{}) + glex.RegisterType("app.bsky.feed.threadgate", &FeedThreadgate{}) } // Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository. @@ -30,17 +30,20 @@ type FeedThreadgate struct { Post string `json:"post"` } +// RecordTypeID implements glex.Record. +func (t *FeedThreadgate) RecordTypeID() string { return "app.bsky.feed.threadgate" } + func (t *FeedThreadgate) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "app.bsky.feed.threadgate" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *FeedThreadgate) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type FeedThreadgate_Allow_Elem struct { @@ -71,7 +74,7 @@ func (t *FeedThreadgate_Allow_Elem) MarshalJSON() ([]byte, error) { } func (t *FeedThreadgate_Allow_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -116,7 +119,7 @@ func (t *FeedThreadgate_Allow_Elem) MarshalCBOR(w io.Writer) error { } func (t *FeedThreadgate_Allow_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -146,17 +149,22 @@ type FeedThreadgate_FollowerRule struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *FeedThreadgate_FollowerRule) RecordTypeID() string { + return "app.bsky.feed.threadgate#followerRule" +} + func (t *FeedThreadgate_FollowerRule) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.threadgate" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.threadgate#followerRule" + return glex.MarshalCBOR(w, t) } func (t *FeedThreadgate_FollowerRule) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedThreadgate_FollowingRule is a "followingRule" in the app.bsky.feed.threadgate schema. @@ -166,17 +174,22 @@ type FeedThreadgate_FollowingRule struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *FeedThreadgate_FollowingRule) RecordTypeID() string { + return "app.bsky.feed.threadgate#followingRule" +} + func (t *FeedThreadgate_FollowingRule) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.threadgate" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.threadgate#followingRule" + return glex.MarshalCBOR(w, t) } func (t *FeedThreadgate_FollowingRule) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedThreadgate_ListRule is a "listRule" in the app.bsky.feed.threadgate schema. @@ -187,17 +200,20 @@ type FeedThreadgate_ListRule struct { List string `json:"list"` } +// RecordTypeID implements glex.Record. +func (t *FeedThreadgate_ListRule) RecordTypeID() string { return "app.bsky.feed.threadgate#listRule" } + func (t *FeedThreadgate_ListRule) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.threadgate" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.threadgate#listRule" + return glex.MarshalCBOR(w, t) } func (t *FeedThreadgate_ListRule) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // FeedThreadgate_MentionRule is a "mentionRule" in the app.bsky.feed.threadgate schema. @@ -207,15 +223,20 @@ type FeedThreadgate_MentionRule struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *FeedThreadgate_MentionRule) RecordTypeID() string { + return "app.bsky.feed.threadgate#mentionRule" +} + func (t *FeedThreadgate_MentionRule) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.feed.threadgate" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.feed.threadgate#mentionRule" + return glex.MarshalCBOR(w, t) } func (t *FeedThreadgate_MentionRule) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/graphblock.go b/pkg/appbsky/graphblock.go index 6b1867a4..20c90f45 100644 --- a/pkg/appbsky/graphblock.go +++ b/pkg/appbsky/graphblock.go @@ -7,12 +7,12 @@ package appbsky import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("app.bsky.graph.block", &GraphBlock{}) + glex.RegisterType("app.bsky.graph.block", &GraphBlock{}) } // Record declaring a 'block' relationship against another account. NOTE: blocks are public in Bluesky; see blog posts for details. @@ -23,15 +23,18 @@ type GraphBlock struct { Subject string `json:"subject"` } +// RecordTypeID implements glex.Record. +func (t *GraphBlock) RecordTypeID() string { return "app.bsky.graph.block" } + func (t *GraphBlock) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "app.bsky.graph.block" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *GraphBlock) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/graphdefs.go b/pkg/appbsky/graphdefs.go index 8e659650..98838e0c 100644 --- a/pkg/appbsky/graphdefs.go +++ b/pkg/appbsky/graphdefs.go @@ -7,7 +7,7 @@ package appbsky import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) @@ -19,17 +19,20 @@ type GraphDefs_ListItemView struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *GraphDefs_ListItemView) RecordTypeID() string { return "app.bsky.graph.defs#listItemView" } + func (t *GraphDefs_ListItemView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.graph.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.graph.defs#listItemView" + return glex.MarshalCBOR(w, t) } func (t *GraphDefs_ListItemView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // GraphDefs_ListView is a "listView" in the app.bsky.graph.defs schema. @@ -49,17 +52,20 @@ type GraphDefs_ListView struct { Viewer *GraphDefs_ListViewerState `json:"viewer,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *GraphDefs_ListView) RecordTypeID() string { return "app.bsky.graph.defs#listView" } + func (t *GraphDefs_ListView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.graph.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.graph.defs#listView" + return glex.MarshalCBOR(w, t) } func (t *GraphDefs_ListView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // GraphDefs_ListViewBasic is a "listViewBasic" in the app.bsky.graph.defs schema. @@ -76,17 +82,20 @@ type GraphDefs_ListViewBasic struct { Viewer *GraphDefs_ListViewerState `json:"viewer,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *GraphDefs_ListViewBasic) RecordTypeID() string { return "app.bsky.graph.defs#listViewBasic" } + func (t *GraphDefs_ListViewBasic) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.graph.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.graph.defs#listViewBasic" + return glex.MarshalCBOR(w, t) } func (t *GraphDefs_ListViewBasic) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // GraphDefs_ListViewerState is a "listViewerState" in the app.bsky.graph.defs schema. @@ -96,17 +105,22 @@ type GraphDefs_ListViewerState struct { Muted *bool `json:"muted,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *GraphDefs_ListViewerState) RecordTypeID() string { + return "app.bsky.graph.defs#listViewerState" +} + func (t *GraphDefs_ListViewerState) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.graph.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.graph.defs#listViewerState" + return glex.MarshalCBOR(w, t) } func (t *GraphDefs_ListViewerState) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // GraphDefs_NotFoundActor is a "notFoundActor" in the app.bsky.graph.defs schema. @@ -118,17 +132,20 @@ type GraphDefs_NotFoundActor struct { NotFound bool `json:"notFound"` } +// RecordTypeID implements glex.Record. +func (t *GraphDefs_NotFoundActor) RecordTypeID() string { return "app.bsky.graph.defs#notFoundActor" } + func (t *GraphDefs_NotFoundActor) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.graph.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.graph.defs#notFoundActor" + return glex.MarshalCBOR(w, t) } func (t *GraphDefs_NotFoundActor) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // GraphDefs_Relationship is a "relationship" in the app.bsky.graph.defs schema. @@ -151,17 +168,20 @@ type GraphDefs_Relationship struct { Following *string `json:"following,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *GraphDefs_Relationship) RecordTypeID() string { return "app.bsky.graph.defs#relationship" } + func (t *GraphDefs_Relationship) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.graph.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.graph.defs#relationship" + return glex.MarshalCBOR(w, t) } func (t *GraphDefs_Relationship) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // GraphDefs_StarterPackView is a "starterPackView" in the app.bsky.graph.defs schema. @@ -176,21 +196,26 @@ type GraphDefs_StarterPackView struct { Labels []comatproto.LabelDefs_Label `json:"labels,omitempty"` List *GraphDefs_ListViewBasic `json:"list,omitempty"` ListItemsSample []GraphDefs_ListItemView `json:"listItemsSample,omitempty"` - Record *glexrt.LexiconTypeDecoder `json:"record"` + Record *glex.LexiconTypeDecoder `json:"record"` Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *GraphDefs_StarterPackView) RecordTypeID() string { + return "app.bsky.graph.defs#starterPackView" +} + func (t *GraphDefs_StarterPackView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.graph.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.graph.defs#starterPackView" + return glex.MarshalCBOR(w, t) } func (t *GraphDefs_StarterPackView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // GraphDefs_StarterPackViewBasic is a "starterPackViewBasic" in the app.bsky.graph.defs schema. @@ -203,19 +228,24 @@ type GraphDefs_StarterPackViewBasic struct { JoinedWeekCount *int64 `json:"joinedWeekCount,omitempty"` Labels []comatproto.LabelDefs_Label `json:"labels,omitempty"` ListItemCount *int64 `json:"listItemCount,omitempty"` - Record *glexrt.LexiconTypeDecoder `json:"record"` + Record *glex.LexiconTypeDecoder `json:"record"` Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *GraphDefs_StarterPackViewBasic) RecordTypeID() string { + return "app.bsky.graph.defs#starterPackViewBasic" +} + func (t *GraphDefs_StarterPackViewBasic) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.graph.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.graph.defs#starterPackViewBasic" + return glex.MarshalCBOR(w, t) } func (t *GraphDefs_StarterPackViewBasic) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/graphfollow.go b/pkg/appbsky/graphfollow.go index 4391415a..de60ecb1 100644 --- a/pkg/appbsky/graphfollow.go +++ b/pkg/appbsky/graphfollow.go @@ -7,13 +7,13 @@ package appbsky import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) func init() { - glexrt.RegisterType("app.bsky.graph.follow", &GraphFollow{}) + glex.RegisterType("app.bsky.graph.follow", &GraphFollow{}) } // Record declaring a social 'follow' relationship of another account. Duplicate follows will be ignored by the AppView. @@ -24,15 +24,18 @@ type GraphFollow struct { Via *comatproto.RepoStrongRef `json:"via,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *GraphFollow) RecordTypeID() string { return "app.bsky.graph.follow" } + func (t *GraphFollow) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "app.bsky.graph.follow" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *GraphFollow) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/graphgetactorstarterpacks.go b/pkg/appbsky/graphgetactorstarterpacks.go deleted file mode 100644 index 032ef4db..00000000 --- a/pkg/appbsky/graphgetactorstarterpacks.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getActorStarterPacks - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetActorStarterPacks_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - StarterPacks []GraphDefs_StarterPackViewBasic `json:"starterPacks"` -} - -func (t *GraphGetActorStarterPacks_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getActorStarterPacks#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetActorStarterPacks_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetActorStarterPacks calls the XRPC method "app.bsky.graph.getActorStarterPacks". -// -// Get a list of starter packs created by the actor. -func GraphGetActorStarterPacks(ctx context.Context, c glexrt.LexClient, actor string, cursor string, limit *int64) (*GraphGetActorStarterPacks_Output, error) { - var out GraphGetActorStarterPacks_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["actor"] = actor - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getActorStarterPacks", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphgetblocks.go b/pkg/appbsky/graphgetblocks.go deleted file mode 100644 index e1abf0fe..00000000 --- a/pkg/appbsky/graphgetblocks.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getBlocks - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetBlocks_Output struct { - LexiconTypeID string `json:"$type"` - Blocks []ActorDefs_ProfileView `json:"blocks"` - Cursor *string `json:"cursor,omitempty"` -} - -func (t *GraphGetBlocks_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getBlocks#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetBlocks_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetBlocks calls the XRPC method "app.bsky.graph.getBlocks". -// -// Enumerates which accounts the requesting account is currently blocking. Requires auth. -func GraphGetBlocks(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64) (*GraphGetBlocks_Output, error) { - var out GraphGetBlocks_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getBlocks", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphgetfollowers.go b/pkg/appbsky/graphgetfollowers.go deleted file mode 100644 index 335197e7..00000000 --- a/pkg/appbsky/graphgetfollowers.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getFollowers - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetFollowers_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Followers []ActorDefs_ProfileView `json:"followers"` - Subject ActorDefs_ProfileView `json:"subject"` -} - -func (t *GraphGetFollowers_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getFollowers#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetFollowers_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetFollowers calls the XRPC method "app.bsky.graph.getFollowers". -// -// Enumerates accounts which follow a specified account (actor). -func GraphGetFollowers(ctx context.Context, c glexrt.LexClient, actor string, cursor string, limit *int64) (*GraphGetFollowers_Output, error) { - var out GraphGetFollowers_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["actor"] = actor - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getFollowers", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphgetfollows.go b/pkg/appbsky/graphgetfollows.go deleted file mode 100644 index 91dd587d..00000000 --- a/pkg/appbsky/graphgetfollows.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getFollows - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetFollows_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Follows []ActorDefs_ProfileView `json:"follows"` - Subject ActorDefs_ProfileView `json:"subject"` -} - -func (t *GraphGetFollows_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getFollows#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetFollows_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetFollows calls the XRPC method "app.bsky.graph.getFollows". -// -// Enumerates accounts which a specified account (actor) follows. -func GraphGetFollows(ctx context.Context, c glexrt.LexClient, actor string, cursor string, limit *int64) (*GraphGetFollows_Output, error) { - var out GraphGetFollows_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["actor"] = actor - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getFollows", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphgetknownfollowers.go b/pkg/appbsky/graphgetknownfollowers.go deleted file mode 100644 index 364bf344..00000000 --- a/pkg/appbsky/graphgetknownfollowers.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getKnownFollowers - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetKnownFollowers_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Followers []ActorDefs_ProfileView `json:"followers"` - Subject ActorDefs_ProfileView `json:"subject"` -} - -func (t *GraphGetKnownFollowers_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getKnownFollowers#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetKnownFollowers_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetKnownFollowers calls the XRPC method "app.bsky.graph.getKnownFollowers". -// -// Enumerates accounts which follow a specified account (actor) and are followed by the viewer. -func GraphGetKnownFollowers(ctx context.Context, c glexrt.LexClient, actor string, cursor string, limit *int64) (*GraphGetKnownFollowers_Output, error) { - var out GraphGetKnownFollowers_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["actor"] = actor - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getKnownFollowers", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphgetlist.go b/pkg/appbsky/graphgetlist.go deleted file mode 100644 index d8033fd0..00000000 --- a/pkg/appbsky/graphgetlist.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getList - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetList_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Items []GraphDefs_ListItemView `json:"items"` - List GraphDefs_ListView `json:"list"` -} - -func (t *GraphGetList_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getList#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetList_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetList calls the XRPC method "app.bsky.graph.getList". -// -// Gets a 'view' (with additional context) of a specified list. -// -// list: Reference (AT-URI) of the list record to hydrate. -func GraphGetList(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, list string) (*GraphGetList_Output, error) { - var out GraphGetList_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["list"] = list - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getList", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphgetlistblocks.go b/pkg/appbsky/graphgetlistblocks.go deleted file mode 100644 index bc2f0f1c..00000000 --- a/pkg/appbsky/graphgetlistblocks.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getListBlocks - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetListBlocks_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Lists []GraphDefs_ListView `json:"lists"` -} - -func (t *GraphGetListBlocks_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getListBlocks#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetListBlocks_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetListBlocks calls the XRPC method "app.bsky.graph.getListBlocks". -// -// Get mod lists that the requesting account (actor) is blocking. Requires auth. -func GraphGetListBlocks(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64) (*GraphGetListBlocks_Output, error) { - var out GraphGetListBlocks_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getListBlocks", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphgetlistmutes.go b/pkg/appbsky/graphgetlistmutes.go deleted file mode 100644 index faa0c278..00000000 --- a/pkg/appbsky/graphgetlistmutes.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getListMutes - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetListMutes_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Lists []GraphDefs_ListView `json:"lists"` -} - -func (t *GraphGetListMutes_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getListMutes#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetListMutes_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetListMutes calls the XRPC method "app.bsky.graph.getListMutes". -// -// Enumerates mod lists that the requesting account (actor) currently has muted. Requires auth. -func GraphGetListMutes(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64) (*GraphGetListMutes_Output, error) { - var out GraphGetListMutes_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getListMutes", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphgetlists.go b/pkg/appbsky/graphgetlists.go deleted file mode 100644 index 9d8637f2..00000000 --- a/pkg/appbsky/graphgetlists.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getLists - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetLists_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Lists []GraphDefs_ListView `json:"lists"` -} - -func (t *GraphGetLists_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getLists#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetLists_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetLists calls the XRPC method "app.bsky.graph.getLists". -// -// Enumerates the lists created by a specified account (actor). -// -// actor: The account (actor) to enumerate lists from. -// purposes[]: Optional filter by list purpose. If not specified, all supported types are returned. -func GraphGetLists(ctx context.Context, c glexrt.LexClient, actor string, cursor string, limit *int64, purposes []string) (*GraphGetLists_Output, error) { - var out GraphGetLists_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - if len(purposes) != 0 { - params["purposes"] = purposes - } - params["actor"] = actor - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getLists", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphgetlistswithmembership.go b/pkg/appbsky/graphgetlistswithmembership.go deleted file mode 100644 index 8ed9f9b9..00000000 --- a/pkg/appbsky/graphgetlistswithmembership.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getListsWithMembership - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetListsWithMembership_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - ListsWithMembership []GraphGetListsWithMembership_ListWithMembership `json:"listsWithMembership"` -} - -func (t *GraphGetListsWithMembership_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getListsWithMembership#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetListsWithMembership_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetListsWithMembership calls the XRPC method "app.bsky.graph.getListsWithMembership". -// -// Enumerates the lists created by the session user, and includes membership information about `actor` in those lists. Only supports curation and moderation lists (no reference lists, used in starter packs). Requires auth. -// -// actor: The account (actor) to check for membership. -// purposes[]: Optional filter by list purpose. If not specified, all supported types are returned. -func GraphGetListsWithMembership(ctx context.Context, c glexrt.LexClient, actor string, cursor string, limit *int64, purposes []string) (*GraphGetListsWithMembership_Output, error) { - var out GraphGetListsWithMembership_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - if len(purposes) != 0 { - params["purposes"] = purposes - } - params["actor"] = actor - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getListsWithMembership", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// GraphGetListsWithMembership_ListWithMembership is a "listWithMembership" in the app.bsky.graph.getListsWithMembership schema. -// -// A list and an optional list item indicating membership of a target user to that list. -type GraphGetListsWithMembership_ListWithMembership struct { - LexiconTypeID string `json:"$type"` - List GraphDefs_ListView `json:"list"` - ListItem *GraphDefs_ListItemView `json:"listItem,omitempty"` -} - -func (t *GraphGetListsWithMembership_ListWithMembership) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getListsWithMembership" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetListsWithMembership_ListWithMembership) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/graphgetmutes.go b/pkg/appbsky/graphgetmutes.go deleted file mode 100644 index 41d2bd78..00000000 --- a/pkg/appbsky/graphgetmutes.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getMutes - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetMutes_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Mutes []ActorDefs_ProfileView `json:"mutes"` -} - -func (t *GraphGetMutes_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getMutes#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetMutes_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetMutes calls the XRPC method "app.bsky.graph.getMutes". -// -// Enumerates accounts that the requesting account (actor) currently has muted. Requires auth. -func GraphGetMutes(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64) (*GraphGetMutes_Output, error) { - var out GraphGetMutes_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getMutes", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphgetrelationships.go b/pkg/appbsky/graphgetrelationships.go deleted file mode 100644 index 820f9c24..00000000 --- a/pkg/appbsky/graphgetrelationships.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getRelationships - -package appbsky - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetRelationships_Output struct { - LexiconTypeID string `json:"$type"` - Actor *string `json:"actor,omitempty"` - Relationships []GraphGetRelationships_Output_Relationships_Elem `json:"relationships"` -} - -func (t *GraphGetRelationships_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getRelationships#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetRelationships_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type GraphGetRelationships_Output_Relationships_Elem struct { - GraphDefs_NotFoundActor *GraphDefs_NotFoundActor - GraphDefs_Relationship *GraphDefs_Relationship -} - -func (t *GraphGetRelationships_Output_Relationships_Elem) MarshalJSON() ([]byte, error) { - if t.GraphDefs_NotFoundActor != nil { - t.GraphDefs_NotFoundActor.LexiconTypeID = "app.bsky.graph.defs#notFoundActor" - return json.Marshal(t.GraphDefs_NotFoundActor) - } - if t.GraphDefs_Relationship != nil { - t.GraphDefs_Relationship.LexiconTypeID = "app.bsky.graph.defs#relationship" - return json.Marshal(t.GraphDefs_Relationship) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *GraphGetRelationships_Output_Relationships_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "app.bsky.graph.defs#notFoundActor": - t.GraphDefs_NotFoundActor = new(GraphDefs_NotFoundActor) - return json.Unmarshal(b, t.GraphDefs_NotFoundActor) - case "app.bsky.graph.defs#relationship": - t.GraphDefs_Relationship = new(GraphDefs_Relationship) - return json.Unmarshal(b, t.GraphDefs_Relationship) - default: - return nil - } -} - -func (t *GraphGetRelationships_Output_Relationships_Elem) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.GraphDefs_NotFoundActor != nil { - return t.GraphDefs_NotFoundActor.MarshalCBOR(w) - } - if t.GraphDefs_Relationship != nil { - return t.GraphDefs_Relationship.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *GraphGetRelationships_Output_Relationships_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "app.bsky.graph.defs#notFoundActor": - t.GraphDefs_NotFoundActor = new(GraphDefs_NotFoundActor) - return t.GraphDefs_NotFoundActor.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.graph.defs#relationship": - t.GraphDefs_Relationship = new(GraphDefs_Relationship) - return t.GraphDefs_Relationship.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} - -// GraphGetRelationships calls the XRPC method "app.bsky.graph.getRelationships". -// -// Enumerates public relationships between one account, and a list of other accounts. Does not require auth. -// -// actor: Primary account requesting relationships for. -// others[]: List of 'other' accounts to be related back to the primary. -func GraphGetRelationships(ctx context.Context, c glexrt.LexClient, actor string, others []string) (*GraphGetRelationships_Output, error) { - var out GraphGetRelationships_Output - - params := map[string]interface{}{} - if len(others) != 0 { - params["others"] = others - } - params["actor"] = actor - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getRelationships", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphgetstarterpack.go b/pkg/appbsky/graphgetstarterpack.go deleted file mode 100644 index fb1c8723..00000000 --- a/pkg/appbsky/graphgetstarterpack.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getStarterPack - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetStarterPack_Output struct { - LexiconTypeID string `json:"$type"` - StarterPack GraphDefs_StarterPackView `json:"starterPack"` -} - -func (t *GraphGetStarterPack_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getStarterPack#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetStarterPack_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetStarterPack calls the XRPC method "app.bsky.graph.getStarterPack". -// -// Gets a view of a starter pack. -// -// starterPack: Reference (AT-URI) of the starter pack record. -func GraphGetStarterPack(ctx context.Context, c glexrt.LexClient, starterPack string) (*GraphGetStarterPack_Output, error) { - var out GraphGetStarterPack_Output - - params := map[string]interface{}{} - params["starterPack"] = starterPack - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getStarterPack", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphgetstarterpacks.go b/pkg/appbsky/graphgetstarterpacks.go deleted file mode 100644 index 0f496219..00000000 --- a/pkg/appbsky/graphgetstarterpacks.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getStarterPacks - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetStarterPacks_Output struct { - LexiconTypeID string `json:"$type"` - StarterPacks []GraphDefs_StarterPackViewBasic `json:"starterPacks"` -} - -func (t *GraphGetStarterPacks_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getStarterPacks#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetStarterPacks_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetStarterPacks calls the XRPC method "app.bsky.graph.getStarterPacks". -// -// Get views for a list of starter packs. -func GraphGetStarterPacks(ctx context.Context, c glexrt.LexClient, uris []string) (*GraphGetStarterPacks_Output, error) { - var out GraphGetStarterPacks_Output - - params := map[string]interface{}{} - params["uris"] = uris - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getStarterPacks", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphgetstarterpackswithmembership.go b/pkg/appbsky/graphgetstarterpackswithmembership.go deleted file mode 100644 index a700a3ae..00000000 --- a/pkg/appbsky/graphgetstarterpackswithmembership.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getStarterPacksWithMembership - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetStarterPacksWithMembership_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - StarterPacksWithMembership []GraphGetStarterPacksWithMembership_StarterPackWithMembership `json:"starterPacksWithMembership"` -} - -func (t *GraphGetStarterPacksWithMembership_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getStarterPacksWithMembership#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetStarterPacksWithMembership_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetStarterPacksWithMembership calls the XRPC method "app.bsky.graph.getStarterPacksWithMembership". -// -// Enumerates the starter packs created by the session user, and includes membership information about `actor` in those starter packs. Requires auth. -// -// actor: The account (actor) to check for membership. -func GraphGetStarterPacksWithMembership(ctx context.Context, c glexrt.LexClient, actor string, cursor string, limit *int64) (*GraphGetStarterPacksWithMembership_Output, error) { - var out GraphGetStarterPacksWithMembership_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["actor"] = actor - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getStarterPacksWithMembership", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// GraphGetStarterPacksWithMembership_StarterPackWithMembership is a "starterPackWithMembership" in the app.bsky.graph.getStarterPacksWithMembership schema. -// -// A starter pack and an optional list item indicating membership of a target user to that starter pack. -type GraphGetStarterPacksWithMembership_StarterPackWithMembership struct { - LexiconTypeID string `json:"$type"` - ListItem *GraphDefs_ListItemView `json:"listItem,omitempty"` - StarterPack GraphDefs_StarterPackView `json:"starterPack"` -} - -func (t *GraphGetStarterPacksWithMembership_StarterPackWithMembership) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getStarterPacksWithMembership" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetStarterPacksWithMembership_StarterPackWithMembership) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/graphgetsuggestedfollowsbyactor.go b/pkg/appbsky/graphgetsuggestedfollowsbyactor.go deleted file mode 100644 index 02562107..00000000 --- a/pkg/appbsky/graphgetsuggestedfollowsbyactor.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.getSuggestedFollowsByActor - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphGetSuggestedFollowsByActor_Output struct { - LexiconTypeID string `json:"$type"` - // isFallback: If true, response has fallen-back to generic results, and is not scoped using relativeToDid - IsFallback *bool `json:"isFallback,omitempty"` - // recId: Snowflake for this recommendation, use when submitting recommendation events. - RecId *int64 `json:"recId,omitempty"` - Suggestions []ActorDefs_ProfileView `json:"suggestions"` -} - -func (t *GraphGetSuggestedFollowsByActor_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.getSuggestedFollowsByActor#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphGetSuggestedFollowsByActor_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphGetSuggestedFollowsByActor calls the XRPC method "app.bsky.graph.getSuggestedFollowsByActor". -// -// Enumerates follows similar to a given account (actor). Expected use is to recommend additional accounts immediately after following one account. -func GraphGetSuggestedFollowsByActor(ctx context.Context, c glexrt.LexClient, actor string) (*GraphGetSuggestedFollowsByActor_Output, error) { - var out GraphGetSuggestedFollowsByActor_Output - - params := map[string]interface{}{} - params["actor"] = actor - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.getSuggestedFollowsByActor", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphlist.go b/pkg/appbsky/graphlist.go deleted file mode 100644 index 370c05bf..00000000 --- a/pkg/appbsky/graphlist.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.list - -package appbsky - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" - comatproto "stream.place/streamplace/pkg/comatproto" -) - -func init() { - glexrt.RegisterType("app.bsky.graph.list", &GraphList{}) -} - -// Record representing a list of accounts (actors). Scope includes both moderation-oriented lists and curration-oriented lists. -type GraphList struct { - LexiconTypeID string `json:"$type"` - Avatar *glexrt.Blob `json:"avatar,omitempty"` - CreatedAt string `json:"createdAt"` - Description *string `json:"description,omitempty"` - DescriptionFacets []RichtextFacet `json:"descriptionFacets,omitempty"` - Labels *GraphList_Labels `json:"labels,omitempty"` - // name: Display name for list; can not be empty. - Name string `json:"name"` - // purpose: Defines the purpose of the list (aka, moderation-oriented or curration-oriented) - Purpose string `json:"purpose"` -} - -func (t *GraphList) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.list" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphList) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type GraphList_Labels struct { - LabelDefs_SelfLabels *comatproto.LabelDefs_SelfLabels -} - -func (t *GraphList_Labels) MarshalJSON() ([]byte, error) { - if t.LabelDefs_SelfLabels != nil { - t.LabelDefs_SelfLabels.LexiconTypeID = "com.atproto.label.defs#selfLabels" - return json.Marshal(t.LabelDefs_SelfLabels) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *GraphList_Labels) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "com.atproto.label.defs#selfLabels": - t.LabelDefs_SelfLabels = new(comatproto.LabelDefs_SelfLabels) - return json.Unmarshal(b, t.LabelDefs_SelfLabels) - default: - return nil - } -} - -func (t *GraphList_Labels) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.LabelDefs_SelfLabels != nil { - return t.LabelDefs_SelfLabels.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *GraphList_Labels) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "com.atproto.label.defs#selfLabels": - t.LabelDefs_SelfLabels = new(comatproto.LabelDefs_SelfLabels) - return t.LabelDefs_SelfLabels.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} diff --git a/pkg/appbsky/graphlistblock.go b/pkg/appbsky/graphlistblock.go deleted file mode 100644 index b5ca0f98..00000000 --- a/pkg/appbsky/graphlistblock.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.listblock - -package appbsky - -import ( - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -func init() { - glexrt.RegisterType("app.bsky.graph.listblock", &GraphListblock{}) -} - -// Record representing a block relationship against an entire an entire list of accounts (actors). -type GraphListblock struct { - LexiconTypeID string `json:"$type"` - CreatedAt string `json:"createdAt"` - // subject: Reference (AT-URI) to the mod list record. - Subject string `json:"subject"` -} - -func (t *GraphListblock) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.listblock" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphListblock) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/graphlistitem.go b/pkg/appbsky/graphlistitem.go deleted file mode 100644 index a0d352c0..00000000 --- a/pkg/appbsky/graphlistitem.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.listitem - -package appbsky - -import ( - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -func init() { - glexrt.RegisterType("app.bsky.graph.listitem", &GraphListitem{}) -} - -// Record representing an account's inclusion on a specific list. The AppView will ignore duplicate listitem records. -type GraphListitem struct { - LexiconTypeID string `json:"$type"` - CreatedAt string `json:"createdAt"` - // list: Reference (AT-URI) to the list record (app.bsky.graph.list). - List string `json:"list"` - // subject: The account which is included on the list. - Subject string `json:"subject"` -} - -func (t *GraphListitem) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.listitem" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphListitem) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/graphmuteactor.go b/pkg/appbsky/graphmuteactor.go deleted file mode 100644 index b954d2c6..00000000 --- a/pkg/appbsky/graphmuteactor.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.muteActor - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphMuteActor_Input struct { - LexiconTypeID string `json:"$type"` - Actor string `json:"actor"` -} - -func (t *GraphMuteActor_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.muteActor#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphMuteActor_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphMuteActor calls the XRPC method "app.bsky.graph.muteActor". -// -// Creates a mute relationship for the specified account. Mutes are private in Bluesky. Requires auth. -func GraphMuteActor(ctx context.Context, c glexrt.LexClient, input *GraphMuteActor_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.graph.muteActor", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/appbsky/graphmuteactorlist.go b/pkg/appbsky/graphmuteactorlist.go deleted file mode 100644 index e1c7e7a6..00000000 --- a/pkg/appbsky/graphmuteactorlist.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.muteActorList - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphMuteActorList_Input struct { - LexiconTypeID string `json:"$type"` - List string `json:"list"` -} - -func (t *GraphMuteActorList_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.muteActorList#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphMuteActorList_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphMuteActorList calls the XRPC method "app.bsky.graph.muteActorList". -// -// Creates a mute relationship for the specified list of accounts. Mutes are private in Bluesky. Requires auth. -func GraphMuteActorList(ctx context.Context, c glexrt.LexClient, input *GraphMuteActorList_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.graph.muteActorList", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/appbsky/graphmutethread.go b/pkg/appbsky/graphmutethread.go deleted file mode 100644 index ac6f7259..00000000 --- a/pkg/appbsky/graphmutethread.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.muteThread - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphMuteThread_Input struct { - LexiconTypeID string `json:"$type"` - Root string `json:"root"` -} - -func (t *GraphMuteThread_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.muteThread#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphMuteThread_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphMuteThread calls the XRPC method "app.bsky.graph.muteThread". -// -// Mutes a thread preventing notifications from the thread and any of its children. Mutes are private in Bluesky. Requires auth. -func GraphMuteThread(ctx context.Context, c glexrt.LexClient, input *GraphMuteThread_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.graph.muteThread", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/appbsky/graphsearchstarterpacks.go b/pkg/appbsky/graphsearchstarterpacks.go deleted file mode 100644 index 730882ce..00000000 --- a/pkg/appbsky/graphsearchstarterpacks.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.searchStarterPacks - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphSearchStarterPacks_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - StarterPacks []GraphDefs_StarterPackViewBasic `json:"starterPacks"` -} - -func (t *GraphSearchStarterPacks_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.searchStarterPacks#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphSearchStarterPacks_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphSearchStarterPacks calls the XRPC method "app.bsky.graph.searchStarterPacks". -// -// Find starter packs matching search criteria. Does not require auth. -// -// q: Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. -func GraphSearchStarterPacks(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, q string) (*GraphSearchStarterPacks_Output, error) { - var out GraphSearchStarterPacks_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["q"] = q - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.graph.searchStarterPacks", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/graphstarterpack.go b/pkg/appbsky/graphstarterpack.go deleted file mode 100644 index 4aa12bc4..00000000 --- a/pkg/appbsky/graphstarterpack.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.starterpack - -package appbsky - -import ( - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -func init() { - glexrt.RegisterType("app.bsky.graph.starterpack", &GraphStarterpack{}) -} - -// Record defining a starter pack of actors and feeds for new users. -type GraphStarterpack struct { - LexiconTypeID string `json:"$type"` - CreatedAt string `json:"createdAt"` - Description *string `json:"description,omitempty"` - DescriptionFacets []RichtextFacet `json:"descriptionFacets,omitempty"` - Feeds []GraphStarterpack_FeedItem `json:"feeds,omitempty"` - // list: Reference (AT-URI) to the list record. - List string `json:"list"` - // name: Display name for starter pack; can not be empty. - Name string `json:"name"` -} - -func (t *GraphStarterpack) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.starterpack" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphStarterpack) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphStarterpack_FeedItem is a "feedItem" in the app.bsky.graph.starterpack schema. -type GraphStarterpack_FeedItem struct { - LexiconTypeID string `json:"$type"` - Uri string `json:"uri"` -} - -func (t *GraphStarterpack_FeedItem) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.starterpack" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphStarterpack_FeedItem) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/graphunmuteactor.go b/pkg/appbsky/graphunmuteactor.go deleted file mode 100644 index 194587cd..00000000 --- a/pkg/appbsky/graphunmuteactor.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.unmuteActor - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphUnmuteActor_Input struct { - LexiconTypeID string `json:"$type"` - Actor string `json:"actor"` -} - -func (t *GraphUnmuteActor_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.unmuteActor#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphUnmuteActor_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphUnmuteActor calls the XRPC method "app.bsky.graph.unmuteActor". -// -// Unmutes the specified account. Requires auth. -func GraphUnmuteActor(ctx context.Context, c glexrt.LexClient, input *GraphUnmuteActor_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.graph.unmuteActor", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/appbsky/graphunmuteactorlist.go b/pkg/appbsky/graphunmuteactorlist.go deleted file mode 100644 index 3dd9429c..00000000 --- a/pkg/appbsky/graphunmuteactorlist.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.unmuteActorList - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphUnmuteActorList_Input struct { - LexiconTypeID string `json:"$type"` - List string `json:"list"` -} - -func (t *GraphUnmuteActorList_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.unmuteActorList#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphUnmuteActorList_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphUnmuteActorList calls the XRPC method "app.bsky.graph.unmuteActorList". -// -// Unmutes the specified list of accounts. Requires auth. -func GraphUnmuteActorList(ctx context.Context, c glexrt.LexClient, input *GraphUnmuteActorList_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.graph.unmuteActorList", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/appbsky/graphunmutethread.go b/pkg/appbsky/graphunmutethread.go deleted file mode 100644 index 5e1767ae..00000000 --- a/pkg/appbsky/graphunmutethread.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.unmuteThread - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type GraphUnmuteThread_Input struct { - LexiconTypeID string `json:"$type"` - Root string `json:"root"` -} - -func (t *GraphUnmuteThread_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.unmuteThread#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphUnmuteThread_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// GraphUnmuteThread calls the XRPC method "app.bsky.graph.unmuteThread". -// -// Unmutes the specified thread. Requires auth. -func GraphUnmuteThread(ctx context.Context, c glexrt.LexClient, input *GraphUnmuteThread_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.graph.unmuteThread", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/appbsky/graphverification.go b/pkg/appbsky/graphverification.go deleted file mode 100644 index 9c819018..00000000 --- a/pkg/appbsky/graphverification.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.graph.verification - -package appbsky - -import ( - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -func init() { - glexrt.RegisterType("app.bsky.graph.verification", &GraphVerification{}) -} - -// Record declaring a verification relationship between two accounts. Verifications are only considered valid by an app if issued by an account the app considers trusted. -type GraphVerification struct { - LexiconTypeID string `json:"$type"` - // createdAt: Date of when the verification was created. - CreatedAt string `json:"createdAt"` - // displayName: Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying. - DisplayName string `json:"displayName"` - // handle: Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying. - Handle string `json:"handle"` - // subject: DID of the subject the verification applies to. - Subject string `json:"subject"` -} - -func (t *GraphVerification) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.graph.verification" - return glexrt.MarshalCBOR(w, t) -} - -func (t *GraphVerification) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/labelerdefs.go b/pkg/appbsky/labelerdefs.go index ccbdc926..f954833c 100644 --- a/pkg/appbsky/labelerdefs.go +++ b/pkg/appbsky/labelerdefs.go @@ -7,7 +7,7 @@ package appbsky import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) @@ -21,17 +21,22 @@ type LabelerDefs_LabelerPolicies struct { LabelValues []string `json:"labelValues"` } +// RecordTypeID implements glex.Record. +func (t *LabelerDefs_LabelerPolicies) RecordTypeID() string { + return "app.bsky.labeler.defs#labelerPolicies" +} + func (t *LabelerDefs_LabelerPolicies) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.labeler.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.labeler.defs#labelerPolicies" + return glex.MarshalCBOR(w, t) } func (t *LabelerDefs_LabelerPolicies) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // LabelerDefs_LabelerView is a "labelerView" in the app.bsky.labeler.defs schema. @@ -46,17 +51,20 @@ type LabelerDefs_LabelerView struct { Viewer *LabelerDefs_LabelerViewerState `json:"viewer,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *LabelerDefs_LabelerView) RecordTypeID() string { return "app.bsky.labeler.defs#labelerView" } + func (t *LabelerDefs_LabelerView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.labeler.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.labeler.defs#labelerView" + return glex.MarshalCBOR(w, t) } func (t *LabelerDefs_LabelerView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // LabelerDefs_LabelerViewDetailed is a "labelerViewDetailed" in the app.bsky.labeler.defs schema. @@ -78,17 +86,22 @@ type LabelerDefs_LabelerViewDetailed struct { Viewer *LabelerDefs_LabelerViewerState `json:"viewer,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *LabelerDefs_LabelerViewDetailed) RecordTypeID() string { + return "app.bsky.labeler.defs#labelerViewDetailed" +} + func (t *LabelerDefs_LabelerViewDetailed) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.labeler.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.labeler.defs#labelerViewDetailed" + return glex.MarshalCBOR(w, t) } func (t *LabelerDefs_LabelerViewDetailed) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // LabelerDefs_LabelerViewerState is a "labelerViewerState" in the app.bsky.labeler.defs schema. @@ -97,15 +110,20 @@ type LabelerDefs_LabelerViewerState struct { Like *string `json:"like,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *LabelerDefs_LabelerViewerState) RecordTypeID() string { + return "app.bsky.labeler.defs#labelerViewerState" +} + func (t *LabelerDefs_LabelerViewerState) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.labeler.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.labeler.defs#labelerViewerState" + return glex.MarshalCBOR(w, t) } func (t *LabelerDefs_LabelerViewerState) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/labelergetservices.go b/pkg/appbsky/labelergetservices.go deleted file mode 100644 index 2f7fe54e..00000000 --- a/pkg/appbsky/labelergetservices.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.labeler.getServices - -package appbsky - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type LabelerGetServices_Output struct { - LexiconTypeID string `json:"$type"` - Views []LabelerGetServices_Output_Views_Elem `json:"views"` -} - -func (t *LabelerGetServices_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.labeler.getServices#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *LabelerGetServices_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type LabelerGetServices_Output_Views_Elem struct { - LabelerDefs_LabelerView *LabelerDefs_LabelerView - LabelerDefs_LabelerViewDetailed *LabelerDefs_LabelerViewDetailed -} - -func (t *LabelerGetServices_Output_Views_Elem) MarshalJSON() ([]byte, error) { - if t.LabelerDefs_LabelerView != nil { - t.LabelerDefs_LabelerView.LexiconTypeID = "app.bsky.labeler.defs#labelerView" - return json.Marshal(t.LabelerDefs_LabelerView) - } - if t.LabelerDefs_LabelerViewDetailed != nil { - t.LabelerDefs_LabelerViewDetailed.LexiconTypeID = "app.bsky.labeler.defs#labelerViewDetailed" - return json.Marshal(t.LabelerDefs_LabelerViewDetailed) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *LabelerGetServices_Output_Views_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "app.bsky.labeler.defs#labelerView": - t.LabelerDefs_LabelerView = new(LabelerDefs_LabelerView) - return json.Unmarshal(b, t.LabelerDefs_LabelerView) - case "app.bsky.labeler.defs#labelerViewDetailed": - t.LabelerDefs_LabelerViewDetailed = new(LabelerDefs_LabelerViewDetailed) - return json.Unmarshal(b, t.LabelerDefs_LabelerViewDetailed) - default: - return nil - } -} - -func (t *LabelerGetServices_Output_Views_Elem) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.LabelerDefs_LabelerView != nil { - return t.LabelerDefs_LabelerView.MarshalCBOR(w) - } - if t.LabelerDefs_LabelerViewDetailed != nil { - return t.LabelerDefs_LabelerViewDetailed.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *LabelerGetServices_Output_Views_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "app.bsky.labeler.defs#labelerView": - t.LabelerDefs_LabelerView = new(LabelerDefs_LabelerView) - return t.LabelerDefs_LabelerView.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.labeler.defs#labelerViewDetailed": - t.LabelerDefs_LabelerViewDetailed = new(LabelerDefs_LabelerViewDetailed) - return t.LabelerDefs_LabelerViewDetailed.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} - -// LabelerGetServices calls the XRPC method "app.bsky.labeler.getServices". -// -// Get information about a list of labeler services. -func LabelerGetServices(ctx context.Context, c glexrt.LexClient, detailed *bool, dids []string) (*LabelerGetServices_Output, error) { - var out LabelerGetServices_Output - - params := map[string]interface{}{} - if detailed != nil { - params["detailed"] = *detailed - } - params["dids"] = dids - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.labeler.getServices", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/labelerservice.go b/pkg/appbsky/labelerservice.go deleted file mode 100644 index dcfb02e9..00000000 --- a/pkg/appbsky/labelerservice.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.labeler.service - -package appbsky - -import ( - "bytes" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" - comatproto "stream.place/streamplace/pkg/comatproto" -) - -func init() { - glexrt.RegisterType("app.bsky.labeler.service", &LabelerService{}) -} - -// A declaration of the existence of labeler service. -type LabelerService struct { - LexiconTypeID string `json:"$type"` - CreatedAt string `json:"createdAt"` - Labels *LabelerService_Labels `json:"labels,omitempty"` - Policies LabelerDefs_LabelerPolicies `json:"policies"` - // reasonTypes: The set of report reason 'codes' which are in-scope for this service to review and action. These usually align to policy categories. If not defined (distinct from empty array), all reason types are allowed. - ReasonTypes []string `json:"reasonTypes,omitempty"` - // subjectCollections: Set of record types (collection NSIDs) which can be reported to this service. If not defined (distinct from empty array), default is any record type. - SubjectCollections []string `json:"subjectCollections,omitempty"` - // subjectTypes: The set of subject types (account, record, etc) this service accepts reports on. - SubjectTypes []string `json:"subjectTypes,omitempty"` -} - -func (t *LabelerService) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.labeler.service" - return glexrt.MarshalCBOR(w, t) -} - -func (t *LabelerService) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type LabelerService_Labels struct { - LabelDefs_SelfLabels *comatproto.LabelDefs_SelfLabels -} - -func (t *LabelerService_Labels) MarshalJSON() ([]byte, error) { - if t.LabelDefs_SelfLabels != nil { - t.LabelDefs_SelfLabels.LexiconTypeID = "com.atproto.label.defs#selfLabels" - return json.Marshal(t.LabelDefs_SelfLabels) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *LabelerService_Labels) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "com.atproto.label.defs#selfLabels": - t.LabelDefs_SelfLabels = new(comatproto.LabelDefs_SelfLabels) - return json.Unmarshal(b, t.LabelDefs_SelfLabels) - default: - return nil - } -} - -func (t *LabelerService_Labels) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.LabelDefs_SelfLabels != nil { - return t.LabelDefs_SelfLabels.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *LabelerService_Labels) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "com.atproto.label.defs#selfLabels": - t.LabelDefs_SelfLabels = new(comatproto.LabelDefs_SelfLabels) - return t.LabelDefs_SelfLabels.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} diff --git a/pkg/appbsky/notificationdeclaration.go b/pkg/appbsky/notificationdeclaration.go deleted file mode 100644 index 804c1f4f..00000000 --- a/pkg/appbsky/notificationdeclaration.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.notification.declaration - -package appbsky - -import ( - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -func init() { - glexrt.RegisterType("app.bsky.notification.declaration", &NotificationDeclaration{}) -} - -// A declaration of the user's choices related to notifications that can be produced by them. -type NotificationDeclaration struct { - LexiconTypeID string `json:"$type"` - // allowSubscriptions: A declaration of the user's preference for allowing activity subscriptions from other users. Absence of a record implies 'followers'. - AllowSubscriptions string `json:"allowSubscriptions"` -} - -func (t *NotificationDeclaration) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.notification.declaration" - return glexrt.MarshalCBOR(w, t) -} - -func (t *NotificationDeclaration) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/notificationdefs.go b/pkg/appbsky/notificationdefs.go index 100b96e9..329e3866 100644 --- a/pkg/appbsky/notificationdefs.go +++ b/pkg/appbsky/notificationdefs.go @@ -7,7 +7,7 @@ package appbsky import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,17 +18,22 @@ type NotificationDefs_ActivitySubscription struct { Reply bool `json:"reply"` } +// RecordTypeID implements glex.Record. +func (t *NotificationDefs_ActivitySubscription) RecordTypeID() string { + return "app.bsky.notification.defs#activitySubscription" +} + func (t *NotificationDefs_ActivitySubscription) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.notification.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.notification.defs#activitySubscription" + return glex.MarshalCBOR(w, t) } func (t *NotificationDefs_ActivitySubscription) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // NotificationDefs_ChatPreference is a "chatPreference" in the app.bsky.notification.defs schema. @@ -38,17 +43,22 @@ type NotificationDefs_ChatPreference struct { Push bool `json:"push"` } +// RecordTypeID implements glex.Record. +func (t *NotificationDefs_ChatPreference) RecordTypeID() string { + return "app.bsky.notification.defs#chatPreference" +} + func (t *NotificationDefs_ChatPreference) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.notification.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.notification.defs#chatPreference" + return glex.MarshalCBOR(w, t) } func (t *NotificationDefs_ChatPreference) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // NotificationDefs_FilterablePreference is a "filterablePreference" in the app.bsky.notification.defs schema. @@ -59,17 +69,22 @@ type NotificationDefs_FilterablePreference struct { Push bool `json:"push"` } +// RecordTypeID implements glex.Record. +func (t *NotificationDefs_FilterablePreference) RecordTypeID() string { + return "app.bsky.notification.defs#filterablePreference" +} + func (t *NotificationDefs_FilterablePreference) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.notification.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.notification.defs#filterablePreference" + return glex.MarshalCBOR(w, t) } func (t *NotificationDefs_FilterablePreference) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // NotificationDefs_Preference is a "preference" in the app.bsky.notification.defs schema. @@ -79,17 +94,22 @@ type NotificationDefs_Preference struct { Push bool `json:"push"` } +// RecordTypeID implements glex.Record. +func (t *NotificationDefs_Preference) RecordTypeID() string { + return "app.bsky.notification.defs#preference" +} + func (t *NotificationDefs_Preference) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.notification.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.notification.defs#preference" + return glex.MarshalCBOR(w, t) } func (t *NotificationDefs_Preference) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // NotificationDefs_Preferences is a "preferences" in the app.bsky.notification.defs schema. @@ -110,17 +130,22 @@ type NotificationDefs_Preferences struct { Verified NotificationDefs_Preference `json:"verified"` } +// RecordTypeID implements glex.Record. +func (t *NotificationDefs_Preferences) RecordTypeID() string { + return "app.bsky.notification.defs#preferences" +} + func (t *NotificationDefs_Preferences) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.notification.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.notification.defs#preferences" + return glex.MarshalCBOR(w, t) } func (t *NotificationDefs_Preferences) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // NotificationDefs_RecordDeleted is a "recordDeleted" in the app.bsky.notification.defs schema. @@ -128,17 +153,22 @@ type NotificationDefs_RecordDeleted struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *NotificationDefs_RecordDeleted) RecordTypeID() string { + return "app.bsky.notification.defs#recordDeleted" +} + func (t *NotificationDefs_RecordDeleted) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.notification.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.notification.defs#recordDeleted" + return glex.MarshalCBOR(w, t) } func (t *NotificationDefs_RecordDeleted) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // NotificationDefs_SubjectActivitySubscription is a "subjectActivitySubscription" in the app.bsky.notification.defs schema. @@ -150,15 +180,20 @@ type NotificationDefs_SubjectActivitySubscription struct { Subject string `json:"subject"` } +// RecordTypeID implements glex.Record. +func (t *NotificationDefs_SubjectActivitySubscription) RecordTypeID() string { + return "app.bsky.notification.defs#subjectActivitySubscription" +} + func (t *NotificationDefs_SubjectActivitySubscription) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.notification.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.notification.defs#subjectActivitySubscription" + return glex.MarshalCBOR(w, t) } func (t *NotificationDefs_SubjectActivitySubscription) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/notificationgetpreferences.go b/pkg/appbsky/notificationgetpreferences.go deleted file mode 100644 index faff682e..00000000 --- a/pkg/appbsky/notificationgetpreferences.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.notification.getPreferences - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type NotificationGetPreferences_Output struct { - LexiconTypeID string `json:"$type"` - Preferences NotificationDefs_Preferences `json:"preferences"` -} - -func (t *NotificationGetPreferences_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.notification.getPreferences#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *NotificationGetPreferences_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// NotificationGetPreferences calls the XRPC method "app.bsky.notification.getPreferences". -// -// Get notification-related preferences for an account. Requires auth. -func NotificationGetPreferences(ctx context.Context, c glexrt.LexClient) (*NotificationGetPreferences_Output, error) { - var out NotificationGetPreferences_Output - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.notification.getPreferences", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/notificationgetunreadcount.go b/pkg/appbsky/notificationgetunreadcount.go deleted file mode 100644 index e196e583..00000000 --- a/pkg/appbsky/notificationgetunreadcount.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.notification.getUnreadCount - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type NotificationGetUnreadCount_Output struct { - LexiconTypeID string `json:"$type"` - Count int64 `json:"count"` -} - -func (t *NotificationGetUnreadCount_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.notification.getUnreadCount#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *NotificationGetUnreadCount_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// NotificationGetUnreadCount calls the XRPC method "app.bsky.notification.getUnreadCount". -// -// Count the number of unread notifications for the requesting account. Requires auth. -func NotificationGetUnreadCount(ctx context.Context, c glexrt.LexClient, priority *bool, seenAt string) (*NotificationGetUnreadCount_Output, error) { - var out NotificationGetUnreadCount_Output - - params := map[string]interface{}{} - if priority != nil { - params["priority"] = *priority - } - if seenAt != "" { - params["seenAt"] = seenAt - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.notification.getUnreadCount", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/notificationlistactivitysubscriptions.go b/pkg/appbsky/notificationlistactivitysubscriptions.go deleted file mode 100644 index c5b9ba14..00000000 --- a/pkg/appbsky/notificationlistactivitysubscriptions.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.notification.listActivitySubscriptions - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type NotificationListActivitySubscriptions_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Subscriptions []ActorDefs_ProfileView `json:"subscriptions"` -} - -func (t *NotificationListActivitySubscriptions_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.notification.listActivitySubscriptions#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *NotificationListActivitySubscriptions_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// NotificationListActivitySubscriptions calls the XRPC method "app.bsky.notification.listActivitySubscriptions". -// -// Enumerate all accounts to which the requesting account is subscribed to receive notifications for. Requires auth. -func NotificationListActivitySubscriptions(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64) (*NotificationListActivitySubscriptions_Output, error) { - var out NotificationListActivitySubscriptions_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.notification.listActivitySubscriptions", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/notificationlistnotifications.go b/pkg/appbsky/notificationlistnotifications.go deleted file mode 100644 index 436f485d..00000000 --- a/pkg/appbsky/notificationlistnotifications.go +++ /dev/null @@ -1,94 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.notification.listNotifications - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" - comatproto "stream.place/streamplace/pkg/comatproto" -) - -type NotificationListNotifications_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Notifications []NotificationListNotifications_Notification `json:"notifications"` - Priority *bool `json:"priority,omitempty"` - SeenAt *string `json:"seenAt,omitempty"` -} - -func (t *NotificationListNotifications_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.notification.listNotifications#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *NotificationListNotifications_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// NotificationListNotifications calls the XRPC method "app.bsky.notification.listNotifications". -// -// Enumerate notifications for the requesting account. Requires auth. -// -// reasons[]: Notification reasons to include in response. -func NotificationListNotifications(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, priority *bool, reasons []string, seenAt string) (*NotificationListNotifications_Output, error) { - var out NotificationListNotifications_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - if priority != nil { - params["priority"] = *priority - } - if len(reasons) != 0 { - params["reasons"] = reasons - } - if seenAt != "" { - params["seenAt"] = seenAt - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.notification.listNotifications", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// NotificationListNotifications_Notification is a "notification" in the app.bsky.notification.listNotifications schema. -type NotificationListNotifications_Notification struct { - LexiconTypeID string `json:"$type"` - Author ActorDefs_ProfileView `json:"author"` - Cid string `json:"cid"` - IndexedAt string `json:"indexedAt"` - IsRead bool `json:"isRead"` - Labels []comatproto.LabelDefs_Label `json:"labels,omitempty"` - // reason: The reason why this notification was delivered - e.g. your post was liked, or you received a new follower. - Reason string `json:"reason"` - ReasonSubject *string `json:"reasonSubject,omitempty"` - Record *glexrt.LexiconTypeDecoder `json:"record"` - Uri string `json:"uri"` -} - -func (t *NotificationListNotifications_Notification) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.notification.listNotifications" - return glexrt.MarshalCBOR(w, t) -} - -func (t *NotificationListNotifications_Notification) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/notificationputactivitysubscription.go b/pkg/appbsky/notificationputactivitysubscription.go deleted file mode 100644 index 2df49db4..00000000 --- a/pkg/appbsky/notificationputactivitysubscription.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.notification.putActivitySubscription - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type NotificationPutActivitySubscription_Input struct { - LexiconTypeID string `json:"$type"` - ActivitySubscription NotificationDefs_ActivitySubscription `json:"activitySubscription"` - Subject string `json:"subject"` -} - -func (t *NotificationPutActivitySubscription_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.notification.putActivitySubscription#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *NotificationPutActivitySubscription_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type NotificationPutActivitySubscription_Output struct { - LexiconTypeID string `json:"$type"` - ActivitySubscription *NotificationDefs_ActivitySubscription `json:"activitySubscription,omitempty"` - Subject string `json:"subject"` -} - -func (t *NotificationPutActivitySubscription_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.notification.putActivitySubscription#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *NotificationPutActivitySubscription_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// NotificationPutActivitySubscription calls the XRPC method "app.bsky.notification.putActivitySubscription". -// -// Puts an activity subscription entry. The key should be omitted for creation and provided for updates. Requires auth. -func NotificationPutActivitySubscription(ctx context.Context, c glexrt.LexClient, input *NotificationPutActivitySubscription_Input) (*NotificationPutActivitySubscription_Output, error) { - var out NotificationPutActivitySubscription_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.notification.putActivitySubscription", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/notificationputpreferences.go b/pkg/appbsky/notificationputpreferences.go deleted file mode 100644 index 818c209c..00000000 --- a/pkg/appbsky/notificationputpreferences.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.notification.putPreferences - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type NotificationPutPreferences_Input struct { - LexiconTypeID string `json:"$type"` - Priority bool `json:"priority"` -} - -func (t *NotificationPutPreferences_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.notification.putPreferences#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *NotificationPutPreferences_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// NotificationPutPreferences calls the XRPC method "app.bsky.notification.putPreferences". -// -// Set notification-related preferences for an account. Requires auth. -func NotificationPutPreferences(ctx context.Context, c glexrt.LexClient, input *NotificationPutPreferences_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.notification.putPreferences", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/appbsky/notificationputpreferencesv2.go b/pkg/appbsky/notificationputpreferencesv2.go deleted file mode 100644 index ef2002bd..00000000 --- a/pkg/appbsky/notificationputpreferencesv2.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.notification.putPreferencesV2 - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type NotificationPutPreferencesV2_Input struct { - LexiconTypeID string `json:"$type"` - Chat *NotificationDefs_ChatPreference `json:"chat,omitempty"` - Follow *NotificationDefs_FilterablePreference `json:"follow,omitempty"` - Like *NotificationDefs_FilterablePreference `json:"like,omitempty"` - LikeViaRepost *NotificationDefs_FilterablePreference `json:"likeViaRepost,omitempty"` - Mention *NotificationDefs_FilterablePreference `json:"mention,omitempty"` - Quote *NotificationDefs_FilterablePreference `json:"quote,omitempty"` - Reply *NotificationDefs_FilterablePreference `json:"reply,omitempty"` - Repost *NotificationDefs_FilterablePreference `json:"repost,omitempty"` - RepostViaRepost *NotificationDefs_FilterablePreference `json:"repostViaRepost,omitempty"` - StarterpackJoined *NotificationDefs_Preference `json:"starterpackJoined,omitempty"` - SubscribedPost *NotificationDefs_Preference `json:"subscribedPost,omitempty"` - Unverified *NotificationDefs_Preference `json:"unverified,omitempty"` - Verified *NotificationDefs_Preference `json:"verified,omitempty"` -} - -func (t *NotificationPutPreferencesV2_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.notification.putPreferencesV2#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *NotificationPutPreferencesV2_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type NotificationPutPreferencesV2_Output struct { - LexiconTypeID string `json:"$type"` - Preferences NotificationDefs_Preferences `json:"preferences"` -} - -func (t *NotificationPutPreferencesV2_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.notification.putPreferencesV2#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *NotificationPutPreferencesV2_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// NotificationPutPreferencesV2 calls the XRPC method "app.bsky.notification.putPreferencesV2". -// -// Set notification-related preferences for an account. Requires auth. -func NotificationPutPreferencesV2(ctx context.Context, c glexrt.LexClient, input *NotificationPutPreferencesV2_Input) (*NotificationPutPreferencesV2_Output, error) { - var out NotificationPutPreferencesV2_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.notification.putPreferencesV2", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/notificationregisterpush.go b/pkg/appbsky/notificationregisterpush.go deleted file mode 100644 index 3dcb57e8..00000000 --- a/pkg/appbsky/notificationregisterpush.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.notification.registerPush - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type NotificationRegisterPush_Input struct { - LexiconTypeID string `json:"$type"` - // ageRestricted: Set to true when the actor is age restricted - AgeRestricted *bool `json:"ageRestricted,omitempty"` - AppId string `json:"appId"` - Platform string `json:"platform"` - ServiceDid string `json:"serviceDid"` - Token string `json:"token"` -} - -func (t *NotificationRegisterPush_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.notification.registerPush#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *NotificationRegisterPush_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// NotificationRegisterPush calls the XRPC method "app.bsky.notification.registerPush". -// -// Register to receive push notifications, via a specified service, for the requesting account. Requires auth. -func NotificationRegisterPush(ctx context.Context, c glexrt.LexClient, input *NotificationRegisterPush_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.notification.registerPush", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/appbsky/notificationunregisterpush.go b/pkg/appbsky/notificationunregisterpush.go deleted file mode 100644 index 339cda82..00000000 --- a/pkg/appbsky/notificationunregisterpush.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.notification.unregisterPush - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type NotificationUnregisterPush_Input struct { - LexiconTypeID string `json:"$type"` - AppId string `json:"appId"` - Platform string `json:"platform"` - ServiceDid string `json:"serviceDid"` - Token string `json:"token"` -} - -func (t *NotificationUnregisterPush_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.notification.unregisterPush#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *NotificationUnregisterPush_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// NotificationUnregisterPush calls the XRPC method "app.bsky.notification.unregisterPush". -// -// The inverse of registerPush - inform a specified service that push notifications should no longer be sent to the given token for the requesting account. Requires auth. -func NotificationUnregisterPush(ctx context.Context, c glexrt.LexClient, input *NotificationUnregisterPush_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.notification.unregisterPush", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/appbsky/notificationupdateseen.go b/pkg/appbsky/notificationupdateseen.go deleted file mode 100644 index f05eb84f..00000000 --- a/pkg/appbsky/notificationupdateseen.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.notification.updateSeen - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type NotificationUpdateSeen_Input struct { - LexiconTypeID string `json:"$type"` - SeenAt string `json:"seenAt"` -} - -func (t *NotificationUpdateSeen_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.notification.updateSeen#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *NotificationUpdateSeen_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// NotificationUpdateSeen calls the XRPC method "app.bsky.notification.updateSeen". -// -// Notify server that the requesting account has seen notifications. Requires auth. -func NotificationUpdateSeen(ctx context.Context, c glexrt.LexClient, input *NotificationUpdateSeen_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.notification.updateSeen", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/appbsky/richtextfacet.go b/pkg/appbsky/richtextfacet.go index 0ed55337..6a8c2ac5 100644 --- a/pkg/appbsky/richtextfacet.go +++ b/pkg/appbsky/richtextfacet.go @@ -10,12 +10,12 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("app.bsky.richtext.facet#main", &RichtextFacet{}) + glex.RegisterType("app.bsky.richtext.facet#main", &RichtextFacet{}) } // Annotation of a sub-string within rich text. @@ -25,17 +25,20 @@ type RichtextFacet struct { Index RichtextFacet_ByteSlice `json:"index"` } +// RecordTypeID implements glex.Record. +func (t *RichtextFacet) RecordTypeID() string { return "app.bsky.richtext.facet" } + func (t *RichtextFacet) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "app.bsky.richtext.facet" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *RichtextFacet) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type RichtextFacet_Features_Elem struct { @@ -61,7 +64,7 @@ func (t *RichtextFacet_Features_Elem) MarshalJSON() ([]byte, error) { } func (t *RichtextFacet_Features_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -100,7 +103,7 @@ func (t *RichtextFacet_Features_Elem) MarshalCBOR(w io.Writer) error { } func (t *RichtextFacet_Features_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -129,17 +132,20 @@ type RichtextFacet_ByteSlice struct { ByteStart int64 `json:"byteStart"` } +// RecordTypeID implements glex.Record. +func (t *RichtextFacet_ByteSlice) RecordTypeID() string { return "app.bsky.richtext.facet#byteSlice" } + func (t *RichtextFacet_ByteSlice) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.richtext.facet" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.richtext.facet#byteSlice" + return glex.MarshalCBOR(w, t) } func (t *RichtextFacet_ByteSlice) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // RichtextFacet_Link is a "link" in the app.bsky.richtext.facet schema. @@ -150,17 +156,20 @@ type RichtextFacet_Link struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *RichtextFacet_Link) RecordTypeID() string { return "app.bsky.richtext.facet#link" } + func (t *RichtextFacet_Link) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.richtext.facet" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.richtext.facet#link" + return glex.MarshalCBOR(w, t) } func (t *RichtextFacet_Link) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // RichtextFacet_Mention is a "mention" in the app.bsky.richtext.facet schema. @@ -171,17 +180,20 @@ type RichtextFacet_Mention struct { Did string `json:"did"` } +// RecordTypeID implements glex.Record. +func (t *RichtextFacet_Mention) RecordTypeID() string { return "app.bsky.richtext.facet#mention" } + func (t *RichtextFacet_Mention) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.richtext.facet" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.richtext.facet#mention" + return glex.MarshalCBOR(w, t) } func (t *RichtextFacet_Mention) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // RichtextFacet_Tag is a "tag" in the app.bsky.richtext.facet schema. @@ -192,15 +204,18 @@ type RichtextFacet_Tag struct { Tag string `json:"tag"` } +// RecordTypeID implements glex.Record. +func (t *RichtextFacet_Tag) RecordTypeID() string { return "app.bsky.richtext.facet#tag" } + func (t *RichtextFacet_Tag) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "app.bsky.richtext.facet" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "app.bsky.richtext.facet#tag" + return glex.MarshalCBOR(w, t) } func (t *RichtextFacet_Tag) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/appbsky/unspecceddefs.go b/pkg/appbsky/unspecceddefs.go deleted file mode 100644 index 1f8c40bb..00000000 --- a/pkg/appbsky/unspecceddefs.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.defs - -package appbsky - -import ( - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -// UnspeccedDefs_AgeAssuranceEvent is a "ageAssuranceEvent" in the app.bsky.unspecced.defs schema. -// -// Object used to store age assurance data in stash. -type UnspeccedDefs_AgeAssuranceEvent struct { - LexiconTypeID string `json:"$type"` - // attemptId: The unique identifier for this instance of the age assurance flow, in UUID format. - AttemptId string `json:"attemptId"` - // completeIp: The IP address used when completing the AA flow. - CompleteIp *string `json:"completeIp,omitempty"` - // completeUa: The user agent used when completing the AA flow. - CompleteUa *string `json:"completeUa,omitempty"` - // createdAt: The date and time of this write operation. - CreatedAt string `json:"createdAt"` - // email: The email used for AA. - Email *string `json:"email,omitempty"` - // initIp: The IP address used when initiating the AA flow. - InitIp *string `json:"initIp,omitempty"` - // initUa: The user agent used when initiating the AA flow. - InitUa *string `json:"initUa,omitempty"` - // status: The status of the age assurance process. - Status string `json:"status"` -} - -func (t *UnspeccedDefs_AgeAssuranceEvent) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedDefs_AgeAssuranceEvent) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedDefs_AgeAssuranceState is a "ageAssuranceState" in the app.bsky.unspecced.defs schema. -// -// The computed state of the age assurance process, returned to the user in question on certain authenticated requests. -type UnspeccedDefs_AgeAssuranceState struct { - LexiconTypeID string `json:"$type"` - // lastInitiatedAt: The timestamp when this state was last updated. - LastInitiatedAt *string `json:"lastInitiatedAt,omitempty"` - // status: The status of the age assurance process. - Status string `json:"status"` -} - -func (t *UnspeccedDefs_AgeAssuranceState) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedDefs_AgeAssuranceState) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedDefs_SkeletonSearchActor is a "skeletonSearchActor" in the app.bsky.unspecced.defs schema. -type UnspeccedDefs_SkeletonSearchActor struct { - LexiconTypeID string `json:"$type"` - Did string `json:"did"` -} - -func (t *UnspeccedDefs_SkeletonSearchActor) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedDefs_SkeletonSearchActor) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedDefs_SkeletonSearchPost is a "skeletonSearchPost" in the app.bsky.unspecced.defs schema. -type UnspeccedDefs_SkeletonSearchPost struct { - LexiconTypeID string `json:"$type"` - Uri string `json:"uri"` -} - -func (t *UnspeccedDefs_SkeletonSearchPost) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedDefs_SkeletonSearchPost) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedDefs_SkeletonSearchStarterPack is a "skeletonSearchStarterPack" in the app.bsky.unspecced.defs schema. -type UnspeccedDefs_SkeletonSearchStarterPack struct { - LexiconTypeID string `json:"$type"` - Uri string `json:"uri"` -} - -func (t *UnspeccedDefs_SkeletonSearchStarterPack) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedDefs_SkeletonSearchStarterPack) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedDefs_SkeletonTrend is a "skeletonTrend" in the app.bsky.unspecced.defs schema. -type UnspeccedDefs_SkeletonTrend struct { - LexiconTypeID string `json:"$type"` - Category *string `json:"category,omitempty"` - Dids []string `json:"dids"` - DisplayName string `json:"displayName"` - Link string `json:"link"` - PostCount int64 `json:"postCount"` - StartedAt string `json:"startedAt"` - Status *string `json:"status,omitempty"` - Topic string `json:"topic"` -} - -func (t *UnspeccedDefs_SkeletonTrend) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedDefs_SkeletonTrend) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedDefs_ThreadItemBlocked is a "threadItemBlocked" in the app.bsky.unspecced.defs schema. -type UnspeccedDefs_ThreadItemBlocked struct { - LexiconTypeID string `json:"$type"` - Author FeedDefs_BlockedAuthor `json:"author"` -} - -func (t *UnspeccedDefs_ThreadItemBlocked) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedDefs_ThreadItemBlocked) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedDefs_ThreadItemNoUnauthenticated is a "threadItemNoUnauthenticated" in the app.bsky.unspecced.defs schema. -type UnspeccedDefs_ThreadItemNoUnauthenticated struct { - LexiconTypeID string `json:"$type"` -} - -func (t *UnspeccedDefs_ThreadItemNoUnauthenticated) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedDefs_ThreadItemNoUnauthenticated) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedDefs_ThreadItemNotFound is a "threadItemNotFound" in the app.bsky.unspecced.defs schema. -type UnspeccedDefs_ThreadItemNotFound struct { - LexiconTypeID string `json:"$type"` -} - -func (t *UnspeccedDefs_ThreadItemNotFound) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedDefs_ThreadItemNotFound) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedDefs_ThreadItemPost is a "threadItemPost" in the app.bsky.unspecced.defs schema. -type UnspeccedDefs_ThreadItemPost struct { - LexiconTypeID string `json:"$type"` - // hiddenByThreadgate: The threadgate created by the author indicates this post as a reply to be hidden for everyone consuming the thread. - HiddenByThreadgate bool `json:"hiddenByThreadgate"` - // moreParents: This post has more parents that were not present in the response. This is just a boolean, without the number of parents. - MoreParents bool `json:"moreParents"` - // moreReplies: This post has more replies that were not present in the response. This is a numeric value, which is best-effort and might not be accurate. - MoreReplies int64 `json:"moreReplies"` - // mutedByViewer: This is by an account muted by the viewer requesting it. - MutedByViewer bool `json:"mutedByViewer"` - // opThread: This post is part of a contiguous thread by the OP from the thread root. Many different OP threads can happen in the same thread. - OpThread bool `json:"opThread"` - Post FeedDefs_PostView `json:"post"` -} - -func (t *UnspeccedDefs_ThreadItemPost) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedDefs_ThreadItemPost) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedDefs_TrendView is a "trendView" in the app.bsky.unspecced.defs schema. -type UnspeccedDefs_TrendView struct { - LexiconTypeID string `json:"$type"` - Actors []ActorDefs_ProfileViewBasic `json:"actors"` - Category *string `json:"category,omitempty"` - DisplayName string `json:"displayName"` - Link string `json:"link"` - PostCount int64 `json:"postCount"` - StartedAt string `json:"startedAt"` - Status *string `json:"status,omitempty"` - Topic string `json:"topic"` -} - -func (t *UnspeccedDefs_TrendView) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedDefs_TrendView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedDefs_TrendingTopic is a "trendingTopic" in the app.bsky.unspecced.defs schema. -type UnspeccedDefs_TrendingTopic struct { - LexiconTypeID string `json:"$type"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Link string `json:"link"` - Topic string `json:"topic"` -} - -func (t *UnspeccedDefs_TrendingTopic) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedDefs_TrendingTopic) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/unspeccedgetageassurancestate.go b/pkg/appbsky/unspeccedgetageassurancestate.go deleted file mode 100644 index 5d12f989..00000000 --- a/pkg/appbsky/unspeccedgetageassurancestate.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getAgeAssuranceState - -package appbsky - -import ( - "context" - - glexrt "github.com/streamplace/glex/runtime" -) - -// UnspeccedGetAgeAssuranceState calls the XRPC method "app.bsky.unspecced.getAgeAssuranceState". -// -// Returns the current state of the age assurance process for an account. This is used to check if the user has completed age assurance or if further action is required. -func UnspeccedGetAgeAssuranceState(ctx context.Context, c glexrt.LexClient) (*UnspeccedDefs_AgeAssuranceState, error) { - var out UnspeccedDefs_AgeAssuranceState - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getAgeAssuranceState", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedgetconfig.go b/pkg/appbsky/unspeccedgetconfig.go deleted file mode 100644 index 93f9e6a9..00000000 --- a/pkg/appbsky/unspeccedgetconfig.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getConfig - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetConfig_Output struct { - LexiconTypeID string `json:"$type"` - CheckEmailConfirmed *bool `json:"checkEmailConfirmed,omitempty"` - LiveNow []UnspeccedGetConfig_LiveNowConfig `json:"liveNow,omitempty"` -} - -func (t *UnspeccedGetConfig_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getConfig#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetConfig_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetConfig calls the XRPC method "app.bsky.unspecced.getConfig". -// -// Get miscellaneous runtime configuration. -func UnspeccedGetConfig(ctx context.Context, c glexrt.LexClient) (*UnspeccedGetConfig_Output, error) { - var out UnspeccedGetConfig_Output - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getConfig", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// UnspeccedGetConfig_LiveNowConfig is a "liveNowConfig" in the app.bsky.unspecced.getConfig schema. -type UnspeccedGetConfig_LiveNowConfig struct { - LexiconTypeID string `json:"$type"` - Did string `json:"did"` - Domains []string `json:"domains"` -} - -func (t *UnspeccedGetConfig_LiveNowConfig) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getConfig" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetConfig_LiveNowConfig) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/unspeccedgetonboardingsuggestedstarterpacks.go b/pkg/appbsky/unspeccedgetonboardingsuggestedstarterpacks.go deleted file mode 100644 index a5a004b7..00000000 --- a/pkg/appbsky/unspeccedgetonboardingsuggestedstarterpacks.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getOnboardingSuggestedStarterPacks - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetOnboardingSuggestedStarterPacks_Output struct { - LexiconTypeID string `json:"$type"` - StarterPacks []GraphDefs_StarterPackView `json:"starterPacks"` -} - -func (t *UnspeccedGetOnboardingSuggestedStarterPacks_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getOnboardingSuggestedStarterPacks#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetOnboardingSuggestedStarterPacks_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetOnboardingSuggestedStarterPacks calls the XRPC method "app.bsky.unspecced.getOnboardingSuggestedStarterPacks". -// -// Get a list of suggested starterpacks for onboarding -func UnspeccedGetOnboardingSuggestedStarterPacks(ctx context.Context, c glexrt.LexClient, limit *int64) (*UnspeccedGetOnboardingSuggestedStarterPacks_Output, error) { - var out UnspeccedGetOnboardingSuggestedStarterPacks_Output - - params := map[string]interface{}{} - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getOnboardingSuggestedStarterPacks", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedgetonboardingsuggestedstarterpacksskeleton.go b/pkg/appbsky/unspeccedgetonboardingsuggestedstarterpacksskeleton.go deleted file mode 100644 index 8a41d61e..00000000 --- a/pkg/appbsky/unspeccedgetonboardingsuggestedstarterpacksskeleton.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetOnboardingSuggestedStarterPacksSkeleton_Output struct { - LexiconTypeID string `json:"$type"` - StarterPacks []string `json:"starterPacks"` -} - -func (t *UnspeccedGetOnboardingSuggestedStarterPacksSkeleton_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetOnboardingSuggestedStarterPacksSkeleton_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetOnboardingSuggestedStarterPacksSkeleton calls the XRPC method "app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton". -// -// Get a skeleton of suggested starterpacks for onboarding. Intended to be called and hydrated by app.bsky.unspecced.getOnboardingSuggestedStarterPacks -// -// viewer: DID of the account making the request (not included for public/unauthenticated queries). -func UnspeccedGetOnboardingSuggestedStarterPacksSkeleton(ctx context.Context, c glexrt.LexClient, limit *int64, viewer string) (*UnspeccedGetOnboardingSuggestedStarterPacksSkeleton_Output, error) { - var out UnspeccedGetOnboardingSuggestedStarterPacksSkeleton_Output - - params := map[string]interface{}{} - if limit != nil { - params["limit"] = *limit - } - if viewer != "" { - params["viewer"] = viewer - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getOnboardingSuggestedStarterPacksSkeleton", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedgetpopularfeedgenerators.go b/pkg/appbsky/unspeccedgetpopularfeedgenerators.go deleted file mode 100644 index a9184b38..00000000 --- a/pkg/appbsky/unspeccedgetpopularfeedgenerators.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getPopularFeedGenerators - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetPopularFeedGenerators_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Feeds []FeedDefs_GeneratorView `json:"feeds"` -} - -func (t *UnspeccedGetPopularFeedGenerators_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getPopularFeedGenerators#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetPopularFeedGenerators_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetPopularFeedGenerators calls the XRPC method "app.bsky.unspecced.getPopularFeedGenerators". -// -// An unspecced view of globally popular feed generators. -func UnspeccedGetPopularFeedGenerators(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, query string) (*UnspeccedGetPopularFeedGenerators_Output, error) { - var out UnspeccedGetPopularFeedGenerators_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - if query != "" { - params["query"] = query - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getPopularFeedGenerators", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedgetpostthreadotherv2.go b/pkg/appbsky/unspeccedgetpostthreadotherv2.go deleted file mode 100644 index 3ea41265..00000000 --- a/pkg/appbsky/unspeccedgetpostthreadotherv2.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getPostThreadOtherV2 - -package appbsky - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetPostThreadOtherV2_Output struct { - LexiconTypeID string `json:"$type"` - // thread: A flat list of other thread items. The depth of each item is indicated by the depth property inside the item. - Thread []UnspeccedGetPostThreadOtherV2_ThreadItem `json:"thread"` -} - -func (t *UnspeccedGetPostThreadOtherV2_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getPostThreadOtherV2#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetPostThreadOtherV2_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetPostThreadOtherV2 calls the XRPC method "app.bsky.unspecced.getPostThreadOtherV2". -// -// (NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get additional posts under a thread e.g. replies hidden by threadgate. Based on an anchor post at any depth of the tree, returns top-level replies below that anchor. It does not include ancestors nor the anchor itself. This should be called after exhausting `app.bsky.unspecced.getPostThreadV2`. Does not require auth, but additional metadata and filtering will be applied for authed requests. -// -// anchor: Reference (AT-URI) to post record. This is the anchor post. -func UnspeccedGetPostThreadOtherV2(ctx context.Context, c glexrt.LexClient, anchor string) (*UnspeccedGetPostThreadOtherV2_Output, error) { - var out UnspeccedGetPostThreadOtherV2_Output - - params := map[string]interface{}{} - params["anchor"] = anchor - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getPostThreadOtherV2", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// UnspeccedGetPostThreadOtherV2_ThreadItem is a "threadItem" in the app.bsky.unspecced.getPostThreadOtherV2 schema. -type UnspeccedGetPostThreadOtherV2_ThreadItem struct { - LexiconTypeID string `json:"$type"` - // depth: The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. - Depth int64 `json:"depth"` - Uri string `json:"uri"` - Value UnspeccedGetPostThreadOtherV2_ThreadItem_Value `json:"value"` -} - -func (t *UnspeccedGetPostThreadOtherV2_ThreadItem) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getPostThreadOtherV2" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetPostThreadOtherV2_ThreadItem) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type UnspeccedGetPostThreadOtherV2_ThreadItem_Value struct { - UnspeccedDefs_ThreadItemPost *UnspeccedDefs_ThreadItemPost -} - -func (t *UnspeccedGetPostThreadOtherV2_ThreadItem_Value) MarshalJSON() ([]byte, error) { - if t.UnspeccedDefs_ThreadItemPost != nil { - t.UnspeccedDefs_ThreadItemPost.LexiconTypeID = "app.bsky.unspecced.defs#threadItemPost" - return json.Marshal(t.UnspeccedDefs_ThreadItemPost) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *UnspeccedGetPostThreadOtherV2_ThreadItem_Value) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "app.bsky.unspecced.defs#threadItemPost": - t.UnspeccedDefs_ThreadItemPost = new(UnspeccedDefs_ThreadItemPost) - return json.Unmarshal(b, t.UnspeccedDefs_ThreadItemPost) - default: - return nil - } -} - -func (t *UnspeccedGetPostThreadOtherV2_ThreadItem_Value) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.UnspeccedDefs_ThreadItemPost != nil { - return t.UnspeccedDefs_ThreadItemPost.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *UnspeccedGetPostThreadOtherV2_ThreadItem_Value) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "app.bsky.unspecced.defs#threadItemPost": - t.UnspeccedDefs_ThreadItemPost = new(UnspeccedDefs_ThreadItemPost) - return t.UnspeccedDefs_ThreadItemPost.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} diff --git a/pkg/appbsky/unspeccedgetpostthreadv2.go b/pkg/appbsky/unspeccedgetpostthreadv2.go deleted file mode 100644 index 5fe0aaff..00000000 --- a/pkg/appbsky/unspeccedgetpostthreadv2.go +++ /dev/null @@ -1,189 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getPostThreadV2 - -package appbsky - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetPostThreadV2_Output struct { - LexiconTypeID string `json:"$type"` - // hasOtherReplies: Whether this thread has additional replies. If true, a call can be made to the `getPostThreadOtherV2` endpoint to retrieve them. - HasOtherReplies bool `json:"hasOtherReplies"` - // thread: A flat list of thread items. The depth of each item is indicated by the depth property inside the item. - Thread []UnspeccedGetPostThreadV2_ThreadItem `json:"thread"` - Threadgate *FeedDefs_ThreadgateView `json:"threadgate,omitempty"` -} - -func (t *UnspeccedGetPostThreadV2_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getPostThreadV2#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetPostThreadV2_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetPostThreadV2 calls the XRPC method "app.bsky.unspecced.getPostThreadV2". -// -// (NOTE: this endpoint is under development and WILL change without notice. Don't use it until it is moved out of `unspecced` or your application WILL break) Get posts in a thread. It is based in an anchor post at any depth of the tree, and returns posts above it (recursively resolving the parent, without further branching to their replies) and below it (recursive replies, with branching to their replies). Does not require auth, but additional metadata and filtering will be applied for authed requests. -// -// above: Whether to include parents above the anchor. -// anchor: Reference (AT-URI) to post record. This is the anchor post, and the thread will be built around it. It can be any post in the tree, not necessarily a root post. -// below: How many levels of replies to include below the anchor. -// branchingFactor: Maximum of replies to include at each level of the thread, except for the direct replies to the anchor, which are (NOTE: currently, during unspecced phase) all returned (NOTE: later they might be paginated). -// sort: Sorting for the thread replies. -func UnspeccedGetPostThreadV2(ctx context.Context, c glexrt.LexClient, above *bool, anchor string, below *int64, branchingFactor *int64, sort string) (*UnspeccedGetPostThreadV2_Output, error) { - var out UnspeccedGetPostThreadV2_Output - - params := map[string]interface{}{} - if above != nil { - params["above"] = *above - } - if below != nil { - params["below"] = *below - } - if branchingFactor != nil { - params["branchingFactor"] = *branchingFactor - } - if sort != "" { - params["sort"] = sort - } - params["anchor"] = anchor - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getPostThreadV2", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// UnspeccedGetPostThreadV2_ThreadItem is a "threadItem" in the app.bsky.unspecced.getPostThreadV2 schema. -type UnspeccedGetPostThreadV2_ThreadItem struct { - LexiconTypeID string `json:"$type"` - // depth: The nesting level of this item in the thread. Depth 0 means the anchor item. Items above have negative depths, items below have positive depths. - Depth int64 `json:"depth"` - Uri string `json:"uri"` - Value UnspeccedGetPostThreadV2_ThreadItem_Value `json:"value"` -} - -func (t *UnspeccedGetPostThreadV2_ThreadItem) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getPostThreadV2" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetPostThreadV2_ThreadItem) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type UnspeccedGetPostThreadV2_ThreadItem_Value struct { - UnspeccedDefs_ThreadItemBlocked *UnspeccedDefs_ThreadItemBlocked - UnspeccedDefs_ThreadItemNoUnauthenticated *UnspeccedDefs_ThreadItemNoUnauthenticated - UnspeccedDefs_ThreadItemNotFound *UnspeccedDefs_ThreadItemNotFound - UnspeccedDefs_ThreadItemPost *UnspeccedDefs_ThreadItemPost -} - -func (t *UnspeccedGetPostThreadV2_ThreadItem_Value) MarshalJSON() ([]byte, error) { - if t.UnspeccedDefs_ThreadItemBlocked != nil { - t.UnspeccedDefs_ThreadItemBlocked.LexiconTypeID = "app.bsky.unspecced.defs#threadItemBlocked" - return json.Marshal(t.UnspeccedDefs_ThreadItemBlocked) - } - if t.UnspeccedDefs_ThreadItemNoUnauthenticated != nil { - t.UnspeccedDefs_ThreadItemNoUnauthenticated.LexiconTypeID = "app.bsky.unspecced.defs#threadItemNoUnauthenticated" - return json.Marshal(t.UnspeccedDefs_ThreadItemNoUnauthenticated) - } - if t.UnspeccedDefs_ThreadItemNotFound != nil { - t.UnspeccedDefs_ThreadItemNotFound.LexiconTypeID = "app.bsky.unspecced.defs#threadItemNotFound" - return json.Marshal(t.UnspeccedDefs_ThreadItemNotFound) - } - if t.UnspeccedDefs_ThreadItemPost != nil { - t.UnspeccedDefs_ThreadItemPost.LexiconTypeID = "app.bsky.unspecced.defs#threadItemPost" - return json.Marshal(t.UnspeccedDefs_ThreadItemPost) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *UnspeccedGetPostThreadV2_ThreadItem_Value) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "app.bsky.unspecced.defs#threadItemBlocked": - t.UnspeccedDefs_ThreadItemBlocked = new(UnspeccedDefs_ThreadItemBlocked) - return json.Unmarshal(b, t.UnspeccedDefs_ThreadItemBlocked) - case "app.bsky.unspecced.defs#threadItemNoUnauthenticated": - t.UnspeccedDefs_ThreadItemNoUnauthenticated = new(UnspeccedDefs_ThreadItemNoUnauthenticated) - return json.Unmarshal(b, t.UnspeccedDefs_ThreadItemNoUnauthenticated) - case "app.bsky.unspecced.defs#threadItemNotFound": - t.UnspeccedDefs_ThreadItemNotFound = new(UnspeccedDefs_ThreadItemNotFound) - return json.Unmarshal(b, t.UnspeccedDefs_ThreadItemNotFound) - case "app.bsky.unspecced.defs#threadItemPost": - t.UnspeccedDefs_ThreadItemPost = new(UnspeccedDefs_ThreadItemPost) - return json.Unmarshal(b, t.UnspeccedDefs_ThreadItemPost) - default: - return nil - } -} - -func (t *UnspeccedGetPostThreadV2_ThreadItem_Value) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.UnspeccedDefs_ThreadItemBlocked != nil { - return t.UnspeccedDefs_ThreadItemBlocked.MarshalCBOR(w) - } - if t.UnspeccedDefs_ThreadItemNoUnauthenticated != nil { - return t.UnspeccedDefs_ThreadItemNoUnauthenticated.MarshalCBOR(w) - } - if t.UnspeccedDefs_ThreadItemNotFound != nil { - return t.UnspeccedDefs_ThreadItemNotFound.MarshalCBOR(w) - } - if t.UnspeccedDefs_ThreadItemPost != nil { - return t.UnspeccedDefs_ThreadItemPost.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *UnspeccedGetPostThreadV2_ThreadItem_Value) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "app.bsky.unspecced.defs#threadItemBlocked": - t.UnspeccedDefs_ThreadItemBlocked = new(UnspeccedDefs_ThreadItemBlocked) - return t.UnspeccedDefs_ThreadItemBlocked.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.unspecced.defs#threadItemNoUnauthenticated": - t.UnspeccedDefs_ThreadItemNoUnauthenticated = new(UnspeccedDefs_ThreadItemNoUnauthenticated) - return t.UnspeccedDefs_ThreadItemNoUnauthenticated.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.unspecced.defs#threadItemNotFound": - t.UnspeccedDefs_ThreadItemNotFound = new(UnspeccedDefs_ThreadItemNotFound) - return t.UnspeccedDefs_ThreadItemNotFound.UnmarshalCBOR(bytes.NewReader(b)) - case "app.bsky.unspecced.defs#threadItemPost": - t.UnspeccedDefs_ThreadItemPost = new(UnspeccedDefs_ThreadItemPost) - return t.UnspeccedDefs_ThreadItemPost.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} diff --git a/pkg/appbsky/unspeccedgetsuggestedfeeds.go b/pkg/appbsky/unspeccedgetsuggestedfeeds.go deleted file mode 100644 index e8700049..00000000 --- a/pkg/appbsky/unspeccedgetsuggestedfeeds.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getSuggestedFeeds - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetSuggestedFeeds_Output struct { - LexiconTypeID string `json:"$type"` - Feeds []FeedDefs_GeneratorView `json:"feeds"` -} - -func (t *UnspeccedGetSuggestedFeeds_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getSuggestedFeeds#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetSuggestedFeeds_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetSuggestedFeeds calls the XRPC method "app.bsky.unspecced.getSuggestedFeeds". -// -// Get a list of suggested feeds -func UnspeccedGetSuggestedFeeds(ctx context.Context, c glexrt.LexClient, limit *int64) (*UnspeccedGetSuggestedFeeds_Output, error) { - var out UnspeccedGetSuggestedFeeds_Output - - params := map[string]interface{}{} - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getSuggestedFeeds", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedgetsuggestedfeedsskeleton.go b/pkg/appbsky/unspeccedgetsuggestedfeedsskeleton.go deleted file mode 100644 index a017804d..00000000 --- a/pkg/appbsky/unspeccedgetsuggestedfeedsskeleton.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getSuggestedFeedsSkeleton - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetSuggestedFeedsSkeleton_Output struct { - LexiconTypeID string `json:"$type"` - Feeds []string `json:"feeds"` -} - -func (t *UnspeccedGetSuggestedFeedsSkeleton_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getSuggestedFeedsSkeleton#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetSuggestedFeedsSkeleton_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetSuggestedFeedsSkeleton calls the XRPC method "app.bsky.unspecced.getSuggestedFeedsSkeleton". -// -// Get a skeleton of suggested feeds. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedFeeds -// -// viewer: DID of the account making the request (not included for public/unauthenticated queries). -func UnspeccedGetSuggestedFeedsSkeleton(ctx context.Context, c glexrt.LexClient, limit *int64, viewer string) (*UnspeccedGetSuggestedFeedsSkeleton_Output, error) { - var out UnspeccedGetSuggestedFeedsSkeleton_Output - - params := map[string]interface{}{} - if limit != nil { - params["limit"] = *limit - } - if viewer != "" { - params["viewer"] = viewer - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getSuggestedFeedsSkeleton", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedgetsuggestedstarterpacks.go b/pkg/appbsky/unspeccedgetsuggestedstarterpacks.go deleted file mode 100644 index 4911d346..00000000 --- a/pkg/appbsky/unspeccedgetsuggestedstarterpacks.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getSuggestedStarterPacks - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetSuggestedStarterPacks_Output struct { - LexiconTypeID string `json:"$type"` - StarterPacks []GraphDefs_StarterPackView `json:"starterPacks"` -} - -func (t *UnspeccedGetSuggestedStarterPacks_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getSuggestedStarterPacks#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetSuggestedStarterPacks_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetSuggestedStarterPacks calls the XRPC method "app.bsky.unspecced.getSuggestedStarterPacks". -// -// Get a list of suggested starterpacks -func UnspeccedGetSuggestedStarterPacks(ctx context.Context, c glexrt.LexClient, limit *int64) (*UnspeccedGetSuggestedStarterPacks_Output, error) { - var out UnspeccedGetSuggestedStarterPacks_Output - - params := map[string]interface{}{} - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getSuggestedStarterPacks", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedgetsuggestedstarterpacksskeleton.go b/pkg/appbsky/unspeccedgetsuggestedstarterpacksskeleton.go deleted file mode 100644 index 5bc6016f..00000000 --- a/pkg/appbsky/unspeccedgetsuggestedstarterpacksskeleton.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getSuggestedStarterPacksSkeleton - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetSuggestedStarterPacksSkeleton_Output struct { - LexiconTypeID string `json:"$type"` - StarterPacks []string `json:"starterPacks"` -} - -func (t *UnspeccedGetSuggestedStarterPacksSkeleton_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getSuggestedStarterPacksSkeleton#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetSuggestedStarterPacksSkeleton_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetSuggestedStarterPacksSkeleton calls the XRPC method "app.bsky.unspecced.getSuggestedStarterPacksSkeleton". -// -// Get a skeleton of suggested starterpacks. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedStarterpacks -// -// viewer: DID of the account making the request (not included for public/unauthenticated queries). -func UnspeccedGetSuggestedStarterPacksSkeleton(ctx context.Context, c glexrt.LexClient, limit *int64, viewer string) (*UnspeccedGetSuggestedStarterPacksSkeleton_Output, error) { - var out UnspeccedGetSuggestedStarterPacksSkeleton_Output - - params := map[string]interface{}{} - if limit != nil { - params["limit"] = *limit - } - if viewer != "" { - params["viewer"] = viewer - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getSuggestedStarterPacksSkeleton", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedgetsuggestedusers.go b/pkg/appbsky/unspeccedgetsuggestedusers.go deleted file mode 100644 index 119a766b..00000000 --- a/pkg/appbsky/unspeccedgetsuggestedusers.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getSuggestedUsers - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetSuggestedUsers_Output struct { - LexiconTypeID string `json:"$type"` - Actors []ActorDefs_ProfileView `json:"actors"` -} - -func (t *UnspeccedGetSuggestedUsers_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getSuggestedUsers#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetSuggestedUsers_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetSuggestedUsers calls the XRPC method "app.bsky.unspecced.getSuggestedUsers". -// -// # Get a list of suggested users -// -// category: Category of users to get suggestions for. -func UnspeccedGetSuggestedUsers(ctx context.Context, c glexrt.LexClient, category string, limit *int64) (*UnspeccedGetSuggestedUsers_Output, error) { - var out UnspeccedGetSuggestedUsers_Output - - params := map[string]interface{}{} - if category != "" { - params["category"] = category - } - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getSuggestedUsers", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedgetsuggestedusersskeleton.go b/pkg/appbsky/unspeccedgetsuggestedusersskeleton.go deleted file mode 100644 index b4708b52..00000000 --- a/pkg/appbsky/unspeccedgetsuggestedusersskeleton.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getSuggestedUsersSkeleton - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetSuggestedUsersSkeleton_Output struct { - LexiconTypeID string `json:"$type"` - Dids []string `json:"dids"` -} - -func (t *UnspeccedGetSuggestedUsersSkeleton_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getSuggestedUsersSkeleton#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetSuggestedUsersSkeleton_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetSuggestedUsersSkeleton calls the XRPC method "app.bsky.unspecced.getSuggestedUsersSkeleton". -// -// Get a skeleton of suggested users. Intended to be called and hydrated by app.bsky.unspecced.getSuggestedUsers -// -// category: Category of users to get suggestions for. -// viewer: DID of the account making the request (not included for public/unauthenticated queries). -func UnspeccedGetSuggestedUsersSkeleton(ctx context.Context, c glexrt.LexClient, category string, limit *int64, viewer string) (*UnspeccedGetSuggestedUsersSkeleton_Output, error) { - var out UnspeccedGetSuggestedUsersSkeleton_Output - - params := map[string]interface{}{} - if category != "" { - params["category"] = category - } - if limit != nil { - params["limit"] = *limit - } - if viewer != "" { - params["viewer"] = viewer - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getSuggestedUsersSkeleton", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedgetsuggestionsskeleton.go b/pkg/appbsky/unspeccedgetsuggestionsskeleton.go deleted file mode 100644 index 6232c263..00000000 --- a/pkg/appbsky/unspeccedgetsuggestionsskeleton.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getSuggestionsSkeleton - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetSuggestionsSkeleton_Output struct { - LexiconTypeID string `json:"$type"` - Actors []UnspeccedDefs_SkeletonSearchActor `json:"actors"` - Cursor *string `json:"cursor,omitempty"` - // recId: Snowflake for this recommendation, use when submitting recommendation events. - RecId *int64 `json:"recId,omitempty"` - // relativeToDid: DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer. - RelativeToDid *string `json:"relativeToDid,omitempty"` -} - -func (t *UnspeccedGetSuggestionsSkeleton_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getSuggestionsSkeleton#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetSuggestionsSkeleton_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetSuggestionsSkeleton calls the XRPC method "app.bsky.unspecced.getSuggestionsSkeleton". -// -// Get a skeleton of suggested actors. Intended to be called and then hydrated through app.bsky.actor.getSuggestions -// -// relativeToDid: DID of the account to get suggestions relative to. If not provided, suggestions will be based on the viewer. -// viewer: DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. -func UnspeccedGetSuggestionsSkeleton(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, relativeToDid string, viewer string) (*UnspeccedGetSuggestionsSkeleton_Output, error) { - var out UnspeccedGetSuggestionsSkeleton_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - if relativeToDid != "" { - params["relativeToDid"] = relativeToDid - } - if viewer != "" { - params["viewer"] = viewer - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getSuggestionsSkeleton", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedgettaggedsuggestions.go b/pkg/appbsky/unspeccedgettaggedsuggestions.go deleted file mode 100644 index 48139408..00000000 --- a/pkg/appbsky/unspeccedgettaggedsuggestions.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getTaggedSuggestions - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetTaggedSuggestions_Output struct { - LexiconTypeID string `json:"$type"` - Suggestions []UnspeccedGetTaggedSuggestions_Suggestion `json:"suggestions"` -} - -func (t *UnspeccedGetTaggedSuggestions_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getTaggedSuggestions#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetTaggedSuggestions_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetTaggedSuggestions calls the XRPC method "app.bsky.unspecced.getTaggedSuggestions". -// -// Get a list of suggestions (feeds and users) tagged with categories -func UnspeccedGetTaggedSuggestions(ctx context.Context, c glexrt.LexClient) (*UnspeccedGetTaggedSuggestions_Output, error) { - var out UnspeccedGetTaggedSuggestions_Output - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getTaggedSuggestions", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// UnspeccedGetTaggedSuggestions_Suggestion is a "suggestion" in the app.bsky.unspecced.getTaggedSuggestions schema. -type UnspeccedGetTaggedSuggestions_Suggestion struct { - LexiconTypeID string `json:"$type"` - Subject string `json:"subject"` - SubjectType string `json:"subjectType"` - Tag string `json:"tag"` -} - -func (t *UnspeccedGetTaggedSuggestions_Suggestion) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getTaggedSuggestions" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetTaggedSuggestions_Suggestion) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/unspeccedgettrendingtopics.go b/pkg/appbsky/unspeccedgettrendingtopics.go deleted file mode 100644 index 9f515d15..00000000 --- a/pkg/appbsky/unspeccedgettrendingtopics.go +++ /dev/null @@ -1,54 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getTrendingTopics - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetTrendingTopics_Output struct { - LexiconTypeID string `json:"$type"` - Suggested []UnspeccedDefs_TrendingTopic `json:"suggested"` - Topics []UnspeccedDefs_TrendingTopic `json:"topics"` -} - -func (t *UnspeccedGetTrendingTopics_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getTrendingTopics#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetTrendingTopics_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetTrendingTopics calls the XRPC method "app.bsky.unspecced.getTrendingTopics". -// -// # Get a list of trending topics -// -// viewer: DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. -func UnspeccedGetTrendingTopics(ctx context.Context, c glexrt.LexClient, limit *int64, viewer string) (*UnspeccedGetTrendingTopics_Output, error) { - var out UnspeccedGetTrendingTopics_Output - - params := map[string]interface{}{} - if limit != nil { - params["limit"] = *limit - } - if viewer != "" { - params["viewer"] = viewer - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getTrendingTopics", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedgettrends.go b/pkg/appbsky/unspeccedgettrends.go deleted file mode 100644 index 93052e0c..00000000 --- a/pkg/appbsky/unspeccedgettrends.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getTrends - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetTrends_Output struct { - LexiconTypeID string `json:"$type"` - Trends []UnspeccedDefs_TrendView `json:"trends"` -} - -func (t *UnspeccedGetTrends_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getTrends#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetTrends_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetTrends calls the XRPC method "app.bsky.unspecced.getTrends". -// -// Get the current trends on the network -func UnspeccedGetTrends(ctx context.Context, c glexrt.LexClient, limit *int64) (*UnspeccedGetTrends_Output, error) { - var out UnspeccedGetTrends_Output - - params := map[string]interface{}{} - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getTrends", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedgettrendsskeleton.go b/pkg/appbsky/unspeccedgettrendsskeleton.go deleted file mode 100644 index e6ad23af..00000000 --- a/pkg/appbsky/unspeccedgettrendsskeleton.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.getTrendsSkeleton - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedGetTrendsSkeleton_Output struct { - LexiconTypeID string `json:"$type"` - Trends []UnspeccedDefs_SkeletonTrend `json:"trends"` -} - -func (t *UnspeccedGetTrendsSkeleton_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.getTrendsSkeleton#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedGetTrendsSkeleton_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedGetTrendsSkeleton calls the XRPC method "app.bsky.unspecced.getTrendsSkeleton". -// -// Get the skeleton of trends on the network. Intended to be called and then hydrated through app.bsky.unspecced.getTrends -// -// viewer: DID of the account making the request (not included for public/unauthenticated queries). -func UnspeccedGetTrendsSkeleton(ctx context.Context, c glexrt.LexClient, limit *int64, viewer string) (*UnspeccedGetTrendsSkeleton_Output, error) { - var out UnspeccedGetTrendsSkeleton_Output - - params := map[string]interface{}{} - if limit != nil { - params["limit"] = *limit - } - if viewer != "" { - params["viewer"] = viewer - } - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.getTrendsSkeleton", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedinitageassurance.go b/pkg/appbsky/unspeccedinitageassurance.go deleted file mode 100644 index ac2cd4f7..00000000 --- a/pkg/appbsky/unspeccedinitageassurance.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.initAgeAssurance - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedInitAgeAssurance_Input struct { - LexiconTypeID string `json:"$type"` - // countryCode: An ISO 3166-1 alpha-2 code of the user's location. - CountryCode string `json:"countryCode"` - // email: The user's email address to receive assurance instructions. - Email string `json:"email"` - // language: The user's preferred language for communication during the assurance process. - Language string `json:"language"` -} - -func (t *UnspeccedInitAgeAssurance_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.initAgeAssurance#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedInitAgeAssurance_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedInitAgeAssurance calls the XRPC method "app.bsky.unspecced.initAgeAssurance". -// -// Initiate age assurance for an account. This is a one-time action that will start the process of verifying the user's age. -func UnspeccedInitAgeAssurance(ctx context.Context, c glexrt.LexClient, input *UnspeccedInitAgeAssurance_Input) (*UnspeccedDefs_AgeAssuranceState, error) { - var out UnspeccedDefs_AgeAssuranceState - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "app.bsky.unspecced.initAgeAssurance", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedsearchactorsskeleton.go b/pkg/appbsky/unspeccedsearchactorsskeleton.go deleted file mode 100644 index d547790e..00000000 --- a/pkg/appbsky/unspeccedsearchactorsskeleton.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.searchActorsSkeleton - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedSearchActorsSkeleton_Output struct { - LexiconTypeID string `json:"$type"` - Actors []UnspeccedDefs_SkeletonSearchActor `json:"actors"` - Cursor *string `json:"cursor,omitempty"` - // hitsTotal: Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. - HitsTotal *int64 `json:"hitsTotal,omitempty"` -} - -func (t *UnspeccedSearchActorsSkeleton_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.searchActorsSkeleton#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedSearchActorsSkeleton_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedSearchActorsSkeleton calls the XRPC method "app.bsky.unspecced.searchActorsSkeleton". -// -// Backend Actors (profile) search, returns only skeleton. -// -// cursor: Optional pagination mechanism; may not necessarily allow scrolling through entire result set. -// q: Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. For typeahead search, only simple term match is supported, not full syntax. -// typeahead: If true, acts as fast/simple 'typeahead' query. -// viewer: DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. -func UnspeccedSearchActorsSkeleton(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, q string, typeahead *bool, viewer string) (*UnspeccedSearchActorsSkeleton_Output, error) { - var out UnspeccedSearchActorsSkeleton_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - if typeahead != nil { - params["typeahead"] = *typeahead - } - if viewer != "" { - params["viewer"] = viewer - } - params["q"] = q - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.searchActorsSkeleton", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedsearchpostsskeleton.go b/pkg/appbsky/unspeccedsearchpostsskeleton.go deleted file mode 100644 index 7faaafda..00000000 --- a/pkg/appbsky/unspeccedsearchpostsskeleton.go +++ /dev/null @@ -1,98 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.searchPostsSkeleton - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedSearchPostsSkeleton_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - // hitsTotal: Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. - HitsTotal *int64 `json:"hitsTotal,omitempty"` - Posts []UnspeccedDefs_SkeletonSearchPost `json:"posts"` -} - -func (t *UnspeccedSearchPostsSkeleton_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.searchPostsSkeleton#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedSearchPostsSkeleton_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedSearchPostsSkeleton calls the XRPC method "app.bsky.unspecced.searchPostsSkeleton". -// -// # Backend Posts search, returns only skeleton -// -// author: Filter to posts by the given account. Handles are resolved to DID before query-time. -// cursor: Optional pagination mechanism; may not necessarily allow scrolling through entire result set. -// domain: Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization. -// lang: Filter to posts in the given language. Expected to be based on post language field, though server may override language detection. -// mentions: Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions. -// q: Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. -// since: Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD). -// sort: Specifies the ranking order of results. -// tag[]: Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching. -// until: Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD). -// url: Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching. -// viewer: DID of the account making the request (not included for public/unauthenticated queries). Used for 'from:me' queries. -func UnspeccedSearchPostsSkeleton(ctx context.Context, c glexrt.LexClient, author string, cursor string, domain string, lang string, limit *int64, mentions string, q string, since string, sort string, tag []string, until string, url string, viewer string) (*UnspeccedSearchPostsSkeleton_Output, error) { - var out UnspeccedSearchPostsSkeleton_Output - - params := map[string]interface{}{} - if author != "" { - params["author"] = author - } - if cursor != "" { - params["cursor"] = cursor - } - if domain != "" { - params["domain"] = domain - } - if lang != "" { - params["lang"] = lang - } - if limit != nil { - params["limit"] = *limit - } - if mentions != "" { - params["mentions"] = mentions - } - if since != "" { - params["since"] = since - } - if sort != "" { - params["sort"] = sort - } - if len(tag) != 0 { - params["tag"] = tag - } - if until != "" { - params["until"] = until - } - if url != "" { - params["url"] = url - } - if viewer != "" { - params["viewer"] = viewer - } - params["q"] = q - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.searchPostsSkeleton", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/unspeccedsearchstarterpacksskeleton.go b/pkg/appbsky/unspeccedsearchstarterpacksskeleton.go deleted file mode 100644 index fb83e829..00000000 --- a/pkg/appbsky/unspeccedsearchstarterpacksskeleton.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.unspecced.searchStarterPacksSkeleton - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type UnspeccedSearchStarterPacksSkeleton_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - // hitsTotal: Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. - HitsTotal *int64 `json:"hitsTotal,omitempty"` - StarterPacks []UnspeccedDefs_SkeletonSearchStarterPack `json:"starterPacks"` -} - -func (t *UnspeccedSearchStarterPacksSkeleton_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.unspecced.searchStarterPacksSkeleton#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *UnspeccedSearchStarterPacksSkeleton_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// UnspeccedSearchStarterPacksSkeleton calls the XRPC method "app.bsky.unspecced.searchStarterPacksSkeleton". -// -// Backend Starter Pack search, returns only skeleton. -// -// cursor: Optional pagination mechanism; may not necessarily allow scrolling through entire result set. -// q: Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. -// viewer: DID of the account making the request (not included for public/unauthenticated queries). -func UnspeccedSearchStarterPacksSkeleton(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, q string, viewer string) (*UnspeccedSearchStarterPacksSkeleton_Output, error) { - var out UnspeccedSearchStarterPacksSkeleton_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - if viewer != "" { - params["viewer"] = viewer - } - params["q"] = q - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.unspecced.searchStarterPacksSkeleton", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/videodefs.go b/pkg/appbsky/videodefs.go deleted file mode 100644 index 86627c43..00000000 --- a/pkg/appbsky/videodefs.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.video.defs - -package appbsky - -import ( - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -// VideoDefs_JobStatus is a "jobStatus" in the app.bsky.video.defs schema. -type VideoDefs_JobStatus struct { - LexiconTypeID string `json:"$type"` - Blob *glexrt.Blob `json:"blob,omitempty"` - Did string `json:"did"` - Error *string `json:"error,omitempty"` - JobId string `json:"jobId"` - Message *string `json:"message,omitempty"` - // progress: Progress within the current processing state. - Progress *int64 `json:"progress,omitempty"` - // state: The state of the video processing job. All values not listed as a known value indicate that the job is in process. - State string `json:"state"` -} - -func (t *VideoDefs_JobStatus) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.video.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *VideoDefs_JobStatus) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/appbsky/videogetjobstatus.go b/pkg/appbsky/videogetjobstatus.go deleted file mode 100644 index c67cc15d..00000000 --- a/pkg/appbsky/videogetjobstatus.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.video.getJobStatus - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type VideoGetJobStatus_Output struct { - LexiconTypeID string `json:"$type"` - JobStatus VideoDefs_JobStatus `json:"jobStatus"` -} - -func (t *VideoGetJobStatus_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.video.getJobStatus#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *VideoGetJobStatus_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// VideoGetJobStatus calls the XRPC method "app.bsky.video.getJobStatus". -// -// Get status details for a video processing job. -func VideoGetJobStatus(ctx context.Context, c glexrt.LexClient, jobId string) (*VideoGetJobStatus_Output, error) { - var out VideoGetJobStatus_Output - - params := map[string]interface{}{} - params["jobId"] = jobId - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.video.getJobStatus", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/videogetuploadlimits.go b/pkg/appbsky/videogetuploadlimits.go deleted file mode 100644 index 460cd601..00000000 --- a/pkg/appbsky/videogetuploadlimits.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.video.getUploadLimits - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type VideoGetUploadLimits_Output struct { - LexiconTypeID string `json:"$type"` - CanUpload bool `json:"canUpload"` - Error *string `json:"error,omitempty"` - Message *string `json:"message,omitempty"` - RemainingDailyBytes *int64 `json:"remainingDailyBytes,omitempty"` - RemainingDailyVideos *int64 `json:"remainingDailyVideos,omitempty"` -} - -func (t *VideoGetUploadLimits_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.video.getUploadLimits#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *VideoGetUploadLimits_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// VideoGetUploadLimits calls the XRPC method "app.bsky.video.getUploadLimits". -// -// Get video upload limits for the authenticated user. -func VideoGetUploadLimits(ctx context.Context, c glexrt.LexClient) (*VideoGetUploadLimits_Output, error) { - var out VideoGetUploadLimits_Output - - if err := c.LexDo(ctx, glexrt.Query, "", "app.bsky.video.getUploadLimits", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/appbsky/videouploadvideo.go b/pkg/appbsky/videouploadvideo.go deleted file mode 100644 index 8e3d8e37..00000000 --- a/pkg/appbsky/videouploadvideo.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: app.bsky.video.uploadVideo - -package appbsky - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type VideoUploadVideo_Output struct { - LexiconTypeID string `json:"$type"` - JobStatus VideoDefs_JobStatus `json:"jobStatus"` -} - -func (t *VideoUploadVideo_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "app.bsky.video.uploadVideo#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *VideoUploadVideo_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// VideoUploadVideo calls the XRPC method "app.bsky.video.uploadVideo". -// -// Upload a video to be processed then stored on the PDS. -func VideoUploadVideo(ctx context.Context, c glexrt.LexClient, input io.Reader) (*VideoUploadVideo_Output, error) { - var out VideoUploadVideo_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "video/mp4", "app.bsky.video.uploadVideo", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/atproto/badges_test.go b/pkg/atproto/badges_test.go index 0805d819..2bcb8c7e 100644 --- a/pkg/atproto/badges_test.go +++ b/pkg/atproto/badges_test.go @@ -8,7 +8,7 @@ import ( "github.com/bluesky-social/indigo/atproto/syntax" "github.com/bluesky-social/indigo/util" "github.com/stretchr/testify/require" - bsky "stream.place/streamplace/pkg/appbsky" + appbsky "stream.place/streamplace/pkg/appbsky" "stream.place/streamplace/pkg/constants" "stream.place/streamplace/pkg/model" "stream.place/streamplace/pkg/placestream" @@ -37,14 +37,14 @@ func TestAddModBadge(t *testing.T) { } t.Run("no badge when user is not a moderator", func(t *testing.T) { - msg := *message // copy + msg := message // copy err := AddModBadgeIfApplicable(ctx, &msg, streamerDID, issuerDID, mod) require.NoError(t, err) require.Nil(t, msg.Badges, "should not have badges when user is not a moderator") }) t.Run("adds streamer badge when user is the streamer", func(t *testing.T) { - msg := *message // copy + msg := message // copy msg.Author = appbsky.ActorDefs_ProfileViewBasic{ Did: streamerDID, Handle: "streamer.test", @@ -72,7 +72,7 @@ func TestAddModBadge(t *testing.T) { err = mod.CreateModerationDelegation(ctx, perm, aturi) require.NoError(t, err) - msg := *message // copy + msg := message // copy err = AddModBadgeIfApplicable(ctx, &msg, streamerDID, issuerDID, mod) require.NoError(t, err) require.Len(t, msg.Badges, 1, "should have 1 badge when user is a moderator") @@ -83,7 +83,7 @@ func TestAddModBadge(t *testing.T) { t.Run("prepends mod badge to existing badges", func(t *testing.T) { // Create message with existing user-settable badge - msg := *message // copy + msg := message // copy msg.Badges = []placestream.BadgeDefs_BadgeView{ { BadgeType: constants.BadgeTypeVIP, diff --git a/pkg/atproto/chat_message_test.go b/pkg/atproto/chat_message_test.go index 38146107..278758fa 100644 --- a/pkg/atproto/chat_message_test.go +++ b/pkg/atproto/chat_message_test.go @@ -10,7 +10,7 @@ import ( "github.com/bluesky-social/indigo/util" "github.com/cenkalti/backoff" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "github.com/stretchr/testify/require" "stream.place/streamplace/pkg/bus" "stream.place/streamplace/pkg/comatproto" @@ -78,7 +78,7 @@ func TestChatMessage(t *testing.T) { rec1, err := comatproto.RepoCreateRecord(ctx, user.XRPC, &comatproto.RepoCreateRecord_Input{ Collection: "place.stream.chat.message", Repo: user.DID, - Record: &glexrt.LexiconTypeDecoder{Val: msg}, + Record: &glex.LexiconTypeDecoder{Val: &msg}, }) require.NoError(t, err) @@ -92,7 +92,7 @@ func TestChatMessage(t *testing.T) { _, err = comatproto.RepoCreateRecord(ctx, user2.XRPC, &comatproto.RepoCreateRecord_Input{ Collection: "place.stream.chat.message", Repo: user2.DID, - Record: &glexrt.LexiconTypeDecoder{Val: msg2}, + Record: &glex.LexiconTypeDecoder{Val: &msg2}, }) require.NoError(t, err) @@ -111,7 +111,7 @@ func TestChatMessage(t *testing.T) { return nil }) // Reverse the messages slice to match expected order (most recent first) - slices.SortFunc(messages, func(a, b *placestream.ChatDefs_MessageView) int { + slices.SortFunc(messages, func(a, b placestream.ChatDefs_MessageView) int { aTime := a.Record.Val.(*placestream.ChatMessage).CreatedAt bTime := b.Record.Val.(*placestream.ChatMessage).CreatedAt if aTime < bTime { diff --git a/pkg/atproto/firehose.go b/pkg/atproto/firehose.go index 6aac4447..f1a29fa6 100644 --- a/pkg/atproto/firehose.go +++ b/pkg/atproto/firehose.go @@ -20,7 +20,7 @@ import ( "github.com/bluesky-social/indigo/repo" "github.com/bluesky-social/indigo/repomgr" "github.com/ipfs/go-cid" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "github.com/streamplace/oatproxy/pkg/oatproxy" "golang.org/x/sync/errgroup" "stream.place/streamplace/pkg/aqhttp" @@ -446,7 +446,7 @@ func (atsync *ATProtoSynchronizer) handleCommitEventOps(ctx context.Context, evt log.Error(ctx, "reading record from event blocks (CAR)", "err", err) break } - if !op.Cid.Defined() || glexrt.Link(rc) != glexrt.Link(cid.Cid(*op.Cid)) { + if !op.Cid.Defined() || glex.Link(rc) != glex.Link(cid.Cid(*op.Cid)) { log.Error(ctx, "mismatch between commit op CID and record block", "recordCID", rc, "opCID", op.Cid) break } diff --git a/pkg/atproto/firehose_moq_test.go b/pkg/atproto/firehose_moq_test.go index 0a90afcd..59e60042 100644 --- a/pkg/atproto/firehose_moq_test.go +++ b/pkg/atproto/firehose_moq_test.go @@ -11,7 +11,7 @@ import ( "github.com/bluesky-social/indigo/events/schedulers/parallel" "github.com/ipfs/go-cid" atmoq "github.com/streamplace/atmoq-go" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "github.com/stretchr/testify/require" "stream.place/streamplace/pkg/comatproto" "stream.place/streamplace/pkg/model" @@ -49,11 +49,11 @@ func TestDispatchMoqFrameCommit(t *testing.T) { Seq: 42, Repo: "did:plc:abc123", Rev: "rev1", - Commit: glexrt.Link(mustCID(t)), + Commit: glex.Link(mustCID(t)), Time: "2026-06-25T00:00:00Z", - Blocks: glexrt.Bytes{}, - Ops: []*comatproto.SyncSubscribeRepos_RepoOp{}, - Blobs: []glexrt.Link{}, + Blocks: glex.Bytes{}, + Ops: []comatproto.SyncSubscribeRepos_RepoOp{}, + Blobs: []glex.Link{}, } require.NoError(t, commit.MarshalCBOR(&buf)) diff --git a/pkg/atproto/firehose_multirelay_test.go b/pkg/atproto/firehose_multirelay_test.go index 8a3239b8..027b9143 100644 --- a/pkg/atproto/firehose_multirelay_test.go +++ b/pkg/atproto/firehose_multirelay_test.go @@ -9,7 +9,7 @@ import ( "github.com/bluesky-social/indigo/util" "github.com/prometheus/client_golang/prometheus" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "github.com/stretchr/testify/require" "stream.place/streamplace/pkg/bus" "stream.place/streamplace/pkg/comatproto" @@ -78,7 +78,7 @@ func TestMultiRelayDedup(t *testing.T) { _, err = comatproto.RepoCreateRecord(ctx, user.XRPC, &comatproto.RepoCreateRecord_Input{ Collection: "place.stream.chat.message", Repo: user.DID, - Record: &glexrt.LexiconTypeDecoder{Val: msg}, + Record: &glex.LexiconTypeDecoder{Val: &msg}, }) require.NoError(t, err) diff --git a/pkg/atproto/handle_test.go b/pkg/atproto/handle_test.go index 3c03c03b..9e8faf1e 100644 --- a/pkg/atproto/handle_test.go +++ b/pkg/atproto/handle_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/bluesky-social/indigo/util" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "github.com/stretchr/testify/require" "stream.place/streamplace/pkg/bus" "stream.place/streamplace/pkg/comatproto" @@ -68,11 +68,11 @@ func TestHandleChange(t *testing.T) { _, err = comatproto.RepoCreateRecord(ctx, user.XRPC, &comatproto.RepoCreateRecord_Input{ Collection: "place.stream.chat.message", Repo: user.DID, - Record: &glexrt.LexiconTypeDecoder{Val: msg}, + Record: &glex.LexiconTypeDecoder{Val: &msg}, }) require.NoError(t, err) - var message *placestream.ChatDefs_MessageView + var message placestream.ChatDefs_MessageView err = untilNoErrors(t, func() error { messages, err := mod.MostRecentChatMessages(user.DID) if err != nil { diff --git a/pkg/atproto/labeler_firehose.go b/pkg/atproto/labeler_firehose.go index 35675a9c..57be70a4 100644 --- a/pkg/atproto/labeler_firehose.go +++ b/pkg/atproto/labeler_firehose.go @@ -17,6 +17,7 @@ import ( "github.com/gorilla/websocket" "golang.org/x/sync/errgroup" "stream.place/streamplace/pkg/aqhttp" + "stream.place/streamplace/pkg/comatproto" "stream.place/streamplace/pkg/log" "stream.place/streamplace/pkg/model" "stream.place/streamplace/pkg/spmetrics" @@ -215,7 +216,14 @@ func (atsync *ATProtoSynchronizer) StartLabelerFirehoseRetry(ctx context.Context log.Error(ctx, "failed to create label", "err", err) continue } - atsync.Bus.Publish(targetDID, labelLex) + // Publish our generated label type — bus consumers (e.g. the + // media ban watcher) type-switch on it, not on indigo's. + busLabel := &comatproto.LabelDefs_Label{} + if err := busLabel.UnmarshalCBOR(bytes.NewReader(bs.Bytes())); err != nil { + log.Error(ctx, "failed to decode label for bus publish", "err", err) + continue + } + atsync.Bus.Publish(targetDID, busLabel) } return nil }, diff --git a/pkg/atproto/lexicon_repo.go b/pkg/atproto/lexicon_repo.go index 357eea10..e1f86eec 100644 --- a/pkg/atproto/lexicon_repo.go +++ b/pkg/atproto/lexicon_repo.go @@ -20,8 +20,7 @@ import ( atrepo "github.com/bluesky-social/indigo/repo" "github.com/bluesky-social/indigo/util" "github.com/ipfs/go-cid" - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" + glex "github.com/streamplace/glex/runtime" "stream.place/streamplace/pkg/comatproto" "github.com/whyrusleeping/go-did" @@ -69,6 +68,9 @@ type SchemaFileWrapper struct { SchemaFile lexicon.SchemaFile } +// RecordTypeID implements glex.Record. +func (sfw *SchemaFileWrapper) RecordTypeID() string { return "com.atproto.lexicon.schema" } + func (sfw *SchemaFileWrapper) MarshalCBOR(w io.Writer) error { bs, err := json.Marshal(sfw.SchemaFile) if err != nil { @@ -266,7 +268,7 @@ func MakeLexiconRepo(ctx context.Context, cli *config.CLI, mod model.Model, stat if err != nil { return nil, err } - cidLink := glexrt.Link(*newCid) + cidLink := glex.Link(*newCid) oldCid, _, err := LexiconRepo.GetRecord(ctx, rpath) if errors.Is(err, mst.ErrNotFound) { @@ -292,7 +294,7 @@ func MakeLexiconRepo(ctx context.Context, cli *config.CLI, mod model.Model, stat if err != nil { return nil, err } - oldLink := glexrt.Link(oldCid) + oldLink := glex.Link(oldCid) ops = append(ops, comatproto.SyncSubscribeRepos_RepoOp{ Action: ActionUpdate, Path: rpath, @@ -319,7 +321,7 @@ func MakeLexiconRepo(ctx context.Context, cli *config.CLI, mod model.Model, stat Repo: cli.BroadcasterDID(), Blocks: blocks, Rev: currentRev, - Commit: glexrt.Link(currentRoot), + Commit: glex.Link(currentRoot), Time: time.Now().Format(util.ISO8601), Ops: ops, TooBig: false, @@ -352,12 +354,11 @@ func OpenLexiconRepo(ctx context.Context) (*atrepo.Repo, *carstore.DeltaSession, } // Get record that handles special-casing for com.atproto.lexicon.schema -func GetRecordCBOR(ctx context.Context, ses *carstore.DeltaSession, c cid.Cid, collection string, rkey string) (cbg.CBORMarshaler, error) { +func GetRecordCBOR(ctx context.Context, ses *carstore.DeltaSession, c cid.Cid, collection string, rkey string) (glex.Record, error) { b, err := ses.Get(ctx, c) if err != nil { return nil, fmt.Errorf("handleComAtprotoRepoListRecords: failed to get record for collection %q, rkey %q: %w", collection, rkey, err) } - var val cbg.CBORMarshaler if collection == "com.atproto.lexicon.schema" { sfMap, err := atdata.UnmarshalCBOR(b.RawData()) if err != nil { @@ -372,22 +373,13 @@ func GetRecordCBOR(ctx context.Context, ses *carstore.DeltaSession, c cid.Cid, c if err != nil { return nil, fmt.Errorf("failed to unmarshal schema file: %w", err) } - val = &SchemaFileWrapper{ + return &SchemaFileWrapper{ SchemaFile: sf, - } - } else { - decoded, err := glexrt.CborDecodeValue(b.RawData()) - if err != nil { - return nil, fmt.Errorf("failed to decode record: %w", err) - } - var ok bool - val, ok = decoded.(cbg.CBORMarshaler) - if !ok { - return nil, fmt.Errorf("decoded record does not implement CBORMarshaler: %T", decoded) - } - if err != nil { - return nil, fmt.Errorf("failed to decode record: %w", err) - } + }, nil + } + decoded, err := glex.CborDecodeValue(b.RawData()) + if err != nil { + return nil, fmt.Errorf("failed to decode record: %w", err) } - return val, nil + return decoded, nil } diff --git a/pkg/atproto/lexicon_repo_queries.go b/pkg/atproto/lexicon_repo_queries.go index de295d7d..410668c6 100644 --- a/pkg/atproto/lexicon_repo_queries.go +++ b/pkg/atproto/lexicon_repo_queries.go @@ -12,7 +12,7 @@ import ( "github.com/ipfs/go-cid" cbor "github.com/ipfs/go-ipld-cbor" "github.com/ipld/go-car" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "stream.place/streamplace/pkg/log" "stream.place/streamplace/pkg/comatproto" @@ -92,7 +92,7 @@ func LexiconRepoListRecords(ctx context.Context, collection string, cursor strin out.Records = append(out.Records, comatproto.RepoListRecords_Record{ Uri: fmt.Sprintf("at://%s/%s", repo, rkey), Cid: c.String(), - Value: &glexrt.LexiconTypeDecoder{Val: val}, + Value: &glex.LexiconTypeDecoder{Val: val}, }) return nil @@ -123,7 +123,7 @@ func LexiconRepoGetRecord(ctx context.Context, repo string, collection string, r return &comatproto.RepoGetRecord_Output{ Uri: fmt.Sprintf("at://%s/%s/%s", repo, collection, rkey), Cid: &str, - Value: &glexrt.LexiconTypeDecoder{Val: rec}, + Value: &glex.LexiconTypeDecoder{Val: rec}, }, nil } diff --git a/pkg/atproto/moderation_test.go b/pkg/atproto/moderation_test.go index 38d3c9d1..0f049295 100644 --- a/pkg/atproto/moderation_test.go +++ b/pkg/atproto/moderation_test.go @@ -9,7 +9,7 @@ import ( "github.com/bluesky-social/indigo/atproto/syntax" "github.com/bluesky-social/indigo/util" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "github.com/stretchr/testify/require" "stream.place/streamplace/pkg/appbsky" "stream.place/streamplace/pkg/bus" @@ -73,7 +73,7 @@ func TestDelegatedModeration(t *testing.T) { _, err = comatproto.RepoCreateRecord(ctx, streamer.XRPC, &comatproto.RepoCreateRecord_Input{ Collection: constants.PLACE_STREAM_MODERATION_PERMISSION, Repo: streamer.DID, - Record: &glexrt.LexiconTypeDecoder{Val: delegationRecord}, + Record: &glex.LexiconTypeDecoder{Val: &delegationRecord}, }) require.NoError(t, err) @@ -117,7 +117,7 @@ func TestDelegatedModeration(t *testing.T) { blockRec, err := comatproto.RepoCreateRecord(ctx, streamer.XRPC, &comatproto.RepoCreateRecord_Input{ Collection: constants.APP_BSKY_GRAPH_BLOCK, Repo: streamer.DID, - Record: &glexrt.LexiconTypeDecoder{Val: block}, + Record: &glex.LexiconTypeDecoder{Val: &block}, }) require.NoError(t, err) t.Logf("✓ Block record created: %s", blockRec.Uri) @@ -149,7 +149,7 @@ func TestDelegatedModeration(t *testing.T) { msgRec, err := comatproto.RepoCreateRecord(ctx, user.XRPC, &comatproto.RepoCreateRecord_Input{ Collection: constants.PLACE_STREAM_CHAT_MESSAGE, Repo: user.DID, - Record: &glexrt.LexiconTypeDecoder{Val: msg}, + Record: &glex.LexiconTypeDecoder{Val: &msg}, }) require.NoError(t, err) t.Logf("✓ Chat message created: %s", msgRec.Uri) @@ -163,7 +163,7 @@ func TestDelegatedModeration(t *testing.T) { gateRec, err := comatproto.RepoCreateRecord(ctx, streamer.XRPC, &comatproto.RepoCreateRecord_Input{ Collection: constants.PLACE_STREAM_CHAT_GATE, Repo: streamer.DID, - Record: &glexrt.LexiconTypeDecoder{Val: gate}, + Record: &glex.LexiconTypeDecoder{Val: &gate}, }) require.NoError(t, err) t.Logf("✓ Gate record created: %s", gateRec.Uri) diff --git a/pkg/atproto/server_repo.go b/pkg/atproto/server_repo.go index 362a961c..830f9ac8 100644 --- a/pkg/atproto/server_repo.go +++ b/pkg/atproto/server_repo.go @@ -20,7 +20,7 @@ import ( "github.com/ipfs/go-cid" cbor "github.com/ipfs/go-ipld-cbor" "github.com/ipld/go-car" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" "gorm.io/driver/sqlite" "gorm.io/gorm" @@ -354,13 +354,13 @@ func CommitServerRepoRecord(ctx context.Context, cli *config.CLI, collection str ServerRepo = r - cidLink := glexrt.Link(recordCid) + cidLink := glex.Link(recordCid) signed := r.SignedCommit() commit := &comatproto.SyncSubscribeRepos_Commit{ Repo: cli.ServerDID(), Blocks: blocks, Rev: rev, - Commit: glexrt.Link(root), + Commit: glex.Link(root), Time: time.Now().Format(util.ISO8601), Ops: []comatproto.SyncSubscribeRepos_RepoOp{ { @@ -586,14 +586,14 @@ func ServerRepoListRecords(ctx context.Context, collection string, cursor string if err != nil { return nil, fmt.Errorf("ServerRepoListRecords: %w", err) } - val, err := glexrt.CborDecodeValue(raw) + val, err := glex.CborDecodeValue(raw) if err != nil { return nil, fmt.Errorf("ServerRepoListRecords: failed to decode record for rkey %q: %w", e.rkey, err) } out.Records = append(out.Records, comatproto.RepoListRecords_Record{ Uri: fmt.Sprintf("at://%s/%s%s", repo, prefix, e.rkey), Cid: e.c.String(), - Value: &glexrt.LexiconTypeDecoder{Val: val}, + Value: &glex.LexiconTypeDecoder{Val: val}, }) } @@ -623,7 +623,7 @@ func ServerRepoGetRecord(ctx context.Context, repo string, collection string, rk if err != nil { return nil, fmt.Errorf("ServerRepoGetRecord: %w", err) } - rec, err := glexrt.CborDecodeValue(raw) + rec, err := glex.CborDecodeValue(raw) if err != nil { return nil, fmt.Errorf("ServerRepoGetRecord: failed to decode record: %w", err) } @@ -631,7 +631,7 @@ func ServerRepoGetRecord(ctx context.Context, repo string, collection string, rk return &comatproto.RepoGetRecord_Output{ Uri: fmt.Sprintf("at://%s/%s/%s", repo, collection, rkey), Cid: &str, - Value: &glexrt.LexiconTypeDecoder{Val: rec}, + Value: &glex.LexiconTypeDecoder{Val: rec}, }, nil } diff --git a/pkg/atproto/server_repo_test.go b/pkg/atproto/server_repo_test.go index 10adbb20..5e5d3280 100644 --- a/pkg/atproto/server_repo_test.go +++ b/pkg/atproto/server_repo_test.go @@ -52,7 +52,7 @@ func TestServerRepo(t *testing.T) { Streamer: "did:plc:abc123", UpdatedAt: &updatedAt, } - err = CommitServerRepoRecord(context.Background(), &cli, constants.PLACE_STREAM_LIVE_VIEWERCOUNT, "did:plc:abc123", vc) + err = CommitServerRepoRecord(context.Background(), &cli, constants.PLACE_STREAM_LIVE_VIEWERCOUNT, "did:plc:abc123", &vc) require.NoError(t, err) // Read it back @@ -106,7 +106,7 @@ func TestServerRepo(t *testing.T) { Size: 1234, MimeType: "video/mp4", } - err = CommitServerRepoRecord(context.Background(), &cli, constants.PLACE_STREAM_MEDIA_ORIGIN, "babczxv1", origin) + err = CommitServerRepoRecord(context.Background(), &cli, constants.PLACE_STREAM_MEDIA_ORIGIN, "babczxv1", &origin) require.NoError(t, err) cols, err = ServerRepoListCollections(context.Background()) require.NoError(t, err) @@ -166,7 +166,7 @@ func TestServerRepoListRecords_Pagination(t *testing.T) { Streamer: s, UpdatedAt: &updatedAt, } - require.NoError(t, CommitServerRepoRecord(context.Background(), &cli, constants.PLACE_STREAM_LIVE_VIEWERCOUNT, s, vc)) + require.NoError(t, CommitServerRepoRecord(context.Background(), &cli, constants.PLACE_STREAM_LIVE_VIEWERCOUNT, s, &vc)) } // Default order is reverse-lexical (newest TID first). limit=2: diff --git a/pkg/atproto/sync.go b/pkg/atproto/sync.go index 984a4f73..28ece9aa 100644 --- a/pkg/atproto/sync.go +++ b/pkg/atproto/sync.go @@ -21,7 +21,7 @@ import ( "stream.place/streamplace/pkg/placestream" "stream.place/streamplace/pkg/statedb" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" ) func (atsync *ATProtoSynchronizer) handleCreateUpdate(ctx context.Context, userDID string, rkey syntax.RecordKey, recCBOR *[]byte, cid string, collection syntax.NSID, isUpdate bool, isFirstSync bool) error { @@ -40,8 +40,8 @@ func (atsync *ATProtoSynchronizer) handleCreateUpdate(ctx context.Context, userD if err != nil { return fmt.Errorf("failed to unmarhsal record CBOR: %w", err) } - cb, err := glexrt.CborDecodeValue(*recCBOR) - if errors.Is(err, glexrt.ErrUnrecognizedType) { + cb, err := glex.CborDecodeValue(*recCBOR) + if errors.Is(err, glex.ErrUnrecognizedType) { log.Debug(ctx, "unrecognized record type", "key", rkey.String(), "type", err) return nil } else if err != nil { @@ -600,7 +600,7 @@ func (atsync *ATProtoSynchronizer) handleCreateUpdate(ctx context.Context, userD Did: userDID, Handle: repo.Handle, }, - Record: &glexrt.LexiconTypeDecoder{Val: rec}, + Record: &glex.LexiconTypeDecoder{Val: rec}, } // publishes with an empty string because we're discovering the stream go atsync.Bus.Publish("", view) @@ -640,7 +640,7 @@ func (atsync *ATProtoSynchronizer) handleCreateUpdate(ctx context.Context, userD Did: userDID, Handle: repo.Handle, }, - Record: &glexrt.LexiconTypeDecoder{Val: rec}, + Record: &glex.LexiconTypeDecoder{Val: rec}, } // Publish moderation permission view to WebSocket bus for real-time updates // This allows moderators to see their permissions instantly without page refresh @@ -749,7 +749,7 @@ func (atsync *ATProtoSynchronizer) handleCreateUpdate(ctx context.Context, userD // Tracks not backed by a muxlTrack (we don't define any other // shape yet) are skipped with a warning — there'd be no blob // to key the row off of. - if rec.Track.MediaDefs_MuxlTrack == nil || rec.Track.MediaDefs_MuxlTrack == nil { + if rec.Track.MediaDefs_MuxlTrack == nil { log.Warn(ctx, "track record missing muxlTrack; skipping", "uri", aturi.String()) return nil } diff --git a/pkg/badges/badges_test.go b/pkg/badges/badges_test.go index dac75604..d4056ff5 100644 --- a/pkg/badges/badges_test.go +++ b/pkg/badges/badges_test.go @@ -6,10 +6,10 @@ import ( "testing" "time" - comatproto "github.com/bluesky-social/indigo/api/atproto" "github.com/bluesky-social/indigo/atproto/syntax" "github.com/bluesky-social/indigo/util" "github.com/stretchr/testify/require" + "stream.place/streamplace/pkg/comatproto" "stream.place/streamplace/pkg/constants" "stream.place/streamplace/pkg/model" "stream.place/streamplace/pkg/placestream" @@ -49,7 +49,7 @@ func TestGetValidBadges(t *testing.T) { t.Run("returns mod badge for moderator", func(t *testing.T) { // Grant moderation permissions - perm := &placestream.ModerationPermission{ + perm := placestream.ModerationPermission{ LexiconTypeID: "place.stream.moderation.permission", Moderator: moderatorDID, Permissions: []string{"ban", "hide"}, @@ -120,7 +120,7 @@ func TestGetValidBadges_Issuance(t *testing.T) { t.Run("vip badge appears when issuance and selection match", func(t *testing.T) { setupVIPIssuance(t, vipUserDID) - profile := buildProfileWithStreamerBadge(t, streamerDID, &comatproto.RepoStrongRef{Uri: issuanceURI, Cid: "bafyiss"}) + profile := buildProfileWithStreamerBadge(t, streamerDID, comatproto.RepoStrongRef{Uri: issuanceURI, Cid: "bafyiss"}) err = mod.CreateChatProfile(ctx, &model.ChatProfile{ RepoDID: vipUserDID, Record: &profile, @@ -163,7 +163,7 @@ func TestGetValidBadges_Issuance(t *testing.T) { require.NoError(t, err) theftUserDID := "did:plc:theftuser" - profile := buildProfileWithStreamerBadge(t, streamerDID, &comatproto.RepoStrongRef{Uri: wrongIssuanceURI, Cid: "bafywrong"}) + profile := buildProfileWithStreamerBadge(t, streamerDID, comatproto.RepoStrongRef{Uri: wrongIssuanceURI, Cid: "bafywrong"}) err = mod.CreateChatProfile(ctx, &model.ChatProfile{ RepoDID: theftUserDID, Record: &profile, @@ -238,7 +238,7 @@ func TestGetValidBadges_Issuance(t *testing.T) { }) require.NoError(t, err) - profile := buildProfileWithGlobalBadge(t, &comatproto.RepoStrongRef{Uri: eventIssuanceURI, Cid: "bafyeventiss"}) + profile := buildProfileWithGlobalBadge(t, comatproto.RepoStrongRef{Uri: eventIssuanceURI, Cid: "bafyeventiss"}) err = mod.CreateChatProfile(ctx, &model.ChatProfile{ RepoDID: eventUserDID, Record: &profile, @@ -259,12 +259,12 @@ func TestGetValidBadges_Issuance(t *testing.T) { }) } -func buildProfileWithStreamerBadge(t *testing.T, streamerDID string, ref *comatproto.RepoStrongRef) []byte { +func buildProfileWithStreamerBadge(t *testing.T, streamerDID string, ref comatproto.RepoStrongRef) []byte { t.Helper() profile := &placestream.ChatProfile{ LexiconTypeID: "place.stream.chat.profile", Badges: &placestream.ChatProfile_BadgeSelections{ - Streamer: []*placestream.ChatProfile_StreamerBadgeSelection{ + Streamer: []placestream.ChatProfile_StreamerBadgeSelection{ {Streamer: streamerDID, Badge: ref}, }, }, @@ -275,12 +275,12 @@ func buildProfileWithStreamerBadge(t *testing.T, streamerDID string, ref *comatp return buf.Bytes() } -func buildProfileWithGlobalBadge(t *testing.T, ref *comatproto.RepoStrongRef) []byte { +func buildProfileWithGlobalBadge(t *testing.T, ref comatproto.RepoStrongRef) []byte { t.Helper() profile := &placestream.ChatProfile{ LexiconTypeID: "place.stream.chat.profile", Badges: &placestream.ChatProfile_BadgeSelections{ - Global: ref, + Global: &ref, }, } var buf bytes.Buffer diff --git a/pkg/cmd/streamplace.go b/pkg/cmd/streamplace.go index c5b4984a..fcdfdde9 100644 --- a/pkg/cmd/streamplace.go +++ b/pkg/cmd/streamplace.go @@ -453,7 +453,7 @@ func runMain(ctx context.Context, build *config.BuildFlags, platformJobs []jobFu "uri", row.URI, "error", err) continue } - if rec.Track.MediaDefs_MuxlTrack == nil || rec.Track.MediaDefs_MuxlTrack == nil { + if rec.Track.MediaDefs_MuxlTrack == nil { continue } tid := rec.Track.MediaDefs_MuxlTrack.TrackId diff --git a/pkg/comatproto/admindefs.go b/pkg/comatproto/admindefs.go deleted file mode 100644 index 2c9383e0..00000000 --- a/pkg/comatproto/admindefs.go +++ /dev/null @@ -1,122 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.defs - -package comatproto - -import ( - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -// AdminDefs_AccountView is a "accountView" in the com.atproto.admin.defs schema. -type AdminDefs_AccountView struct { - LexiconTypeID string `json:"$type"` - DeactivatedAt *string `json:"deactivatedAt,omitempty"` - Did string `json:"did"` - Email *string `json:"email,omitempty"` - EmailConfirmedAt *string `json:"emailConfirmedAt,omitempty"` - Handle string `json:"handle"` - IndexedAt string `json:"indexedAt"` - InviteNote *string `json:"inviteNote,omitempty"` - InvitedBy *ServerDefs_InviteCode `json:"invitedBy,omitempty"` - Invites []ServerDefs_InviteCode `json:"invites,omitempty"` - InvitesDisabled *bool `json:"invitesDisabled,omitempty"` - RelatedRecords []*glexrt.LexiconTypeDecoder `json:"relatedRecords,omitempty"` - ThreatSignatures []AdminDefs_ThreatSignature `json:"threatSignatures,omitempty"` -} - -func (t *AdminDefs_AccountView) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminDefs_AccountView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminDefs_RepoBlobRef is a "repoBlobRef" in the com.atproto.admin.defs schema. -type AdminDefs_RepoBlobRef struct { - LexiconTypeID string `json:"$type"` - Cid string `json:"cid"` - Did string `json:"did"` - RecordUri *string `json:"recordUri,omitempty"` -} - -func (t *AdminDefs_RepoBlobRef) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminDefs_RepoBlobRef) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminDefs_RepoRef is a "repoRef" in the com.atproto.admin.defs schema. -type AdminDefs_RepoRef struct { - LexiconTypeID string `json:"$type"` - Did string `json:"did"` -} - -func (t *AdminDefs_RepoRef) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminDefs_RepoRef) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminDefs_StatusAttr is a "statusAttr" in the com.atproto.admin.defs schema. -type AdminDefs_StatusAttr struct { - LexiconTypeID string `json:"$type"` - Applied bool `json:"applied"` - Ref *string `json:"ref,omitempty"` -} - -func (t *AdminDefs_StatusAttr) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminDefs_StatusAttr) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminDefs_ThreatSignature is a "threatSignature" in the com.atproto.admin.defs schema. -type AdminDefs_ThreatSignature struct { - LexiconTypeID string `json:"$type"` - Property string `json:"property"` - Value string `json:"value"` -} - -func (t *AdminDefs_ThreatSignature) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminDefs_ThreatSignature) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/admindeleteaccount.go b/pkg/comatproto/admindeleteaccount.go deleted file mode 100644 index 8e90bfa3..00000000 --- a/pkg/comatproto/admindeleteaccount.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.deleteAccount - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AdminDeleteAccount_Input struct { - LexiconTypeID string `json:"$type"` - Did string `json:"did"` -} - -func (t *AdminDeleteAccount_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.deleteAccount#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminDeleteAccount_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminDeleteAccount calls the XRPC method "com.atproto.admin.deleteAccount". -// -// Delete a user account as an administrator. -func AdminDeleteAccount(ctx context.Context, c glexrt.LexClient, input *AdminDeleteAccount_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.admin.deleteAccount", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/admindisableaccountinvites.go b/pkg/comatproto/admindisableaccountinvites.go deleted file mode 100644 index de8ca3b9..00000000 --- a/pkg/comatproto/admindisableaccountinvites.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.disableAccountInvites - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AdminDisableAccountInvites_Input struct { - LexiconTypeID string `json:"$type"` - Account string `json:"account"` - // note: Optional reason for disabled invites. - Note *string `json:"note,omitempty"` -} - -func (t *AdminDisableAccountInvites_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.disableAccountInvites#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminDisableAccountInvites_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminDisableAccountInvites calls the XRPC method "com.atproto.admin.disableAccountInvites". -// -// Disable an account from receiving new invite codes, but does not invalidate existing codes. -func AdminDisableAccountInvites(ctx context.Context, c glexrt.LexClient, input *AdminDisableAccountInvites_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.admin.disableAccountInvites", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/admindisableinvitecodes.go b/pkg/comatproto/admindisableinvitecodes.go deleted file mode 100644 index e7035a41..00000000 --- a/pkg/comatproto/admindisableinvitecodes.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.disableInviteCodes - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AdminDisableInviteCodes_Input struct { - LexiconTypeID string `json:"$type"` - Accounts []string `json:"accounts,omitempty"` - Codes []string `json:"codes,omitempty"` -} - -func (t *AdminDisableInviteCodes_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.disableInviteCodes#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminDisableInviteCodes_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminDisableInviteCodes calls the XRPC method "com.atproto.admin.disableInviteCodes". -// -// Disable some set of codes and/or all codes associated with a set of users. -func AdminDisableInviteCodes(ctx context.Context, c glexrt.LexClient, input *AdminDisableInviteCodes_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.admin.disableInviteCodes", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/adminenableaccountinvites.go b/pkg/comatproto/adminenableaccountinvites.go deleted file mode 100644 index cb16d9ef..00000000 --- a/pkg/comatproto/adminenableaccountinvites.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.enableAccountInvites - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AdminEnableAccountInvites_Input struct { - LexiconTypeID string `json:"$type"` - Account string `json:"account"` - // note: Optional reason for enabled invites. - Note *string `json:"note,omitempty"` -} - -func (t *AdminEnableAccountInvites_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.enableAccountInvites#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminEnableAccountInvites_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminEnableAccountInvites calls the XRPC method "com.atproto.admin.enableAccountInvites". -// -// Re-enable an account's ability to receive invite codes. -func AdminEnableAccountInvites(ctx context.Context, c glexrt.LexClient, input *AdminEnableAccountInvites_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.admin.enableAccountInvites", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/admingetaccountinfo.go b/pkg/comatproto/admingetaccountinfo.go deleted file mode 100644 index b7699877..00000000 --- a/pkg/comatproto/admingetaccountinfo.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.getAccountInfo - -package comatproto - -import ( - "context" - - glexrt "github.com/streamplace/glex/runtime" -) - -// AdminGetAccountInfo calls the XRPC method "com.atproto.admin.getAccountInfo". -// -// Get details about an account. -func AdminGetAccountInfo(ctx context.Context, c glexrt.LexClient, did string) (*AdminDefs_AccountView, error) { - var out AdminDefs_AccountView - - params := map[string]interface{}{} - params["did"] = did - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.admin.getAccountInfo", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/admingetaccountinfos.go b/pkg/comatproto/admingetaccountinfos.go deleted file mode 100644 index 95556014..00000000 --- a/pkg/comatproto/admingetaccountinfos.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.getAccountInfos - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AdminGetAccountInfos_Output struct { - LexiconTypeID string `json:"$type"` - Infos []AdminDefs_AccountView `json:"infos"` -} - -func (t *AdminGetAccountInfos_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.getAccountInfos#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminGetAccountInfos_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminGetAccountInfos calls the XRPC method "com.atproto.admin.getAccountInfos". -// -// Get details about some accounts. -func AdminGetAccountInfos(ctx context.Context, c glexrt.LexClient, dids []string) (*AdminGetAccountInfos_Output, error) { - var out AdminGetAccountInfos_Output - - params := map[string]interface{}{} - params["dids"] = dids - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.admin.getAccountInfos", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/admingetinvitecodes.go b/pkg/comatproto/admingetinvitecodes.go deleted file mode 100644 index 2cbc9de6..00000000 --- a/pkg/comatproto/admingetinvitecodes.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.getInviteCodes - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AdminGetInviteCodes_Output struct { - LexiconTypeID string `json:"$type"` - Codes []ServerDefs_InviteCode `json:"codes"` - Cursor *string `json:"cursor,omitempty"` -} - -func (t *AdminGetInviteCodes_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.getInviteCodes#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminGetInviteCodes_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminGetInviteCodes calls the XRPC method "com.atproto.admin.getInviteCodes". -// -// Get an admin view of invite codes. -func AdminGetInviteCodes(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, sort string) (*AdminGetInviteCodes_Output, error) { - var out AdminGetInviteCodes_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - if sort != "" { - params["sort"] = sort - } - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.admin.getInviteCodes", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/admingetsubjectstatus.go b/pkg/comatproto/admingetsubjectstatus.go deleted file mode 100644 index 5759d8c7..00000000 --- a/pkg/comatproto/admingetsubjectstatus.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.getSubjectStatus - -package comatproto - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AdminGetSubjectStatus_Output struct { - LexiconTypeID string `json:"$type"` - Deactivated *AdminDefs_StatusAttr `json:"deactivated,omitempty"` - Subject AdminGetSubjectStatus_Output_Subject `json:"subject"` - Takedown *AdminDefs_StatusAttr `json:"takedown,omitempty"` -} - -func (t *AdminGetSubjectStatus_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.getSubjectStatus#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminGetSubjectStatus_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type AdminGetSubjectStatus_Output_Subject struct { - AdminDefs_RepoBlobRef *AdminDefs_RepoBlobRef - AdminDefs_RepoRef *AdminDefs_RepoRef - RepoStrongRef *RepoStrongRef -} - -func (t *AdminGetSubjectStatus_Output_Subject) MarshalJSON() ([]byte, error) { - if t.AdminDefs_RepoBlobRef != nil { - t.AdminDefs_RepoBlobRef.LexiconTypeID = "com.atproto.admin.defs#repoBlobRef" - return json.Marshal(t.AdminDefs_RepoBlobRef) - } - if t.AdminDefs_RepoRef != nil { - t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" - return json.Marshal(t.AdminDefs_RepoRef) - } - if t.RepoStrongRef != nil { - t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" - return json.Marshal(t.RepoStrongRef) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *AdminGetSubjectStatus_Output_Subject) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "com.atproto.admin.defs#repoBlobRef": - t.AdminDefs_RepoBlobRef = new(AdminDefs_RepoBlobRef) - return json.Unmarshal(b, t.AdminDefs_RepoBlobRef) - case "com.atproto.admin.defs#repoRef": - t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) - return json.Unmarshal(b, t.AdminDefs_RepoRef) - case "com.atproto.repo.strongRef": - t.RepoStrongRef = new(RepoStrongRef) - return json.Unmarshal(b, t.RepoStrongRef) - default: - return nil - } -} - -func (t *AdminGetSubjectStatus_Output_Subject) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.AdminDefs_RepoBlobRef != nil { - return t.AdminDefs_RepoBlobRef.MarshalCBOR(w) - } - if t.AdminDefs_RepoRef != nil { - return t.AdminDefs_RepoRef.MarshalCBOR(w) - } - if t.RepoStrongRef != nil { - return t.RepoStrongRef.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *AdminGetSubjectStatus_Output_Subject) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "com.atproto.admin.defs#repoBlobRef": - t.AdminDefs_RepoBlobRef = new(AdminDefs_RepoBlobRef) - return t.AdminDefs_RepoBlobRef.UnmarshalCBOR(bytes.NewReader(b)) - case "com.atproto.admin.defs#repoRef": - t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) - return t.AdminDefs_RepoRef.UnmarshalCBOR(bytes.NewReader(b)) - case "com.atproto.repo.strongRef": - t.RepoStrongRef = new(RepoStrongRef) - return t.RepoStrongRef.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} - -// AdminGetSubjectStatus calls the XRPC method "com.atproto.admin.getSubjectStatus". -// -// Get the service-specific admin status of a subject (account, record, or blob). -func AdminGetSubjectStatus(ctx context.Context, c glexrt.LexClient, blob string, did string, uri string) (*AdminGetSubjectStatus_Output, error) { - var out AdminGetSubjectStatus_Output - - params := map[string]interface{}{} - if blob != "" { - params["blob"] = blob - } - if did != "" { - params["did"] = did - } - if uri != "" { - params["uri"] = uri - } - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.admin.getSubjectStatus", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/adminsearchaccounts.go b/pkg/comatproto/adminsearchaccounts.go deleted file mode 100644 index 36f5116e..00000000 --- a/pkg/comatproto/adminsearchaccounts.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.searchAccounts - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AdminSearchAccounts_Output struct { - LexiconTypeID string `json:"$type"` - Accounts []AdminDefs_AccountView `json:"accounts"` - Cursor *string `json:"cursor,omitempty"` -} - -func (t *AdminSearchAccounts_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.searchAccounts#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminSearchAccounts_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminSearchAccounts calls the XRPC method "com.atproto.admin.searchAccounts". -// -// Get list of accounts that matches your search query. -func AdminSearchAccounts(ctx context.Context, c glexrt.LexClient, cursor string, email string, limit *int64) (*AdminSearchAccounts_Output, error) { - var out AdminSearchAccounts_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if email != "" { - params["email"] = email - } - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.admin.searchAccounts", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/adminsendemail.go b/pkg/comatproto/adminsendemail.go deleted file mode 100644 index 81597c51..00000000 --- a/pkg/comatproto/adminsendemail.go +++ /dev/null @@ -1,66 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.sendEmail - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AdminSendEmail_Input struct { - LexiconTypeID string `json:"$type"` - // comment: Additional comment by the sender that won't be used in the email itself but helpful to provide more context for moderators/reviewers - Comment *string `json:"comment,omitempty"` - Content string `json:"content"` - RecipientDid string `json:"recipientDid"` - SenderDid string `json:"senderDid"` - Subject *string `json:"subject,omitempty"` -} - -func (t *AdminSendEmail_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.sendEmail#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminSendEmail_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type AdminSendEmail_Output struct { - LexiconTypeID string `json:"$type"` - Sent bool `json:"sent"` -} - -func (t *AdminSendEmail_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.sendEmail#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminSendEmail_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminSendEmail calls the XRPC method "com.atproto.admin.sendEmail". -// -// Send email to a user's account email address. -func AdminSendEmail(ctx context.Context, c glexrt.LexClient, input *AdminSendEmail_Input) (*AdminSendEmail_Output, error) { - var out AdminSendEmail_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.admin.sendEmail", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/adminupdateaccountemail.go b/pkg/comatproto/adminupdateaccountemail.go deleted file mode 100644 index f81e9bd5..00000000 --- a/pkg/comatproto/adminupdateaccountemail.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.updateAccountEmail - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AdminUpdateAccountEmail_Input struct { - LexiconTypeID string `json:"$type"` - // account: The handle or DID of the repo. - Account string `json:"account"` - Email string `json:"email"` -} - -func (t *AdminUpdateAccountEmail_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.updateAccountEmail#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminUpdateAccountEmail_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminUpdateAccountEmail calls the XRPC method "com.atproto.admin.updateAccountEmail". -// -// Administrative action to update an account's email. -func AdminUpdateAccountEmail(ctx context.Context, c glexrt.LexClient, input *AdminUpdateAccountEmail_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.admin.updateAccountEmail", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/adminupdateaccounthandle.go b/pkg/comatproto/adminupdateaccounthandle.go deleted file mode 100644 index e99e32e4..00000000 --- a/pkg/comatproto/adminupdateaccounthandle.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.updateAccountHandle - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AdminUpdateAccountHandle_Input struct { - LexiconTypeID string `json:"$type"` - Did string `json:"did"` - Handle string `json:"handle"` -} - -func (t *AdminUpdateAccountHandle_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.updateAccountHandle#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminUpdateAccountHandle_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminUpdateAccountHandle calls the XRPC method "com.atproto.admin.updateAccountHandle". -// -// Administrative action to update an account's handle. -func AdminUpdateAccountHandle(ctx context.Context, c glexrt.LexClient, input *AdminUpdateAccountHandle_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.admin.updateAccountHandle", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/adminupdateaccountpassword.go b/pkg/comatproto/adminupdateaccountpassword.go deleted file mode 100644 index 073a4613..00000000 --- a/pkg/comatproto/adminupdateaccountpassword.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.updateAccountPassword - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AdminUpdateAccountPassword_Input struct { - LexiconTypeID string `json:"$type"` - Did string `json:"did"` - Password string `json:"password"` -} - -func (t *AdminUpdateAccountPassword_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.updateAccountPassword#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminUpdateAccountPassword_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminUpdateAccountPassword calls the XRPC method "com.atproto.admin.updateAccountPassword". -// -// Update the password for a user account as an administrator. -func AdminUpdateAccountPassword(ctx context.Context, c glexrt.LexClient, input *AdminUpdateAccountPassword_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.admin.updateAccountPassword", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/adminupdateaccountsigningkey.go b/pkg/comatproto/adminupdateaccountsigningkey.go deleted file mode 100644 index e7af8d29..00000000 --- a/pkg/comatproto/adminupdateaccountsigningkey.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.updateAccountSigningKey - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AdminUpdateAccountSigningKey_Input struct { - LexiconTypeID string `json:"$type"` - Did string `json:"did"` - // signingKey: Did-key formatted public key - SigningKey string `json:"signingKey"` -} - -func (t *AdminUpdateAccountSigningKey_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.updateAccountSigningKey#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminUpdateAccountSigningKey_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// AdminUpdateAccountSigningKey calls the XRPC method "com.atproto.admin.updateAccountSigningKey". -// -// Administrative action to update an account's signing key in their Did document. -func AdminUpdateAccountSigningKey(ctx context.Context, c glexrt.LexClient, input *AdminUpdateAccountSigningKey_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.admin.updateAccountSigningKey", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/adminupdatesubjectstatus.go b/pkg/comatproto/adminupdatesubjectstatus.go deleted file mode 100644 index e40e555d..00000000 --- a/pkg/comatproto/adminupdatesubjectstatus.go +++ /dev/null @@ -1,231 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.admin.updateSubjectStatus - -package comatproto - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type AdminUpdateSubjectStatus_Input struct { - LexiconTypeID string `json:"$type"` - Deactivated *AdminDefs_StatusAttr `json:"deactivated,omitempty"` - Subject AdminUpdateSubjectStatus_Input_Subject `json:"subject"` - Takedown *AdminDefs_StatusAttr `json:"takedown,omitempty"` -} - -func (t *AdminUpdateSubjectStatus_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.updateSubjectStatus#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminUpdateSubjectStatus_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type AdminUpdateSubjectStatus_Input_Subject struct { - AdminDefs_RepoBlobRef *AdminDefs_RepoBlobRef - AdminDefs_RepoRef *AdminDefs_RepoRef - RepoStrongRef *RepoStrongRef -} - -func (t *AdminUpdateSubjectStatus_Input_Subject) MarshalJSON() ([]byte, error) { - if t.AdminDefs_RepoBlobRef != nil { - t.AdminDefs_RepoBlobRef.LexiconTypeID = "com.atproto.admin.defs#repoBlobRef" - return json.Marshal(t.AdminDefs_RepoBlobRef) - } - if t.AdminDefs_RepoRef != nil { - t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" - return json.Marshal(t.AdminDefs_RepoRef) - } - if t.RepoStrongRef != nil { - t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" - return json.Marshal(t.RepoStrongRef) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *AdminUpdateSubjectStatus_Input_Subject) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "com.atproto.admin.defs#repoBlobRef": - t.AdminDefs_RepoBlobRef = new(AdminDefs_RepoBlobRef) - return json.Unmarshal(b, t.AdminDefs_RepoBlobRef) - case "com.atproto.admin.defs#repoRef": - t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) - return json.Unmarshal(b, t.AdminDefs_RepoRef) - case "com.atproto.repo.strongRef": - t.RepoStrongRef = new(RepoStrongRef) - return json.Unmarshal(b, t.RepoStrongRef) - default: - return nil - } -} - -func (t *AdminUpdateSubjectStatus_Input_Subject) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.AdminDefs_RepoBlobRef != nil { - return t.AdminDefs_RepoBlobRef.MarshalCBOR(w) - } - if t.AdminDefs_RepoRef != nil { - return t.AdminDefs_RepoRef.MarshalCBOR(w) - } - if t.RepoStrongRef != nil { - return t.RepoStrongRef.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *AdminUpdateSubjectStatus_Input_Subject) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "com.atproto.admin.defs#repoBlobRef": - t.AdminDefs_RepoBlobRef = new(AdminDefs_RepoBlobRef) - return t.AdminDefs_RepoBlobRef.UnmarshalCBOR(bytes.NewReader(b)) - case "com.atproto.admin.defs#repoRef": - t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) - return t.AdminDefs_RepoRef.UnmarshalCBOR(bytes.NewReader(b)) - case "com.atproto.repo.strongRef": - t.RepoStrongRef = new(RepoStrongRef) - return t.RepoStrongRef.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} - -type AdminUpdateSubjectStatus_Output struct { - LexiconTypeID string `json:"$type"` - Subject AdminUpdateSubjectStatus_Output_Subject `json:"subject"` - Takedown *AdminDefs_StatusAttr `json:"takedown,omitempty"` -} - -func (t *AdminUpdateSubjectStatus_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.admin.updateSubjectStatus#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *AdminUpdateSubjectStatus_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type AdminUpdateSubjectStatus_Output_Subject struct { - AdminDefs_RepoBlobRef *AdminDefs_RepoBlobRef - AdminDefs_RepoRef *AdminDefs_RepoRef - RepoStrongRef *RepoStrongRef -} - -func (t *AdminUpdateSubjectStatus_Output_Subject) MarshalJSON() ([]byte, error) { - if t.AdminDefs_RepoBlobRef != nil { - t.AdminDefs_RepoBlobRef.LexiconTypeID = "com.atproto.admin.defs#repoBlobRef" - return json.Marshal(t.AdminDefs_RepoBlobRef) - } - if t.AdminDefs_RepoRef != nil { - t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" - return json.Marshal(t.AdminDefs_RepoRef) - } - if t.RepoStrongRef != nil { - t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" - return json.Marshal(t.RepoStrongRef) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *AdminUpdateSubjectStatus_Output_Subject) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "com.atproto.admin.defs#repoBlobRef": - t.AdminDefs_RepoBlobRef = new(AdminDefs_RepoBlobRef) - return json.Unmarshal(b, t.AdminDefs_RepoBlobRef) - case "com.atproto.admin.defs#repoRef": - t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) - return json.Unmarshal(b, t.AdminDefs_RepoRef) - case "com.atproto.repo.strongRef": - t.RepoStrongRef = new(RepoStrongRef) - return json.Unmarshal(b, t.RepoStrongRef) - default: - return nil - } -} - -func (t *AdminUpdateSubjectStatus_Output_Subject) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.AdminDefs_RepoBlobRef != nil { - return t.AdminDefs_RepoBlobRef.MarshalCBOR(w) - } - if t.AdminDefs_RepoRef != nil { - return t.AdminDefs_RepoRef.MarshalCBOR(w) - } - if t.RepoStrongRef != nil { - return t.RepoStrongRef.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *AdminUpdateSubjectStatus_Output_Subject) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "com.atproto.admin.defs#repoBlobRef": - t.AdminDefs_RepoBlobRef = new(AdminDefs_RepoBlobRef) - return t.AdminDefs_RepoBlobRef.UnmarshalCBOR(bytes.NewReader(b)) - case "com.atproto.admin.defs#repoRef": - t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) - return t.AdminDefs_RepoRef.UnmarshalCBOR(bytes.NewReader(b)) - case "com.atproto.repo.strongRef": - t.RepoStrongRef = new(RepoStrongRef) - return t.RepoStrongRef.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} - -// AdminUpdateSubjectStatus calls the XRPC method "com.atproto.admin.updateSubjectStatus". -// -// Update the service-specific admin status of a subject (account, record, or blob). -func AdminUpdateSubjectStatus(ctx context.Context, c glexrt.LexClient, input *AdminUpdateSubjectStatus_Input) (*AdminUpdateSubjectStatus_Output, error) { - var out AdminUpdateSubjectStatus_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.admin.updateSubjectStatus", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/identitydefs.go b/pkg/comatproto/identitydefs.go deleted file mode 100644 index 6da047c4..00000000 --- a/pkg/comatproto/identitydefs.go +++ /dev/null @@ -1,35 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.identity.defs - -package comatproto - -import ( - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -// IdentityDefs_IdentityInfo is a "identityInfo" in the com.atproto.identity.defs schema. -type IdentityDefs_IdentityInfo struct { - LexiconTypeID string `json:"$type"` - Did string `json:"did"` - // didDoc: The complete DID document for the identity. - DidDoc *glexrt.LexiconTypeDecoder `json:"didDoc"` - // handle: The validated handle of the account; or 'handle.invalid' if the handle did not bi-directionally match the DID document. - Handle string `json:"handle"` -} - -func (t *IdentityDefs_IdentityInfo) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.identity.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *IdentityDefs_IdentityInfo) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/identitygetrecommendeddidcredentials.go b/pkg/comatproto/identitygetrecommendeddidcredentials.go deleted file mode 100644 index 6b8401e9..00000000 --- a/pkg/comatproto/identitygetrecommendeddidcredentials.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.identity.getRecommendedDidCredentials - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type IdentityGetRecommendedDidCredentials_Output struct { - LexiconTypeID string `json:"$type"` - AlsoKnownAs []string `json:"alsoKnownAs,omitempty"` - // rotationKeys: Recommended rotation keys for PLC dids. Should be undefined (or ignored) for did:webs. - RotationKeys []string `json:"rotationKeys,omitempty"` - Services *glexrt.LexiconTypeDecoder `json:"services,omitempty"` - VerificationMethods *glexrt.LexiconTypeDecoder `json:"verificationMethods,omitempty"` -} - -func (t *IdentityGetRecommendedDidCredentials_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.identity.getRecommendedDidCredentials#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *IdentityGetRecommendedDidCredentials_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// IdentityGetRecommendedDidCredentials calls the XRPC method "com.atproto.identity.getRecommendedDidCredentials". -// -// Describe the credentials that should be included in the DID doc of an account that is migrating to this service. -func IdentityGetRecommendedDidCredentials(ctx context.Context, c glexrt.LexClient) (*IdentityGetRecommendedDidCredentials_Output, error) { - var out IdentityGetRecommendedDidCredentials_Output - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.identity.getRecommendedDidCredentials", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/identityrefreshidentity.go b/pkg/comatproto/identityrefreshidentity.go deleted file mode 100644 index 5c9b5061..00000000 --- a/pkg/comatproto/identityrefreshidentity.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.identity.refreshIdentity - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type IdentityRefreshIdentity_Input struct { - LexiconTypeID string `json:"$type"` - Identifier string `json:"identifier"` -} - -func (t *IdentityRefreshIdentity_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.identity.refreshIdentity#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *IdentityRefreshIdentity_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// IdentityRefreshIdentity calls the XRPC method "com.atproto.identity.refreshIdentity". -// -// Request that the server re-resolve an identity (DID and handle). The server may ignore this request, or require authentication, depending on the role, implementation, and policy of the server. -func IdentityRefreshIdentity(ctx context.Context, c glexrt.LexClient, input *IdentityRefreshIdentity_Input) (*IdentityDefs_IdentityInfo, error) { - var out IdentityDefs_IdentityInfo - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.identity.refreshIdentity", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/identityrequestplcoperationsignature.go b/pkg/comatproto/identityrequestplcoperationsignature.go deleted file mode 100644 index 67b080ce..00000000 --- a/pkg/comatproto/identityrequestplcoperationsignature.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.identity.requestPlcOperationSignature - -package comatproto - -import ( - "context" - - glexrt "github.com/streamplace/glex/runtime" -) - -// IdentityRequestPlcOperationSignature calls the XRPC method "com.atproto.identity.requestPlcOperationSignature". -// -// Request an email with a code to in order to request a signed PLC operation. Requires Auth. -func IdentityRequestPlcOperationSignature(ctx context.Context, c glexrt.LexClient) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "", "com.atproto.identity.requestPlcOperationSignature", nil, nil, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/identityresolvedid.go b/pkg/comatproto/identityresolvedid.go deleted file mode 100644 index ed78fe5d..00000000 --- a/pkg/comatproto/identityresolvedid.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.identity.resolveDid - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type IdentityResolveDid_Output struct { - LexiconTypeID string `json:"$type"` - // didDoc: The complete DID document for the identity. - DidDoc *glexrt.LexiconTypeDecoder `json:"didDoc"` -} - -func (t *IdentityResolveDid_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.identity.resolveDid#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *IdentityResolveDid_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// IdentityResolveDid calls the XRPC method "com.atproto.identity.resolveDid". -// -// Resolves DID to DID document. Does not bi-directionally verify handle. -// -// did: DID to resolve. -func IdentityResolveDid(ctx context.Context, c glexrt.LexClient, did string) (*IdentityResolveDid_Output, error) { - var out IdentityResolveDid_Output - - params := map[string]interface{}{} - params["did"] = did - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.identity.resolveDid", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/identityresolvehandle.go b/pkg/comatproto/identityresolvehandle.go deleted file mode 100644 index 834c071a..00000000 --- a/pkg/comatproto/identityresolvehandle.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.identity.resolveHandle - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type IdentityResolveHandle_Output struct { - LexiconTypeID string `json:"$type"` - Did string `json:"did"` -} - -func (t *IdentityResolveHandle_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.identity.resolveHandle#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *IdentityResolveHandle_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// IdentityResolveHandle calls the XRPC method "com.atproto.identity.resolveHandle". -// -// Resolves an atproto handle (hostname) to a DID. Does not necessarily bi-directionally verify against the the DID document. -// -// handle: The handle to resolve. -func IdentityResolveHandle(ctx context.Context, c glexrt.LexClient, handle string) (*IdentityResolveHandle_Output, error) { - var out IdentityResolveHandle_Output - - params := map[string]interface{}{} - params["handle"] = handle - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.identity.resolveHandle", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/identityresolveidentity.go b/pkg/comatproto/identityresolveidentity.go deleted file mode 100644 index 309a565e..00000000 --- a/pkg/comatproto/identityresolveidentity.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.identity.resolveIdentity - -package comatproto - -import ( - "context" - - glexrt "github.com/streamplace/glex/runtime" -) - -// IdentityResolveIdentity calls the XRPC method "com.atproto.identity.resolveIdentity". -// -// Resolves an identity (DID or Handle) to a full identity (DID document and verified handle). -// -// identifier: Handle or DID to resolve. -func IdentityResolveIdentity(ctx context.Context, c glexrt.LexClient, identifier string) (*IdentityDefs_IdentityInfo, error) { - var out IdentityDefs_IdentityInfo - - params := map[string]interface{}{} - params["identifier"] = identifier - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.identity.resolveIdentity", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/identitysignplcoperation.go b/pkg/comatproto/identitysignplcoperation.go deleted file mode 100644 index f7a5f7ba..00000000 --- a/pkg/comatproto/identitysignplcoperation.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.identity.signPlcOperation - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type IdentitySignPlcOperation_Input struct { - LexiconTypeID string `json:"$type"` - AlsoKnownAs []string `json:"alsoKnownAs,omitempty"` - RotationKeys []string `json:"rotationKeys,omitempty"` - Services *glexrt.LexiconTypeDecoder `json:"services,omitempty"` - // token: A token received through com.atproto.identity.requestPlcOperationSignature - Token *string `json:"token,omitempty"` - VerificationMethods *glexrt.LexiconTypeDecoder `json:"verificationMethods,omitempty"` -} - -func (t *IdentitySignPlcOperation_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.identity.signPlcOperation#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *IdentitySignPlcOperation_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type IdentitySignPlcOperation_Output struct { - LexiconTypeID string `json:"$type"` - // operation: A signed DID PLC operation. - Operation *glexrt.LexiconTypeDecoder `json:"operation"` -} - -func (t *IdentitySignPlcOperation_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.identity.signPlcOperation#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *IdentitySignPlcOperation_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// IdentitySignPlcOperation calls the XRPC method "com.atproto.identity.signPlcOperation". -// -// Signs a PLC operation to update some value(s) in the requesting DID's document. -func IdentitySignPlcOperation(ctx context.Context, c glexrt.LexClient, input *IdentitySignPlcOperation_Input) (*IdentitySignPlcOperation_Output, error) { - var out IdentitySignPlcOperation_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.identity.signPlcOperation", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/identitysubmitplcoperation.go b/pkg/comatproto/identitysubmitplcoperation.go deleted file mode 100644 index 5400aa2e..00000000 --- a/pkg/comatproto/identitysubmitplcoperation.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.identity.submitPlcOperation - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type IdentitySubmitPlcOperation_Input struct { - LexiconTypeID string `json:"$type"` - Operation *glexrt.LexiconTypeDecoder `json:"operation"` -} - -func (t *IdentitySubmitPlcOperation_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.identity.submitPlcOperation#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *IdentitySubmitPlcOperation_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// IdentitySubmitPlcOperation calls the XRPC method "com.atproto.identity.submitPlcOperation". -// -// Validates a PLC operation to ensure that it doesn't violate a service's constraints or get the identity into a bad state, then submits it to the PLC registry -func IdentitySubmitPlcOperation(ctx context.Context, c glexrt.LexClient, input *IdentitySubmitPlcOperation_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.identity.submitPlcOperation", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/identityupdatehandle.go b/pkg/comatproto/identityupdatehandle.go index 0e3cd535..30f7c1f5 100644 --- a/pkg/comatproto/identityupdatehandle.go +++ b/pkg/comatproto/identityupdatehandle.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,25 +18,30 @@ type IdentityUpdateHandle_Input struct { Handle string `json:"handle"` } +// RecordTypeID implements glex.Record. +func (t *IdentityUpdateHandle_Input) RecordTypeID() string { + return "com.atproto.identity.updateHandle" +} + func (t *IdentityUpdateHandle_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.identity.updateHandle#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.identity.updateHandle" + return glex.MarshalCBOR(w, t) } func (t *IdentityUpdateHandle_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // IdentityUpdateHandle calls the XRPC method "com.atproto.identity.updateHandle". // // Updates the current account's handle. Verifies handle validity, and updates did:plc document if necessary. Implemented by PDS, and requires auth. -func IdentityUpdateHandle(ctx context.Context, c glexrt.LexClient, input *IdentityUpdateHandle_Input) error { +func IdentityUpdateHandle(ctx context.Context, c glex.LexClient, input *IdentityUpdateHandle_Input) error { - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.identity.updateHandle", nil, input, nil); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "com.atproto.identity.updateHandle", nil, input, nil); err != nil { return err } return nil diff --git a/pkg/comatproto/labeldefs.go b/pkg/comatproto/labeldefs.go index b1fe1bb9..6f2795ab 100644 --- a/pkg/comatproto/labeldefs.go +++ b/pkg/comatproto/labeldefs.go @@ -7,7 +7,7 @@ package comatproto import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -25,7 +25,7 @@ type LabelDefs_Label struct { // neg: If true, this is a negation label, overwriting a previous label. Neg *bool `json:"neg,omitempty"` // sig: Signature of dag-cbor encoded label. - Sig glexrt.Bytes `json:"sig,omitempty"` + Sig glex.Bytes `json:"sig,omitempty"` // src: DID of the actor who created this label. Src string `json:"src"` // uri: AT URI of the record, repository (account), or other resource that this label applies to. @@ -36,17 +36,20 @@ type LabelDefs_Label struct { Ver *int64 `json:"ver,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *LabelDefs_Label) RecordTypeID() string { return "com.atproto.label.defs#label" } + func (t *LabelDefs_Label) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.label.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.label.defs#label" + return glex.MarshalCBOR(w, t) } func (t *LabelDefs_Label) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // LabelDefs_LabelValueDefinition is a "labelValueDefinition" in the com.atproto.label.defs schema. @@ -67,17 +70,22 @@ type LabelDefs_LabelValueDefinition struct { Severity string `json:"severity"` } +// RecordTypeID implements glex.Record. +func (t *LabelDefs_LabelValueDefinition) RecordTypeID() string { + return "com.atproto.label.defs#labelValueDefinition" +} + func (t *LabelDefs_LabelValueDefinition) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.label.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.label.defs#labelValueDefinition" + return glex.MarshalCBOR(w, t) } func (t *LabelDefs_LabelValueDefinition) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // LabelDefs_LabelValueDefinitionStrings is a "labelValueDefinitionStrings" in the com.atproto.label.defs schema. @@ -93,17 +101,22 @@ type LabelDefs_LabelValueDefinitionStrings struct { Name string `json:"name"` } +// RecordTypeID implements glex.Record. +func (t *LabelDefs_LabelValueDefinitionStrings) RecordTypeID() string { + return "com.atproto.label.defs#labelValueDefinitionStrings" +} + func (t *LabelDefs_LabelValueDefinitionStrings) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.label.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.label.defs#labelValueDefinitionStrings" + return glex.MarshalCBOR(w, t) } func (t *LabelDefs_LabelValueDefinitionStrings) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // LabelDefs_SelfLabel is a "selfLabel" in the com.atproto.label.defs schema. @@ -115,17 +128,20 @@ type LabelDefs_SelfLabel struct { Val string `json:"val"` } +// RecordTypeID implements glex.Record. +func (t *LabelDefs_SelfLabel) RecordTypeID() string { return "com.atproto.label.defs#selfLabel" } + func (t *LabelDefs_SelfLabel) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.label.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.label.defs#selfLabel" + return glex.MarshalCBOR(w, t) } func (t *LabelDefs_SelfLabel) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // LabelDefs_SelfLabels is a "selfLabels" in the com.atproto.label.defs schema. @@ -136,15 +152,18 @@ type LabelDefs_SelfLabels struct { Values []LabelDefs_SelfLabel `json:"values"` } +// RecordTypeID implements glex.Record. +func (t *LabelDefs_SelfLabels) RecordTypeID() string { return "com.atproto.label.defs#selfLabels" } + func (t *LabelDefs_SelfLabels) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.label.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.label.defs#selfLabels" + return glex.MarshalCBOR(w, t) } func (t *LabelDefs_SelfLabels) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/comatproto/labelquerylabels.go b/pkg/comatproto/labelquerylabels.go deleted file mode 100644 index cd8b675d..00000000 --- a/pkg/comatproto/labelquerylabels.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.label.queryLabels - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type LabelQueryLabels_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Labels []LabelDefs_Label `json:"labels"` -} - -func (t *LabelQueryLabels_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.label.queryLabels#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *LabelQueryLabels_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// LabelQueryLabels calls the XRPC method "com.atproto.label.queryLabels". -// -// Find labels relevant to the provided AT-URI patterns. Public endpoint for moderation services, though may return different or additional results with auth. -// -// sources[]: Optional list of label sources (DIDs) to filter on. -// uriPatterns[]: List of AT URI patterns to match (boolean 'OR'). Each may be a prefix (ending with '*'; will match inclusive of the string leading to '*'), or a full URI. -func LabelQueryLabels(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, sources []string, uriPatterns []string) (*LabelQueryLabels_Output, error) { - var out LabelQueryLabels_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - if len(sources) != 0 { - params["sources"] = sources - } - params["uriPatterns"] = uriPatterns - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.label.queryLabels", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/labelsubscribelabels.go b/pkg/comatproto/labelsubscribelabels.go deleted file mode 100644 index a35981fb..00000000 --- a/pkg/comatproto/labelsubscribelabels.go +++ /dev/null @@ -1,52 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.label.subscribeLabels - -package comatproto - -import ( - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -// LabelSubscribeLabels_Info is a "info" in the com.atproto.label.subscribeLabels schema. -type LabelSubscribeLabels_Info struct { - LexiconTypeID string `json:"$type"` - Message *string `json:"message,omitempty"` - Name string `json:"name"` -} - -func (t *LabelSubscribeLabels_Info) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.label.subscribeLabels" - return glexrt.MarshalCBOR(w, t) -} - -func (t *LabelSubscribeLabels_Info) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// LabelSubscribeLabels_Labels is a "labels" in the com.atproto.label.subscribeLabels schema. -type LabelSubscribeLabels_Labels struct { - LexiconTypeID string `json:"$type"` - Labels []LabelDefs_Label `json:"labels"` - Seq int64 `json:"seq"` -} - -func (t *LabelSubscribeLabels_Labels) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.label.subscribeLabels" - return glexrt.MarshalCBOR(w, t) -} - -func (t *LabelSubscribeLabels_Labels) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/lexiconschema.go b/pkg/comatproto/lexiconschema.go deleted file mode 100644 index 414543ac..00000000 --- a/pkg/comatproto/lexiconschema.go +++ /dev/null @@ -1,36 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.lexicon.schema - -package comatproto - -import ( - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -func init() { - glexrt.RegisterType("com.atproto.lexicon.schema", &LexiconSchema{}) -} - -// Representation of Lexicon schemas themselves, when published as atproto records. Note that the schema language is not defined in Lexicon; this meta schema currently only includes a single version field ('lexicon'). See the atproto specifications for description of the other expected top-level fields ('id', 'defs', etc). -type LexiconSchema struct { - LexiconTypeID string `json:"$type"` - // lexicon: Indicates the 'version' of the Lexicon language. Must be '1' for the current atproto/Lexicon schema system. - Lexicon int64 `json:"lexicon"` -} - -func (t *LexiconSchema) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.lexicon.schema" - return glexrt.MarshalCBOR(w, t) -} - -func (t *LexiconSchema) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/moderationcreatereport.go b/pkg/comatproto/moderationcreatereport.go deleted file mode 100644 index f1804ac4..00000000 --- a/pkg/comatproto/moderationcreatereport.go +++ /dev/null @@ -1,234 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.moderation.createReport - -package comatproto - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ModerationCreateReport_Input struct { - LexiconTypeID string `json:"$type"` - ModTool *ModerationCreateReport_ModTool `json:"modTool,omitempty"` - // reason: Additional context about the content and violation. - Reason *string `json:"reason,omitempty"` - // reasonType: Indicates the broad category of violation the report is for. - ReasonType string `json:"reasonType"` - Subject ModerationCreateReport_Input_Subject `json:"subject"` -} - -func (t *ModerationCreateReport_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.moderation.createReport#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ModerationCreateReport_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type ModerationCreateReport_Input_Subject struct { - AdminDefs_RepoRef *AdminDefs_RepoRef - RepoStrongRef *RepoStrongRef -} - -func (t *ModerationCreateReport_Input_Subject) MarshalJSON() ([]byte, error) { - if t.AdminDefs_RepoRef != nil { - t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" - return json.Marshal(t.AdminDefs_RepoRef) - } - if t.RepoStrongRef != nil { - t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" - return json.Marshal(t.RepoStrongRef) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *ModerationCreateReport_Input_Subject) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "com.atproto.admin.defs#repoRef": - t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) - return json.Unmarshal(b, t.AdminDefs_RepoRef) - case "com.atproto.repo.strongRef": - t.RepoStrongRef = new(RepoStrongRef) - return json.Unmarshal(b, t.RepoStrongRef) - default: - return nil - } -} - -func (t *ModerationCreateReport_Input_Subject) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.AdminDefs_RepoRef != nil { - return t.AdminDefs_RepoRef.MarshalCBOR(w) - } - if t.RepoStrongRef != nil { - return t.RepoStrongRef.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *ModerationCreateReport_Input_Subject) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "com.atproto.admin.defs#repoRef": - t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) - return t.AdminDefs_RepoRef.UnmarshalCBOR(bytes.NewReader(b)) - case "com.atproto.repo.strongRef": - t.RepoStrongRef = new(RepoStrongRef) - return t.RepoStrongRef.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} - -type ModerationCreateReport_Output struct { - LexiconTypeID string `json:"$type"` - CreatedAt string `json:"createdAt"` - Id int64 `json:"id"` - Reason *string `json:"reason,omitempty"` - ReasonType string `json:"reasonType"` - ReportedBy string `json:"reportedBy"` - Subject ModerationCreateReport_Output_Subject `json:"subject"` -} - -func (t *ModerationCreateReport_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.moderation.createReport#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ModerationCreateReport_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type ModerationCreateReport_Output_Subject struct { - AdminDefs_RepoRef *AdminDefs_RepoRef - RepoStrongRef *RepoStrongRef -} - -func (t *ModerationCreateReport_Output_Subject) MarshalJSON() ([]byte, error) { - if t.AdminDefs_RepoRef != nil { - t.AdminDefs_RepoRef.LexiconTypeID = "com.atproto.admin.defs#repoRef" - return json.Marshal(t.AdminDefs_RepoRef) - } - if t.RepoStrongRef != nil { - t.RepoStrongRef.LexiconTypeID = "com.atproto.repo.strongRef" - return json.Marshal(t.RepoStrongRef) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *ModerationCreateReport_Output_Subject) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "com.atproto.admin.defs#repoRef": - t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) - return json.Unmarshal(b, t.AdminDefs_RepoRef) - case "com.atproto.repo.strongRef": - t.RepoStrongRef = new(RepoStrongRef) - return json.Unmarshal(b, t.RepoStrongRef) - default: - return nil - } -} - -func (t *ModerationCreateReport_Output_Subject) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.AdminDefs_RepoRef != nil { - return t.AdminDefs_RepoRef.MarshalCBOR(w) - } - if t.RepoStrongRef != nil { - return t.RepoStrongRef.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *ModerationCreateReport_Output_Subject) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "com.atproto.admin.defs#repoRef": - t.AdminDefs_RepoRef = new(AdminDefs_RepoRef) - return t.AdminDefs_RepoRef.UnmarshalCBOR(bytes.NewReader(b)) - case "com.atproto.repo.strongRef": - t.RepoStrongRef = new(RepoStrongRef) - return t.RepoStrongRef.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} - -// ModerationCreateReport calls the XRPC method "com.atproto.moderation.createReport". -// -// Submit a moderation report regarding an atproto account or record. Implemented by moderation services (with PDS proxying), and requires auth. -func ModerationCreateReport(ctx context.Context, c glexrt.LexClient, input *ModerationCreateReport_Input) (*ModerationCreateReport_Output, error) { - var out ModerationCreateReport_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.moderation.createReport", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} - -// ModerationCreateReport_ModTool is a "modTool" in the com.atproto.moderation.createReport schema. -// -// Moderation tool information for tracing the source of the action -type ModerationCreateReport_ModTool struct { - LexiconTypeID string `json:"$type"` - // meta: Additional arbitrary metadata about the source - Meta *glexrt.LexiconTypeDecoder `json:"meta,omitempty"` - // name: Name/identifier of the source (e.g., 'bsky-app/android', 'bsky-web/chrome') - Name string `json:"name"` -} - -func (t *ModerationCreateReport_ModTool) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.moderation.createReport" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ModerationCreateReport_ModTool) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/repoapplywrites.go b/pkg/comatproto/repoapplywrites.go deleted file mode 100644 index 2809e513..00000000 --- a/pkg/comatproto/repoapplywrites.go +++ /dev/null @@ -1,364 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.repo.applyWrites - -package comatproto - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type RepoApplyWrites_Input struct { - LexiconTypeID string `json:"$type"` - // repo: The handle or DID of the repo (aka, current account). - Repo string `json:"repo"` - // swapCommit: If provided, the entire operation will fail if the current repo commit CID does not match this value. Used to prevent conflicting repo mutations. - SwapCommit *string `json:"swapCommit,omitempty"` - // validate: Can be set to 'false' to skip Lexicon schema validation of record data across all operations, 'true' to require it, or leave unset to validate only for known Lexicons. - Validate *bool `json:"validate,omitempty"` - Writes []RepoApplyWrites_Input_Writes_Elem `json:"writes"` -} - -func (t *RepoApplyWrites_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.repo.applyWrites#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *RepoApplyWrites_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type RepoApplyWrites_Input_Writes_Elem struct { - RepoApplyWrites_Create *RepoApplyWrites_Create - RepoApplyWrites_Delete *RepoApplyWrites_Delete - RepoApplyWrites_Update *RepoApplyWrites_Update -} - -func (t *RepoApplyWrites_Input_Writes_Elem) MarshalJSON() ([]byte, error) { - if t.RepoApplyWrites_Create != nil { - t.RepoApplyWrites_Create.LexiconTypeID = "com.atproto.repo.applyWrites#create" - return json.Marshal(t.RepoApplyWrites_Create) - } - if t.RepoApplyWrites_Delete != nil { - t.RepoApplyWrites_Delete.LexiconTypeID = "com.atproto.repo.applyWrites#delete" - return json.Marshal(t.RepoApplyWrites_Delete) - } - if t.RepoApplyWrites_Update != nil { - t.RepoApplyWrites_Update.LexiconTypeID = "com.atproto.repo.applyWrites#update" - return json.Marshal(t.RepoApplyWrites_Update) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *RepoApplyWrites_Input_Writes_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "com.atproto.repo.applyWrites#create": - t.RepoApplyWrites_Create = new(RepoApplyWrites_Create) - return json.Unmarshal(b, t.RepoApplyWrites_Create) - case "com.atproto.repo.applyWrites#delete": - t.RepoApplyWrites_Delete = new(RepoApplyWrites_Delete) - return json.Unmarshal(b, t.RepoApplyWrites_Delete) - case "com.atproto.repo.applyWrites#update": - t.RepoApplyWrites_Update = new(RepoApplyWrites_Update) - return json.Unmarshal(b, t.RepoApplyWrites_Update) - default: - return fmt.Errorf("closed unions must match a listed schema") - } -} - -func (t *RepoApplyWrites_Input_Writes_Elem) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.RepoApplyWrites_Create != nil { - return t.RepoApplyWrites_Create.MarshalCBOR(w) - } - if t.RepoApplyWrites_Delete != nil { - return t.RepoApplyWrites_Delete.MarshalCBOR(w) - } - if t.RepoApplyWrites_Update != nil { - return t.RepoApplyWrites_Update.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *RepoApplyWrites_Input_Writes_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "com.atproto.repo.applyWrites#create": - t.RepoApplyWrites_Create = new(RepoApplyWrites_Create) - return t.RepoApplyWrites_Create.UnmarshalCBOR(bytes.NewReader(b)) - case "com.atproto.repo.applyWrites#delete": - t.RepoApplyWrites_Delete = new(RepoApplyWrites_Delete) - return t.RepoApplyWrites_Delete.UnmarshalCBOR(bytes.NewReader(b)) - case "com.atproto.repo.applyWrites#update": - t.RepoApplyWrites_Update = new(RepoApplyWrites_Update) - return t.RepoApplyWrites_Update.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} - -type RepoApplyWrites_Output struct { - LexiconTypeID string `json:"$type"` - Commit *RepoDefs_CommitMeta `json:"commit,omitempty"` - Results []RepoApplyWrites_Output_Results_Elem `json:"results,omitempty"` -} - -func (t *RepoApplyWrites_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.repo.applyWrites#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *RepoApplyWrites_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type RepoApplyWrites_Output_Results_Elem struct { - RepoApplyWrites_CreateResult *RepoApplyWrites_CreateResult - RepoApplyWrites_DeleteResult *RepoApplyWrites_DeleteResult - RepoApplyWrites_UpdateResult *RepoApplyWrites_UpdateResult -} - -func (t *RepoApplyWrites_Output_Results_Elem) MarshalJSON() ([]byte, error) { - if t.RepoApplyWrites_CreateResult != nil { - t.RepoApplyWrites_CreateResult.LexiconTypeID = "com.atproto.repo.applyWrites#createResult" - return json.Marshal(t.RepoApplyWrites_CreateResult) - } - if t.RepoApplyWrites_DeleteResult != nil { - t.RepoApplyWrites_DeleteResult.LexiconTypeID = "com.atproto.repo.applyWrites#deleteResult" - return json.Marshal(t.RepoApplyWrites_DeleteResult) - } - if t.RepoApplyWrites_UpdateResult != nil { - t.RepoApplyWrites_UpdateResult.LexiconTypeID = "com.atproto.repo.applyWrites#updateResult" - return json.Marshal(t.RepoApplyWrites_UpdateResult) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *RepoApplyWrites_Output_Results_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "com.atproto.repo.applyWrites#createResult": - t.RepoApplyWrites_CreateResult = new(RepoApplyWrites_CreateResult) - return json.Unmarshal(b, t.RepoApplyWrites_CreateResult) - case "com.atproto.repo.applyWrites#deleteResult": - t.RepoApplyWrites_DeleteResult = new(RepoApplyWrites_DeleteResult) - return json.Unmarshal(b, t.RepoApplyWrites_DeleteResult) - case "com.atproto.repo.applyWrites#updateResult": - t.RepoApplyWrites_UpdateResult = new(RepoApplyWrites_UpdateResult) - return json.Unmarshal(b, t.RepoApplyWrites_UpdateResult) - default: - return fmt.Errorf("closed unions must match a listed schema") - } -} - -func (t *RepoApplyWrites_Output_Results_Elem) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.RepoApplyWrites_CreateResult != nil { - return t.RepoApplyWrites_CreateResult.MarshalCBOR(w) - } - if t.RepoApplyWrites_DeleteResult != nil { - return t.RepoApplyWrites_DeleteResult.MarshalCBOR(w) - } - if t.RepoApplyWrites_UpdateResult != nil { - return t.RepoApplyWrites_UpdateResult.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *RepoApplyWrites_Output_Results_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "com.atproto.repo.applyWrites#createResult": - t.RepoApplyWrites_CreateResult = new(RepoApplyWrites_CreateResult) - return t.RepoApplyWrites_CreateResult.UnmarshalCBOR(bytes.NewReader(b)) - case "com.atproto.repo.applyWrites#deleteResult": - t.RepoApplyWrites_DeleteResult = new(RepoApplyWrites_DeleteResult) - return t.RepoApplyWrites_DeleteResult.UnmarshalCBOR(bytes.NewReader(b)) - case "com.atproto.repo.applyWrites#updateResult": - t.RepoApplyWrites_UpdateResult = new(RepoApplyWrites_UpdateResult) - return t.RepoApplyWrites_UpdateResult.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} - -// RepoApplyWrites calls the XRPC method "com.atproto.repo.applyWrites". -// -// Apply a batch transaction of repository creates, updates, and deletes. Requires auth, implemented by PDS. -func RepoApplyWrites(ctx context.Context, c glexrt.LexClient, input *RepoApplyWrites_Input) (*RepoApplyWrites_Output, error) { - var out RepoApplyWrites_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.repo.applyWrites", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} - -// RepoApplyWrites_Create is a "create" in the com.atproto.repo.applyWrites schema. -// -// Operation which creates a new record. -type RepoApplyWrites_Create struct { - LexiconTypeID string `json:"$type"` - Collection string `json:"collection"` - // rkey: NOTE: maxLength is redundant with record-key format. Keeping it temporarily to ensure backwards compatibility. - Rkey *string `json:"rkey,omitempty"` - Value *glexrt.LexiconTypeDecoder `json:"value"` -} - -func (t *RepoApplyWrites_Create) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.repo.applyWrites" - return glexrt.MarshalCBOR(w, t) -} - -func (t *RepoApplyWrites_Create) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// RepoApplyWrites_CreateResult is a "createResult" in the com.atproto.repo.applyWrites schema. -type RepoApplyWrites_CreateResult struct { - LexiconTypeID string `json:"$type"` - Cid string `json:"cid"` - Uri string `json:"uri"` - ValidationStatus *string `json:"validationStatus,omitempty"` -} - -func (t *RepoApplyWrites_CreateResult) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.repo.applyWrites" - return glexrt.MarshalCBOR(w, t) -} - -func (t *RepoApplyWrites_CreateResult) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// RepoApplyWrites_Delete is a "delete" in the com.atproto.repo.applyWrites schema. -// -// Operation which deletes an existing record. -type RepoApplyWrites_Delete struct { - LexiconTypeID string `json:"$type"` - Collection string `json:"collection"` - Rkey string `json:"rkey"` -} - -func (t *RepoApplyWrites_Delete) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.repo.applyWrites" - return glexrt.MarshalCBOR(w, t) -} - -func (t *RepoApplyWrites_Delete) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// RepoApplyWrites_DeleteResult is a "deleteResult" in the com.atproto.repo.applyWrites schema. -type RepoApplyWrites_DeleteResult struct { - LexiconTypeID string `json:"$type"` -} - -func (t *RepoApplyWrites_DeleteResult) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.repo.applyWrites" - return glexrt.MarshalCBOR(w, t) -} - -func (t *RepoApplyWrites_DeleteResult) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// RepoApplyWrites_Update is a "update" in the com.atproto.repo.applyWrites schema. -// -// Operation which updates an existing record. -type RepoApplyWrites_Update struct { - LexiconTypeID string `json:"$type"` - Collection string `json:"collection"` - Rkey string `json:"rkey"` - Value *glexrt.LexiconTypeDecoder `json:"value"` -} - -func (t *RepoApplyWrites_Update) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.repo.applyWrites" - return glexrt.MarshalCBOR(w, t) -} - -func (t *RepoApplyWrites_Update) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// RepoApplyWrites_UpdateResult is a "updateResult" in the com.atproto.repo.applyWrites schema. -type RepoApplyWrites_UpdateResult struct { - LexiconTypeID string `json:"$type"` - Cid string `json:"cid"` - Uri string `json:"uri"` - ValidationStatus *string `json:"validationStatus,omitempty"` -} - -func (t *RepoApplyWrites_UpdateResult) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.repo.applyWrites" - return glexrt.MarshalCBOR(w, t) -} - -func (t *RepoApplyWrites_UpdateResult) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/repocreaterecord.go b/pkg/comatproto/repocreaterecord.go index 7a9f63cb..e36559ef 100644 --- a/pkg/comatproto/repocreaterecord.go +++ b/pkg/comatproto/repocreaterecord.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -17,7 +17,7 @@ type RepoCreateRecord_Input struct { // collection: The NSID of the record collection. Collection string `json:"collection"` // record: The record itself. Must contain a $type field. - Record *glexrt.LexiconTypeDecoder `json:"record"` + Record *glex.LexiconTypeDecoder `json:"record"` // repo: The handle or DID of the repo (aka, current account). Repo string `json:"repo"` // rkey: The Record Key. @@ -28,17 +28,20 @@ type RepoCreateRecord_Input struct { Validate *bool `json:"validate,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *RepoCreateRecord_Input) RecordTypeID() string { return "com.atproto.repo.createRecord" } + func (t *RepoCreateRecord_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.repo.createRecord#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.repo.createRecord" + return glex.MarshalCBOR(w, t) } func (t *RepoCreateRecord_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type RepoCreateRecord_Output struct { @@ -49,26 +52,29 @@ type RepoCreateRecord_Output struct { ValidationStatus *string `json:"validationStatus,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *RepoCreateRecord_Output) RecordTypeID() string { return "com.atproto.repo.createRecord" } + func (t *RepoCreateRecord_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.repo.createRecord#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.repo.createRecord" + return glex.MarshalCBOR(w, t) } func (t *RepoCreateRecord_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // RepoCreateRecord calls the XRPC method "com.atproto.repo.createRecord". // // Create a single new repository record. Requires auth, implemented by PDS. -func RepoCreateRecord(ctx context.Context, c glexrt.LexClient, input *RepoCreateRecord_Input) (*RepoCreateRecord_Output, error) { +func RepoCreateRecord(ctx context.Context, c glex.LexClient, input *RepoCreateRecord_Input) (*RepoCreateRecord_Output, error) { var out RepoCreateRecord_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.repo.createRecord", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "com.atproto.repo.createRecord", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/comatproto/repodefs.go b/pkg/comatproto/repodefs.go index a6439f8a..ae794557 100644 --- a/pkg/comatproto/repodefs.go +++ b/pkg/comatproto/repodefs.go @@ -7,7 +7,7 @@ package comatproto import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,15 +18,18 @@ type RepoDefs_CommitMeta struct { Rev string `json:"rev"` } +// RecordTypeID implements glex.Record. +func (t *RepoDefs_CommitMeta) RecordTypeID() string { return "com.atproto.repo.defs#commitMeta" } + func (t *RepoDefs_CommitMeta) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.repo.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.repo.defs#commitMeta" + return glex.MarshalCBOR(w, t) } func (t *RepoDefs_CommitMeta) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/comatproto/repodeleterecord.go b/pkg/comatproto/repodeleterecord.go index 84762be5..60de5554 100644 --- a/pkg/comatproto/repodeleterecord.go +++ b/pkg/comatproto/repodeleterecord.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -26,17 +26,20 @@ type RepoDeleteRecord_Input struct { SwapRecord *string `json:"swapRecord,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *RepoDeleteRecord_Input) RecordTypeID() string { return "com.atproto.repo.deleteRecord" } + func (t *RepoDeleteRecord_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.repo.deleteRecord#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.repo.deleteRecord" + return glex.MarshalCBOR(w, t) } func (t *RepoDeleteRecord_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type RepoDeleteRecord_Output struct { @@ -44,26 +47,29 @@ type RepoDeleteRecord_Output struct { Commit *RepoDefs_CommitMeta `json:"commit,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *RepoDeleteRecord_Output) RecordTypeID() string { return "com.atproto.repo.deleteRecord" } + func (t *RepoDeleteRecord_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.repo.deleteRecord#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.repo.deleteRecord" + return glex.MarshalCBOR(w, t) } func (t *RepoDeleteRecord_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // RepoDeleteRecord calls the XRPC method "com.atproto.repo.deleteRecord". // // Delete a repository record, or ensure it doesn't exist. Requires auth, implemented by PDS. -func RepoDeleteRecord(ctx context.Context, c glexrt.LexClient, input *RepoDeleteRecord_Input) (*RepoDeleteRecord_Output, error) { +func RepoDeleteRecord(ctx context.Context, c glex.LexClient, input *RepoDeleteRecord_Input) (*RepoDeleteRecord_Output, error) { var out RepoDeleteRecord_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.repo.deleteRecord", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "com.atproto.repo.deleteRecord", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/comatproto/repodescriberepo.go b/pkg/comatproto/repodescriberepo.go index 091ecc29..1837628b 100644 --- a/pkg/comatproto/repodescriberepo.go +++ b/pkg/comatproto/repodescriberepo.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,23 +18,26 @@ type RepoDescribeRepo_Output struct { Collections []string `json:"collections"` Did string `json:"did"` // didDoc: The complete DID document for this account. - DidDoc *glexrt.LexiconTypeDecoder `json:"didDoc"` - Handle string `json:"handle"` + DidDoc *glex.LexiconTypeDecoder `json:"didDoc"` + Handle string `json:"handle"` // handleIsCorrect: Indicates if handle is currently valid (resolves bi-directionally) HandleIsCorrect bool `json:"handleIsCorrect"` } +// RecordTypeID implements glex.Record. +func (t *RepoDescribeRepo_Output) RecordTypeID() string { return "com.atproto.repo.describeRepo" } + func (t *RepoDescribeRepo_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.repo.describeRepo#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.repo.describeRepo" + return glex.MarshalCBOR(w, t) } func (t *RepoDescribeRepo_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // RepoDescribeRepo calls the XRPC method "com.atproto.repo.describeRepo". @@ -42,13 +45,13 @@ func (t *RepoDescribeRepo_Output) UnmarshalCBOR(r io.Reader) error { // Get information about an account and repository, including the list of collections. Does not require auth. // // repo: The handle or DID of the repo. -func RepoDescribeRepo(ctx context.Context, c glexrt.LexClient, repo string) (*RepoDescribeRepo_Output, error) { +func RepoDescribeRepo(ctx context.Context, c glex.LexClient, repo string) (*RepoDescribeRepo_Output, error) { var out RepoDescribeRepo_Output params := map[string]interface{}{} params["repo"] = repo - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.repo.describeRepo", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "com.atproto.repo.describeRepo", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/comatproto/repogetrecord.go b/pkg/comatproto/repogetrecord.go index d5ae21ec..8955ff3e 100644 --- a/pkg/comatproto/repogetrecord.go +++ b/pkg/comatproto/repogetrecord.go @@ -8,28 +8,31 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type RepoGetRecord_Output struct { - LexiconTypeID string `json:"$type"` - Cid *string `json:"cid,omitempty"` - Uri string `json:"uri"` - Value *glexrt.LexiconTypeDecoder `json:"value"` + LexiconTypeID string `json:"$type"` + Cid *string `json:"cid,omitempty"` + Uri string `json:"uri"` + Value *glex.LexiconTypeDecoder `json:"value"` } +// RecordTypeID implements glex.Record. +func (t *RepoGetRecord_Output) RecordTypeID() string { return "com.atproto.repo.getRecord" } + func (t *RepoGetRecord_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.repo.getRecord#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.repo.getRecord" + return glex.MarshalCBOR(w, t) } func (t *RepoGetRecord_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // RepoGetRecord calls the XRPC method "com.atproto.repo.getRecord". @@ -40,7 +43,7 @@ func (t *RepoGetRecord_Output) UnmarshalCBOR(r io.Reader) error { // collection: The NSID of the record collection. // repo: The handle or DID of the repo. // rkey: The Record Key. -func RepoGetRecord(ctx context.Context, c glexrt.LexClient, cid string, collection string, repo string, rkey string) (*RepoGetRecord_Output, error) { +func RepoGetRecord(ctx context.Context, c glex.LexClient, cid string, collection string, repo string, rkey string) (*RepoGetRecord_Output, error) { var out RepoGetRecord_Output params := map[string]interface{}{} @@ -51,7 +54,7 @@ func RepoGetRecord(ctx context.Context, c glexrt.LexClient, cid string, collecti params["repo"] = repo params["rkey"] = rkey - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.repo.getRecord", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "com.atproto.repo.getRecord", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/comatproto/repoimportrepo.go b/pkg/comatproto/repoimportrepo.go deleted file mode 100644 index a17400a5..00000000 --- a/pkg/comatproto/repoimportrepo.go +++ /dev/null @@ -1,23 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.repo.importRepo - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" -) - -// RepoImportRepo calls the XRPC method "com.atproto.repo.importRepo". -// -// Import a repo in the form of a CAR file. Requires Content-Length HTTP header to be set. -func RepoImportRepo(ctx context.Context, c glexrt.LexClient, input io.Reader) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/vnd.ipld.car", "com.atproto.repo.importRepo", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/repolistmissingblobs.go b/pkg/comatproto/repolistmissingblobs.go deleted file mode 100644 index ea5f7265..00000000 --- a/pkg/comatproto/repolistmissingblobs.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.repo.listMissingBlobs - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type RepoListMissingBlobs_Output struct { - LexiconTypeID string `json:"$type"` - Blobs []RepoListMissingBlobs_RecordBlob `json:"blobs"` - Cursor *string `json:"cursor,omitempty"` -} - -func (t *RepoListMissingBlobs_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.repo.listMissingBlobs#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *RepoListMissingBlobs_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// RepoListMissingBlobs calls the XRPC method "com.atproto.repo.listMissingBlobs". -// -// Returns a list of missing blobs for the requesting account. Intended to be used in the account migration flow. -func RepoListMissingBlobs(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64) (*RepoListMissingBlobs_Output, error) { - var out RepoListMissingBlobs_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.repo.listMissingBlobs", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// RepoListMissingBlobs_RecordBlob is a "recordBlob" in the com.atproto.repo.listMissingBlobs schema. -type RepoListMissingBlobs_RecordBlob struct { - LexiconTypeID string `json:"$type"` - Cid string `json:"cid"` - RecordUri string `json:"recordUri"` -} - -func (t *RepoListMissingBlobs_RecordBlob) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.repo.listMissingBlobs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *RepoListMissingBlobs_RecordBlob) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/repolistrecords.go b/pkg/comatproto/repolistrecords.go index 81caec69..1db04cf1 100644 --- a/pkg/comatproto/repolistrecords.go +++ b/pkg/comatproto/repolistrecords.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,17 +18,20 @@ type RepoListRecords_Output struct { Records []RepoListRecords_Record `json:"records"` } +// RecordTypeID implements glex.Record. +func (t *RepoListRecords_Output) RecordTypeID() string { return "com.atproto.repo.listRecords" } + func (t *RepoListRecords_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.repo.listRecords#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.repo.listRecords" + return glex.MarshalCBOR(w, t) } func (t *RepoListRecords_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // RepoListRecords calls the XRPC method "com.atproto.repo.listRecords". @@ -39,7 +42,7 @@ func (t *RepoListRecords_Output) UnmarshalCBOR(r io.Reader) error { // limit: The number of records to return. // repo: The handle or DID of the repo. // reverse: Flag to reverse the order of the returned records. -func RepoListRecords(ctx context.Context, c glexrt.LexClient, collection string, cursor string, limit *int64, repo string, reverse *bool) (*RepoListRecords_Output, error) { +func RepoListRecords(ctx context.Context, c glex.LexClient, collection string, cursor string, limit *int64, repo string, reverse *bool) (*RepoListRecords_Output, error) { var out RepoListRecords_Output params := map[string]interface{}{} @@ -55,7 +58,7 @@ func RepoListRecords(ctx context.Context, c glexrt.LexClient, collection string, params["collection"] = collection params["repo"] = repo - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.repo.listRecords", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "com.atproto.repo.listRecords", params, nil, &out); err != nil { return nil, err } return &out, nil @@ -63,21 +66,24 @@ func RepoListRecords(ctx context.Context, c glexrt.LexClient, collection string, // RepoListRecords_Record is a "record" in the com.atproto.repo.listRecords schema. type RepoListRecords_Record struct { - LexiconTypeID string `json:"$type"` - Cid string `json:"cid"` - Uri string `json:"uri"` - Value *glexrt.LexiconTypeDecoder `json:"value"` + LexiconTypeID string `json:"$type"` + Cid string `json:"cid"` + Uri string `json:"uri"` + Value *glex.LexiconTypeDecoder `json:"value"` } +// RecordTypeID implements glex.Record. +func (t *RepoListRecords_Record) RecordTypeID() string { return "com.atproto.repo.listRecords#record" } + func (t *RepoListRecords_Record) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.repo.listRecords" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.repo.listRecords#record" + return glex.MarshalCBOR(w, t) } func (t *RepoListRecords_Record) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/comatproto/repoputrecord.go b/pkg/comatproto/repoputrecord.go index ac873240..c234a25f 100644 --- a/pkg/comatproto/repoputrecord.go +++ b/pkg/comatproto/repoputrecord.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -17,7 +17,7 @@ type RepoPutRecord_Input struct { // collection: The NSID of the record collection. Collection string `json:"collection"` // record: The record to write. - Record *glexrt.LexiconTypeDecoder `json:"record"` + Record *glex.LexiconTypeDecoder `json:"record"` // repo: The handle or DID of the repo (aka, current account). Repo string `json:"repo"` // rkey: The Record Key. @@ -30,17 +30,20 @@ type RepoPutRecord_Input struct { Validate *bool `json:"validate,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *RepoPutRecord_Input) RecordTypeID() string { return "com.atproto.repo.putRecord" } + func (t *RepoPutRecord_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.repo.putRecord#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.repo.putRecord" + return glex.MarshalCBOR(w, t) } func (t *RepoPutRecord_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type RepoPutRecord_Output struct { @@ -51,26 +54,29 @@ type RepoPutRecord_Output struct { ValidationStatus *string `json:"validationStatus,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *RepoPutRecord_Output) RecordTypeID() string { return "com.atproto.repo.putRecord" } + func (t *RepoPutRecord_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.repo.putRecord#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.repo.putRecord" + return glex.MarshalCBOR(w, t) } func (t *RepoPutRecord_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // RepoPutRecord calls the XRPC method "com.atproto.repo.putRecord". // // Write a repository record, creating or updating it as needed. Requires auth, implemented by PDS. -func RepoPutRecord(ctx context.Context, c glexrt.LexClient, input *RepoPutRecord_Input) (*RepoPutRecord_Output, error) { +func RepoPutRecord(ctx context.Context, c glex.LexClient, input *RepoPutRecord_Input) (*RepoPutRecord_Output, error) { var out RepoPutRecord_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.repo.putRecord", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "com.atproto.repo.putRecord", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/comatproto/repostrongref.go b/pkg/comatproto/repostrongref.go index 60b53732..271bb1da 100644 --- a/pkg/comatproto/repostrongref.go +++ b/pkg/comatproto/repostrongref.go @@ -7,12 +7,12 @@ package comatproto import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("com.atproto.repo.strongRef#main", &RepoStrongRef{}) + glex.RegisterType("com.atproto.repo.strongRef#main", &RepoStrongRef{}) } type RepoStrongRef struct { @@ -21,15 +21,18 @@ type RepoStrongRef struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *RepoStrongRef) RecordTypeID() string { return "com.atproto.repo.strongRef" } + func (t *RepoStrongRef) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "com.atproto.repo.strongRef" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *RepoStrongRef) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/comatproto/repouploadblob.go b/pkg/comatproto/repouploadblob.go index 82f0e6d0..165e30f6 100644 --- a/pkg/comatproto/repouploadblob.go +++ b/pkg/comatproto/repouploadblob.go @@ -8,35 +8,38 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) type RepoUploadBlob_Output struct { - LexiconTypeID string `json:"$type"` - Blob glexrt.Blob `json:"blob"` + LexiconTypeID string `json:"$type"` + Blob glex.Blob `json:"blob"` } +// RecordTypeID implements glex.Record. +func (t *RepoUploadBlob_Output) RecordTypeID() string { return "com.atproto.repo.uploadBlob" } + func (t *RepoUploadBlob_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.repo.uploadBlob#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.repo.uploadBlob" + return glex.MarshalCBOR(w, t) } func (t *RepoUploadBlob_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // RepoUploadBlob calls the XRPC method "com.atproto.repo.uploadBlob". // // Upload a new blob, to be referenced from a repository record. The blob will be deleted if it is not referenced within a time window (eg, minutes). Blob restrictions (mimetype, size, etc) are enforced when the reference is created. Requires auth, implemented by PDS. -func RepoUploadBlob(ctx context.Context, c glexrt.LexClient, input io.Reader) (*RepoUploadBlob_Output, error) { +func RepoUploadBlob(ctx context.Context, c glex.LexClient, input io.Reader) (*RepoUploadBlob_Output, error) { var out RepoUploadBlob_Output - if err := c.LexDo(ctx, glexrt.Procedure, "*/*", "com.atproto.repo.uploadBlob", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "*/*", "com.atproto.repo.uploadBlob", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/comatproto/serveractivateaccount.go b/pkg/comatproto/serveractivateaccount.go deleted file mode 100644 index c3c26a5e..00000000 --- a/pkg/comatproto/serveractivateaccount.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.activateAccount - -package comatproto - -import ( - "context" - - glexrt "github.com/streamplace/glex/runtime" -) - -// ServerActivateAccount calls the XRPC method "com.atproto.server.activateAccount". -// -// Activates a currently deactivated account. Used to finalize account migration after the account's repo is imported and identity is setup. -func ServerActivateAccount(ctx context.Context, c glexrt.LexClient) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "", "com.atproto.server.activateAccount", nil, nil, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/servercheckaccountstatus.go b/pkg/comatproto/servercheckaccountstatus.go deleted file mode 100644 index 96a08293..00000000 --- a/pkg/comatproto/servercheckaccountstatus.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.checkAccountStatus - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerCheckAccountStatus_Output struct { - LexiconTypeID string `json:"$type"` - Activated bool `json:"activated"` - ExpectedBlobs int64 `json:"expectedBlobs"` - ImportedBlobs int64 `json:"importedBlobs"` - IndexedRecords int64 `json:"indexedRecords"` - PrivateStateValues int64 `json:"privateStateValues"` - RepoBlocks int64 `json:"repoBlocks"` - RepoCommit string `json:"repoCommit"` - RepoRev string `json:"repoRev"` - ValidDid bool `json:"validDid"` -} - -func (t *ServerCheckAccountStatus_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.checkAccountStatus#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerCheckAccountStatus_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerCheckAccountStatus calls the XRPC method "com.atproto.server.checkAccountStatus". -// -// Returns the status of an account, especially as pertaining to import or recovery. Can be called many times over the course of an account migration. Requires auth and can only be called pertaining to oneself. -func ServerCheckAccountStatus(ctx context.Context, c glexrt.LexClient) (*ServerCheckAccountStatus_Output, error) { - var out ServerCheckAccountStatus_Output - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.server.checkAccountStatus", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/serverconfirmemail.go b/pkg/comatproto/serverconfirmemail.go deleted file mode 100644 index eb9abd95..00000000 --- a/pkg/comatproto/serverconfirmemail.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.confirmEmail - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerConfirmEmail_Input struct { - LexiconTypeID string `json:"$type"` - Email string `json:"email"` - Token string `json:"token"` -} - -func (t *ServerConfirmEmail_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.confirmEmail#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerConfirmEmail_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerConfirmEmail calls the XRPC method "com.atproto.server.confirmEmail". -// -// Confirm an email using a token from com.atproto.server.requestEmailConfirmation. -func ServerConfirmEmail(ctx context.Context, c glexrt.LexClient, input *ServerConfirmEmail_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.server.confirmEmail", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/servercreateaccount.go b/pkg/comatproto/servercreateaccount.go deleted file mode 100644 index 006d6288..00000000 --- a/pkg/comatproto/servercreateaccount.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.createAccount - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerCreateAccount_Input struct { - LexiconTypeID string `json:"$type"` - // did: Pre-existing atproto DID, being imported to a new account. - Did *string `json:"did,omitempty"` - Email *string `json:"email,omitempty"` - // handle: Requested handle for the account. - Handle string `json:"handle"` - InviteCode *string `json:"inviteCode,omitempty"` - // password: Initial account password. May need to meet instance-specific password strength requirements. - Password *string `json:"password,omitempty"` - // plcOp: A signed DID PLC operation to be submitted as part of importing an existing account to this instance. NOTE: this optional field may be updated when full account migration is implemented. - PlcOp *glexrt.LexiconTypeDecoder `json:"plcOp,omitempty"` - // recoveryKey: DID PLC rotation key (aka, recovery key) to be included in PLC creation operation. - RecoveryKey *string `json:"recoveryKey,omitempty"` - VerificationCode *string `json:"verificationCode,omitempty"` - VerificationPhone *string `json:"verificationPhone,omitempty"` -} - -func (t *ServerCreateAccount_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.createAccount#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerCreateAccount_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// Account login session returned on successful account creation. -type ServerCreateAccount_Output struct { - LexiconTypeID string `json:"$type"` - AccessJwt string `json:"accessJwt"` - // did: The DID of the new account. - Did string `json:"did"` - // didDoc: Complete DID document. - DidDoc *glexrt.LexiconTypeDecoder `json:"didDoc,omitempty"` - Handle string `json:"handle"` - RefreshJwt string `json:"refreshJwt"` -} - -func (t *ServerCreateAccount_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.createAccount#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerCreateAccount_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerCreateAccount calls the XRPC method "com.atproto.server.createAccount". -// -// Create an account. Implemented by PDS. -func ServerCreateAccount(ctx context.Context, c glexrt.LexClient, input *ServerCreateAccount_Input) (*ServerCreateAccount_Output, error) { - var out ServerCreateAccount_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.server.createAccount", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/servercreateapppassword.go b/pkg/comatproto/servercreateapppassword.go deleted file mode 100644 index 39b92228..00000000 --- a/pkg/comatproto/servercreateapppassword.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.createAppPassword - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerCreateAppPassword_Input struct { - LexiconTypeID string `json:"$type"` - // name: A short name for the App Password, to help distinguish them. - Name string `json:"name"` - // privileged: If an app password has 'privileged' access to possibly sensitive account state. Meant for use with trusted clients. - Privileged *bool `json:"privileged,omitempty"` -} - -func (t *ServerCreateAppPassword_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.createAppPassword#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerCreateAppPassword_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerCreateAppPassword calls the XRPC method "com.atproto.server.createAppPassword". -// -// Create an App Password. -func ServerCreateAppPassword(ctx context.Context, c glexrt.LexClient, input *ServerCreateAppPassword_Input) (*ServerCreateAppPassword_AppPassword, error) { - var out ServerCreateAppPassword_AppPassword - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.server.createAppPassword", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} - -// ServerCreateAppPassword_AppPassword is a "appPassword" in the com.atproto.server.createAppPassword schema. -type ServerCreateAppPassword_AppPassword struct { - LexiconTypeID string `json:"$type"` - CreatedAt string `json:"createdAt"` - Name string `json:"name"` - Password string `json:"password"` - Privileged *bool `json:"privileged,omitempty"` -} - -func (t *ServerCreateAppPassword_AppPassword) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.createAppPassword" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerCreateAppPassword_AppPassword) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/servercreateinvitecode.go b/pkg/comatproto/servercreateinvitecode.go deleted file mode 100644 index 82391b10..00000000 --- a/pkg/comatproto/servercreateinvitecode.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.createInviteCode - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerCreateInviteCode_Input struct { - LexiconTypeID string `json:"$type"` - ForAccount *string `json:"forAccount,omitempty"` - UseCount int64 `json:"useCount"` -} - -func (t *ServerCreateInviteCode_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.createInviteCode#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerCreateInviteCode_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type ServerCreateInviteCode_Output struct { - LexiconTypeID string `json:"$type"` - Code string `json:"code"` -} - -func (t *ServerCreateInviteCode_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.createInviteCode#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerCreateInviteCode_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerCreateInviteCode calls the XRPC method "com.atproto.server.createInviteCode". -// -// Create an invite code. -func ServerCreateInviteCode(ctx context.Context, c glexrt.LexClient, input *ServerCreateInviteCode_Input) (*ServerCreateInviteCode_Output, error) { - var out ServerCreateInviteCode_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.server.createInviteCode", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/servercreateinvitecodes.go b/pkg/comatproto/servercreateinvitecodes.go deleted file mode 100644 index 3fb8255e..00000000 --- a/pkg/comatproto/servercreateinvitecodes.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.createInviteCodes - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerCreateInviteCodes_Input struct { - LexiconTypeID string `json:"$type"` - CodeCount int64 `json:"codeCount"` - ForAccounts []string `json:"forAccounts,omitempty"` - UseCount int64 `json:"useCount"` -} - -func (t *ServerCreateInviteCodes_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.createInviteCodes#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerCreateInviteCodes_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type ServerCreateInviteCodes_Output struct { - LexiconTypeID string `json:"$type"` - Codes []ServerCreateInviteCodes_AccountCodes `json:"codes"` -} - -func (t *ServerCreateInviteCodes_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.createInviteCodes#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerCreateInviteCodes_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerCreateInviteCodes calls the XRPC method "com.atproto.server.createInviteCodes". -// -// Create invite codes. -func ServerCreateInviteCodes(ctx context.Context, c glexrt.LexClient, input *ServerCreateInviteCodes_Input) (*ServerCreateInviteCodes_Output, error) { - var out ServerCreateInviteCodes_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.server.createInviteCodes", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} - -// ServerCreateInviteCodes_AccountCodes is a "accountCodes" in the com.atproto.server.createInviteCodes schema. -type ServerCreateInviteCodes_AccountCodes struct { - LexiconTypeID string `json:"$type"` - Account string `json:"account"` - Codes []string `json:"codes"` -} - -func (t *ServerCreateInviteCodes_AccountCodes) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.createInviteCodes" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerCreateInviteCodes_AccountCodes) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/servercreatesession.go b/pkg/comatproto/servercreatesession.go index 0464bbc0..12ba0340 100644 --- a/pkg/comatproto/servercreatesession.go +++ b/pkg/comatproto/servercreatesession.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -22,54 +22,60 @@ type ServerCreateSession_Input struct { Password string `json:"password"` } +// RecordTypeID implements glex.Record. +func (t *ServerCreateSession_Input) RecordTypeID() string { return "com.atproto.server.createSession" } + func (t *ServerCreateSession_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.server.createSession#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.server.createSession" + return glex.MarshalCBOR(w, t) } func (t *ServerCreateSession_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ServerCreateSession_Output struct { - LexiconTypeID string `json:"$type"` - AccessJwt string `json:"accessJwt"` - Active *bool `json:"active,omitempty"` - Did string `json:"did"` - DidDoc *glexrt.LexiconTypeDecoder `json:"didDoc,omitempty"` - Email *string `json:"email,omitempty"` - EmailAuthFactor *bool `json:"emailAuthFactor,omitempty"` - EmailConfirmed *bool `json:"emailConfirmed,omitempty"` - Handle string `json:"handle"` - RefreshJwt string `json:"refreshJwt"` + LexiconTypeID string `json:"$type"` + AccessJwt string `json:"accessJwt"` + Active *bool `json:"active,omitempty"` + Did string `json:"did"` + DidDoc *glex.LexiconTypeDecoder `json:"didDoc,omitempty"` + Email *string `json:"email,omitempty"` + EmailAuthFactor *bool `json:"emailAuthFactor,omitempty"` + EmailConfirmed *bool `json:"emailConfirmed,omitempty"` + Handle string `json:"handle"` + RefreshJwt string `json:"refreshJwt"` // status: If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. Status *string `json:"status,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ServerCreateSession_Output) RecordTypeID() string { return "com.atproto.server.createSession" } + func (t *ServerCreateSession_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.server.createSession#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.server.createSession" + return glex.MarshalCBOR(w, t) } func (t *ServerCreateSession_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ServerCreateSession calls the XRPC method "com.atproto.server.createSession". // // Create an authentication session. -func ServerCreateSession(ctx context.Context, c glexrt.LexClient, input *ServerCreateSession_Input) (*ServerCreateSession_Output, error) { +func ServerCreateSession(ctx context.Context, c glex.LexClient, input *ServerCreateSession_Input) (*ServerCreateSession_Output, error) { var out ServerCreateSession_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.server.createSession", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "com.atproto.server.createSession", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/comatproto/serverdeactivateaccount.go b/pkg/comatproto/serverdeactivateaccount.go deleted file mode 100644 index 2745250a..00000000 --- a/pkg/comatproto/serverdeactivateaccount.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.deactivateAccount - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerDeactivateAccount_Input struct { - LexiconTypeID string `json:"$type"` - // deleteAfter: A recommendation to server as to how long they should hold onto the deactivated account before deleting. - DeleteAfter *string `json:"deleteAfter,omitempty"` -} - -func (t *ServerDeactivateAccount_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.deactivateAccount#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerDeactivateAccount_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerDeactivateAccount calls the XRPC method "com.atproto.server.deactivateAccount". -// -// Deactivates a currently active account. Stops serving of repo, and future writes to repo until reactivated. Used to finalize account migration with the old host after the account has been activated on the new host. -func ServerDeactivateAccount(ctx context.Context, c glexrt.LexClient, input *ServerDeactivateAccount_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.server.deactivateAccount", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/serverdefs.go b/pkg/comatproto/serverdefs.go deleted file mode 100644 index 7189f934..00000000 --- a/pkg/comatproto/serverdefs.go +++ /dev/null @@ -1,57 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.defs - -package comatproto - -import ( - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -// ServerDefs_InviteCode is a "inviteCode" in the com.atproto.server.defs schema. -type ServerDefs_InviteCode struct { - LexiconTypeID string `json:"$type"` - Available int64 `json:"available"` - Code string `json:"code"` - CreatedAt string `json:"createdAt"` - CreatedBy string `json:"createdBy"` - Disabled bool `json:"disabled"` - ForAccount string `json:"forAccount"` - Uses []ServerDefs_InviteCodeUse `json:"uses"` -} - -func (t *ServerDefs_InviteCode) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerDefs_InviteCode) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerDefs_InviteCodeUse is a "inviteCodeUse" in the com.atproto.server.defs schema. -type ServerDefs_InviteCodeUse struct { - LexiconTypeID string `json:"$type"` - UsedAt string `json:"usedAt"` - UsedBy string `json:"usedBy"` -} - -func (t *ServerDefs_InviteCodeUse) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.defs" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerDefs_InviteCodeUse) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/serverdeleteaccount.go b/pkg/comatproto/serverdeleteaccount.go deleted file mode 100644 index dbbb0b78..00000000 --- a/pkg/comatproto/serverdeleteaccount.go +++ /dev/null @@ -1,44 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.deleteAccount - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerDeleteAccount_Input struct { - LexiconTypeID string `json:"$type"` - Did string `json:"did"` - Password string `json:"password"` - Token string `json:"token"` -} - -func (t *ServerDeleteAccount_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.deleteAccount#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerDeleteAccount_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerDeleteAccount calls the XRPC method "com.atproto.server.deleteAccount". -// -// Delete an actor's account with a token and password. Can only be called after requesting a deletion token. Requires auth. -func ServerDeleteAccount(ctx context.Context, c glexrt.LexClient, input *ServerDeleteAccount_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.server.deleteAccount", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/serverdeletesession.go b/pkg/comatproto/serverdeletesession.go deleted file mode 100644 index 5d3aeafe..00000000 --- a/pkg/comatproto/serverdeletesession.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.deleteSession - -package comatproto - -import ( - "context" - - glexrt "github.com/streamplace/glex/runtime" -) - -// ServerDeleteSession calls the XRPC method "com.atproto.server.deleteSession". -// -// Delete the current session. Requires auth. -func ServerDeleteSession(ctx context.Context, c glexrt.LexClient) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "", "com.atproto.server.deleteSession", nil, nil, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/serverdescribeserver.go b/pkg/comatproto/serverdescribeserver.go deleted file mode 100644 index 376a1c1b..00000000 --- a/pkg/comatproto/serverdescribeserver.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.describeServer - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerDescribeServer_Output struct { - LexiconTypeID string `json:"$type"` - // availableUserDomains: List of domain suffixes that can be used in account handles. - AvailableUserDomains []string `json:"availableUserDomains"` - // contact: Contact information - Contact *ServerDescribeServer_Contact `json:"contact,omitempty"` - Did string `json:"did"` - // inviteCodeRequired: If true, an invite code must be supplied to create an account on this instance. - InviteCodeRequired *bool `json:"inviteCodeRequired,omitempty"` - // links: URLs of service policy documents. - Links *ServerDescribeServer_Links `json:"links,omitempty"` - // phoneVerificationRequired: If true, a phone verification token must be supplied to create an account on this instance. - PhoneVerificationRequired *bool `json:"phoneVerificationRequired,omitempty"` -} - -func (t *ServerDescribeServer_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.describeServer#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerDescribeServer_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerDescribeServer calls the XRPC method "com.atproto.server.describeServer". -// -// Describes the server's account creation requirements and capabilities. Implemented by PDS. -func ServerDescribeServer(ctx context.Context, c glexrt.LexClient) (*ServerDescribeServer_Output, error) { - var out ServerDescribeServer_Output - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.server.describeServer", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// ServerDescribeServer_Contact is a "contact" in the com.atproto.server.describeServer schema. -type ServerDescribeServer_Contact struct { - LexiconTypeID string `json:"$type"` - Email *string `json:"email,omitempty"` -} - -func (t *ServerDescribeServer_Contact) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.describeServer" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerDescribeServer_Contact) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerDescribeServer_Links is a "links" in the com.atproto.server.describeServer schema. -type ServerDescribeServer_Links struct { - LexiconTypeID string `json:"$type"` - PrivacyPolicy *string `json:"privacyPolicy,omitempty"` - TermsOfService *string `json:"termsOfService,omitempty"` -} - -func (t *ServerDescribeServer_Links) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.describeServer" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerDescribeServer_Links) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/servergetaccountinvitecodes.go b/pkg/comatproto/servergetaccountinvitecodes.go deleted file mode 100644 index 3e42dac6..00000000 --- a/pkg/comatproto/servergetaccountinvitecodes.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.getAccountInviteCodes - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerGetAccountInviteCodes_Output struct { - LexiconTypeID string `json:"$type"` - Codes []ServerDefs_InviteCode `json:"codes"` -} - -func (t *ServerGetAccountInviteCodes_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.getAccountInviteCodes#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerGetAccountInviteCodes_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerGetAccountInviteCodes calls the XRPC method "com.atproto.server.getAccountInviteCodes". -// -// Get all invite codes for the current account. Requires auth. -// -// createAvailable: Controls whether any new 'earned' but not 'created' invites should be created. -func ServerGetAccountInviteCodes(ctx context.Context, c glexrt.LexClient, createAvailable *bool, includeUsed *bool) (*ServerGetAccountInviteCodes_Output, error) { - var out ServerGetAccountInviteCodes_Output - - params := map[string]interface{}{} - if createAvailable != nil { - params["createAvailable"] = *createAvailable - } - if includeUsed != nil { - params["includeUsed"] = *includeUsed - } - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.server.getAccountInviteCodes", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/servergetserviceauth.go b/pkg/comatproto/servergetserviceauth.go deleted file mode 100644 index 31488f4d..00000000 --- a/pkg/comatproto/servergetserviceauth.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.getServiceAuth - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerGetServiceAuth_Output struct { - LexiconTypeID string `json:"$type"` - Token string `json:"token"` -} - -func (t *ServerGetServiceAuth_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.getServiceAuth#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerGetServiceAuth_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerGetServiceAuth calls the XRPC method "com.atproto.server.getServiceAuth". -// -// Get a signed token on behalf of the requesting DID for the requested service. -// -// aud: The DID of the service that the token will be used to authenticate with -// exp: The time in Unix Epoch seconds that the JWT expires. Defaults to 60 seconds in the future. The service may enforce certain time bounds on tokens depending on the requested scope. -// lxm: Lexicon (XRPC) method to bind the requested token to -func ServerGetServiceAuth(ctx context.Context, c glexrt.LexClient, aud string, exp *int64, lxm string) (*ServerGetServiceAuth_Output, error) { - var out ServerGetServiceAuth_Output - - params := map[string]interface{}{} - if exp != nil { - params["exp"] = *exp - } - if lxm != "" { - params["lxm"] = lxm - } - params["aud"] = aud - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.server.getServiceAuth", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/servergetsession.go b/pkg/comatproto/servergetsession.go deleted file mode 100644 index fcbc4e1f..00000000 --- a/pkg/comatproto/servergetsession.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.getSession - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerGetSession_Output struct { - LexiconTypeID string `json:"$type"` - Active *bool `json:"active,omitempty"` - Did string `json:"did"` - DidDoc *glexrt.LexiconTypeDecoder `json:"didDoc,omitempty"` - Email *string `json:"email,omitempty"` - EmailAuthFactor *bool `json:"emailAuthFactor,omitempty"` - EmailConfirmed *bool `json:"emailConfirmed,omitempty"` - Handle string `json:"handle"` - // status: If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. - Status *string `json:"status,omitempty"` -} - -func (t *ServerGetSession_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.getSession#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerGetSession_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerGetSession calls the XRPC method "com.atproto.server.getSession". -// -// Get information about the current auth session. Requires auth. -func ServerGetSession(ctx context.Context, c glexrt.LexClient) (*ServerGetSession_Output, error) { - var out ServerGetSession_Output - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.server.getSession", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/serverlistapppasswords.go b/pkg/comatproto/serverlistapppasswords.go deleted file mode 100644 index 9373c2ab..00000000 --- a/pkg/comatproto/serverlistapppasswords.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.listAppPasswords - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerListAppPasswords_Output struct { - LexiconTypeID string `json:"$type"` - Passwords []ServerListAppPasswords_AppPassword `json:"passwords"` -} - -func (t *ServerListAppPasswords_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.listAppPasswords#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerListAppPasswords_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerListAppPasswords calls the XRPC method "com.atproto.server.listAppPasswords". -// -// List all App Passwords. -func ServerListAppPasswords(ctx context.Context, c glexrt.LexClient) (*ServerListAppPasswords_Output, error) { - var out ServerListAppPasswords_Output - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.server.listAppPasswords", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// ServerListAppPasswords_AppPassword is a "appPassword" in the com.atproto.server.listAppPasswords schema. -type ServerListAppPasswords_AppPassword struct { - LexiconTypeID string `json:"$type"` - CreatedAt string `json:"createdAt"` - Name string `json:"name"` - Privileged *bool `json:"privileged,omitempty"` -} - -func (t *ServerListAppPasswords_AppPassword) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.listAppPasswords" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerListAppPasswords_AppPassword) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/serverrefreshsession.go b/pkg/comatproto/serverrefreshsession.go deleted file mode 100644 index 9b43257c..00000000 --- a/pkg/comatproto/serverrefreshsession.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.refreshSession - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerRefreshSession_Output struct { - LexiconTypeID string `json:"$type"` - AccessJwt string `json:"accessJwt"` - Active *bool `json:"active,omitempty"` - Did string `json:"did"` - DidDoc *glexrt.LexiconTypeDecoder `json:"didDoc,omitempty"` - Handle string `json:"handle"` - RefreshJwt string `json:"refreshJwt"` - // status: Hosting status of the account. If not specified, then assume 'active'. - Status *string `json:"status,omitempty"` -} - -func (t *ServerRefreshSession_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.refreshSession#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerRefreshSession_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerRefreshSession calls the XRPC method "com.atproto.server.refreshSession". -// -// Refresh an authentication session. Requires auth using the 'refreshJwt' (not the 'accessJwt'). -func ServerRefreshSession(ctx context.Context, c glexrt.LexClient) (*ServerRefreshSession_Output, error) { - var out ServerRefreshSession_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "", "com.atproto.server.refreshSession", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/serverrequestaccountdelete.go b/pkg/comatproto/serverrequestaccountdelete.go deleted file mode 100644 index 5b5203eb..00000000 --- a/pkg/comatproto/serverrequestaccountdelete.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.requestAccountDelete - -package comatproto - -import ( - "context" - - glexrt "github.com/streamplace/glex/runtime" -) - -// ServerRequestAccountDelete calls the XRPC method "com.atproto.server.requestAccountDelete". -// -// Initiate a user account deletion via email. -func ServerRequestAccountDelete(ctx context.Context, c glexrt.LexClient) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "", "com.atproto.server.requestAccountDelete", nil, nil, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/serverrequestemailconfirmation.go b/pkg/comatproto/serverrequestemailconfirmation.go deleted file mode 100644 index 3cbe6fbe..00000000 --- a/pkg/comatproto/serverrequestemailconfirmation.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.requestEmailConfirmation - -package comatproto - -import ( - "context" - - glexrt "github.com/streamplace/glex/runtime" -) - -// ServerRequestEmailConfirmation calls the XRPC method "com.atproto.server.requestEmailConfirmation". -// -// Request an email with a code to confirm ownership of email. -func ServerRequestEmailConfirmation(ctx context.Context, c glexrt.LexClient) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "", "com.atproto.server.requestEmailConfirmation", nil, nil, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/serverrequestemailupdate.go b/pkg/comatproto/serverrequestemailupdate.go deleted file mode 100644 index dedf613d..00000000 --- a/pkg/comatproto/serverrequestemailupdate.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.requestEmailUpdate - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerRequestEmailUpdate_Output struct { - LexiconTypeID string `json:"$type"` - TokenRequired bool `json:"tokenRequired"` -} - -func (t *ServerRequestEmailUpdate_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.requestEmailUpdate#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerRequestEmailUpdate_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerRequestEmailUpdate calls the XRPC method "com.atproto.server.requestEmailUpdate". -// -// Request a token in order to update email. -func ServerRequestEmailUpdate(ctx context.Context, c glexrt.LexClient) (*ServerRequestEmailUpdate_Output, error) { - var out ServerRequestEmailUpdate_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "", "com.atproto.server.requestEmailUpdate", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/serverrequestpasswordreset.go b/pkg/comatproto/serverrequestpasswordreset.go deleted file mode 100644 index aa3b10ac..00000000 --- a/pkg/comatproto/serverrequestpasswordreset.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.requestPasswordReset - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerRequestPasswordReset_Input struct { - LexiconTypeID string `json:"$type"` - Email string `json:"email"` -} - -func (t *ServerRequestPasswordReset_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.requestPasswordReset#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerRequestPasswordReset_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerRequestPasswordReset calls the XRPC method "com.atproto.server.requestPasswordReset". -// -// Initiate a user account password reset via email. -func ServerRequestPasswordReset(ctx context.Context, c glexrt.LexClient, input *ServerRequestPasswordReset_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.server.requestPasswordReset", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/serverreservesigningkey.go b/pkg/comatproto/serverreservesigningkey.go deleted file mode 100644 index a61f49dc..00000000 --- a/pkg/comatproto/serverreservesigningkey.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.reserveSigningKey - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerReserveSigningKey_Input struct { - LexiconTypeID string `json:"$type"` - // did: The DID to reserve a key for. - Did *string `json:"did,omitempty"` -} - -func (t *ServerReserveSigningKey_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.reserveSigningKey#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerReserveSigningKey_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type ServerReserveSigningKey_Output struct { - LexiconTypeID string `json:"$type"` - // signingKey: The public key for the reserved signing key, in did:key serialization. - SigningKey string `json:"signingKey"` -} - -func (t *ServerReserveSigningKey_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.reserveSigningKey#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerReserveSigningKey_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerReserveSigningKey calls the XRPC method "com.atproto.server.reserveSigningKey". -// -// Reserve a repo signing key, for use with account creation. Necessary so that a DID PLC update operation can be constructed during an account migraiton. Public and does not require auth; implemented by PDS. NOTE: this endpoint may change when full account migration is implemented. -func ServerReserveSigningKey(ctx context.Context, c glexrt.LexClient, input *ServerReserveSigningKey_Input) (*ServerReserveSigningKey_Output, error) { - var out ServerReserveSigningKey_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.server.reserveSigningKey", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/serverresetpassword.go b/pkg/comatproto/serverresetpassword.go deleted file mode 100644 index 68c36a37..00000000 --- a/pkg/comatproto/serverresetpassword.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.resetPassword - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerResetPassword_Input struct { - LexiconTypeID string `json:"$type"` - Password string `json:"password"` - Token string `json:"token"` -} - -func (t *ServerResetPassword_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.resetPassword#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerResetPassword_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerResetPassword calls the XRPC method "com.atproto.server.resetPassword". -// -// Reset a user account password using a token. -func ServerResetPassword(ctx context.Context, c glexrt.LexClient, input *ServerResetPassword_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.server.resetPassword", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/serverrevokeapppassword.go b/pkg/comatproto/serverrevokeapppassword.go deleted file mode 100644 index e6cc49da..00000000 --- a/pkg/comatproto/serverrevokeapppassword.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.revokeAppPassword - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerRevokeAppPassword_Input struct { - LexiconTypeID string `json:"$type"` - Name string `json:"name"` -} - -func (t *ServerRevokeAppPassword_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.revokeAppPassword#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerRevokeAppPassword_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerRevokeAppPassword calls the XRPC method "com.atproto.server.revokeAppPassword". -// -// Revoke an App Password by name. -func ServerRevokeAppPassword(ctx context.Context, c glexrt.LexClient, input *ServerRevokeAppPassword_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.server.revokeAppPassword", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/serverupdateemail.go b/pkg/comatproto/serverupdateemail.go deleted file mode 100644 index a1a549be..00000000 --- a/pkg/comatproto/serverupdateemail.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.server.updateEmail - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type ServerUpdateEmail_Input struct { - LexiconTypeID string `json:"$type"` - Email string `json:"email"` - EmailAuthFactor *bool `json:"emailAuthFactor,omitempty"` - // token: Requires a token from com.atproto.sever.requestEmailUpdate if the account's email has been confirmed. - Token *string `json:"token,omitempty"` -} - -func (t *ServerUpdateEmail_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.server.updateEmail#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *ServerUpdateEmail_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// ServerUpdateEmail calls the XRPC method "com.atproto.server.updateEmail". -// -// Update an account's email. -func ServerUpdateEmail(ctx context.Context, c glexrt.LexClient, input *ServerUpdateEmail_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.server.updateEmail", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/syncgetblob.go b/pkg/comatproto/syncgetblob.go deleted file mode 100644 index d48ea8cd..00000000 --- a/pkg/comatproto/syncgetblob.go +++ /dev/null @@ -1,31 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.sync.getBlob - -package comatproto - -import ( - "bytes" - "context" - - glexrt "github.com/streamplace/glex/runtime" -) - -// SyncGetBlob calls the XRPC method "com.atproto.sync.getBlob". -// -// Get a blob associated with a given account. Returns the full blob as originally uploaded. Does not require auth; implemented by PDS. -// -// cid: The CID of the blob to fetch -// did: The DID of the account. -func SyncGetBlob(ctx context.Context, c glexrt.LexClient, cid string, did string) ([]byte, error) { - buf := new(bytes.Buffer) - - params := map[string]interface{}{} - params["cid"] = cid - params["did"] = did - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.sync.getBlob", params, nil, buf); err != nil { - return nil, err - } - return buf.Bytes(), nil -} diff --git a/pkg/comatproto/syncgetblocks.go b/pkg/comatproto/syncgetblocks.go deleted file mode 100644 index e10f8e1c..00000000 --- a/pkg/comatproto/syncgetblocks.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.sync.getBlocks - -package comatproto - -import ( - "bytes" - "context" - - glexrt "github.com/streamplace/glex/runtime" -) - -// SyncGetBlocks calls the XRPC method "com.atproto.sync.getBlocks". -// -// Get data blocks from a given repo, by CID. For example, intermediate MST nodes, or records. Does not require auth; implemented by PDS. -// -// did: The DID of the repo. -func SyncGetBlocks(ctx context.Context, c glexrt.LexClient, cids []string, did string) ([]byte, error) { - buf := new(bytes.Buffer) - - params := map[string]interface{}{} - params["cids"] = cids - params["did"] = did - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.sync.getBlocks", params, nil, buf); err != nil { - return nil, err - } - return buf.Bytes(), nil -} diff --git a/pkg/comatproto/syncgetcheckout.go b/pkg/comatproto/syncgetcheckout.go deleted file mode 100644 index c55b9ddc..00000000 --- a/pkg/comatproto/syncgetcheckout.go +++ /dev/null @@ -1,29 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.sync.getCheckout - -package comatproto - -import ( - "bytes" - "context" - - glexrt "github.com/streamplace/glex/runtime" -) - -// SyncGetCheckout calls the XRPC method "com.atproto.sync.getCheckout". -// -// # DEPRECATED - please use com.atproto.sync.getRepo instead -// -// did: The DID of the repo. -func SyncGetCheckout(ctx context.Context, c glexrt.LexClient, did string) ([]byte, error) { - buf := new(bytes.Buffer) - - params := map[string]interface{}{} - params["did"] = did - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.sync.getCheckout", params, nil, buf); err != nil { - return nil, err - } - return buf.Bytes(), nil -} diff --git a/pkg/comatproto/syncgethead.go b/pkg/comatproto/syncgethead.go deleted file mode 100644 index 1520ffc5..00000000 --- a/pkg/comatproto/syncgethead.go +++ /dev/null @@ -1,48 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.sync.getHead - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type SyncGetHead_Output struct { - LexiconTypeID string `json:"$type"` - Root string `json:"root"` -} - -func (t *SyncGetHead_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.sync.getHead#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *SyncGetHead_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// SyncGetHead calls the XRPC method "com.atproto.sync.getHead". -// -// # DEPRECATED - please use com.atproto.sync.getLatestCommit instead -// -// did: The DID of the repo. -func SyncGetHead(ctx context.Context, c glexrt.LexClient, did string) (*SyncGetHead_Output, error) { - var out SyncGetHead_Output - - params := map[string]interface{}{} - params["did"] = did - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.sync.getHead", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/syncgethoststatus.go b/pkg/comatproto/syncgethoststatus.go deleted file mode 100644 index fb48d23f..00000000 --- a/pkg/comatproto/syncgethoststatus.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.sync.getHostStatus - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type SyncGetHostStatus_Output struct { - LexiconTypeID string `json:"$type"` - // accountCount: Number of accounts on the server which are associated with the upstream host. Note that the upstream may actually have more accounts. - AccountCount *int64 `json:"accountCount,omitempty"` - Hostname string `json:"hostname"` - // seq: Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor). - Seq *int64 `json:"seq,omitempty"` - Status *string `json:"status,omitempty"` -} - -func (t *SyncGetHostStatus_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.sync.getHostStatus#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *SyncGetHostStatus_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// SyncGetHostStatus calls the XRPC method "com.atproto.sync.getHostStatus". -// -// Returns information about a specified upstream host, as consumed by the server. Implemented by relays. -// -// hostname: Hostname of the host (eg, PDS or relay) being queried. -func SyncGetHostStatus(ctx context.Context, c glexrt.LexClient, hostname string) (*SyncGetHostStatus_Output, error) { - var out SyncGetHostStatus_Output - - params := map[string]interface{}{} - params["hostname"] = hostname - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.sync.getHostStatus", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/syncgetlatestcommit.go b/pkg/comatproto/syncgetlatestcommit.go deleted file mode 100644 index 1170a0a2..00000000 --- a/pkg/comatproto/syncgetlatestcommit.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.sync.getLatestCommit - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type SyncGetLatestCommit_Output struct { - LexiconTypeID string `json:"$type"` - Cid string `json:"cid"` - Rev string `json:"rev"` -} - -func (t *SyncGetLatestCommit_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.sync.getLatestCommit#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *SyncGetLatestCommit_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// SyncGetLatestCommit calls the XRPC method "com.atproto.sync.getLatestCommit". -// -// Get the current commit CID & revision of the specified repo. Does not require auth. -// -// did: The DID of the repo. -func SyncGetLatestCommit(ctx context.Context, c glexrt.LexClient, did string) (*SyncGetLatestCommit_Output, error) { - var out SyncGetLatestCommit_Output - - params := map[string]interface{}{} - params["did"] = did - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.sync.getLatestCommit", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/syncgetrecord.go b/pkg/comatproto/syncgetrecord.go deleted file mode 100644 index a30a7de0..00000000 --- a/pkg/comatproto/syncgetrecord.go +++ /dev/null @@ -1,32 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.sync.getRecord - -package comatproto - -import ( - "bytes" - "context" - - glexrt "github.com/streamplace/glex/runtime" -) - -// SyncGetRecord calls the XRPC method "com.atproto.sync.getRecord". -// -// Get data blocks needed to prove the existence or non-existence of record in the current version of repo. Does not require auth. -// -// did: The DID of the repo. -// rkey: Record Key -func SyncGetRecord(ctx context.Context, c glexrt.LexClient, collection string, did string, rkey string) ([]byte, error) { - buf := new(bytes.Buffer) - - params := map[string]interface{}{} - params["collection"] = collection - params["did"] = did - params["rkey"] = rkey - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.sync.getRecord", params, nil, buf); err != nil { - return nil, err - } - return buf.Bytes(), nil -} diff --git a/pkg/comatproto/syncgetrepo.go b/pkg/comatproto/syncgetrepo.go index 763746c5..dd7e3400 100644 --- a/pkg/comatproto/syncgetrepo.go +++ b/pkg/comatproto/syncgetrepo.go @@ -8,7 +8,7 @@ import ( "bytes" "context" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" ) // SyncGetRepo calls the XRPC method "com.atproto.sync.getRepo". @@ -17,7 +17,7 @@ import ( // // did: The DID of the repo. // since: The revision ('rev') of the repo to create a diff from. -func SyncGetRepo(ctx context.Context, c glexrt.LexClient, did string, since string) ([]byte, error) { +func SyncGetRepo(ctx context.Context, c glex.LexClient, did string, since string) ([]byte, error) { buf := new(bytes.Buffer) params := map[string]interface{}{} @@ -26,7 +26,7 @@ func SyncGetRepo(ctx context.Context, c glexrt.LexClient, did string, since stri } params["did"] = did - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.sync.getRepo", params, nil, buf); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "com.atproto.sync.getRepo", params, nil, buf); err != nil { return nil, err } return buf.Bytes(), nil diff --git a/pkg/comatproto/syncgetrepostatus.go b/pkg/comatproto/syncgetrepostatus.go deleted file mode 100644 index 3f778ae1..00000000 --- a/pkg/comatproto/syncgetrepostatus.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.sync.getRepoStatus - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type SyncGetRepoStatus_Output struct { - LexiconTypeID string `json:"$type"` - Active bool `json:"active"` - Did string `json:"did"` - // rev: Optional field, the current rev of the repo, if active=true - Rev *string `json:"rev,omitempty"` - // status: If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. - Status *string `json:"status,omitempty"` -} - -func (t *SyncGetRepoStatus_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.sync.getRepoStatus#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *SyncGetRepoStatus_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// SyncGetRepoStatus calls the XRPC method "com.atproto.sync.getRepoStatus". -// -// Get the hosting status for a repository, on this server. Expected to be implemented by PDS and Relay. -// -// did: The DID of the repo. -func SyncGetRepoStatus(ctx context.Context, c glexrt.LexClient, did string) (*SyncGetRepoStatus_Output, error) { - var out SyncGetRepoStatus_Output - - params := map[string]interface{}{} - params["did"] = did - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.sync.getRepoStatus", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/synclistblobs.go b/pkg/comatproto/synclistblobs.go deleted file mode 100644 index 05065360..00000000 --- a/pkg/comatproto/synclistblobs.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.sync.listBlobs - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type SyncListBlobs_Output struct { - LexiconTypeID string `json:"$type"` - Cids []string `json:"cids"` - Cursor *string `json:"cursor,omitempty"` -} - -func (t *SyncListBlobs_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.sync.listBlobs#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *SyncListBlobs_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// SyncListBlobs calls the XRPC method "com.atproto.sync.listBlobs". -// -// List blob CIDs for an account, since some repo revision. Does not require auth; implemented by PDS. -// -// did: The DID of the repo. -// since: Optional revision of the repo to list blobs since. -func SyncListBlobs(ctx context.Context, c glexrt.LexClient, cursor string, did string, limit *int64, since string) (*SyncListBlobs_Output, error) { - var out SyncListBlobs_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - if since != "" { - params["since"] = since - } - params["did"] = did - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.sync.listBlobs", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/synclisthosts.go b/pkg/comatproto/synclisthosts.go deleted file mode 100644 index 502a5f45..00000000 --- a/pkg/comatproto/synclisthosts.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.sync.listHosts - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type SyncListHosts_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - // hosts: Sort order is not formally specified. Recommended order is by time host was first seen by the server, with oldest first. - Hosts []SyncListHosts_Host `json:"hosts"` -} - -func (t *SyncListHosts_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.sync.listHosts#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *SyncListHosts_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// SyncListHosts calls the XRPC method "com.atproto.sync.listHosts". -// -// Enumerates upstream hosts (eg, PDS or relay instances) that this service consumes from. Implemented by relays. -func SyncListHosts(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64) (*SyncListHosts_Output, error) { - var out SyncListHosts_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.sync.listHosts", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// SyncListHosts_Host is a "host" in the com.atproto.sync.listHosts schema. -type SyncListHosts_Host struct { - LexiconTypeID string `json:"$type"` - AccountCount *int64 `json:"accountCount,omitempty"` - // hostname: hostname of server; not a URL (no scheme) - Hostname string `json:"hostname"` - // seq: Recent repo stream event sequence number. May be delayed from actual stream processing (eg, persisted cursor not in-memory cursor). - Seq *int64 `json:"seq,omitempty"` - Status *string `json:"status,omitempty"` -} - -func (t *SyncListHosts_Host) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.sync.listHosts" - return glexrt.MarshalCBOR(w, t) -} - -func (t *SyncListHosts_Host) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/synclistrepos.go b/pkg/comatproto/synclistrepos.go deleted file mode 100644 index 828faa56..00000000 --- a/pkg/comatproto/synclistrepos.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.sync.listRepos - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type SyncListRepos_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Repos []SyncListRepos_Repo `json:"repos"` -} - -func (t *SyncListRepos_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.sync.listRepos#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *SyncListRepos_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// SyncListRepos calls the XRPC method "com.atproto.sync.listRepos". -// -// Enumerates all the DID, rev, and commit CID for all repos hosted by this service. Does not require auth; implemented by PDS and Relay. -func SyncListRepos(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64) (*SyncListRepos_Output, error) { - var out SyncListRepos_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.sync.listRepos", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// SyncListRepos_Repo is a "repo" in the com.atproto.sync.listRepos schema. -type SyncListRepos_Repo struct { - LexiconTypeID string `json:"$type"` - Active *bool `json:"active,omitempty"` - Did string `json:"did"` - // head: Current repo commit CID - Head string `json:"head"` - Rev string `json:"rev"` - // status: If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. - Status *string `json:"status,omitempty"` -} - -func (t *SyncListRepos_Repo) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.sync.listRepos" - return glexrt.MarshalCBOR(w, t) -} - -func (t *SyncListRepos_Repo) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/synclistreposbycollection.go b/pkg/comatproto/synclistreposbycollection.go deleted file mode 100644 index 7e0deb52..00000000 --- a/pkg/comatproto/synclistreposbycollection.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.sync.listReposByCollection - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type SyncListReposByCollection_Output struct { - LexiconTypeID string `json:"$type"` - Cursor *string `json:"cursor,omitempty"` - Repos []SyncListReposByCollection_Repo `json:"repos"` -} - -func (t *SyncListReposByCollection_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.sync.listReposByCollection#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *SyncListReposByCollection_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// SyncListReposByCollection calls the XRPC method "com.atproto.sync.listReposByCollection". -// -// Enumerates all the DIDs which have records with the given collection NSID. -// -// limit: Maximum size of response set. Recommend setting a large maximum (1000+) when enumerating large DID lists. -func SyncListReposByCollection(ctx context.Context, c glexrt.LexClient, collection string, cursor string, limit *int64) (*SyncListReposByCollection_Output, error) { - var out SyncListReposByCollection_Output - - params := map[string]interface{}{} - if cursor != "" { - params["cursor"] = cursor - } - if limit != nil { - params["limit"] = *limit - } - params["collection"] = collection - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.sync.listReposByCollection", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// SyncListReposByCollection_Repo is a "repo" in the com.atproto.sync.listReposByCollection schema. -type SyncListReposByCollection_Repo struct { - LexiconTypeID string `json:"$type"` - Did string `json:"did"` -} - -func (t *SyncListReposByCollection_Repo) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.sync.listReposByCollection" - return glexrt.MarshalCBOR(w, t) -} - -func (t *SyncListReposByCollection_Repo) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/syncnotifyofupdate.go b/pkg/comatproto/syncnotifyofupdate.go deleted file mode 100644 index 0d685f6d..00000000 --- a/pkg/comatproto/syncnotifyofupdate.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.sync.notifyOfUpdate - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type SyncNotifyOfUpdate_Input struct { - LexiconTypeID string `json:"$type"` - // hostname: Hostname of the current service (usually a PDS) that is notifying of update. - Hostname string `json:"hostname"` -} - -func (t *SyncNotifyOfUpdate_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.sync.notifyOfUpdate#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *SyncNotifyOfUpdate_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// SyncNotifyOfUpdate calls the XRPC method "com.atproto.sync.notifyOfUpdate". -// -// Notify a crawling service of a recent update, and that crawling should resume. Intended use is after a gap between repo stream events caused the crawling service to disconnect. Does not require auth; implemented by Relay. DEPRECATED: just use com.atproto.sync.requestCrawl -func SyncNotifyOfUpdate(ctx context.Context, c glexrt.LexClient, input *SyncNotifyOfUpdate_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.sync.notifyOfUpdate", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/syncrequestcrawl.go b/pkg/comatproto/syncrequestcrawl.go deleted file mode 100644 index 904b200d..00000000 --- a/pkg/comatproto/syncrequestcrawl.go +++ /dev/null @@ -1,43 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.sync.requestCrawl - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type SyncRequestCrawl_Input struct { - LexiconTypeID string `json:"$type"` - // hostname: Hostname of the current service (eg, PDS) that is requesting to be crawled. - Hostname string `json:"hostname"` -} - -func (t *SyncRequestCrawl_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.sync.requestCrawl#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *SyncRequestCrawl_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// SyncRequestCrawl calls the XRPC method "com.atproto.sync.requestCrawl". -// -// Request a service to persistently crawl hosted repos. Expected use is new PDS instances declaring their existence to Relays. Does not require auth. -func SyncRequestCrawl(ctx context.Context, c glexrt.LexClient, input *SyncRequestCrawl_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.sync.requestCrawl", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/syncsubscriberepos.go b/pkg/comatproto/syncsubscriberepos.go index bd0648d3..c1f729e8 100644 --- a/pkg/comatproto/syncsubscriberepos.go +++ b/pkg/comatproto/syncsubscriberepos.go @@ -7,7 +7,7 @@ package comatproto import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -25,32 +25,37 @@ type SyncSubscribeRepos_Account struct { Time string `json:"time"` } +// RecordTypeID implements glex.Record. +func (t *SyncSubscribeRepos_Account) RecordTypeID() string { + return "com.atproto.sync.subscribeRepos#account" +} + func (t *SyncSubscribeRepos_Account) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.sync.subscribeRepos" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.sync.subscribeRepos#account" + return glex.MarshalCBOR(w, t) } func (t *SyncSubscribeRepos_Account) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // SyncSubscribeRepos_Commit is a "commit" in the com.atproto.sync.subscribeRepos schema. // // Represents an update of repository state. Note that empty commits are allowed, which include no repo data changes, but an update to rev and signature. type SyncSubscribeRepos_Commit struct { - LexiconTypeID string `json:"$type"` - Blobs []glexrt.Link `json:"blobs"` + LexiconTypeID string `json:"$type"` + Blobs []glex.Link `json:"blobs"` // blocks: CAR file containing relevant blocks, as a diff since the previous repo state. The commit must be included as a block, and the commit block CID must be the first entry in the CAR header 'roots' list. - Blocks glexrt.Bytes `json:"blocks"` + Blocks glex.Bytes `json:"blocks"` // commit: Repo commit object CID. - Commit glexrt.Link `json:"commit"` + Commit glex.Link `json:"commit"` Ops []SyncSubscribeRepos_RepoOp `json:"ops"` // prevData: The root CID of the MST tree for the previous commit from this repo (indicated by the 'since' revision field in this message). Corresponds to the 'data' field in the repo commit object. NOTE: this field is effectively required for the 'inductive' version of firehose. - PrevData *glexrt.Link `json:"prevData,omitempty"` + PrevData *glex.Link `json:"prevData,omitempty"` // rebase: DEPRECATED -- unused Rebase bool `json:"rebase"` // repo: The repo this event comes from. Note that all other message types name this field 'did'. @@ -67,17 +72,22 @@ type SyncSubscribeRepos_Commit struct { TooBig bool `json:"tooBig"` } +// RecordTypeID implements glex.Record. +func (t *SyncSubscribeRepos_Commit) RecordTypeID() string { + return "com.atproto.sync.subscribeRepos#commit" +} + func (t *SyncSubscribeRepos_Commit) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.sync.subscribeRepos" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.sync.subscribeRepos#commit" + return glex.MarshalCBOR(w, t) } func (t *SyncSubscribeRepos_Commit) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // SyncSubscribeRepos_Identity is a "identity" in the com.atproto.sync.subscribeRepos schema. @@ -92,17 +102,22 @@ type SyncSubscribeRepos_Identity struct { Time string `json:"time"` } +// RecordTypeID implements glex.Record. +func (t *SyncSubscribeRepos_Identity) RecordTypeID() string { + return "com.atproto.sync.subscribeRepos#identity" +} + func (t *SyncSubscribeRepos_Identity) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.sync.subscribeRepos" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.sync.subscribeRepos#identity" + return glex.MarshalCBOR(w, t) } func (t *SyncSubscribeRepos_Identity) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // SyncSubscribeRepos_Info is a "info" in the com.atproto.sync.subscribeRepos schema. @@ -112,17 +127,22 @@ type SyncSubscribeRepos_Info struct { Name string `json:"name"` } +// RecordTypeID implements glex.Record. +func (t *SyncSubscribeRepos_Info) RecordTypeID() string { + return "com.atproto.sync.subscribeRepos#info" +} + func (t *SyncSubscribeRepos_Info) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.sync.subscribeRepos" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.sync.subscribeRepos#info" + return glex.MarshalCBOR(w, t) } func (t *SyncSubscribeRepos_Info) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // SyncSubscribeRepos_RepoOp is a "repoOp" in the com.atproto.sync.subscribeRepos schema. @@ -132,10 +152,15 @@ type SyncSubscribeRepos_RepoOp struct { LexiconTypeID string `json:"$type"` Action string `json:"action"` // cid: For creates and updates, the new record CID. For deletions, null. - Cid glexrt.Link `json:"cid"` - Path string `json:"path"` + Cid glex.Link `json:"cid"` + Path string `json:"path"` // prev: For updates and deletes, the previous record CID (required for inductive firehose). For creations, field should not be defined. - Prev *glexrt.Link `json:"prev,omitempty"` + Prev *glex.Link `json:"prev,omitempty"` +} + +// RecordTypeID implements glex.Record. +func (t *SyncSubscribeRepos_RepoOp) RecordTypeID() string { + return "com.atproto.sync.subscribeRepos#repoOp" } func (t *SyncSubscribeRepos_RepoOp) MarshalCBOR(w io.Writer) error { @@ -143,12 +168,12 @@ func (t *SyncSubscribeRepos_RepoOp) MarshalCBOR(w io.Writer) error { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.sync.subscribeRepos" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.sync.subscribeRepos#repoOp" + return glex.MarshalCBOR(w, t) } func (t *SyncSubscribeRepos_RepoOp) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // SyncSubscribeRepos_Sync is a "sync" in the com.atproto.sync.subscribeRepos schema. @@ -157,7 +182,7 @@ func (t *SyncSubscribeRepos_RepoOp) UnmarshalCBOR(r io.Reader) error { type SyncSubscribeRepos_Sync struct { LexiconTypeID string `json:"$type"` // blocks: CAR file containing the commit, as a block. The CAR header must include the commit block CID as the first 'root'. - Blocks glexrt.Bytes `json:"blocks"` + Blocks glex.Bytes `json:"blocks"` // did: The account this repo event corresponds to. Must match that in the commit object. Did string `json:"did"` // rev: The rev of the commit. This value must match that in the commit object. @@ -168,15 +193,20 @@ type SyncSubscribeRepos_Sync struct { Time string `json:"time"` } +// RecordTypeID implements glex.Record. +func (t *SyncSubscribeRepos_Sync) RecordTypeID() string { + return "com.atproto.sync.subscribeRepos#sync" +} + func (t *SyncSubscribeRepos_Sync) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "com.atproto.sync.subscribeRepos" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "com.atproto.sync.subscribeRepos#sync" + return glex.MarshalCBOR(w, t) } func (t *SyncSubscribeRepos_Sync) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/comatproto/tempaddreservedhandle.go b/pkg/comatproto/tempaddreservedhandle.go deleted file mode 100644 index 1e15755a..00000000 --- a/pkg/comatproto/tempaddreservedhandle.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.temp.addReservedHandle - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type TempAddReservedHandle_Input struct { - LexiconTypeID string `json:"$type"` - Handle string `json:"handle"` -} - -func (t *TempAddReservedHandle_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.temp.addReservedHandle#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *TempAddReservedHandle_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type TempAddReservedHandle_Output struct { - LexiconTypeID string `json:"$type"` -} - -func (t *TempAddReservedHandle_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.temp.addReservedHandle#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *TempAddReservedHandle_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// TempAddReservedHandle calls the XRPC method "com.atproto.temp.addReservedHandle". -// -// Add a handle to the set of reserved handles. -func TempAddReservedHandle(ctx context.Context, c glexrt.LexClient, input *TempAddReservedHandle_Input) (*TempAddReservedHandle_Output, error) { - var out TempAddReservedHandle_Output - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.temp.addReservedHandle", nil, input, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/tempcheckhandleavailability.go b/pkg/comatproto/tempcheckhandleavailability.go deleted file mode 100644 index b9bc302a..00000000 --- a/pkg/comatproto/tempcheckhandleavailability.go +++ /dev/null @@ -1,192 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.temp.checkHandleAvailability - -package comatproto - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type TempCheckHandleAvailability_Output struct { - LexiconTypeID string `json:"$type"` - // handle: Echo of the input handle. - Handle string `json:"handle"` - Result TempCheckHandleAvailability_Output_Result `json:"result"` -} - -func (t *TempCheckHandleAvailability_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.temp.checkHandleAvailability#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *TempCheckHandleAvailability_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -type TempCheckHandleAvailability_Output_Result struct { - TempCheckHandleAvailability_ResultAvailable *TempCheckHandleAvailability_ResultAvailable - TempCheckHandleAvailability_ResultUnavailable *TempCheckHandleAvailability_ResultUnavailable -} - -func (t *TempCheckHandleAvailability_Output_Result) MarshalJSON() ([]byte, error) { - if t.TempCheckHandleAvailability_ResultAvailable != nil { - t.TempCheckHandleAvailability_ResultAvailable.LexiconTypeID = "com.atproto.temp.checkHandleAvailability#resultAvailable" - return json.Marshal(t.TempCheckHandleAvailability_ResultAvailable) - } - if t.TempCheckHandleAvailability_ResultUnavailable != nil { - t.TempCheckHandleAvailability_ResultUnavailable.LexiconTypeID = "com.atproto.temp.checkHandleAvailability#resultUnavailable" - return json.Marshal(t.TempCheckHandleAvailability_ResultUnavailable) - } - return nil, fmt.Errorf("can not marshal empty union as JSON") -} - -func (t *TempCheckHandleAvailability_Output_Result) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) - if err != nil { - return err - } - - switch typ { - case "com.atproto.temp.checkHandleAvailability#resultAvailable": - t.TempCheckHandleAvailability_ResultAvailable = new(TempCheckHandleAvailability_ResultAvailable) - return json.Unmarshal(b, t.TempCheckHandleAvailability_ResultAvailable) - case "com.atproto.temp.checkHandleAvailability#resultUnavailable": - t.TempCheckHandleAvailability_ResultUnavailable = new(TempCheckHandleAvailability_ResultUnavailable) - return json.Unmarshal(b, t.TempCheckHandleAvailability_ResultUnavailable) - default: - return nil - } -} - -func (t *TempCheckHandleAvailability_Output_Result) MarshalCBOR(w io.Writer) error { - - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - if t.TempCheckHandleAvailability_ResultAvailable != nil { - return t.TempCheckHandleAvailability_ResultAvailable.MarshalCBOR(w) - } - if t.TempCheckHandleAvailability_ResultUnavailable != nil { - return t.TempCheckHandleAvailability_ResultUnavailable.MarshalCBOR(w) - } - return fmt.Errorf("can not marshal empty union as CBOR") -} - -func (t *TempCheckHandleAvailability_Output_Result) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) - if err != nil { - return err - } - - switch typ { - case "com.atproto.temp.checkHandleAvailability#resultAvailable": - t.TempCheckHandleAvailability_ResultAvailable = new(TempCheckHandleAvailability_ResultAvailable) - return t.TempCheckHandleAvailability_ResultAvailable.UnmarshalCBOR(bytes.NewReader(b)) - case "com.atproto.temp.checkHandleAvailability#resultUnavailable": - t.TempCheckHandleAvailability_ResultUnavailable = new(TempCheckHandleAvailability_ResultUnavailable) - return t.TempCheckHandleAvailability_ResultUnavailable.UnmarshalCBOR(bytes.NewReader(b)) - default: - return nil - } -} - -// TempCheckHandleAvailability calls the XRPC method "com.atproto.temp.checkHandleAvailability". -// -// Checks whether the provided handle is available. If the handle is not available, available suggestions will be returned. Optional inputs will be used to generate suggestions. -// -// birthDate: User-provided birth date. Might be used to build handle suggestions. -// email: User-provided email. Might be used to build handle suggestions. -// handle: Tentative handle. Will be checked for availability or used to build handle suggestions. -func TempCheckHandleAvailability(ctx context.Context, c glexrt.LexClient, birthDate string, email string, handle string) (*TempCheckHandleAvailability_Output, error) { - var out TempCheckHandleAvailability_Output - - params := map[string]interface{}{} - if birthDate != "" { - params["birthDate"] = birthDate - } - if email != "" { - params["email"] = email - } - params["handle"] = handle - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.temp.checkHandleAvailability", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} - -// TempCheckHandleAvailability_ResultAvailable is a "resultAvailable" in the com.atproto.temp.checkHandleAvailability schema. -// -// Indicates the provided handle is available. -type TempCheckHandleAvailability_ResultAvailable struct { - LexiconTypeID string `json:"$type"` -} - -func (t *TempCheckHandleAvailability_ResultAvailable) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.temp.checkHandleAvailability" - return glexrt.MarshalCBOR(w, t) -} - -func (t *TempCheckHandleAvailability_ResultAvailable) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// TempCheckHandleAvailability_ResultUnavailable is a "resultUnavailable" in the com.atproto.temp.checkHandleAvailability schema. -// -// Indicates the provided handle is unavailable and gives suggestions of available handles. -type TempCheckHandleAvailability_ResultUnavailable struct { - LexiconTypeID string `json:"$type"` - // suggestions: List of suggested handles based on the provided inputs. - Suggestions []TempCheckHandleAvailability_Suggestion `json:"suggestions"` -} - -func (t *TempCheckHandleAvailability_ResultUnavailable) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.temp.checkHandleAvailability" - return glexrt.MarshalCBOR(w, t) -} - -func (t *TempCheckHandleAvailability_ResultUnavailable) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// TempCheckHandleAvailability_Suggestion is a "suggestion" in the com.atproto.temp.checkHandleAvailability schema. -type TempCheckHandleAvailability_Suggestion struct { - LexiconTypeID string `json:"$type"` - Handle string `json:"handle"` - // method: Method used to build this suggestion. Should be considered opaque to clients. Can be used for metrics. - Method string `json:"method"` -} - -func (t *TempCheckHandleAvailability_Suggestion) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.temp.checkHandleAvailability" - return glexrt.MarshalCBOR(w, t) -} - -func (t *TempCheckHandleAvailability_Suggestion) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} diff --git a/pkg/comatproto/tempchecksignupqueue.go b/pkg/comatproto/tempchecksignupqueue.go deleted file mode 100644 index f1f77d5b..00000000 --- a/pkg/comatproto/tempchecksignupqueue.go +++ /dev/null @@ -1,45 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.temp.checkSignupQueue - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type TempCheckSignupQueue_Output struct { - LexiconTypeID string `json:"$type"` - Activated bool `json:"activated"` - EstimatedTimeMs *int64 `json:"estimatedTimeMs,omitempty"` - PlaceInQueue *int64 `json:"placeInQueue,omitempty"` -} - -func (t *TempCheckSignupQueue_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.temp.checkSignupQueue#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *TempCheckSignupQueue_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// TempCheckSignupQueue calls the XRPC method "com.atproto.temp.checkSignupQueue". -// -// Check accounts location in signup queue. -func TempCheckSignupQueue(ctx context.Context, c glexrt.LexClient) (*TempCheckSignupQueue_Output, error) { - var out TempCheckSignupQueue_Output - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.temp.checkSignupQueue", nil, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/tempdereferencescope.go b/pkg/comatproto/tempdereferencescope.go deleted file mode 100644 index ae417e7b..00000000 --- a/pkg/comatproto/tempdereferencescope.go +++ /dev/null @@ -1,49 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.temp.dereferenceScope - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type TempDereferenceScope_Output struct { - LexiconTypeID string `json:"$type"` - // scope: The full oauth permission scope - Scope string `json:"scope"` -} - -func (t *TempDereferenceScope_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.temp.dereferenceScope#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *TempDereferenceScope_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// TempDereferenceScope calls the XRPC method "com.atproto.temp.dereferenceScope". -// -// # Allows finding the oauth permission scope from a reference -// -// scope: The scope reference (starts with 'ref:') -func TempDereferenceScope(ctx context.Context, c glexrt.LexClient, scope string) (*TempDereferenceScope_Output, error) { - var out TempDereferenceScope_Output - - params := map[string]interface{}{} - params["scope"] = scope - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.temp.dereferenceScope", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/tempfetchlabels.go b/pkg/comatproto/tempfetchlabels.go deleted file mode 100644 index 6e4635db..00000000 --- a/pkg/comatproto/tempfetchlabels.go +++ /dev/null @@ -1,51 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.temp.fetchLabels - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type TempFetchLabels_Output struct { - LexiconTypeID string `json:"$type"` - Labels []LabelDefs_Label `json:"labels"` -} - -func (t *TempFetchLabels_Output) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.temp.fetchLabels#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *TempFetchLabels_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// TempFetchLabels calls the XRPC method "com.atproto.temp.fetchLabels". -// -// DEPRECATED: use queryLabels or subscribeLabels instead -- Fetch all labels from a labeler created after a certain date. -func TempFetchLabels(ctx context.Context, c glexrt.LexClient, limit *int64, since *int64) (*TempFetchLabels_Output, error) { - var out TempFetchLabels_Output - - params := map[string]interface{}{} - if limit != nil { - params["limit"] = *limit - } - if since != nil { - params["since"] = *since - } - - if err := c.LexDo(ctx, glexrt.Query, "", "com.atproto.temp.fetchLabels", params, nil, &out); err != nil { - return nil, err - } - return &out, nil -} diff --git a/pkg/comatproto/temprequestphoneverification.go b/pkg/comatproto/temprequestphoneverification.go deleted file mode 100644 index c358a8ed..00000000 --- a/pkg/comatproto/temprequestphoneverification.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.temp.requestPhoneVerification - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type TempRequestPhoneVerification_Input struct { - LexiconTypeID string `json:"$type"` - PhoneNumber string `json:"phoneNumber"` -} - -func (t *TempRequestPhoneVerification_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.temp.requestPhoneVerification#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *TempRequestPhoneVerification_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// TempRequestPhoneVerification calls the XRPC method "com.atproto.temp.requestPhoneVerification". -// -// Request a verification code to be sent to the supplied phone number -func TempRequestPhoneVerification(ctx context.Context, c glexrt.LexClient, input *TempRequestPhoneVerification_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.temp.requestPhoneVerification", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/comatproto/temprevokeaccountcredentials.go b/pkg/comatproto/temprevokeaccountcredentials.go deleted file mode 100644 index f26cdd2d..00000000 --- a/pkg/comatproto/temprevokeaccountcredentials.go +++ /dev/null @@ -1,42 +0,0 @@ -// Code generated by glex; DO NOT EDIT. - -// Lexicon schema: com.atproto.temp.revokeAccountCredentials - -package comatproto - -import ( - "context" - "io" - - glexrt "github.com/streamplace/glex/runtime" - cbg "github.com/whyrusleeping/cbor-gen" -) - -type TempRevokeAccountCredentials_Input struct { - LexiconTypeID string `json:"$type"` - Account string `json:"account"` -} - -func (t *TempRevokeAccountCredentials_Input) MarshalCBOR(w io.Writer) error { - if t == nil { - _, err := w.Write(cbg.CborNull) - return err - } - t.LexiconTypeID = "com.atproto.temp.revokeAccountCredentials#main" - return glexrt.MarshalCBOR(w, t) -} - -func (t *TempRevokeAccountCredentials_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) -} - -// TempRevokeAccountCredentials calls the XRPC method "com.atproto.temp.revokeAccountCredentials". -// -// Revoke sessions, password, and app passwords associated with account. May be resolved by a password reset. -func TempRevokeAccountCredentials(ctx context.Context, c glexrt.LexClient, input *TempRevokeAccountCredentials_Input) error { - - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "com.atproto.temp.revokeAccountCredentials", nil, input, nil); err != nil { - return err - } - return nil -} diff --git a/pkg/director/stream_session.go b/pkg/director/stream_session.go index 8b0065fb..b8a39708 100644 --- a/pkg/director/stream_session.go +++ b/pkg/director/stream_session.go @@ -14,7 +14,7 @@ import ( "github.com/bluesky-social/indigo/util" "github.com/bluesky-social/indigo/xrpc" "github.com/google/uuid" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "github.com/streamplace/oatproxy/pkg/oatproxy" "golang.org/x/sync/errgroup" "stream.place/streamplace/pkg/appbsky" @@ -537,7 +537,7 @@ func (ss *StreamSession) doUpdateStatus(ctx context.Context, repoDID string) err inp := comatproto.RepoPutRecord_Input{ Collection: "app.appbsky.actor.status", - Record: &glexrt.LexiconTypeDecoder{Val: &status}, + Record: &glex.LexiconTypeDecoder{Val: &status}, Rkey: "self", Repo: repoDID, SwapRecord: swapRecord, @@ -638,7 +638,7 @@ func (ss *StreamSession) doUpdateLivestream(ctx context.Context, repoDID string) inp := comatproto.RepoPutRecord_Input{ Collection: "place.stream.livestream", - Record: &glexrt.LexiconTypeDecoder{Val: lsvr}, + Record: &glex.LexiconTypeDecoder{Val: lsvr}, Rkey: aturi.RecordKey().String(), Repo: ss.repoDID, SwapRecord: swapRecord, @@ -762,7 +762,7 @@ func (ss *StreamSession) doUpdateBroadcastOrigin(ctx context.Context) error { inp := comatproto.RepoPutRecord_Input{ Collection: "place.stream.broadcast.origin", - Record: &glexrt.LexiconTypeDecoder{Val: &origin}, + Record: &glex.LexiconTypeDecoder{Val: &origin}, Rkey: rkey, Repo: ss.repoDID, SwapRecord: swapRecord, diff --git a/pkg/gamesgamesgamesgamesgames/defs.go b/pkg/gamesgamesgamesgamesgames/defs.go index c3ef82dc..4eae5ac1 100644 --- a/pkg/gamesgamesgamesgamesgames/defs.go +++ b/pkg/gamesgamesgamesgamesgames/defs.go @@ -7,7 +7,7 @@ package gamesgamesgamesgamesgames import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" appbsky "stream.place/streamplace/pkg/appbsky" ) @@ -27,17 +27,22 @@ type Defs_ActivityFeedItem struct { Type string `json:"type"` } +// RecordTypeID implements glex.Record. +func (t *Defs_ActivityFeedItem) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#activityFeedItem" +} + func (t *Defs_ActivityFeedItem) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#activityFeedItem" + return glex.MarshalCBOR(w, t) } func (t *Defs_ActivityFeedItem) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_ActivityListView is a "activityListView" in the games.gamesgamesgamesgames.defs schema. @@ -48,17 +53,22 @@ type Defs_ActivityListView struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *Defs_ActivityListView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#activityListView" +} + func (t *Defs_ActivityListView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#activityListView" + return glex.MarshalCBOR(w, t) } func (t *Defs_ActivityListView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_ActivityReviewView is a "activityReviewView" in the games.gamesgamesgamesgames.defs schema. @@ -73,17 +83,22 @@ type Defs_ActivityReviewView struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *Defs_ActivityReviewView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#activityReviewView" +} + func (t *Defs_ActivityReviewView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#activityReviewView" + return glex.MarshalCBOR(w, t) } func (t *Defs_ActivityReviewView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_ActorCreditView is a "actorCreditView" in the games.gamesgamesgamesgames.defs schema. @@ -95,23 +110,28 @@ type Defs_ActorCreditView struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *Defs_ActorCreditView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#actorCreditView" +} + func (t *Defs_ActorCreditView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#actorCreditView" + return glex.MarshalCBOR(w, t) } func (t *Defs_ActorCreditView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_ActorProfileDetailView is a "actorProfileDetailView" in the games.gamesgamesgamesgames.defs schema. type Defs_ActorProfileDetailView struct { LexiconTypeID string `json:"$type"` - Avatar *glexrt.Blob `json:"avatar,omitempty"` + Avatar *glex.Blob `json:"avatar,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` Description *string `json:"description,omitempty"` DescriptionFacets []appbsky.RichtextFacet `json:"descriptionFacets,omitempty"` @@ -122,26 +142,36 @@ type Defs_ActorProfileDetailView struct { Websites []Defs_Website `json:"websites,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_ActorProfileDetailView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#actorProfileDetailView" +} + func (t *Defs_ActorProfileDetailView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#actorProfileDetailView" + return glex.MarshalCBOR(w, t) } func (t *Defs_ActorProfileDetailView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_ActorProfileSummaryView is a "actorProfileSummaryView" in the games.gamesgamesgamesgames.defs schema. type Defs_ActorProfileSummaryView struct { - LexiconTypeID string `json:"$type"` - Avatar *glexrt.Blob `json:"avatar,omitempty"` - Did string `json:"did"` - DisplayName *string `json:"displayName,omitempty"` - Uri string `json:"uri"` + LexiconTypeID string `json:"$type"` + Avatar *glex.Blob `json:"avatar,omitempty"` + Did string `json:"did"` + DisplayName *string `json:"displayName,omitempty"` + Uri string `json:"uri"` +} + +// RecordTypeID implements glex.Record. +func (t *Defs_ActorProfileSummaryView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#actorProfileSummaryView" } func (t *Defs_ActorProfileSummaryView) MarshalCBOR(w io.Writer) error { @@ -149,12 +179,12 @@ func (t *Defs_ActorProfileSummaryView) MarshalCBOR(w io.Writer) error { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#actorProfileSummaryView" + return glex.MarshalCBOR(w, t) } func (t *Defs_ActorProfileSummaryView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_AgeRating is a "ageRating" in the games.gamesgamesgamesgames.defs schema. @@ -165,17 +195,20 @@ type Defs_AgeRating struct { Rating string `json:"rating"` } +// RecordTypeID implements glex.Record. +func (t *Defs_AgeRating) RecordTypeID() string { return "games.gamesgamesgamesgames.defs#ageRating" } + func (t *Defs_AgeRating) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#ageRating" + return glex.MarshalCBOR(w, t) } func (t *Defs_AgeRating) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_AlternativeName is a "alternativeName" in the games.gamesgamesgamesgames.defs schema. @@ -186,17 +219,22 @@ type Defs_AlternativeName struct { Name string `json:"name"` } +// RecordTypeID implements glex.Record. +func (t *Defs_AlternativeName) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#alternativeName" +} + func (t *Defs_AlternativeName) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#alternativeName" + return glex.MarshalCBOR(w, t) } func (t *Defs_AlternativeName) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_CollectionSummaryView is a "collectionSummaryView" in the games.gamesgamesgamesgames.defs schema. @@ -208,17 +246,22 @@ type Defs_CollectionSummaryView struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *Defs_CollectionSummaryView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#collectionSummaryView" +} + func (t *Defs_CollectionSummaryView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#collectionSummaryView" + return glex.MarshalCBOR(w, t) } func (t *Defs_CollectionSummaryView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_CommunityFeedActorView is a "communityFeedActorView" in the games.gamesgamesgamesgames.defs schema. @@ -231,17 +274,22 @@ type Defs_CommunityFeedActorView struct { Handle *string `json:"handle,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_CommunityFeedActorView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#communityFeedActorView" +} + func (t *Defs_CommunityFeedActorView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#communityFeedActorView" + return glex.MarshalCBOR(w, t) } func (t *Defs_CommunityFeedActorView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_CommunityFeedItem is a "communityFeedItem" in the games.gamesgamesgamesgames.defs schema. @@ -263,17 +311,22 @@ type Defs_CommunityFeedItem struct { Type string `json:"type"` } +// RecordTypeID implements glex.Record. +func (t *Defs_CommunityFeedItem) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#communityFeedItem" +} + func (t *Defs_CommunityFeedItem) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#communityFeedItem" + return glex.MarshalCBOR(w, t) } func (t *Defs_CommunityFeedItem) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_CreditEntry is a "creditEntry" in the games.gamesgamesgamesgames.defs schema. @@ -283,17 +336,22 @@ type Defs_CreditEntry struct { Role string `json:"role"` } +// RecordTypeID implements glex.Record. +func (t *Defs_CreditEntry) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#creditEntry" +} + func (t *Defs_CreditEntry) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#creditEntry" + return glex.MarshalCBOR(w, t) } func (t *Defs_CreditEntry) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_EngineSummaryView is a "engineSummaryView" in the games.gamesgamesgamesgames.defs schema. @@ -304,17 +362,22 @@ type Defs_EngineSummaryView struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *Defs_EngineSummaryView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#engineSummaryView" +} + func (t *Defs_EngineSummaryView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#engineSummaryView" + return glex.MarshalCBOR(w, t) } func (t *Defs_EngineSummaryView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_ExternalIds is a "externalIds" in the games.gamesgamesgamesgames.defs schema. @@ -334,17 +397,22 @@ type Defs_ExternalIds struct { Xbox *string `json:"xbox,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_ExternalIds) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#externalIds" +} + func (t *Defs_ExternalIds) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#externalIds" + return glex.MarshalCBOR(w, t) } func (t *Defs_ExternalIds) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_ExternalVideo is a "externalVideo" in the games.gamesgamesgamesgames.defs schema. @@ -355,17 +423,22 @@ type Defs_ExternalVideo struct { VideoId string `json:"videoId"` } +// RecordTypeID implements glex.Record. +func (t *Defs_ExternalVideo) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#externalVideo" +} + func (t *Defs_ExternalVideo) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#externalVideo" + return glex.MarshalCBOR(w, t) } func (t *Defs_ExternalVideo) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_GameDetailView is a "gameDetailView" in the games.gamesgamesgamesgames.defs schema. @@ -401,17 +474,22 @@ type Defs_GameDetailView struct { Websites []Defs_Website `json:"websites,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_GameDetailView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#gameDetailView" +} + func (t *Defs_GameDetailView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#gameDetailView" + return glex.MarshalCBOR(w, t) } func (t *Defs_GameDetailView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_GameFeedViewItem is a "gameFeedViewItem" in the games.gamesgamesgamesgames.defs schema. @@ -421,17 +499,22 @@ type Defs_GameFeedViewItem struct { Game Defs_GameView `json:"game"` } +// RecordTypeID implements glex.Record. +func (t *Defs_GameFeedViewItem) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#gameFeedViewItem" +} + func (t *Defs_GameFeedViewItem) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#gameFeedViewItem" + return glex.MarshalCBOR(w, t) } func (t *Defs_GameFeedViewItem) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_GameSummaryView is a "gameSummaryView" in the games.gamesgamesgamesgames.defs schema. @@ -447,17 +530,22 @@ type Defs_GameSummaryView struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *Defs_GameSummaryView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#gameSummaryView" +} + func (t *Defs_GameSummaryView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#gameSummaryView" + return glex.MarshalCBOR(w, t) } func (t *Defs_GameSummaryView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_GameView is a "gameView" in the games.gamesgamesgamesgames.defs schema. @@ -476,17 +564,20 @@ type Defs_GameView struct { Viewer *Defs_ViewerState `json:"viewer,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_GameView) RecordTypeID() string { return "games.gamesgamesgamesgames.defs#gameView" } + func (t *Defs_GameView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#gameView" + return glex.MarshalCBOR(w, t) } func (t *Defs_GameView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_ItchIoId is a "itchIoId" in the games.gamesgamesgamesgames.defs schema. @@ -496,17 +587,20 @@ type Defs_ItchIoId struct { Game string `json:"game"` } +// RecordTypeID implements glex.Record. +func (t *Defs_ItchIoId) RecordTypeID() string { return "games.gamesgamesgamesgames.defs#itchIoId" } + func (t *Defs_ItchIoId) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#itchIoId" + return glex.MarshalCBOR(w, t) } func (t *Defs_ItchIoId) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_LanguageSupport is a "languageSupport" in the games.gamesgamesgamesgames.defs schema. @@ -518,42 +612,50 @@ type Defs_LanguageSupport struct { Subtitles *bool `json:"subtitles,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_LanguageSupport) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#languageSupport" +} + func (t *Defs_LanguageSupport) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#languageSupport" + return glex.MarshalCBOR(w, t) } func (t *Defs_LanguageSupport) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_MediaItem is a "mediaItem" in the games.gamesgamesgamesgames.defs schema. type Defs_MediaItem struct { - LexiconTypeID string `json:"$type"` - Blob *glexrt.Blob `json:"blob,omitempty"` - Description *string `json:"description,omitempty"` - Height *int64 `json:"height,omitempty"` - Locale *string `json:"locale,omitempty"` - MediaType *string `json:"mediaType,omitempty"` - Title *string `json:"title,omitempty"` - Width *int64 `json:"width,omitempty"` + LexiconTypeID string `json:"$type"` + Blob *glex.Blob `json:"blob,omitempty"` + Description *string `json:"description,omitempty"` + Height *int64 `json:"height,omitempty"` + Locale *string `json:"locale,omitempty"` + MediaType *string `json:"mediaType,omitempty"` + Title *string `json:"title,omitempty"` + Width *int64 `json:"width,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_MediaItem) RecordTypeID() string { return "games.gamesgamesgamesgames.defs#mediaItem" } + func (t *Defs_MediaItem) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#mediaItem" + return glex.MarshalCBOR(w, t) } func (t *Defs_MediaItem) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_MultiplayerMode is a "multiplayerMode" in the games.gamesgamesgamesgames.defs schema. @@ -571,17 +673,22 @@ type Defs_MultiplayerMode struct { Platform *string `json:"platform,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_MultiplayerMode) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#multiplayerMode" +} + func (t *Defs_MultiplayerMode) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#multiplayerMode" + return glex.MarshalCBOR(w, t) } func (t *Defs_MultiplayerMode) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_OrgCreditView is a "orgCreditView" in the games.gamesgamesgamesgames.defs schema. @@ -593,23 +700,28 @@ type Defs_OrgCreditView struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *Defs_OrgCreditView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#orgCreditView" +} + func (t *Defs_OrgCreditView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#orgCreditView" + return glex.MarshalCBOR(w, t) } func (t *Defs_OrgCreditView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_OrgProfileDetailView is a "orgProfileDetailView" in the games.gamesgamesgamesgames.defs schema. type Defs_OrgProfileDetailView struct { LexiconTypeID string `json:"$type"` - Avatar *glexrt.Blob `json:"avatar,omitempty"` + Avatar *glex.Blob `json:"avatar,omitempty"` Country *string `json:"country,omitempty"` CreatedAt *string `json:"createdAt,omitempty"` Description *string `json:"description,omitempty"` @@ -624,26 +736,36 @@ type Defs_OrgProfileDetailView struct { Websites []Defs_Website `json:"websites,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_OrgProfileDetailView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#orgProfileDetailView" +} + func (t *Defs_OrgProfileDetailView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#orgProfileDetailView" + return glex.MarshalCBOR(w, t) } func (t *Defs_OrgProfileDetailView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_OrgProfileSummaryView is a "orgProfileSummaryView" in the games.gamesgamesgamesgames.defs schema. type Defs_OrgProfileSummaryView struct { - LexiconTypeID string `json:"$type"` - Avatar *glexrt.Blob `json:"avatar,omitempty"` - Did string `json:"did"` - DisplayName *string `json:"displayName,omitempty"` - Uri string `json:"uri"` + LexiconTypeID string `json:"$type"` + Avatar *glex.Blob `json:"avatar,omitempty"` + Did string `json:"did"` + DisplayName *string `json:"displayName,omitempty"` + Uri string `json:"uri"` +} + +// RecordTypeID implements glex.Record. +func (t *Defs_OrgProfileSummaryView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#orgProfileSummaryView" } func (t *Defs_OrgProfileSummaryView) MarshalCBOR(w io.Writer) error { @@ -651,12 +773,12 @@ func (t *Defs_OrgProfileSummaryView) MarshalCBOR(w io.Writer) error { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#orgProfileSummaryView" + return glex.MarshalCBOR(w, t) } func (t *Defs_OrgProfileSummaryView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_PlatformFeatures is a "platformFeatures" in the games.gamesgamesgamesgames.defs schema. @@ -668,17 +790,22 @@ type Defs_PlatformFeatures struct { Platform string `json:"platform"` } +// RecordTypeID implements glex.Record. +func (t *Defs_PlatformFeatures) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#platformFeatures" +} + func (t *Defs_PlatformFeatures) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#platformFeatures" + return glex.MarshalCBOR(w, t) } func (t *Defs_PlatformFeatures) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_PlatformSummaryView is a "platformSummaryView" in the games.gamesgamesgamesgames.defs schema. @@ -691,17 +818,22 @@ type Defs_PlatformSummaryView struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *Defs_PlatformSummaryView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#platformSummaryView" +} + func (t *Defs_PlatformSummaryView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#platformSummaryView" + return glex.MarshalCBOR(w, t) } func (t *Defs_PlatformSummaryView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_PlatformVersion is a "platformVersion" in the games.gamesgamesgamesgames.defs schema. @@ -720,27 +852,37 @@ type Defs_PlatformVersion struct { Summary *string `json:"summary,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_PlatformVersion) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#platformVersion" +} + func (t *Defs_PlatformVersion) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#platformVersion" + return glex.MarshalCBOR(w, t) } func (t *Defs_PlatformVersion) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_ProfileSummaryView is a "profileSummaryView" in the games.gamesgamesgamesgames.defs schema. type Defs_ProfileSummaryView struct { - LexiconTypeID string `json:"$type"` - Avatar *glexrt.Blob `json:"avatar,omitempty"` - Did string `json:"did"` - DisplayName *string `json:"displayName,omitempty"` - ProfileType string `json:"profileType"` - Uri string `json:"uri"` + LexiconTypeID string `json:"$type"` + Avatar *glex.Blob `json:"avatar,omitempty"` + Did string `json:"did"` + DisplayName *string `json:"displayName,omitempty"` + ProfileType string `json:"profileType"` + Uri string `json:"uri"` +} + +// RecordTypeID implements glex.Record. +func (t *Defs_ProfileSummaryView) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#profileSummaryView" } func (t *Defs_ProfileSummaryView) MarshalCBOR(w io.Writer) error { @@ -748,12 +890,12 @@ func (t *Defs_ProfileSummaryView) MarshalCBOR(w io.Writer) error { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#profileSummaryView" + return glex.MarshalCBOR(w, t) } func (t *Defs_ProfileSummaryView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_Release is a "release" in the games.gamesgamesgamesgames.defs schema. @@ -766,17 +908,20 @@ type Defs_Release struct { ReleaseDates []Defs_ReleaseDate `json:"releaseDates,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_Release) RecordTypeID() string { return "games.gamesgamesgamesgames.defs#release" } + func (t *Defs_Release) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#release" + return glex.MarshalCBOR(w, t) } func (t *Defs_Release) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_ReleaseDate is a "releaseDate" in the games.gamesgamesgamesgames.defs schema. @@ -788,17 +933,22 @@ type Defs_ReleaseDate struct { Status *string `json:"status,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_ReleaseDate) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#releaseDate" +} + func (t *Defs_ReleaseDate) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#releaseDate" + return glex.MarshalCBOR(w, t) } func (t *Defs_ReleaseDate) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_Signature is a "signature" in the games.gamesgamesgamesgames.defs schema. @@ -809,20 +959,23 @@ type Defs_Signature struct { // key: DID key reference (e.g., did:web:example.com#signing1). Key string `json:"key"` // signature: The signature bytes. - Signature glexrt.Bytes `json:"signature"` + Signature glex.Bytes `json:"signature"` } +// RecordTypeID implements glex.Record. +func (t *Defs_Signature) RecordTypeID() string { return "games.gamesgamesgamesgames.defs#signature" } + func (t *Defs_Signature) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#signature" + return glex.MarshalCBOR(w, t) } func (t *Defs_Signature) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_SkeletonGameFeedItem is a "skeletonGameFeedItem" in the games.gamesgamesgamesgames.defs schema. @@ -832,17 +985,22 @@ type Defs_SkeletonGameFeedItem struct { Game string `json:"game"` } +// RecordTypeID implements glex.Record. +func (t *Defs_SkeletonGameFeedItem) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#skeletonGameFeedItem" +} + func (t *Defs_SkeletonGameFeedItem) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#skeletonGameFeedItem" + return glex.MarshalCBOR(w, t) } func (t *Defs_SkeletonGameFeedItem) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_SystemRequirements is a "systemRequirements" in the games.gamesgamesgamesgames.defs schema. @@ -855,17 +1013,22 @@ type Defs_SystemRequirements struct { Recommended *Defs_SystemSpec `json:"recommended,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_SystemRequirements) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#systemRequirements" +} + func (t *Defs_SystemRequirements) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#systemRequirements" + return glex.MarshalCBOR(w, t) } func (t *Defs_SystemRequirements) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_SystemSpec is a "systemSpec" in the games.gamesgamesgamesgames.defs schema. @@ -883,17 +1046,20 @@ type Defs_SystemSpec struct { Storage *string `json:"storage,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_SystemSpec) RecordTypeID() string { return "games.gamesgamesgamesgames.defs#systemSpec" } + func (t *Defs_SystemSpec) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#systemSpec" + return glex.MarshalCBOR(w, t) } func (t *Defs_SystemSpec) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_TimeToBeat is a "timeToBeat" in the games.gamesgamesgamesgames.defs schema. @@ -904,17 +1070,20 @@ type Defs_TimeToBeat struct { Normally *int64 `json:"normally,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_TimeToBeat) RecordTypeID() string { return "games.gamesgamesgamesgames.defs#timeToBeat" } + func (t *Defs_TimeToBeat) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#timeToBeat" + return glex.MarshalCBOR(w, t) } func (t *Defs_TimeToBeat) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_ViewerState is a "viewerState" in the games.gamesgamesgamesgames.defs schema. @@ -923,17 +1092,22 @@ type Defs_ViewerState struct { Like *string `json:"like,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Defs_ViewerState) RecordTypeID() string { + return "games.gamesgamesgamesgames.defs#viewerState" +} + func (t *Defs_ViewerState) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#viewerState" + return glex.MarshalCBOR(w, t) } func (t *Defs_ViewerState) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_Website is a "website" in the games.gamesgamesgamesgames.defs schema. @@ -943,15 +1117,18 @@ type Defs_Website struct { Url string `json:"url"` } +// RecordTypeID implements glex.Record. +func (t *Defs_Website) RecordTypeID() string { return "games.gamesgamesgamesgames.defs#website" } + func (t *Defs_Website) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.defs#website" + return glex.MarshalCBOR(w, t) } func (t *Defs_Website) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/gamesgamesgamesgamesgames/search.go b/pkg/gamesgamesgamesgamesgames/search.go index 0356dfcc..a0b94e89 100644 --- a/pkg/gamesgamesgamesgamesgames/search.go +++ b/pkg/gamesgamesgamesgamesgames/search.go @@ -11,7 +11,7 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -23,17 +23,20 @@ type Search_Output struct { TotalResults *int64 `json:"totalResults,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Search_Output) RecordTypeID() string { return "games.gamesgamesgamesgames.search" } + func (t *Search_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "games.gamesgamesgamesgames.search#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "games.gamesgamesgamesgames.search" + return glex.MarshalCBOR(w, t) } func (t *Search_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type Search_Output_Results_Elem struct { @@ -69,7 +72,7 @@ func (t *Search_Output_Results_Elem) MarshalJSON() ([]byte, error) { } func (t *Search_Output_Results_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -120,7 +123,7 @@ func (t *Search_Output_Results_Elem) MarshalCBOR(w io.Writer) error { } func (t *Search_Output_Results_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -153,7 +156,7 @@ func (t *Search_Output_Results_Elem) UnmarshalCBOR(r io.Reader) error { // ageRatings[]: Filter game results by age rating in 'organization:rating' format (e.g. esrb:M, pegi:Eighteen). // applicationTypes[]: Filter game results by application type (e.g. game, dlc, bundle). Only applies when types includes game. // includeUnrated: When age rating filters are active, also include games with no age ratings. -func Search(ctx context.Context, c glexrt.LexClient, ageRatings []string, applicationTypes []string, cursor string, genres []string, includeCancelled *bool, includeUnrated *bool, limit *int64, modes []string, playerPerspectives []string, q string, sort string, themes []string, types []string) (*Search_Output, error) { +func Search(ctx context.Context, c glex.LexClient, ageRatings []string, applicationTypes []string, cursor string, genres []string, includeCancelled *bool, includeUnrated *bool, limit *int64, modes []string, playerPerspectives []string, q string, sort string, themes []string, types []string) (*Search_Output, error) { var out Search_Output params := map[string]interface{}{} @@ -195,7 +198,7 @@ func Search(ctx context.Context, c glexrt.LexClient, ageRatings []string, applic } params["q"] = q - if err := c.LexDo(ctx, glexrt.Query, "", "games.gamesgamesgamesgames.search", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "games.gamesgamesgamesgames.search", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/integrations/discord/send-livestream.go b/pkg/integrations/discord/send-livestream.go index 71c70347..c7819dcb 100644 --- a/pkg/integrations/discord/send-livestream.go +++ b/pkg/integrations/discord/send-livestream.go @@ -47,7 +47,7 @@ func SendLivestream(ctx context.Context, w *discordtypes.Webhook, pdsURL string, color := "f8baca" if spcp != nil && spcp.Color != nil { - color = strings.TrimPrefix(model.ColorToHex(*spcp.Color), "#") + color = strings.TrimPrefix(model.ColorToHex(spcp.Color), "#") } colorInt, err := strconv.ParseInt(color, 16, 64) diff --git a/pkg/lex/bridge.go b/pkg/lex/bridge.go deleted file mode 100644 index d4c5fc77..00000000 --- a/pkg/lex/bridge.go +++ /dev/null @@ -1,39 +0,0 @@ -package lex - -import ( - "github.com/ipfs/go-cid" - - lexutil "github.com/bluesky-social/indigo/lex/util" -) - -// This file bridges between glex's go-dasl-native Blob type and indigo's -// lexutil.LexBlob, for the boundaries where Streamplace records interoperate -// with indigo's bundled bsky/atproto types (e.g. com.atproto.repo.uploadBlob -// output, or app.bsky embed types) which still use lexutil.LexBlob. -// -// Since Blob is a type alias for glexrt.Blob (from another package), we cannot -// define methods on it here — so the conversions are free functions. - -// BlobFromLexUtil converts an indigo *lexutil.LexBlob to a *Blob (nil-safe). -func BlobFromLexUtil(b *lexutil.LexBlob) *Blob { - if b == nil { - return nil - } - return &Blob{ - Ref: Link(cid.Cid(b.Ref)), - MimeType: b.MimeType, - Size: b.Size, - } -} - -// BlobToLexUtil converts a *Blob to an indigo *lexutil.LexBlob (nil-safe). -func BlobToLexUtil(b *Blob) *lexutil.LexBlob { - if b == nil { - return nil - } - return &lexutil.LexBlob{ - Ref: lexutil.LexLink(cid.Cid(b.Ref)), - MimeType: b.MimeType, - Size: b.Size, - } -} diff --git a/pkg/lex/lex.go b/pkg/lex/lex.go deleted file mode 100644 index 5830027b..00000000 --- a/pkg/lex/lex.go +++ /dev/null @@ -1,50 +0,0 @@ -// Package lex is a compatibility shim that re-exports the glex runtime -// (github.com/streamplace/glex/runtime, package glexrt) under the historical -// streamplace import path. This allows existing generated code and hand-written -// callers to keep importing "stream.place/streamplace/pkg/lex" while the -// underlying implementation lives in the standalone glex module. -// -// Once all generated code is regenerated to import glexrt directly, this shim -// can be removed. -package lex - -import ( - "github.com/streamplace/glex/runtime" -) - -// Re-export the value types. -type Link = glexrt.Link -type Blob = glexrt.Blob -type Bytes = glexrt.Bytes - -// Re-export the adapter helpers. -var ( - MarshalCBOR = glexrt.MarshalCBOR - UnmarshalCBOR = glexrt.UnmarshalCBOR -) - -// Re-export the registry and decode functions. -var ( - RegisterType = glexrt.RegisterType - CborDecodeValue = glexrt.CborDecodeValue - JsonDecodeValue = glexrt.JsonDecodeValue - NewFromType = glexrt.NewFromType - ErrUnrecognizedType = glexrt.ErrUnrecognizedType -) - -// Re-export the type decoder and extract helpers. -type LexiconTypeDecoder = glexrt.LexiconTypeDecoder - -var ( - TypeExtract = glexrt.TypeExtract - CborTypeExtract = glexrt.CborTypeExtract - CborTypeExtractReader = glexrt.CborTypeExtractReader -) - -// Re-export the XRPC client interface and constants. -type LexClient = glexrt.LexClient - -const ( - Query = glexrt.Query - Procedure = glexrt.Procedure -) diff --git a/pkg/lexroundtrip/roundtrip_test.go b/pkg/lexroundtrip/roundtrip_test.go index f9812807..a96c2854 100644 --- a/pkg/lexroundtrip/roundtrip_test.go +++ b/pkg/lexroundtrip/roundtrip_test.go @@ -5,8 +5,7 @@ import ( "testing" "github.com/ipfs/go-cid" - glexrt "github.com/streamplace/glex/runtime" - "stream.place/streamplace/pkg/lex" + glex "github.com/streamplace/glex/runtime" "stream.place/streamplace/pkg/placestream" ) @@ -20,7 +19,7 @@ func TestAdapterRegistryRoundtrip(t *testing.T) { CreatedAt: "2026-07-07T00:00:00Z", Title: "hello world", Tags: []string{"lang:en"}, - Thumb: &lex.Blob{Ref: lex.Link(c), MimeType: "image/jpeg", Size: 4096}, + Thumb: &glex.Blob{Ref: glex.Link(c), MimeType: "image/jpeg", Size: 4096}, Activity: &placestream.Livestream_Activity{ Defs_ActivityGame: &placestream.Defs_ActivityGame{Uri: "at://did:plc:x/games.gamesgamesgamesgames.game/abc"}, }, @@ -38,7 +37,7 @@ func TestAdapterRegistryRoundtrip(t *testing.T) { } // Decode via the glex runtime registry, exactly like the firehose does. - decoded, err := glexrt.CborDecodeValue(enc) + decoded, err := glex.CborDecodeValue(enc) if err != nil { t.Fatalf("CborDecodeValue: %v", err) } diff --git a/pkg/linking/linking_test.go b/pkg/linking/linking_test.go index 909c6adb..d3821298 100644 --- a/pkg/linking/linking_test.go +++ b/pkg/linking/linking_test.go @@ -7,13 +7,12 @@ import ( "strings" "testing" - "github.com/bluesky-social/indigo/api/atproto" "github.com/ipfs/go-cid" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "github.com/stretchr/testify/require" "stream.place/streamplace/js/app" "stream.place/streamplace/pkg/appbsky" - "stream.place/streamplace/pkg/lex" + "stream.place/streamplace/pkg/comatproto" "stream.place/streamplace/pkg/placestream" ) @@ -47,7 +46,7 @@ func TestGenerateLinkCard(t *testing.T) { sp := "https://stream.place" ls := &placestream.Livestream{ CreatedAt: "2025-03-25T00:39:49.121Z", - Post: &atproto.RepoStrongRef{ + Post: &comatproto.RepoStrongRef{ Cid: "bafyreiczmyne5jd4lpax5ttyb5p2fbcageyt6fsthdpyymecokcsmyh4a4", Uri: "at://did:plc:2zmxikig2sj7gqaezl5gntae/app.appbsky.feed.post/3ll5zuomua22x", }, @@ -61,7 +60,7 @@ func TestGenerateLinkCard(t *testing.T) { }, Cid: "bafyreib2ohz45jileumnuwa3wdoo3o7caikfyq467eanleqcscouh5wery", IndexedAt: "2025-03-25T01:16:14Z", - Record: &glexrt.LexiconTypeDecoder{Val: ls}, + Record: &glex.LexiconTypeDecoder{Val: ls}, Uri: "at://did:plc:2zmxikig2sj7gqaezl5gntae/place.stream.livestream/3ll5zuop2k22x", } linkCard, err := linker.GenerateStreamerCard(context.Background(), u, lsv, "") @@ -87,8 +86,8 @@ func TestGenerateVideoCard(t *testing.T) { video := &placestream.Video{ Title: "My excellent VOD", - Thumb: &lex.Blob{ - Ref: lex.Link(c), + Thumb: &glex.Blob{ + Ref: glex.Link(c), MimeType: "image/jpeg", }, } @@ -98,7 +97,7 @@ func TestGenerateVideoCard(t *testing.T) { Did: "did:plc:2zmxikig2sj7gqaezl5gntae", }, Cid: "bafyreib2ohz45jileumnuwa3wdoo3o7caikfyq467eanleqcscouh5wery", - Record: &glexrt.LexiconTypeDecoder{Val: video}, + Record: &glex.LexiconTypeDecoder{Val: video}, Uri: "at://did:plc:2zmxikig2sj7gqaezl5gntae/place.stream.video/3mms3tfkcxstu", } diff --git a/pkg/media/key_revocation_linux_test.go b/pkg/media/key_revocation_linux_test.go index 86b801c7..dc537a71 100644 --- a/pkg/media/key_revocation_linux_test.go +++ b/pkg/media/key_revocation_linux_test.go @@ -13,11 +13,11 @@ import ( "testing" "time" - comatproto "github.com/bluesky-social/indigo/api/atproto" "github.com/google/uuid" "github.com/stretchr/testify/require" "stream.place/streamplace/pkg/atproto" "stream.place/streamplace/pkg/bus" + "stream.place/streamplace/pkg/comatproto" "stream.place/streamplace/pkg/config" ) diff --git a/pkg/media/key_revocation_test.go b/pkg/media/key_revocation_test.go index 0416a5c2..065d2baf 100644 --- a/pkg/media/key_revocation_test.go +++ b/pkg/media/key_revocation_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - comatproto "github.com/bluesky-social/indigo/api/atproto" "github.com/stretchr/testify/require" "stream.place/streamplace/pkg/atproto" + "stream.place/streamplace/pkg/comatproto" ) // TestStreamKickMarshalsAsPlaceStreamError locks the dashboard wire contract: a diff --git a/pkg/media/rtmp_push_worker_test.go b/pkg/media/rtmp_push_worker_test.go index 948aee18..d37417fb 100644 --- a/pkg/media/rtmp_push_worker_test.go +++ b/pkg/media/rtmp_push_worker_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "github.com/stretchr/testify/require" "stream.place/streamplace/pkg/bus" "stream.place/streamplace/pkg/ingestframe" @@ -116,7 +116,7 @@ func TestRTMPPushWorkerContainsFailure(t *testing.T) { mm := &MediaManager{bus: bus.NewBus()} targetView := &placestream.MultistreamDefs_TargetView{ Uri: "at://did:plc:test/place.stream.multistream.target/abc", - Record: &glexrt.LexiconTypeDecoder{ + Record: &glex.LexiconTypeDecoder{ Val: &placestream.MultistreamTarget{Url: "http://127.0.0.1:1/nope"}, }, } diff --git a/pkg/media/validate_bare_test.go b/pkg/media/validate_bare_test.go index 7852a849..8ce68ab9 100644 --- a/pkg/media/validate_bare_test.go +++ b/pkg/media/validate_bare_test.go @@ -11,11 +11,11 @@ import ( "testing" "time" - comatproto "github.com/bluesky-social/indigo/api/atproto" "github.com/bluesky-social/indigo/atproto/atcrypto" "github.com/decred/dcrd/dcrec/secp256k1" "github.com/stretchr/testify/require" "stream.place/streamplace/pkg/atproto" + "stream.place/streamplace/pkg/comatproto" "stream.place/streamplace/pkg/crypto/aqpub" "stream.place/streamplace/pkg/crypto/signers" "stream.place/streamplace/pkg/livehls" diff --git a/pkg/model/block.go b/pkg/model/block.go index a90b7966..1a6e5785 100644 --- a/pkg/model/block.go +++ b/pkg/model/block.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "stream.place/streamplace/pkg/appbsky" "stream.place/streamplace/pkg/placestream" @@ -32,13 +32,9 @@ func (b *Block) ToStreamplaceBlock() (placestream.Defs_BlockView, error) { if b.Record == nil { return placestream.Defs_BlockView{}, fmt.Errorf("block record is nil") } - rec, err := glexrt.CborDecodeValue(b.Record) - if err != nil { - return placestream.Defs_BlockView{}, fmt.Errorf("error decoding feed post: %w", err) - } - block, ok := rec.(appbsky.GraphBlock) - if !ok { - return placestream.Defs_BlockView{}, fmt.Errorf("record is not a GraphBlock") + var block appbsky.GraphBlock + if err := glex.DecodeCBOR(b.Record, &block); err != nil { + return placestream.Defs_BlockView{}, fmt.Errorf("error decoding block record: %w", err) } return placestream.Defs_BlockView{ LexiconTypeID: "place.stream.defs#blockView", diff --git a/pkg/model/broadcast_origin.go b/pkg/model/broadcast_origin.go index a2977c7a..db8b77fc 100644 --- a/pkg/model/broadcast_origin.go +++ b/pkg/model/broadcast_origin.go @@ -7,7 +7,7 @@ import ( "time" "github.com/bluesky-social/indigo/atproto/syntax" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "stream.place/streamplace/pkg/appbsky" "stream.place/streamplace/pkg/aqtime" "stream.place/streamplace/pkg/placestream" @@ -31,7 +31,7 @@ func (bo *BroadcastOrigin) TableName() string { } func (bo *BroadcastOrigin) ToBroadcastOriginView() (placestream.BroadcastDefs_BroadcastOriginView, error) { - rec, err := glexrt.CborDecodeValue(bo.Record) + rec, err := glex.CborDecodeValue(bo.Record) if err != nil { return placestream.BroadcastDefs_BroadcastOriginView{}, fmt.Errorf("error decoding broadcast origin: %w", err) } @@ -40,7 +40,7 @@ func (bo *BroadcastOrigin) ToBroadcastOriginView() (placestream.BroadcastDefs_Br Did: bo.StreamerRepoDID, }, Cid: bo.CID, - Record: &glexrt.LexiconTypeDecoder{Val: rec}, + Record: &glex.LexiconTypeDecoder{Val: rec}, Uri: bo.URI, }, nil } diff --git a/pkg/model/bsky_profile.go b/pkg/model/bsky_profile.go index 2eeab38e..bf4cf196 100644 --- a/pkg/model/bsky_profile.go +++ b/pkg/model/bsky_profile.go @@ -6,7 +6,7 @@ import ( "fmt" "github.com/bluesky-social/indigo/atproto/syntax" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "gorm.io/gorm/clause" "stream.place/streamplace/pkg/appbsky" @@ -48,22 +48,18 @@ func (m *DBModel) UpsertBskyProfile(ctx context.Context, aturi syntax.ATURI, rec Create(dbProfile).Error } -func (m *DBModel) GetBskyProfile(ctx context.Context, did string, wasStreamplace bool) (appbsky.ActorProfile, error) { +func (m *DBModel) GetBskyProfile(ctx context.Context, did string, wasStreamplace bool) (*appbsky.ActorProfile, error) { var profile BskyProfile err := m.DB.Where("uri = ? AND was_streamplace = ?", fmt.Sprintf("at://%s/app.appbsky.actor.profile/self", did), wasStreamplace).First(&profile).Error if errors.Is(err, gorm.ErrRecordNotFound) { - return appbsky.ActorProfile{}, nil + return nil, nil } if err != nil { - return appbsky.ActorProfile{}, err + return nil, err } - rec, err := glexrt.CborDecodeValue(*profile.Record) - if err != nil { - return appbsky.ActorProfile{}, fmt.Errorf("failed to decode profile record: %w", err) - } - bskyProfile, ok := rec.(appbsky.ActorProfile) - if !ok { - return appbsky.ActorProfile{}, fmt.Errorf("invalid profile record") + var bskyProfile appbsky.ActorProfile + if err := glex.DecodeCBOR(*profile.Record, &bskyProfile); err != nil { + return nil, fmt.Errorf("failed to decode profile record: %w", err) } - return bskyProfile, nil + return &bskyProfile, nil } diff --git a/pkg/model/chat_message.go b/pkg/model/chat_message.go index 20422ef0..fa5885ba 100644 --- a/pkg/model/chat_message.go +++ b/pkg/model/chat_message.go @@ -9,7 +9,7 @@ import ( "time" "github.com/rivo/uniseg" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "stream.place/streamplace/pkg/appbsky" "stream.place/streamplace/pkg/placestream" @@ -39,21 +39,18 @@ func hashString(s string) int { } func (m *ChatMessage) ToStreamplaceMessageView() (placestream.ChatDefs_MessageView, error) { - rec, err := glexrt.CborDecodeValue(*m.ChatMessage) - if err != nil { - return placestream.ChatDefs_MessageView{}, fmt.Errorf("error decoding feed post: %w", err) + var msg placestream.ChatMessage + if err := glex.DecodeCBOR(*m.ChatMessage, &msg); err != nil { + return placestream.ChatDefs_MessageView{}, fmt.Errorf("error decoding chat message: %w", err) } - // Truncate message text if it is a ChatMessage - if msg, ok := rec.(placestream.ChatMessage); ok { - graphemeCount := uniseg.GraphemeClusterCount(msg.Text) - if graphemeCount > 300 { - gr := uniseg.NewGraphemes(msg.Text) - var result strings.Builder - for count := 0; count < 300 && gr.Next(); count++ { - result.WriteString(gr.Str()) - } - msg.Text = result.String() + // Truncate overlong message text + if uniseg.GraphemeClusterCount(msg.Text) > 300 { + gr := uniseg.NewGraphemes(msg.Text) + var result strings.Builder + for count := 0; count < 300 && gr.Next(); count++ { + result.WriteString(gr.Str()) } + msg.Text = result.String() } message := placestream.ChatDefs_MessageView{ @@ -67,7 +64,7 @@ func (m *ChatMessage) ToStreamplaceMessageView() (placestream.ChatDefs_MessageVi if m.Repo != nil { message.Author.Handle = m.Repo.Handle } - message.Record = &glexrt.LexiconTypeDecoder{Val: rec} + message.Record = &glex.LexiconTypeDecoder{Val: &msg} message.IndexedAt = m.IndexedAt.UTC().Format(time.RFC3339Nano) if m.ChatProfile != nil { scp, err := m.ChatProfile.ToStreamplaceChatProfile() diff --git a/pkg/model/chat_profile.go b/pkg/model/chat_profile.go index 678a89b8..2cc38d2a 100644 --- a/pkg/model/chat_profile.go +++ b/pkg/model/chat_profile.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "stream.place/streamplace/pkg/placestream" ) @@ -20,13 +20,9 @@ func (m *ChatProfile) ToStreamplaceChatProfile() (placestream.ChatProfile, error if m == nil || m.Record == nil { return placestream.ChatProfile{}, fmt.Errorf("chat profile is nil") } - rec, err := glexrt.CborDecodeValue(*m.Record) - if err != nil { - return placestream.ChatProfile{}, fmt.Errorf("error decoding feed post: %w", err) - } - scp, ok := rec.(placestream.ChatProfile) - if !ok { - return placestream.ChatProfile{}, fmt.Errorf("invalid chat profile") + var scp placestream.ChatProfile + if err := glex.DecodeCBOR(*m.Record, &scp); err != nil { + return placestream.ChatProfile{}, fmt.Errorf("error decoding chat profile: %w", err) } return scp, nil } @@ -51,8 +47,8 @@ func (m *DBModel) GetChatProfile(ctx context.Context, repoDID string) (*ChatProf return &profile, nil } -func ColorToHex(color placestream.ChatProfile_Color) string { - if true { +func ColorToHex(color *placestream.ChatProfile_Color) string { + if color == nil { return "#f8baca" } hex := fmt.Sprintf("#%02x%02x%02x", color.Red, color.Green, color.Blue) diff --git a/pkg/model/default_metadata.go b/pkg/model/default_metadata.go index 8018edac..6ecff654 100644 --- a/pkg/model/default_metadata.go +++ b/pkg/model/default_metadata.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "stream.place/streamplace/pkg/placestream" ) @@ -17,13 +17,9 @@ type MetadataConfiguration struct { } func (m *MetadataConfiguration) ToStreamplaceMetadataConfiguration() (placestream.MetadataConfiguration, error) { - rec, err := glexrt.CborDecodeValue(*m.Record) - if err != nil { - return placestream.MetadataConfiguration{}, fmt.Errorf("error decoding feed post: %w", err) - } - sdm, ok := rec.(placestream.MetadataConfiguration) - if !ok { - return placestream.MetadataConfiguration{}, fmt.Errorf("invalid metadata configuration") + var sdm placestream.MetadataConfiguration + if err := glex.DecodeCBOR(*m.Record, &sdm); err != nil { + return placestream.MetadataConfiguration{}, fmt.Errorf("error decoding metadata configuration: %w", err) } return sdm, nil } diff --git a/pkg/model/feed_post.go b/pkg/model/feed_post.go index 6fdb0095..d5f9671d 100644 --- a/pkg/model/feed_post.go +++ b/pkg/model/feed_post.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "stream.place/streamplace/pkg/appbsky" ) @@ -27,7 +27,7 @@ type FeedPost struct { } func (fp *FeedPost) ToBskyPostView() (appbsky.FeedDefs_PostView, error) { - rec, err := glexrt.CborDecodeValue(*fp.FeedPost) + rec, err := glex.CborDecodeValue(*fp.FeedPost) if err != nil { return appbsky.FeedDefs_PostView{}, fmt.Errorf("error decoding feed post: %w", err) } @@ -38,7 +38,7 @@ func (fp *FeedPost) ToBskyPostView() (appbsky.FeedDefs_PostView, error) { Author: appbsky.ActorDefs_ProfileViewBasic{ Did: fp.RepoDID, }, - Record: &glexrt.LexiconTypeDecoder{Val: rec}, + Record: &glex.LexiconTypeDecoder{Val: rec}, IndexedAt: fp.IndexedAt.UTC().Format(time.RFC3339Nano), } if fp.Repo != nil { diff --git a/pkg/model/like.go b/pkg/model/like.go index fe11df92..035609e9 100644 --- a/pkg/model/like.go +++ b/pkg/model/like.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "stream.place/streamplace/pkg/appbsky" "stream.place/streamplace/pkg/placestream" @@ -26,14 +26,13 @@ type Like struct { } func (l *Like) ToStreamplaceLikeView() (placestream.GetLikes_LikeView, error) { - rec, err := glexrt.CborDecodeValue([]byte{}) - if err != nil { - rec = placestream.Like{Subject: l.Subject, CreatedAt: l.CreatedAt.Format(time.RFC3339)} - } + // The likes table doesn't store record bytes; synthesize the record from + // the indexed columns. + rec := &placestream.Like{Subject: l.Subject, CreatedAt: l.CreatedAt.Format(time.RFC3339)} return placestream.GetLikes_LikeView{ Uri: l.URI, Cid: l.CID, - Record: &glexrt.LexiconTypeDecoder{Val: rec}, + Record: &glex.LexiconTypeDecoder{Val: rec}, Author: appbsky.ActorDefs_ProfileViewBasic{ Did: l.RepoDID, Handle: func() string { diff --git a/pkg/model/livestream.go b/pkg/model/livestream.go index f9deecbc..9aab2d37 100644 --- a/pkg/model/livestream.go +++ b/pkg/model/livestream.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "gorm.io/gorm/clause" "stream.place/streamplace/pkg/appbsky" @@ -30,13 +30,11 @@ func (ls *Livestream) ToLivestreamView() (placestream.Livestream_LivestreamView, if ls == nil || ls.Livestream == nil { return placestream.Livestream_LivestreamView{}, fmt.Errorf("livestream record is nil") } - rec, err := glexrt.CborDecodeValue(*ls.Livestream) - if err != nil { - return placestream.Livestream_LivestreamView{}, fmt.Errorf("error decoding feed post: %w", err) - } - if typedRec, ok := rec.(placestream.Livestream); ok { - typedRec.Tags = moderation.FilterTags(typedRec.Tags) + var rec placestream.Livestream + if err := glex.DecodeCBOR(*ls.Livestream, &rec); err != nil { + return placestream.Livestream_LivestreamView{}, fmt.Errorf("error decoding livestream record: %w", err) } + rec.Tags = moderation.FilterTags(rec.Tags) postView := placestream.Livestream_LivestreamView{ LexiconTypeID: "place.stream.livestream#livestreamView", Cid: ls.CID, @@ -45,7 +43,7 @@ func (ls *Livestream) ToLivestreamView() (placestream.Livestream_LivestreamView, Did: ls.RepoDID, Handle: ls.Repo.Handle, }, - Record: &glexrt.LexiconTypeDecoder{Val: rec}, + Record: &glex.LexiconTypeDecoder{Val: &rec}, IndexedAt: time.Now().Format(time.RFC3339), } return postView, nil diff --git a/pkg/model/media_origin.go b/pkg/model/media_origin.go index 9dca1c27..b811f73e 100644 --- a/pkg/model/media_origin.go +++ b/pkg/model/media_origin.go @@ -8,7 +8,7 @@ import ( "time" "github.com/bluesky-social/indigo/atproto/syntax" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "stream.place/streamplace/pkg/aqtime" "stream.place/streamplace/pkg/placestream" @@ -32,14 +32,10 @@ type MediaOrigin struct { // ToRecord decodes the stored CBOR into the typed lexicon struct. func (o *MediaOrigin) ToRecord() (placestream.MediaOrigin, error) { - rec, err := glexrt.CborDecodeValue(o.Record) - if err != nil { + var origin placestream.MediaOrigin + if err := glex.DecodeCBOR(o.Record, &origin); err != nil { return placestream.MediaOrigin{}, fmt.Errorf("decode media origin record: %w", err) } - origin, ok := rec.(placestream.MediaOrigin) - if !ok { - return placestream.MediaOrigin{}, fmt.Errorf("media origin record decoded as %T, expected placestream.MediaOrigin", rec) - } return origin, nil } diff --git a/pkg/model/media_track.go b/pkg/model/media_track.go index df504730..b596e197 100644 --- a/pkg/model/media_track.go +++ b/pkg/model/media_track.go @@ -8,7 +8,7 @@ import ( "time" "github.com/bluesky-social/indigo/atproto/syntax" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "stream.place/streamplace/pkg/aqtime" "stream.place/streamplace/pkg/placestream" @@ -31,14 +31,10 @@ type MediaTrack struct { // ToRecord decodes the stored CBOR into the typed lexicon struct. func (t *MediaTrack) ToRecord() (placestream.MediaTrack, error) { - rec, err := glexrt.CborDecodeValue(t.Record) - if err != nil { + var track placestream.MediaTrack + if err := glex.DecodeCBOR(t.Record, &track); err != nil { return placestream.MediaTrack{}, fmt.Errorf("decode media track record: %w", err) } - track, ok := rec.(placestream.MediaTrack) - if !ok { - return placestream.MediaTrack{}, fmt.Errorf("media track record decoded as %T, expected placestream.MediaTrack", rec) - } return track, nil } @@ -81,16 +77,20 @@ func (m *DBModel) DeleteMediaTrack(ctx context.Context, uri string) error { return m.DB.WithContext(ctx).Where("uri = ?", uri).Delete(&MediaTrack{}).Error } -func (m *DBModel) GetMediaTrackByURI(ctx context.Context, uri string) (placestream.MediaTrack, error) { +func (m *DBModel) GetMediaTrackByURI(ctx context.Context, uri string) (*placestream.MediaTrack, error) { var t MediaTrack err := m.DB.WithContext(ctx).Where("uri = ?", uri).First(&t).Error if errors.Is(err, gorm.ErrRecordNotFound) { - return placestream.MediaTrack{}, nil + return nil, nil + } + if err != nil { + return nil, fmt.Errorf("get media track by uri: %w", err) } + rec, err := t.ToRecord() if err != nil { - return placestream.MediaTrack{}, fmt.Errorf("get media track by uri: %w", err) + return nil, err } - return t.ToRecord() + return &rec, nil } // GetMediaTracksByBlob returns every track row that claims to live diff --git a/pkg/model/media_view_count.go b/pkg/model/media_view_count.go index abbe34e6..831e86cc 100644 --- a/pkg/model/media_view_count.go +++ b/pkg/model/media_view_count.go @@ -8,7 +8,7 @@ import ( "time" "github.com/bluesky-social/indigo/atproto/syntax" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "stream.place/streamplace/pkg/aqtime" "stream.place/streamplace/pkg/placestream" @@ -37,14 +37,10 @@ type MediaViewCount struct { // ToRecord decodes the stored CBOR into the typed lexicon struct. func (v *MediaViewCount) ToRecord() (placestream.MediaViewCount, error) { - rec, err := glexrt.CborDecodeValue(v.Record) - if err != nil { + var vc placestream.MediaViewCount + if err := glex.DecodeCBOR(v.Record, &vc); err != nil { return placestream.MediaViewCount{}, fmt.Errorf("decode view-count record: %w", err) } - vc, ok := rec.(placestream.MediaViewCount) - if !ok { - return placestream.MediaViewCount{}, fmt.Errorf("view-count record decoded as %T, expected placestream.MediaViewCount", rec) - } return vc, nil } diff --git a/pkg/model/model.go b/pkg/model/model.go index 2b062643..d0e20cd5 100644 --- a/pkg/model/model.go +++ b/pkg/model/model.go @@ -118,7 +118,7 @@ type Model interface { CreateModerationDelegation(ctx context.Context, rec placestream.ModerationPermission, aturi syntax.ATURI) error DeleteModerationDelegation(ctx context.Context, rkey string) error - GetModerationDelegation(ctx context.Context, streamerDID, moderatorDID string) (placestream.ModerationDefs_PermissionView, error) + GetModerationDelegation(ctx context.Context, streamerDID, moderatorDID string) (*placestream.ModerationDefs_PermissionView, error) GetModerationDelegations(ctx context.Context, streamerDID, moderatorDID string) ([]placestream.ModerationDefs_PermissionView, error) GetModeratorDelegations(ctx context.Context, moderatorDID string) ([]placestream.ModerationDefs_PermissionView, error) GetStreamerModerators(ctx context.Context, streamerDID string) ([]placestream.ModerationDefs_PermissionView, error) @@ -127,7 +127,7 @@ type Model interface { UpsertRecommendation(rec *Recommendation) error UpsertBskyProfile(ctx context.Context, aturi syntax.ATURI, profileBs []byte, wasStreamplace bool) error - GetBskyProfile(ctx context.Context, did string, wasStreamplace bool) (appbsky.ActorProfile, error) + GetBskyProfile(ctx context.Context, did string, wasStreamplace bool) (*appbsky.ActorProfile, error) UpsertBadgeDef(ctx context.Context, def *BadgeDef) error DeleteBadgeDef(ctx context.Context, uri string) error @@ -139,12 +139,12 @@ type Model interface { UpsertVideo(ctx context.Context, rec placestream.Video, aturi syntax.ATURI) error DeleteVideo(ctx context.Context, uri string) error - GetVideoByURI(ctx context.Context, uri string) (placestream.Video, error) + GetVideoByURI(ctx context.Context, uri string) (*placestream.Video, error) GetLatestVideosForRepo(ctx context.Context, repoDID string, limit int) ([]*Video, error) UpsertMediaTrack(ctx context.Context, rec placestream.MediaTrack, aturi syntax.ATURI) error DeleteMediaTrack(ctx context.Context, uri string) error - GetMediaTrackByURI(ctx context.Context, uri string) (placestream.MediaTrack, error) + GetMediaTrackByURI(ctx context.Context, uri string) (*placestream.MediaTrack, error) GetMediaTracksByBlob(ctx context.Context, blob string) ([]*MediaTrack, error) UpsertMediaOrigin(ctx context.Context, rec placestream.MediaOrigin, aturi syntax.ATURI) error @@ -162,7 +162,7 @@ type Model interface { UpsertMediaViewCount(ctx context.Context, rec placestream.MediaViewCount, aturi syntax.ATURI) error DeleteMediaViewCount(ctx context.Context, uri string) error GetMediaViewCountByURI(ctx context.Context, uri string) (placestream.MediaViewCount, error) - GetVideoView(ctx context.Context, uri string) (placestream.MediaGetVideo_VideoView, error) + GetVideoView(ctx context.Context, uri string) (*placestream.MediaGetVideo_VideoView, error) GetVideoList(ctx context.Context, repoDID string, limit int, cursor string, hostedByServerDID string) (placestream.MediaGetVideoList_Output, error) CreateVodComment(ctx context.Context, comment *VodComment) error diff --git a/pkg/model/moderation_delegation.go b/pkg/model/moderation_delegation.go index 080422b5..561a05cc 100644 --- a/pkg/model/moderation_delegation.go +++ b/pkg/model/moderation_delegation.go @@ -8,7 +8,7 @@ import ( "time" "github.com/bluesky-social/indigo/atproto/syntax" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "stream.place/streamplace/pkg/appbsky" "stream.place/streamplace/pkg/aqtime" @@ -28,8 +28,8 @@ type ModerationDelegation struct { } func (md *ModerationDelegation) ToPermissionView() (placestream.ModerationDefs_PermissionView, error) { - rec, err := glexrt.CborDecodeValue(md.Record) - if err != nil { + var rec placestream.ModerationPermission + if err := glex.DecodeCBOR(md.Record, &rec); err != nil { return placestream.ModerationDefs_PermissionView{}, fmt.Errorf("error decoding moderation permission: %w", err) } @@ -40,7 +40,7 @@ func (md *ModerationDelegation) ToPermissionView() (placestream.ModerationDefs_P Did: md.RepoDID, }, Cid: md.CID, - Record: &glexrt.LexiconTypeDecoder{Val: rec}, + Record: &glex.LexiconTypeDecoder{Val: &rec}, Uri: uri, } @@ -87,19 +87,23 @@ func (m *DBModel) DeleteModerationDelegation(ctx context.Context, rkey string) e return m.DB.WithContext(ctx).Where("rkey = ?", rkey).Delete(&ModerationDelegation{}).Error } -func (m *DBModel) GetModerationDelegation(ctx context.Context, streamerDID, moderatorDID string) (placestream.ModerationDefs_PermissionView, error) { +func (m *DBModel) GetModerationDelegation(ctx context.Context, streamerDID, moderatorDID string) (*placestream.ModerationDefs_PermissionView, error) { var delegation ModerationDelegation err := m.DB.WithContext(ctx).Preload("Repo"). Where("repo_did = ? AND moderator_did = ?", streamerDID, moderatorDID). Order("created_at DESC"). First(&delegation).Error if errors.Is(err, gorm.ErrRecordNotFound) { - return placestream.ModerationDefs_PermissionView{}, nil + return nil, nil } if err != nil { - return placestream.ModerationDefs_PermissionView{}, err + return nil, err + } + view, err := delegation.ToPermissionView() + if err != nil { + return nil, err } - return delegation.ToPermissionView() + return &view, nil } // GetModerationDelegations returns ALL delegation records for a moderator from a specific streamer. diff --git a/pkg/model/server_settings.go b/pkg/model/server_settings.go index 0fe9d28a..0fddee14 100644 --- a/pkg/model/server_settings.go +++ b/pkg/model/server_settings.go @@ -6,7 +6,7 @@ import ( "fmt" "time" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "stream.place/streamplace/pkg/placestream" ) @@ -30,14 +30,10 @@ func (m *ServerSettings) ToStreamplaceServerSettings() (placestream.ServerSettin if m.Record == nil { return placestream.ServerSettings{}, fmt.Errorf("no record data") } - rec, err := glexrt.CborDecodeValue(*m.Record) - if err != nil { + var ss placestream.ServerSettings + if err := glex.DecodeCBOR(*m.Record, &ss); err != nil { return placestream.ServerSettings{}, fmt.Errorf("error decoding server settings: %w", err) } - ss, ok := rec.(placestream.ServerSettings) - if !ok { - return placestream.ServerSettings{}, fmt.Errorf("invalid server settings") - } return ss, nil } diff --git a/pkg/model/video.go b/pkg/model/video.go index 03066168..e32e7f77 100644 --- a/pkg/model/video.go +++ b/pkg/model/video.go @@ -8,7 +8,7 @@ import ( "time" "github.com/bluesky-social/indigo/atproto/syntax" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "stream.place/streamplace/pkg/appbsky" "stream.place/streamplace/pkg/aqtime" @@ -31,14 +31,10 @@ type Video struct { // ToRecord decodes the stored CBOR into the typed lexicon struct. func (v *Video) ToRecord() (placestream.Video, error) { - rec, err := glexrt.CborDecodeValue(v.Record) - if err != nil { + var video placestream.Video + if err := glex.DecodeCBOR(v.Record, &video); err != nil { return placestream.Video{}, fmt.Errorf("decode video record: %w", err) } - video, ok := rec.(placestream.Video) - if !ok { - return placestream.Video{}, fmt.Errorf("video record decoded as %T, expected placestream.Video", rec) - } return video, nil } @@ -69,16 +65,20 @@ func (m *DBModel) DeleteVideo(ctx context.Context, uri string) error { return m.DB.WithContext(ctx).Where("uri = ?", uri).Delete(&Video{}).Error } -func (m *DBModel) GetVideoByURI(ctx context.Context, uri string) (placestream.Video, error) { +func (m *DBModel) GetVideoByURI(ctx context.Context, uri string) (*placestream.Video, error) { var v Video err := m.DB.WithContext(ctx).Where("uri = ?", uri).First(&v).Error if errors.Is(err, gorm.ErrRecordNotFound) { - return placestream.Video{}, nil + return nil, nil + } + if err != nil { + return nil, fmt.Errorf("get video by uri: %w", err) } + rec, err := v.ToRecord() if err != nil { - return placestream.Video{}, fmt.Errorf("get video by uri: %w", err) + return nil, err } - return v.ToRecord() + return &rec, nil } // GetVideoView is the hydrated read path for place.stream.media.getVideo: @@ -86,24 +86,24 @@ func (m *DBModel) GetVideoByURI(ctx context.Context, uri string) (placestream.Vi // indexed place.stream.media.viewCount record for the video. Returns // (nil, nil) when no video matches the URI so callers can surface a // 404 without inspecting any model types. -func (m *DBModel) GetVideoView(ctx context.Context, uri string) (placestream.MediaGetVideo_VideoView, error) { +func (m *DBModel) GetVideoView(ctx context.Context, uri string) (*placestream.MediaGetVideo_VideoView, error) { var row Video err := m.DB.WithContext(ctx).Where("uri = ?", uri).First(&row).Error if errors.Is(err, gorm.ErrRecordNotFound) { - return placestream.MediaGetVideo_VideoView{}, nil + return nil, nil } if err != nil { - return placestream.MediaGetVideo_VideoView{}, fmt.Errorf("get video by uri: %w", err) + return nil, fmt.Errorf("get video by uri: %w", err) } rec, err := row.ToRecord() if err != nil { - return placestream.MediaGetVideo_VideoView{}, err + return nil, err } author := appbsky.ActorDefs_ProfileViewBasic{Did: row.RepoDID} repo, err := m.GetRepo(row.RepoDID) if err != nil { - return placestream.MediaGetVideo_VideoView{}, fmt.Errorf("hydrate author repo: %w", err) + return nil, fmt.Errorf("hydrate author repo: %w", err) } if repo != nil { author.Handle = repo.Handle @@ -111,12 +111,12 @@ func (m *DBModel) GetVideoView(ctx context.Context, uri string) (placestream.Med summary, err := m.viewCountSummary(ctx, uri) if err != nil { - return placestream.MediaGetVideo_VideoView{}, err + return nil, err } likeCount, err := m.GetLikeCount(ctx, uri) if err != nil { - return placestream.MediaGetVideo_VideoView{}, fmt.Errorf("get like count: %w", err) + return nil, fmt.Errorf("get like count: %w", err) } tracks := []placestream.MediaTrack_TrackView{} @@ -124,17 +124,17 @@ func (m *DBModel) GetVideoView(ctx context.Context, uri string) (placestream.Med for _, track := range rec.Source.MediaDefs_SourceTracks.Tracks { t, err := m.GetMediaTrackByURI(ctx, track.Uri) if err != nil { - return placestream.MediaGetVideo_VideoView{}, fmt.Errorf("get media track by uri: %w", err) + return nil, fmt.Errorf("get media track by uri: %w", err) } - if false { + if t == nil { continue } - cid, err := spid.GetCID(&t) + cid, err := spid.GetCID(t) if err != nil { - return placestream.MediaGetVideo_VideoView{}, fmt.Errorf("get cid: %w", err) + return nil, fmt.Errorf("get cid: %w", err) } tracks = append(tracks, placestream.MediaTrack_TrackView{ - Record: &glexrt.LexiconTypeDecoder{Val: t}, + Record: &glex.LexiconTypeDecoder{Val: t}, Uri: track.Uri, Cid: cid.String(), Author: author, @@ -142,11 +142,11 @@ func (m *DBModel) GetVideoView(ctx context.Context, uri string) (placestream.Med } } - return placestream.MediaGetVideo_VideoView{ + return &placestream.MediaGetVideo_VideoView{ Uri: row.URI, Cid: row.CID, Author: author, - Record: &glexrt.LexiconTypeDecoder{Val: rec}, + Record: &glex.LexiconTypeDecoder{Val: &rec}, ViewCounts: summary, LikeCount: likeCount, Tracks: tracks, diff --git a/pkg/model/video_list.go b/pkg/model/video_list.go index 7d1e6ed1..a50465ac 100644 --- a/pkg/model/video_list.go +++ b/pkg/model/video_list.go @@ -5,7 +5,7 @@ import ( "fmt" "time" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "stream.place/streamplace/pkg/appbsky" "stream.place/streamplace/pkg/comatproto" "stream.place/streamplace/pkg/placestream" @@ -210,7 +210,7 @@ func (m *DBModel) videoContentBlob(ctx context.Context, row *Video) (string, err if err != nil { return "", err } - if parent.Source.MediaDefs_SourceTracks == nil { + if parent == nil || parent.Source.MediaDefs_SourceTracks == nil { return "", nil } return m.firstTrackBlobCID(ctx, parent.Source.MediaDefs_SourceTracks.Tracks) @@ -230,7 +230,7 @@ func (m *DBModel) firstTrackBlobCID(ctx context.Context, tracks []comatproto.Rep if err != nil { return "", err } - if track.Track.MediaDefs_MuxlTrack == nil { + if track == nil || track.Track.MediaDefs_MuxlTrack == nil { return "", nil } return track.Track.MediaDefs_MuxlTrack.Blob, nil @@ -289,7 +289,7 @@ func (m *DBModel) hydrateVideoView(ctx context.Context, row *Video) (placestream Uri: row.URI, Cid: row.CID, Author: author, - Record: &glexrt.LexiconTypeDecoder{Val: rec}, + Record: &glex.LexiconTypeDecoder{Val: &rec}, ViewCounts: summary, LikeCount: likeCount, }, nil diff --git a/pkg/model/vod_comment.go b/pkg/model/vod_comment.go index e3527e6e..8933a8f1 100644 --- a/pkg/model/vod_comment.go +++ b/pkg/model/vod_comment.go @@ -8,7 +8,7 @@ import ( "time" "github.com/rivo/uniseg" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "stream.place/streamplace/pkg/appbsky" "stream.place/streamplace/pkg/placestream" @@ -31,23 +31,20 @@ type VodComment struct { // decodeRecord decodes the stored comment CBOR, truncating overly long text // to the same 300-grapheme cap the views enforce. -func (c *VodComment) decodeRecord() (*glexrt.LexiconTypeDecoder, error) { - rec, err := glexrt.CborDecodeValue(*c.Comment) - if err != nil { +func (c *VodComment) decodeRecord() (*glex.LexiconTypeDecoder, error) { + var msg placestream.VodComment + if err := glex.DecodeCBOR(*c.Comment, &msg); err != nil { return nil, fmt.Errorf("error decoding comment: %w", err) } - if msg, ok := rec.(placestream.VodComment); ok { - graphemeCount := uniseg.GraphemeClusterCount(msg.Text) - if graphemeCount > 300 { - gr := uniseg.NewGraphemes(msg.Text) - var result strings.Builder - for count := 0; count < 300 && gr.Next(); count++ { - result.WriteString(gr.Str()) - } - msg.Text = result.String() + if uniseg.GraphemeClusterCount(msg.Text) > 300 { + gr := uniseg.NewGraphemes(msg.Text) + var result strings.Builder + for count := 0; count < 300 && gr.Next(); count++ { + result.WriteString(gr.Str()) } + msg.Text = result.String() } - return &glexrt.LexiconTypeDecoder{Val: rec}, nil + return &glex.LexiconTypeDecoder{Val: &msg}, nil } func (c *VodComment) author() appbsky.ActorDefs_ProfileViewBasic { diff --git a/pkg/moderation/permissions_test.go b/pkg/moderation/permissions_test.go index 07337f5d..e3090794 100644 --- a/pkg/moderation/permissions_test.go +++ b/pkg/moderation/permissions_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "github.com/stretchr/testify/require" "stream.place/streamplace/pkg/appbsky" "stream.place/streamplace/pkg/placestream" @@ -199,12 +199,12 @@ func TestPermissionChecker_HasPermission_NoExpiration(t *testing.T) { } type mockModel struct { - delegations map[string][]*placestream.ModerationDefs_PermissionView + delegations map[string][]placestream.ModerationDefs_PermissionView } func newMockModel() *mockModel { return &mockModel{ - delegations: make(map[string][]*placestream.ModerationDefs_PermissionView), + delegations: make(map[string][]placestream.ModerationDefs_PermissionView), } } @@ -223,17 +223,17 @@ func (m *mockModel) addPermissionView(streamerDID, moderatorDID string, permissi ExpirationTime: expTimeStr, } - view := &placestream.ModerationDefs_PermissionView{ + view := placestream.ModerationDefs_PermissionView{ Uri: fmt.Sprintf("at://%s/place.stream.moderation.permission/test", streamerDID), Cid: "bafytest", - Author: &appbsky.ActorDefs_ProfileViewBasic{Did: streamerDID}, - Record: &glexrt.LexiconTypeDecoder{Val: permRecord}, + Author: appbsky.ActorDefs_ProfileViewBasic{Did: streamerDID}, + Record: &glex.LexiconTypeDecoder{Val: permRecord}, } m.delegations[key] = append(m.delegations[key], view) } -func (m *mockModel) GetModerationDelegations(ctx context.Context, streamerDID, moderatorDID string) ([]*placestream.ModerationDefs_PermissionView, error) { +func (m *mockModel) GetModerationDelegations(ctx context.Context, streamerDID, moderatorDID string) ([]placestream.ModerationDefs_PermissionView, error) { key := streamerDID + "_" + moderatorDID delegations, exists := m.delegations[key] if !exists { diff --git a/pkg/multitest/multitest_test.go b/pkg/multitest/multitest_test.go index 78576c6e..0830b7e1 100644 --- a/pkg/multitest/multitest_test.go +++ b/pkg/multitest/multitest_test.go @@ -13,13 +13,13 @@ import ( "testing" "time" - comatproto "github.com/bluesky-social/indigo/api/atproto" "github.com/bluesky-social/indigo/util" scraper "github.com/starttoaster/prometheus-exporter-scraper" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "github.com/stretchr/testify/require" "golang.org/x/sync/errgroup" "stream.place/streamplace/pkg/cmd" + "stream.place/streamplace/pkg/comatproto" "stream.place/streamplace/pkg/crypto/spkey" "stream.place/streamplace/pkg/devenv" "stream.place/streamplace/pkg/gstinit" @@ -256,7 +256,7 @@ func (node *TestNode) StartStream(t *testing.T, acct *devenv.DevEnvAccount) { _, err = comatproto.RepoCreateRecord(context.TODO(), acct.XRPC, &comatproto.RepoCreateRecord_Input{ Collection: "place.stream.key", Repo: acct.DID, - Record: &glexrt.LexiconTypeDecoder{Val: &streamKey}, + Record: &glex.LexiconTypeDecoder{Val: &streamKey}, }) require.NoErrorf(t, err, "[%s] failed to create Repo record for DID %s", node.Name, acct.DID) log.Log(context.Background(), "created stream key", "did", acct.DID, "pub", pub.DIDKey()) diff --git a/pkg/placestream/badgedef.go b/pkg/placestream/badgedef.go index 6911c6fd..67b47e9a 100644 --- a/pkg/placestream/badgedef.go +++ b/pkg/placestream/badgedef.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.badge.def", &BadgeDef{}) + glex.RegisterType("place.stream.badge.def", &BadgeDef{}) } // Defines a badge's visual appearance and type. Created by the issuer and referenced by issuance records. @@ -24,20 +24,23 @@ type BadgeDef struct { // description: Optional description of the badge. Description *string `json:"description,omitempty"` // image: Badge icon image. - Image *glexrt.Blob `json:"image,omitempty"` + Image *glex.Blob `json:"image,omitempty"` // name: Display name for this badge. Name string `json:"name"` } +// RecordTypeID implements glex.Record. +func (t *BadgeDef) RecordTypeID() string { return "place.stream.badge.def" } + func (t *BadgeDef) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.badge.def" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *BadgeDef) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/badgedefs.go b/pkg/placestream/badgedefs.go index 818de051..4c2ff9f5 100644 --- a/pkg/placestream/badgedefs.go +++ b/pkg/placestream/badgedefs.go @@ -7,7 +7,7 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -33,17 +33,22 @@ type BadgeDefs_BadgeIssuanceView struct { Selected *bool `json:"selected,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *BadgeDefs_BadgeIssuanceView) RecordTypeID() string { + return "place.stream.badge.defs#badgeIssuanceView" +} + func (t *BadgeDefs_BadgeIssuanceView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.badge.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.badge.defs#badgeIssuanceView" + return glex.MarshalCBOR(w, t) } func (t *BadgeDefs_BadgeIssuanceView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // BadgeDefs_BadgeSlot is a "badgeSlot" in the place.stream.badge.defs schema. @@ -57,17 +62,20 @@ type BadgeDefs_BadgeSlot struct { Selected *BadgeDefs_BadgeIssuanceView `json:"selected,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *BadgeDefs_BadgeSlot) RecordTypeID() string { return "place.stream.badge.defs#badgeSlot" } + func (t *BadgeDefs_BadgeSlot) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.badge.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.badge.defs#badgeSlot" + return glex.MarshalCBOR(w, t) } func (t *BadgeDefs_BadgeSlot) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // BadgeDefs_BadgeView is a "badgeView" in the place.stream.badge.defs schema. @@ -90,15 +98,18 @@ type BadgeDefs_BadgeView struct { Signature *string `json:"signature,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *BadgeDefs_BadgeView) RecordTypeID() string { return "place.stream.badge.defs#badgeView" } + func (t *BadgeDefs_BadgeView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.badge.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.badge.defs#badgeView" + return glex.MarshalCBOR(w, t) } func (t *BadgeDefs_BadgeView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/badgegetissuedbadges.go b/pkg/placestream/badgegetissuedbadges.go index 98749046..2bb47ad1 100644 --- a/pkg/placestream/badgegetissuedbadges.go +++ b/pkg/placestream/badgegetissuedbadges.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -22,17 +22,22 @@ type BadgeGetIssuedBadges_Output struct { User BadgeDefs_BadgeSlot `json:"user"` } +// RecordTypeID implements glex.Record. +func (t *BadgeGetIssuedBadges_Output) RecordTypeID() string { + return "place.stream.badge.getIssuedBadges" +} + func (t *BadgeGetIssuedBadges_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.badge.getIssuedBadges#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.badge.getIssuedBadges" + return glex.MarshalCBOR(w, t) } func (t *BadgeGetIssuedBadges_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // BadgeGetIssuedBadges calls the XRPC method "place.stream.badge.getIssuedBadges". @@ -40,7 +45,7 @@ func (t *BadgeGetIssuedBadges_Output) UnmarshalCBOR(r io.Reader) error { // Returns badges issued to the authenticated user, organized by display slot. Also indicates which badges are currently selected in the user's chat profile. // // streamer: DID of the streamer channel to compute the server badge against. -func BadgeGetIssuedBadges(ctx context.Context, c glexrt.LexClient, streamer string) (*BadgeGetIssuedBadges_Output, error) { +func BadgeGetIssuedBadges(ctx context.Context, c glex.LexClient, streamer string) (*BadgeGetIssuedBadges_Output, error) { var out BadgeGetIssuedBadges_Output params := map[string]interface{}{} @@ -48,7 +53,7 @@ func BadgeGetIssuedBadges(ctx context.Context, c glexrt.LexClient, streamer stri params["streamer"] = streamer } - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.badge.getIssuedBadges", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.badge.getIssuedBadges", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/badgegetvalidbadges.go b/pkg/placestream/badgegetvalidbadges.go index c26318e4..32163e61 100644 --- a/pkg/placestream/badgegetvalidbadges.go +++ b/pkg/placestream/badgegetvalidbadges.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -17,17 +17,22 @@ type BadgeGetValidBadges_Output struct { Badges []BadgeDefs_BadgeView `json:"badges"` } +// RecordTypeID implements glex.Record. +func (t *BadgeGetValidBadges_Output) RecordTypeID() string { + return "place.stream.badge.getValidBadges" +} + func (t *BadgeGetValidBadges_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.badge.getValidBadges#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.badge.getValidBadges" + return glex.MarshalCBOR(w, t) } func (t *BadgeGetValidBadges_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // BadgeGetValidBadges calls the XRPC method "place.stream.badge.getValidBadges". @@ -35,7 +40,7 @@ func (t *BadgeGetValidBadges_Output) UnmarshalCBOR(r io.Reader) error { // # Get valid badges for the authenticated user, optionally in the context of a specific streamer's chat // // streamer: Optional DID of the streamer for context-specific badges (mod, vip, etc) -func BadgeGetValidBadges(ctx context.Context, c glexrt.LexClient, streamer string) (*BadgeGetValidBadges_Output, error) { +func BadgeGetValidBadges(ctx context.Context, c glex.LexClient, streamer string) (*BadgeGetValidBadges_Output, error) { var out BadgeGetValidBadges_Output params := map[string]interface{}{} @@ -43,7 +48,7 @@ func BadgeGetValidBadges(ctx context.Context, c glexrt.LexClient, streamer strin params["streamer"] = streamer } - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.badge.getValidBadges", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.badge.getValidBadges", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/badgeissuance.go b/pkg/placestream/badgeissuance.go index ba677c03..3eeb98d4 100644 --- a/pkg/placestream/badgeissuance.go +++ b/pkg/placestream/badgeissuance.go @@ -7,13 +7,13 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) func init() { - glexrt.RegisterType("place.stream.badge.issuance", &BadgeIssuance{}) + glex.RegisterType("place.stream.badge.issuance", &BadgeIssuance{}) } // Grants a specific badge to a recipient. The badge only appears in chat after the recipient adds this record to their place.stream.chat.profile selection array. @@ -27,15 +27,18 @@ type BadgeIssuance struct { Did string `json:"did"` } +// RecordTypeID implements glex.Record. +func (t *BadgeIssuance) RecordTypeID() string { return "place.stream.badge.issuance" } + func (t *BadgeIssuance) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.badge.issuance" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *BadgeIssuance) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/betagetstatus.go b/pkg/placestream/betagetstatus.go index 28990a96..c16a8c86 100644 --- a/pkg/placestream/betagetstatus.go +++ b/pkg/placestream/betagetstatus.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -22,17 +22,20 @@ type BetaGetStatus_Output struct { Status string `json:"status"` } +// RecordTypeID implements glex.Record. +func (t *BetaGetStatus_Output) RecordTypeID() string { return "place.stream.beta.getStatus" } + func (t *BetaGetStatus_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.beta.getStatus#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.beta.getStatus" + return glex.MarshalCBOR(w, t) } func (t *BetaGetStatus_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // BetaGetStatus calls the XRPC method "place.stream.beta.getStatus". @@ -41,7 +44,7 @@ func (t *BetaGetStatus_Output) UnmarshalCBOR(r io.Reader) error { // // did: Account to check. Defaults to the authenticated caller's DID when omitted. // feature: Identifier of the beta feature to check (e.g. "vod"). -func BetaGetStatus(ctx context.Context, c glexrt.LexClient, did string, feature string) (*BetaGetStatus_Output, error) { +func BetaGetStatus(ctx context.Context, c glex.LexClient, did string, feature string) (*BetaGetStatus_Output, error) { var out BetaGetStatus_Output params := map[string]interface{}{} @@ -50,7 +53,7 @@ func BetaGetStatus(ctx context.Context, c glexrt.LexClient, did string, feature } params["feature"] = feature - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.beta.getStatus", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.beta.getStatus", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/betainvite.go b/pkg/placestream/betainvite.go index 6f830690..439eaeb4 100644 --- a/pkg/placestream/betainvite.go +++ b/pkg/placestream/betainvite.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.beta.invite", &BetaInvite{}) + glex.RegisterType("place.stream.beta.invite", &BetaInvite{}) } // Grants a single account access to a named beta feature on this network. Records live in a project-operated repo (the streamplace node's `--beta-invite-did`); operators trust invites only from that one account, by configuration. Each (did, feature) pair gets its own record so individual features can be revoked independently by deleting the corresponding record. @@ -26,15 +26,18 @@ type BetaInvite struct { Feature string `json:"feature"` } +// RecordTypeID implements glex.Record. +func (t *BetaInvite) RecordTypeID() string { return "place.stream.beta.invite" } + func (t *BetaInvite) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.beta.invite" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *BetaInvite) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/betarequest.go b/pkg/placestream/betarequest.go index 6f832497..6a4e4248 100644 --- a/pkg/placestream/betarequest.go +++ b/pkg/placestream/betarequest.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.beta.request", &BetaRequest{}) + glex.RegisterType("place.stream.beta.request", &BetaRequest{}) } // Requests access to a named beta feature on this network. Published in the requester's own repo, so the requesting account is the record's authority — there is no separate subject field. Operators index these to surface who is waiting for access; granting access is a separate place.stream.beta.invite record issued by the operator-trusted issuer. Each (requester, feature) pair gets its own record. @@ -24,15 +24,18 @@ type BetaRequest struct { Feature string `json:"feature"` } +// RecordTypeID implements glex.Record. +func (t *BetaRequest) RecordTypeID() string { return "place.stream.beta.request" } + func (t *BetaRequest) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.beta.request" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *BetaRequest) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/brandingdeleteblob.go b/pkg/placestream/brandingdeleteblob.go index 91011b40..449ee94e 100644 --- a/pkg/placestream/brandingdeleteblob.go +++ b/pkg/placestream/brandingdeleteblob.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -20,17 +20,20 @@ type BrandingDeleteBlob_Input struct { Key string `json:"key"` } +// RecordTypeID implements glex.Record. +func (t *BrandingDeleteBlob_Input) RecordTypeID() string { return "place.stream.branding.deleteBlob" } + func (t *BrandingDeleteBlob_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.branding.deleteBlob#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.branding.deleteBlob" + return glex.MarshalCBOR(w, t) } func (t *BrandingDeleteBlob_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type BrandingDeleteBlob_Output struct { @@ -38,26 +41,29 @@ type BrandingDeleteBlob_Output struct { Success bool `json:"success"` } +// RecordTypeID implements glex.Record. +func (t *BrandingDeleteBlob_Output) RecordTypeID() string { return "place.stream.branding.deleteBlob" } + func (t *BrandingDeleteBlob_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.branding.deleteBlob#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.branding.deleteBlob" + return glex.MarshalCBOR(w, t) } func (t *BrandingDeleteBlob_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // BrandingDeleteBlob calls the XRPC method "place.stream.branding.deleteBlob". // // Delete a branding asset blob. Requires admin authorization. -func BrandingDeleteBlob(ctx context.Context, c glexrt.LexClient, input *BrandingDeleteBlob_Input) (*BrandingDeleteBlob_Output, error) { +func BrandingDeleteBlob(ctx context.Context, c glex.LexClient, input *BrandingDeleteBlob_Input) (*BrandingDeleteBlob_Output, error) { var out BrandingDeleteBlob_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.branding.deleteBlob", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.branding.deleteBlob", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/brandinggetblob.go b/pkg/placestream/brandinggetblob.go index a2d3bb93..320a9e8e 100644 --- a/pkg/placestream/brandinggetblob.go +++ b/pkg/placestream/brandinggetblob.go @@ -8,7 +8,7 @@ import ( "bytes" "context" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" ) // BrandingGetBlob calls the XRPC method "place.stream.branding.getBlob". @@ -17,7 +17,7 @@ import ( // // broadcaster: DID of the broadcaster. If not provided, uses the server's default broadcaster. // key: Branding asset key (mainLogo, favicon, siteTitle, etc.) -func BrandingGetBlob(ctx context.Context, c glexrt.LexClient, broadcaster string, key string) ([]byte, error) { +func BrandingGetBlob(ctx context.Context, c glex.LexClient, broadcaster string, key string) ([]byte, error) { buf := new(bytes.Buffer) params := map[string]interface{}{} @@ -26,7 +26,7 @@ func BrandingGetBlob(ctx context.Context, c glexrt.LexClient, broadcaster string } params["key"] = key - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.branding.getBlob", params, nil, buf); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.branding.getBlob", params, nil, buf); err != nil { return nil, err } return buf.Bytes(), nil diff --git a/pkg/placestream/brandinggetbranding.go b/pkg/placestream/brandinggetbranding.go index b41c017e..3d4c905e 100644 --- a/pkg/placestream/brandinggetbranding.go +++ b/pkg/placestream/brandinggetbranding.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,17 +18,22 @@ type BrandingGetBranding_Output struct { Assets []BrandingGetBranding_BrandingAsset `json:"assets"` } +// RecordTypeID implements glex.Record. +func (t *BrandingGetBranding_Output) RecordTypeID() string { + return "place.stream.branding.getBranding" +} + func (t *BrandingGetBranding_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.branding.getBranding#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.branding.getBranding" + return glex.MarshalCBOR(w, t) } func (t *BrandingGetBranding_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // BrandingGetBranding calls the XRPC method "place.stream.branding.getBranding". @@ -36,7 +41,7 @@ func (t *BrandingGetBranding_Output) UnmarshalCBOR(r io.Reader) error { // Get all branding configuration for the broadcaster. // // broadcaster: DID of the broadcaster. If not provided, uses the server's default broadcaster. -func BrandingGetBranding(ctx context.Context, c glexrt.LexClient, broadcaster string) (*BrandingGetBranding_Output, error) { +func BrandingGetBranding(ctx context.Context, c glex.LexClient, broadcaster string) (*BrandingGetBranding_Output, error) { var out BrandingGetBranding_Output params := map[string]interface{}{} @@ -44,7 +49,7 @@ func BrandingGetBranding(ctx context.Context, c glexrt.LexClient, broadcaster st params["broadcaster"] = broadcaster } - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.branding.getBranding", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.branding.getBranding", params, nil, &out); err != nil { return nil, err } return &out, nil @@ -67,15 +72,20 @@ type BrandingGetBranding_BrandingAsset struct { Width *int64 `json:"width,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *BrandingGetBranding_BrandingAsset) RecordTypeID() string { + return "place.stream.branding.getBranding#brandingAsset" +} + func (t *BrandingGetBranding_BrandingAsset) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.branding.getBranding" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.branding.getBranding#brandingAsset" + return glex.MarshalCBOR(w, t) } func (t *BrandingGetBranding_BrandingAsset) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/brandingupdateblob.go b/pkg/placestream/brandingupdateblob.go index 66ce2f15..0ebdf67a 100644 --- a/pkg/placestream/brandingupdateblob.go +++ b/pkg/placestream/brandingupdateblob.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -28,17 +28,20 @@ type BrandingUpdateBlob_Input struct { Width *int64 `json:"width,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *BrandingUpdateBlob_Input) RecordTypeID() string { return "place.stream.branding.updateBlob" } + func (t *BrandingUpdateBlob_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.branding.updateBlob#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.branding.updateBlob" + return glex.MarshalCBOR(w, t) } func (t *BrandingUpdateBlob_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type BrandingUpdateBlob_Output struct { @@ -46,26 +49,29 @@ type BrandingUpdateBlob_Output struct { Success bool `json:"success"` } +// RecordTypeID implements glex.Record. +func (t *BrandingUpdateBlob_Output) RecordTypeID() string { return "place.stream.branding.updateBlob" } + func (t *BrandingUpdateBlob_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.branding.updateBlob#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.branding.updateBlob" + return glex.MarshalCBOR(w, t) } func (t *BrandingUpdateBlob_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // BrandingUpdateBlob calls the XRPC method "place.stream.branding.updateBlob". // // Update or create a branding asset blob. Requires admin authorization. -func BrandingUpdateBlob(ctx context.Context, c glexrt.LexClient, input *BrandingUpdateBlob_Input) (*BrandingUpdateBlob_Output, error) { +func BrandingUpdateBlob(ctx context.Context, c glex.LexClient, input *BrandingUpdateBlob_Input) (*BrandingUpdateBlob_Output, error) { var out BrandingUpdateBlob_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.branding.updateBlob", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.branding.updateBlob", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/broadcastdefs.go b/pkg/placestream/broadcastdefs.go index bf94f302..1ab82969 100644 --- a/pkg/placestream/broadcastdefs.go +++ b/pkg/placestream/broadcastdefs.go @@ -7,7 +7,7 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" appbsky "stream.place/streamplace/pkg/appbsky" ) @@ -17,19 +17,24 @@ type BroadcastDefs_BroadcastOriginView struct { LexiconTypeID string `json:"$type"` Author appbsky.ActorDefs_ProfileViewBasic `json:"author"` Cid string `json:"cid"` - Record *glexrt.LexiconTypeDecoder `json:"record"` + Record *glex.LexiconTypeDecoder `json:"record"` Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *BroadcastDefs_BroadcastOriginView) RecordTypeID() string { + return "place.stream.broadcast.defs#broadcastOriginView" +} + func (t *BroadcastDefs_BroadcastOriginView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.broadcast.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.broadcast.defs#broadcastOriginView" + return glex.MarshalCBOR(w, t) } func (t *BroadcastDefs_BroadcastOriginView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/broadcastgetbroadcaster.go b/pkg/placestream/broadcastgetbroadcaster.go index 1b8db581..659cffe6 100644 --- a/pkg/placestream/broadcastgetbroadcaster.go +++ b/pkg/placestream/broadcastgetbroadcaster.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -22,26 +22,31 @@ type BroadcastGetBroadcaster_Output struct { Server *string `json:"server,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *BroadcastGetBroadcaster_Output) RecordTypeID() string { + return "place.stream.broadcast.getBroadcaster" +} + func (t *BroadcastGetBroadcaster_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.broadcast.getBroadcaster#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.broadcast.getBroadcaster" + return glex.MarshalCBOR(w, t) } func (t *BroadcastGetBroadcaster_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // BroadcastGetBroadcaster calls the XRPC method "place.stream.broadcast.getBroadcaster". // // Get information about a Streamplace broadcaster. -func BroadcastGetBroadcaster(ctx context.Context, c glexrt.LexClient) (*BroadcastGetBroadcaster_Output, error) { +func BroadcastGetBroadcaster(ctx context.Context, c glex.LexClient) (*BroadcastGetBroadcaster_Output, error) { var out BroadcastGetBroadcaster_Output - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.broadcast.getBroadcaster", nil, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.broadcast.getBroadcaster", nil, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/broadcastorigin.go b/pkg/placestream/broadcastorigin.go index ac891b41..d37bbf95 100644 --- a/pkg/placestream/broadcastorigin.go +++ b/pkg/placestream/broadcastorigin.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.broadcast.origin", &BroadcastOrigin{}) + glex.RegisterType("place.stream.broadcast.origin", &BroadcastOrigin{}) } // Record indicating a livestream is published and available for replication at a given address. By convention, the record key is streamer::server @@ -32,15 +32,18 @@ type BroadcastOrigin struct { WebsocketURL *string `json:"websocketURL,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *BroadcastOrigin) RecordTypeID() string { return "place.stream.broadcast.origin" } + func (t *BroadcastOrigin) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.broadcast.origin" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *BroadcastOrigin) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/broadcastsyndication.go b/pkg/placestream/broadcastsyndication.go index 601dedcc..80fb63bc 100644 --- a/pkg/placestream/broadcastsyndication.go +++ b/pkg/placestream/broadcastsyndication.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.broadcast.syndication", &BroadcastSyndication{}) + glex.RegisterType("place.stream.broadcast.syndication", &BroadcastSyndication{}) } // Record created by a Streamplace broadcaster to indicate that they will be replicating a livestream. NYI @@ -26,15 +26,18 @@ type BroadcastSyndication struct { Streamer string `json:"streamer"` } +// RecordTypeID implements glex.Record. +func (t *BroadcastSyndication) RecordTypeID() string { return "place.stream.broadcast.syndication" } + func (t *BroadcastSyndication) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.broadcast.syndication" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *BroadcastSyndication) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/chatdefs.go b/pkg/placestream/chatdefs.go index 7e150781..fe49f9d5 100644 --- a/pkg/placestream/chatdefs.go +++ b/pkg/placestream/chatdefs.go @@ -10,7 +10,7 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" appbsky "stream.place/streamplace/pkg/appbsky" ) @@ -26,22 +26,25 @@ type ChatDefs_MessageView struct { // deleted: If true, this message has been deleted or labeled and should be cleared from the cache Deleted *bool `json:"deleted,omitempty"` IndexedAt string `json:"indexedAt"` - Record *glexrt.LexiconTypeDecoder `json:"record"` + Record *glex.LexiconTypeDecoder `json:"record"` ReplyTo *ChatDefs_MessageView_ReplyTo `json:"replyTo,omitempty"` Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *ChatDefs_MessageView) RecordTypeID() string { return "place.stream.chat.defs#messageView" } + func (t *ChatDefs_MessageView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.chat.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.chat.defs#messageView" + return glex.MarshalCBOR(w, t) } func (t *ChatDefs_MessageView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ChatDefs_MessageView_ReplyTo struct { @@ -57,7 +60,7 @@ func (t *ChatDefs_MessageView_ReplyTo) MarshalJSON() ([]byte, error) { } func (t *ChatDefs_MessageView_ReplyTo) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -84,7 +87,7 @@ func (t *ChatDefs_MessageView_ReplyTo) MarshalCBOR(w io.Writer) error { } func (t *ChatDefs_MessageView_ReplyTo) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -111,15 +114,20 @@ type ChatDefs_PinnedRecordView struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *ChatDefs_PinnedRecordView) RecordTypeID() string { + return "place.stream.chat.defs#pinnedRecordView" +} + func (t *ChatDefs_PinnedRecordView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.chat.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.chat.defs#pinnedRecordView" + return glex.MarshalCBOR(w, t) } func (t *ChatDefs_PinnedRecordView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/chatgate.go b/pkg/placestream/chatgate.go index 11ac96f6..27904c1a 100644 --- a/pkg/placestream/chatgate.go +++ b/pkg/placestream/chatgate.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.chat.gate", &ChatGate{}) + glex.RegisterType("place.stream.chat.gate", &ChatGate{}) } // Record defining a single gated chat message. @@ -22,15 +22,18 @@ type ChatGate struct { HiddenMessage string `json:"hiddenMessage"` } +// RecordTypeID implements glex.Record. +func (t *ChatGate) RecordTypeID() string { return "place.stream.chat.gate" } + func (t *ChatGate) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.chat.gate" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *ChatGate) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/chatmessage.go b/pkg/placestream/chatmessage.go index a147f251..906dfa8b 100644 --- a/pkg/placestream/chatmessage.go +++ b/pkg/placestream/chatmessage.go @@ -7,13 +7,13 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) func init() { - glexrt.RegisterType("place.stream.chat.message", &ChatMessage{}) + glex.RegisterType("place.stream.chat.message", &ChatMessage{}) } // Record containing a Streamplace chat message. @@ -30,17 +30,20 @@ type ChatMessage struct { Text string `json:"text"` } +// RecordTypeID implements glex.Record. +func (t *ChatMessage) RecordTypeID() string { return "place.stream.chat.message" } + func (t *ChatMessage) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.chat.message" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *ChatMessage) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ChatMessage_ReplyRef is a "replyRef" in the place.stream.chat.message schema. @@ -50,15 +53,18 @@ type ChatMessage_ReplyRef struct { Root comatproto.RepoStrongRef `json:"root"` } +// RecordTypeID implements glex.Record. +func (t *ChatMessage_ReplyRef) RecordTypeID() string { return "place.stream.chat.message#replyRef" } + func (t *ChatMessage_ReplyRef) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.chat.message" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.chat.message#replyRef" + return glex.MarshalCBOR(w, t) } func (t *ChatMessage_ReplyRef) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/chatpinnedrecord.go b/pkg/placestream/chatpinnedrecord.go index 68f9ac8a..661d69d9 100644 --- a/pkg/placestream/chatpinnedrecord.go +++ b/pkg/placestream/chatpinnedrecord.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.chat.pinnedRecord", &ChatPinnedRecord{}) + glex.RegisterType("place.stream.chat.pinnedRecord", &ChatPinnedRecord{}) } // Record pinning a chat message for prominent display. @@ -28,15 +28,18 @@ type ChatPinnedRecord struct { PinnedMessage string `json:"pinnedMessage"` } +// RecordTypeID implements glex.Record. +func (t *ChatPinnedRecord) RecordTypeID() string { return "place.stream.chat.pinnedRecord" } + func (t *ChatPinnedRecord) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.chat.pinnedRecord" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *ChatPinnedRecord) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/chatprofile.go b/pkg/placestream/chatprofile.go index 0193f7cd..e4669b11 100644 --- a/pkg/placestream/chatprofile.go +++ b/pkg/placestream/chatprofile.go @@ -7,13 +7,13 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) func init() { - glexrt.RegisterType("place.stream.chat.profile", &ChatProfile{}) + glex.RegisterType("place.stream.chat.profile", &ChatProfile{}) } // Record containing customizations for a user's chat profile. @@ -26,17 +26,20 @@ type ChatProfile struct { SelfLabels []string `json:"selfLabels,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ChatProfile) RecordTypeID() string { return "place.stream.chat.profile" } + func (t *ChatProfile) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.chat.profile" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *ChatProfile) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ChatProfile_BadgeSelections is a "badgeSelections" in the place.stream.chat.profile schema. @@ -50,17 +53,22 @@ type ChatProfile_BadgeSelections struct { Streamer []ChatProfile_StreamerBadgeSelection `json:"streamer,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ChatProfile_BadgeSelections) RecordTypeID() string { + return "place.stream.chat.profile#badgeSelections" +} + func (t *ChatProfile_BadgeSelections) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.chat.profile" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.chat.profile#badgeSelections" + return glex.MarshalCBOR(w, t) } func (t *ChatProfile_BadgeSelections) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ChatProfile_Color is a "color" in the place.stream.chat.profile schema. @@ -73,17 +81,20 @@ type ChatProfile_Color struct { Red int64 `json:"red"` } +// RecordTypeID implements glex.Record. +func (t *ChatProfile_Color) RecordTypeID() string { return "place.stream.chat.profile#color" } + func (t *ChatProfile_Color) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.chat.profile" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.chat.profile#color" + return glex.MarshalCBOR(w, t) } func (t *ChatProfile_Color) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ChatProfile_StreamerBadgeSelection is a "streamerBadgeSelection" in the place.stream.chat.profile schema. @@ -97,15 +108,20 @@ type ChatProfile_StreamerBadgeSelection struct { Streamer string `json:"streamer"` } +// RecordTypeID implements glex.Record. +func (t *ChatProfile_StreamerBadgeSelection) RecordTypeID() string { + return "place.stream.chat.profile#streamerBadgeSelection" +} + func (t *ChatProfile_StreamerBadgeSelection) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.chat.profile" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.chat.profile#streamerBadgeSelection" + return glex.MarshalCBOR(w, t) } func (t *ChatProfile_StreamerBadgeSelection) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/configgetenv.go b/pkg/placestream/configgetenv.go index fd6aa0ee..9f65314c 100644 --- a/pkg/placestream/configgetenv.go +++ b/pkg/placestream/configgetenv.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -20,26 +20,29 @@ type ConfigGetEnv_Output struct { PlaybackWorkerUrl *string `json:"playbackWorkerUrl,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ConfigGetEnv_Output) RecordTypeID() string { return "place.stream.config.getEnv" } + func (t *ConfigGetEnv_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.config.getEnv#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.config.getEnv" + return glex.MarshalCBOR(w, t) } func (t *ConfigGetEnv_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ConfigGetEnv calls the XRPC method "place.stream.config.getEnv". // // Get client-facing environment configuration from the server. -func ConfigGetEnv(ctx context.Context, c glexrt.LexClient) (*ConfigGetEnv_Output, error) { +func ConfigGetEnv(ctx context.Context, c glex.LexClient) (*ConfigGetEnv_Output, error) { var out ConfigGetEnv_Output - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.config.getEnv", nil, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.config.getEnv", nil, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/defs.go b/pkg/placestream/defs.go index b91f2e49..4a416f8c 100644 --- a/pkg/placestream/defs.go +++ b/pkg/placestream/defs.go @@ -7,7 +7,7 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" appbsky "stream.place/streamplace/pkg/appbsky" ) @@ -22,17 +22,20 @@ type Defs_ActivityGame struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *Defs_ActivityGame) RecordTypeID() string { return "place.stream.defs#activityGame" } + func (t *Defs_ActivityGame) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.defs#activityGame" + return glex.MarshalCBOR(w, t) } func (t *Defs_ActivityGame) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_ActivityLabel is a "activityLabel" in the place.stream.defs schema. @@ -43,17 +46,20 @@ type Defs_ActivityLabel struct { Label string `json:"label"` } +// RecordTypeID implements glex.Record. +func (t *Defs_ActivityLabel) RecordTypeID() string { return "place.stream.defs#activityLabel" } + func (t *Defs_ActivityLabel) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.defs#activityLabel" + return glex.MarshalCBOR(w, t) } func (t *Defs_ActivityLabel) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_BlockView is a "blockView" in the place.stream.defs schema. @@ -66,17 +72,20 @@ type Defs_BlockView struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *Defs_BlockView) RecordTypeID() string { return "place.stream.defs#blockView" } + func (t *Defs_BlockView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.defs#blockView" + return glex.MarshalCBOR(w, t) } func (t *Defs_BlockView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_Rendition is a "rendition" in the place.stream.defs schema. @@ -85,17 +94,20 @@ type Defs_Rendition struct { Name string `json:"name"` } +// RecordTypeID implements glex.Record. +func (t *Defs_Rendition) RecordTypeID() string { return "place.stream.defs#rendition" } + func (t *Defs_Rendition) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.defs#rendition" + return glex.MarshalCBOR(w, t) } func (t *Defs_Rendition) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Defs_Renditions is a "renditions" in the place.stream.defs schema. @@ -104,15 +116,18 @@ type Defs_Renditions struct { Renditions []Defs_Rendition `json:"renditions"` } +// RecordTypeID implements glex.Record. +func (t *Defs_Renditions) RecordTypeID() string { return "place.stream.defs#renditions" } + func (t *Defs_Renditions) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.defs#renditions" + return glex.MarshalCBOR(w, t) } func (t *Defs_Renditions) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/gamegetgame.go b/pkg/placestream/gamegetgame.go index 88455c8e..3d69f79e 100644 --- a/pkg/placestream/gamegetgame.go +++ b/pkg/placestream/gamegetgame.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -21,27 +21,30 @@ type GameGetGame_Output struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *GameGetGame_Output) RecordTypeID() string { return "place.stream.game.getGame" } + func (t *GameGetGame_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.game.getGame#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.game.getGame" + return glex.MarshalCBOR(w, t) } func (t *GameGetGame_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // GameGetGame calls the XRPC method "place.stream.game.getGame". -func GameGetGame(ctx context.Context, c glexrt.LexClient, uri string) (*GameGetGame_Output, error) { +func GameGetGame(ctx context.Context, c glex.LexClient, uri string) (*GameGetGame_Output, error) { var out GameGetGame_Output params := map[string]interface{}{} params["uri"] = uri - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.game.getGame", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.game.getGame", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/gamesearch.go b/pkg/placestream/gamesearch.go index 65f73ca5..76c97eb2 100644 --- a/pkg/placestream/gamesearch.go +++ b/pkg/placestream/gamesearch.go @@ -11,7 +11,7 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" gamesgamesgamesgamesgames "stream.place/streamplace/pkg/gamesgamesgamesgamesgames" ) @@ -23,17 +23,20 @@ type GameSearch_Output struct { TotalResults *int64 `json:"totalResults,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *GameSearch_Output) RecordTypeID() string { return "place.stream.game.search" } + func (t *GameSearch_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.game.search#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.game.search" + return glex.MarshalCBOR(w, t) } func (t *GameSearch_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type GameSearch_Output_Results_Elem struct { @@ -69,7 +72,7 @@ func (t *GameSearch_Output_Results_Elem) MarshalJSON() ([]byte, error) { } func (t *GameSearch_Output_Results_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -120,7 +123,7 @@ func (t *GameSearch_Output_Results_Elem) MarshalCBOR(w io.Writer) error { } func (t *GameSearch_Output_Results_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -149,7 +152,7 @@ func (t *GameSearch_Output_Results_Elem) UnmarshalCBOR(r io.Reader) error { // GameSearch calls the XRPC method "place.stream.game.search". // // Search for games and other entities via the games.gamesgamesgamesgames catalog. Proxied from the configured games API. -func GameSearch(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, q string) (*GameSearch_Output, error) { +func GameSearch(ctx context.Context, c glex.LexClient, cursor string, limit *int64, q string) (*GameSearch_Output, error) { var out GameSearch_Output params := map[string]interface{}{} @@ -161,7 +164,7 @@ func GameSearch(ctx context.Context, c glexrt.LexClient, cursor string, limit *i } params["q"] = q - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.game.search", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.game.search", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/getlikes.go b/pkg/placestream/getlikes.go index 800fb75e..531cc450 100644 --- a/pkg/placestream/getlikes.go +++ b/pkg/placestream/getlikes.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" appbsky "stream.place/streamplace/pkg/appbsky" ) @@ -22,17 +22,20 @@ type GetLikes_Output struct { Subject string `json:"subject"` } +// RecordTypeID implements glex.Record. +func (t *GetLikes_Output) RecordTypeID() string { return "place.stream.getLikes" } + func (t *GetLikes_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.getLikes#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.getLikes" + return glex.MarshalCBOR(w, t) } func (t *GetLikes_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // GetLikes calls the XRPC method "place.stream.getLikes". @@ -42,7 +45,7 @@ func (t *GetLikes_Output) UnmarshalCBOR(r io.Reader) error { // cursor: Optional pagination cursor. // limit: Maximum number of likes to return. // subject: AT-URI of the subject (video or comment). -func GetLikes(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, subject string) (*GetLikes_Output, error) { +func GetLikes(ctx context.Context, c glex.LexClient, cursor string, limit *int64, subject string) (*GetLikes_Output, error) { var out GetLikes_Output params := map[string]interface{}{} @@ -54,7 +57,7 @@ func GetLikes(ctx context.Context, c glexrt.LexClient, cursor string, limit *int } params["subject"] = subject - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.getLikes", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.getLikes", params, nil, &out); err != nil { return nil, err } return &out, nil @@ -66,19 +69,22 @@ type GetLikes_LikeView struct { Author appbsky.ActorDefs_ProfileViewBasic `json:"author"` Cid string `json:"cid"` IndexedAt string `json:"indexedAt"` - Record *glexrt.LexiconTypeDecoder `json:"record"` + Record *glex.LexiconTypeDecoder `json:"record"` Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *GetLikes_LikeView) RecordTypeID() string { return "place.stream.getLikes#likeView" } + func (t *GetLikes_LikeView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.getLikes" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.getLikes#likeView" + return glex.MarshalCBOR(w, t) } func (t *GetLikes_LikeView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/graphgetfollowinguser.go b/pkg/placestream/graphgetfollowinguser.go index 74a8227c..8f04e8ac 100644 --- a/pkg/placestream/graphgetfollowinguser.go +++ b/pkg/placestream/graphgetfollowinguser.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) @@ -18,17 +18,22 @@ type GraphGetFollowingUser_Output struct { Follow *comatproto.RepoStrongRef `json:"follow,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *GraphGetFollowingUser_Output) RecordTypeID() string { + return "place.stream.graph.getFollowingUser" +} + func (t *GraphGetFollowingUser_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.graph.getFollowingUser#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.graph.getFollowingUser" + return glex.MarshalCBOR(w, t) } func (t *GraphGetFollowingUser_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // GraphGetFollowingUser calls the XRPC method "place.stream.graph.getFollowingUser". @@ -37,14 +42,14 @@ func (t *GraphGetFollowingUser_Output) UnmarshalCBOR(r io.Reader) error { // // subjectDID: The DID of the user potentially being followed // userDID: The DID of the potentially-following user -func GraphGetFollowingUser(ctx context.Context, c glexrt.LexClient, subjectDID string, userDID string) (*GraphGetFollowingUser_Output, error) { +func GraphGetFollowingUser(ctx context.Context, c glex.LexClient, subjectDID string, userDID string) (*GraphGetFollowingUser_Output, error) { var out GraphGetFollowingUser_Output params := map[string]interface{}{} params["subjectDID"] = subjectDID params["userDID"] = userDID - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.graph.getFollowingUser", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.graph.getFollowingUser", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/ingestdefs.go b/pkg/placestream/ingestdefs.go index ab5a4add..b5348f6b 100644 --- a/pkg/placestream/ingestdefs.go +++ b/pkg/placestream/ingestdefs.go @@ -7,7 +7,7 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -22,15 +22,18 @@ type IngestDefs_Ingest struct { Url string `json:"url"` } +// RecordTypeID implements glex.Record. +func (t *IngestDefs_Ingest) RecordTypeID() string { return "place.stream.ingest.defs#ingest" } + func (t *IngestDefs_Ingest) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.ingest.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.ingest.defs#ingest" + return glex.MarshalCBOR(w, t) } func (t *IngestDefs_Ingest) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/ingestgetingesturls.go b/pkg/placestream/ingestgetingesturls.go index 0eb6ccf8..b3e97697 100644 --- a/pkg/placestream/ingestgetingesturls.go +++ b/pkg/placestream/ingestgetingesturls.go @@ -11,7 +11,7 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -20,17 +20,22 @@ type IngestGetIngestUrls_Output struct { Ingests []IngestGetIngestUrls_Output_Ingests_Elem `json:"ingests"` } +// RecordTypeID implements glex.Record. +func (t *IngestGetIngestUrls_Output) RecordTypeID() string { + return "place.stream.ingest.getIngestUrls" +} + func (t *IngestGetIngestUrls_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.ingest.getIngestUrls#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.ingest.getIngestUrls" + return glex.MarshalCBOR(w, t) } func (t *IngestGetIngestUrls_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type IngestGetIngestUrls_Output_Ingests_Elem struct { @@ -46,7 +51,7 @@ func (t *IngestGetIngestUrls_Output_Ingests_Elem) MarshalJSON() ([]byte, error) } func (t *IngestGetIngestUrls_Output_Ingests_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -73,7 +78,7 @@ func (t *IngestGetIngestUrls_Output_Ingests_Elem) MarshalCBOR(w io.Writer) error } func (t *IngestGetIngestUrls_Output_Ingests_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -90,10 +95,10 @@ func (t *IngestGetIngestUrls_Output_Ingests_Elem) UnmarshalCBOR(r io.Reader) err // IngestGetIngestUrls calls the XRPC method "place.stream.ingest.getIngestUrls". // // Get ingest URLs for a Streamplace station. -func IngestGetIngestUrls(ctx context.Context, c glexrt.LexClient) (*IngestGetIngestUrls_Output, error) { +func IngestGetIngestUrls(ctx context.Context, c glex.LexClient) (*IngestGetIngestUrls_Output, error) { var out IngestGetIngestUrls_Output - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.ingest.getIngestUrls", nil, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.ingest.getIngestUrls", nil, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/key.go b/pkg/placestream/key.go index b590779a..4d9d7266 100644 --- a/pkg/placestream/key.go +++ b/pkg/placestream/key.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.key", &Key{}) + glex.RegisterType("place.stream.key", &Key{}) } // Record linking an atproto identity with a stream signing key @@ -26,15 +26,18 @@ type Key struct { SigningKey string `json:"signingKey"` } +// RecordTypeID implements glex.Record. +func (t *Key) RecordTypeID() string { return "place.stream.key" } + func (t *Key) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.key" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *Key) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/like.go b/pkg/placestream/like.go index e8eed498..5b3713ff 100644 --- a/pkg/placestream/like.go +++ b/pkg/placestream/like.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.like", &Like{}) + glex.RegisterType("place.stream.like", &Like{}) } // Record indicating a like on some other record (e.g. a video or a comment). @@ -24,15 +24,18 @@ type Like struct { Subject string `json:"subject"` } +// RecordTypeID implements glex.Record. +func (t *Like) RecordTypeID() string { return "place.stream.like" } + func (t *Like) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.like" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *Like) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/livedenyteleport.go b/pkg/placestream/livedenyteleport.go index 17cb73ba..bb80a121 100644 --- a/pkg/placestream/livedenyteleport.go +++ b/pkg/placestream/livedenyteleport.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,17 +18,20 @@ type LiveDenyTeleport_Input struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *LiveDenyTeleport_Input) RecordTypeID() string { return "place.stream.live.denyTeleport" } + func (t *LiveDenyTeleport_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.live.denyTeleport#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.live.denyTeleport" + return glex.MarshalCBOR(w, t) } func (t *LiveDenyTeleport_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type LiveDenyTeleport_Output struct { @@ -37,26 +40,29 @@ type LiveDenyTeleport_Output struct { Success bool `json:"success"` } +// RecordTypeID implements glex.Record. +func (t *LiveDenyTeleport_Output) RecordTypeID() string { return "place.stream.live.denyTeleport" } + func (t *LiveDenyTeleport_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.live.denyTeleport#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.live.denyTeleport" + return glex.MarshalCBOR(w, t) } func (t *LiveDenyTeleport_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // LiveDenyTeleport calls the XRPC method "place.stream.live.denyTeleport". // // Deny an incoming teleport request. -func LiveDenyTeleport(ctx context.Context, c glexrt.LexClient, input *LiveDenyTeleport_Input) (*LiveDenyTeleport_Output, error) { +func LiveDenyTeleport(ctx context.Context, c glex.LexClient, input *LiveDenyTeleport_Input) (*LiveDenyTeleport_Output, error) { var out LiveDenyTeleport_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.live.denyTeleport", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.live.denyTeleport", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/livegetliveusers.go b/pkg/placestream/livegetliveusers.go index 93e84c27..45609193 100644 --- a/pkg/placestream/livegetliveusers.go +++ b/pkg/placestream/livegetliveusers.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -17,23 +17,26 @@ type LiveGetLiveUsers_Output struct { Streams []Livestream_LivestreamView `json:"streams,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *LiveGetLiveUsers_Output) RecordTypeID() string { return "place.stream.live.getLiveUsers" } + func (t *LiveGetLiveUsers_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.live.getLiveUsers#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.live.getLiveUsers" + return glex.MarshalCBOR(w, t) } func (t *LiveGetLiveUsers_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // LiveGetLiveUsers calls the XRPC method "place.stream.live.getLiveUsers". // // Get a list of livestream segments for a user -func LiveGetLiveUsers(ctx context.Context, c glexrt.LexClient, before string, limit *int64) (*LiveGetLiveUsers_Output, error) { +func LiveGetLiveUsers(ctx context.Context, c glex.LexClient, before string, limit *int64) (*LiveGetLiveUsers_Output, error) { var out LiveGetLiveUsers_Output params := map[string]interface{}{} @@ -44,7 +47,7 @@ func LiveGetLiveUsers(ctx context.Context, c glexrt.LexClient, before string, li params["limit"] = *limit } - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.live.getLiveUsers", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.live.getLiveUsers", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/livegetprofilecard.go b/pkg/placestream/livegetprofilecard.go index fb0f05c5..9756ca76 100644 --- a/pkg/placestream/livegetprofilecard.go +++ b/pkg/placestream/livegetprofilecard.go @@ -8,7 +8,7 @@ import ( "bytes" "context" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" ) // LiveGetProfileCard calls the XRPC method "place.stream.live.getProfileCard". @@ -16,13 +16,13 @@ import ( // Get an OG image associated with a given account. // // id: The DID or handle of the account. -func LiveGetProfileCard(ctx context.Context, c glexrt.LexClient, id string) ([]byte, error) { +func LiveGetProfileCard(ctx context.Context, c glex.LexClient, id string) ([]byte, error) { buf := new(bytes.Buffer) params := map[string]interface{}{} params["id"] = id - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.live.getProfileCard", params, nil, buf); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.live.getProfileCard", params, nil, buf); err != nil { return nil, err } return buf.Bytes(), nil diff --git a/pkg/placestream/livegetrecommendations.go b/pkg/placestream/livegetrecommendations.go index 15026b29..c4165594 100644 --- a/pkg/placestream/livegetrecommendations.go +++ b/pkg/placestream/livegetrecommendations.go @@ -11,7 +11,7 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -23,17 +23,22 @@ type LiveGetRecommendations_Output struct { UserDID *string `json:"userDID,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *LiveGetRecommendations_Output) RecordTypeID() string { + return "place.stream.live.getRecommendations" +} + func (t *LiveGetRecommendations_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.live.getRecommendations#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.live.getRecommendations" + return glex.MarshalCBOR(w, t) } func (t *LiveGetRecommendations_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type LiveGetRecommendations_Output_Recommendations_Elem struct { @@ -49,7 +54,7 @@ func (t *LiveGetRecommendations_Output_Recommendations_Elem) MarshalJSON() ([]by } func (t *LiveGetRecommendations_Output_Recommendations_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -76,7 +81,7 @@ func (t *LiveGetRecommendations_Output_Recommendations_Elem) MarshalCBOR(w io.Wr } func (t *LiveGetRecommendations_Output_Recommendations_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -95,13 +100,13 @@ func (t *LiveGetRecommendations_Output_Recommendations_Elem) UnmarshalCBOR(r io. // # Get the list of streamers recommended by a user // // userDID: The DID of the user whose recommendations to fetch -func LiveGetRecommendations(ctx context.Context, c glexrt.LexClient, userDID string) (*LiveGetRecommendations_Output, error) { +func LiveGetRecommendations(ctx context.Context, c glex.LexClient, userDID string) (*LiveGetRecommendations_Output, error) { var out LiveGetRecommendations_Output params := map[string]interface{}{} params["userDID"] = userDID - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.live.getRecommendations", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.live.getRecommendations", params, nil, &out); err != nil { return nil, err } return &out, nil @@ -116,15 +121,20 @@ type LiveGetRecommendations_LivestreamRecommendation struct { Source string `json:"source"` } +// RecordTypeID implements glex.Record. +func (t *LiveGetRecommendations_LivestreamRecommendation) RecordTypeID() string { + return "place.stream.live.getRecommendations#livestreamRecommendation" +} + func (t *LiveGetRecommendations_LivestreamRecommendation) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.live.getRecommendations" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.live.getRecommendations#livestreamRecommendation" + return glex.MarshalCBOR(w, t) } func (t *LiveGetRecommendations_LivestreamRecommendation) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/livegetsegments.go b/pkg/placestream/livegetsegments.go index 6e0ae1bc..78a769dc 100644 --- a/pkg/placestream/livegetsegments.go +++ b/pkg/placestream/livegetsegments.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -17,17 +17,20 @@ type LiveGetSegments_Output struct { Segments []Segment_SegmentView `json:"segments,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *LiveGetSegments_Output) RecordTypeID() string { return "place.stream.live.getSegments" } + func (t *LiveGetSegments_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.live.getSegments#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.live.getSegments" + return glex.MarshalCBOR(w, t) } func (t *LiveGetSegments_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // LiveGetSegments calls the XRPC method "place.stream.live.getSegments". @@ -35,7 +38,7 @@ func (t *LiveGetSegments_Output) UnmarshalCBOR(r io.Reader) error { // # Get a list of livestream segments for a user // // userDID: The DID of the potentially-following user -func LiveGetSegments(ctx context.Context, c glexrt.LexClient, before string, limit *int64, userDID string) (*LiveGetSegments_Output, error) { +func LiveGetSegments(ctx context.Context, c glex.LexClient, before string, limit *int64, userDID string) (*LiveGetSegments_Output, error) { var out LiveGetSegments_Output params := map[string]interface{}{} @@ -47,7 +50,7 @@ func LiveGetSegments(ctx context.Context, c glexrt.LexClient, before string, lim } params["userDID"] = userDID - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.live.getSegments", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.live.getSegments", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/liverecommendations.go b/pkg/placestream/liverecommendations.go index 00a7f86b..0da2e05b 100644 --- a/pkg/placestream/liverecommendations.go +++ b/pkg/placestream/liverecommendations.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.live.recommendations", &LiveRecommendations{}) + glex.RegisterType("place.stream.live.recommendations", &LiveRecommendations{}) } // A list of recommended streamers, in order of preference @@ -24,15 +24,18 @@ type LiveRecommendations struct { Streamers []string `json:"streamers"` } +// RecordTypeID implements glex.Record. +func (t *LiveRecommendations) RecordTypeID() string { return "place.stream.live.recommendations" } + func (t *LiveRecommendations) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.live.recommendations" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *LiveRecommendations) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/livesearchactorstypeahead.go b/pkg/placestream/livesearchactorstypeahead.go index d9abe635..2a69a942 100644 --- a/pkg/placestream/livesearchactorstypeahead.go +++ b/pkg/placestream/livesearchactorstypeahead.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -17,17 +17,22 @@ type LiveSearchActorsTypeahead_Output struct { Actors []LiveSearchActorsTypeahead_Actor `json:"actors"` } +// RecordTypeID implements glex.Record. +func (t *LiveSearchActorsTypeahead_Output) RecordTypeID() string { + return "place.stream.live.searchActorsTypeahead" +} + func (t *LiveSearchActorsTypeahead_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.live.searchActorsTypeahead#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.live.searchActorsTypeahead" + return glex.MarshalCBOR(w, t) } func (t *LiveSearchActorsTypeahead_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // LiveSearchActorsTypeahead calls the XRPC method "place.stream.live.searchActorsTypeahead". @@ -35,7 +40,7 @@ func (t *LiveSearchActorsTypeahead_Output) UnmarshalCBOR(r io.Reader) error { // Find actor suggestions for a prefix search term. Expected use is for auto-completion during text field entry. // // q: Search query prefix; not a full query string. -func LiveSearchActorsTypeahead(ctx context.Context, c glexrt.LexClient, limit *int64, q string) (*LiveSearchActorsTypeahead_Output, error) { +func LiveSearchActorsTypeahead(ctx context.Context, c glex.LexClient, limit *int64, q string) (*LiveSearchActorsTypeahead_Output, error) { var out LiveSearchActorsTypeahead_Output params := map[string]interface{}{} @@ -46,7 +51,7 @@ func LiveSearchActorsTypeahead(ctx context.Context, c glexrt.LexClient, limit *i params["q"] = q } - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.live.searchActorsTypeahead", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.live.searchActorsTypeahead", params, nil, &out); err != nil { return nil, err } return &out, nil @@ -61,15 +66,20 @@ type LiveSearchActorsTypeahead_Actor struct { Handle string `json:"handle"` } +// RecordTypeID implements glex.Record. +func (t *LiveSearchActorsTypeahead_Actor) RecordTypeID() string { + return "place.stream.live.searchActorsTypeahead#actor" +} + func (t *LiveSearchActorsTypeahead_Actor) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.live.searchActorsTypeahead" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.live.searchActorsTypeahead#actor" + return glex.MarshalCBOR(w, t) } func (t *LiveSearchActorsTypeahead_Actor) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/livestartlivestream.go b/pkg/placestream/livestartlivestream.go index 7d5e8764..a650350c 100644 --- a/pkg/placestream/livestartlivestream.go +++ b/pkg/placestream/livestartlivestream.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -21,17 +21,20 @@ type LiveStartLivestream_Input struct { Streamer string `json:"streamer"` } +// RecordTypeID implements glex.Record. +func (t *LiveStartLivestream_Input) RecordTypeID() string { return "place.stream.live.startLivestream" } + func (t *LiveStartLivestream_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.live.startLivestream#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.live.startLivestream" + return glex.MarshalCBOR(w, t) } func (t *LiveStartLivestream_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type LiveStartLivestream_Output struct { @@ -42,26 +45,31 @@ type LiveStartLivestream_Output struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *LiveStartLivestream_Output) RecordTypeID() string { + return "place.stream.live.startLivestream" +} + func (t *LiveStartLivestream_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.live.startLivestream#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.live.startLivestream" + return glex.MarshalCBOR(w, t) } func (t *LiveStartLivestream_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // LiveStartLivestream calls the XRPC method "place.stream.live.startLivestream". // // Create a new place.stream.livestream record, automatically populating a thumbnail and creating a Bluesky post and whatnot. You can do this manually by creating a record but this method can work better for mobile livestreaming and such. -func LiveStartLivestream(ctx context.Context, c glexrt.LexClient, input *LiveStartLivestream_Input) (*LiveStartLivestream_Output, error) { +func LiveStartLivestream(ctx context.Context, c glex.LexClient, input *LiveStartLivestream_Input) (*LiveStartLivestream_Output, error) { var out LiveStartLivestream_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.live.startLivestream", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.live.startLivestream", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/livestoplivestream.go b/pkg/placestream/livestoplivestream.go index cac497c3..21103e6a 100644 --- a/pkg/placestream/livestoplivestream.go +++ b/pkg/placestream/livestoplivestream.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -16,17 +16,20 @@ type LiveStopLivestream_Input struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *LiveStopLivestream_Input) RecordTypeID() string { return "place.stream.live.stopLivestream" } + func (t *LiveStopLivestream_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.live.stopLivestream#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.live.stopLivestream" + return glex.MarshalCBOR(w, t) } func (t *LiveStopLivestream_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type LiveStopLivestream_Output struct { @@ -37,26 +40,29 @@ type LiveStopLivestream_Output struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *LiveStopLivestream_Output) RecordTypeID() string { return "place.stream.live.stopLivestream" } + func (t *LiveStopLivestream_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.live.stopLivestream#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.live.stopLivestream" + return glex.MarshalCBOR(w, t) } func (t *LiveStopLivestream_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // LiveStopLivestream calls the XRPC method "place.stream.live.stopLivestream". // // Stop your current livestream, updating your current place.stream.livestream record and ceasing the flow of video. -func LiveStopLivestream(ctx context.Context, c glexrt.LexClient, input *LiveStopLivestream_Input) (*LiveStopLivestream_Output, error) { +func LiveStopLivestream(ctx context.Context, c glex.LexClient, input *LiveStopLivestream_Input) (*LiveStopLivestream_Output, error) { var out LiveStopLivestream_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.live.stopLivestream", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.live.stopLivestream", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/livestream.go b/pkg/placestream/livestream.go index 07b3ec0c..d0e5729f 100644 --- a/pkg/placestream/livestream.go +++ b/pkg/placestream/livestream.go @@ -10,14 +10,14 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" appbsky "stream.place/streamplace/pkg/appbsky" comatproto "stream.place/streamplace/pkg/comatproto" ) func init() { - glexrt.RegisterType("place.stream.livestream", &Livestream{}) + glex.RegisterType("place.stream.livestream", &Livestream{}) } // Record announcing a livestream is happening @@ -41,25 +41,28 @@ type Livestream struct { // post: The post that announced this livestream. Post *comatproto.RepoStrongRef `json:"post,omitempty"` // tags: Freeform tags for this stream. Each tag must be alphanumeric (a-z, A-Z, 0-9) plus colon. Tags with colons indicate a specific tag group (e.g. 'lang:en' indicates the stream's primary language). - Tags []string `json:"tags,omitempty"` - Thumb *glexrt.Blob `json:"thumb,omitempty"` + Tags []string `json:"tags,omitempty"` + Thumb *glex.Blob `json:"thumb,omitempty"` // title: The title of the livestream, as it will be announced to followers. Title string `json:"title"` // url: The URL where this stream can be found. This is primarily a hint for other Streamplace nodes to locate and replicate the stream. Url *string `json:"url,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Livestream) RecordTypeID() string { return "place.stream.livestream" } + func (t *Livestream) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.livestream" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *Livestream) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // The game or activity being streamed. @@ -81,7 +84,7 @@ func (t *Livestream_Activity) MarshalJSON() ([]byte, error) { } func (t *Livestream_Activity) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -114,7 +117,7 @@ func (t *Livestream_Activity) MarshalCBOR(w io.Writer) error { } func (t *Livestream_Activity) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -137,23 +140,28 @@ type Livestream_LivestreamView struct { Author appbsky.ActorDefs_ProfileViewBasic `json:"author"` Cid string `json:"cid"` IndexedAt string `json:"indexedAt"` - Record *glexrt.LexiconTypeDecoder `json:"record"` + Record *glex.LexiconTypeDecoder `json:"record"` Uri string `json:"uri"` // viewerCount: The number of viewers watching this livestream. Use when you can't reasonably use #viewerCount directly. ViewerCount *Livestream_ViewerCount `json:"viewerCount,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Livestream_LivestreamView) RecordTypeID() string { + return "place.stream.livestream#livestreamView" +} + func (t *Livestream_LivestreamView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.livestream" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.livestream#livestreamView" + return glex.MarshalCBOR(w, t) } func (t *Livestream_LivestreamView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Livestream_NotificationSettings is a "notificationSettings" in the place.stream.livestream schema. @@ -163,17 +171,22 @@ type Livestream_NotificationSettings struct { PushNotification *bool `json:"pushNotification,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Livestream_NotificationSettings) RecordTypeID() string { + return "place.stream.livestream#notificationSettings" +} + func (t *Livestream_NotificationSettings) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.livestream" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.livestream#notificationSettings" + return glex.MarshalCBOR(w, t) } func (t *Livestream_NotificationSettings) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Livestream_StreamplaceAnything is a "streamplaceAnything" in the place.stream.livestream schema. @@ -182,17 +195,22 @@ type Livestream_StreamplaceAnything struct { Livestream Livestream_StreamplaceAnything_Livestream `json:"livestream"` } +// RecordTypeID implements glex.Record. +func (t *Livestream_StreamplaceAnything) RecordTypeID() string { + return "place.stream.livestream#streamplaceAnything" +} + func (t *Livestream_StreamplaceAnything) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.livestream" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.livestream#streamplaceAnything" + return glex.MarshalCBOR(w, t) } func (t *Livestream_StreamplaceAnything) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type Livestream_StreamplaceAnything_Livestream struct { @@ -248,7 +266,7 @@ func (t *Livestream_StreamplaceAnything_Livestream) MarshalJSON() ([]byte, error } func (t *Livestream_StreamplaceAnything_Livestream) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -323,7 +341,7 @@ func (t *Livestream_StreamplaceAnything_Livestream) MarshalCBOR(w io.Writer) err } func (t *Livestream_StreamplaceAnything_Livestream) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -376,17 +394,22 @@ type Livestream_TeleportArrival struct { ViewerCount int64 `json:"viewerCount"` } +// RecordTypeID implements glex.Record. +func (t *Livestream_TeleportArrival) RecordTypeID() string { + return "place.stream.livestream#teleportArrival" +} + func (t *Livestream_TeleportArrival) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.livestream" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.livestream#teleportArrival" + return glex.MarshalCBOR(w, t) } func (t *Livestream_TeleportArrival) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Livestream_TeleportCanceled is a "teleportCanceled" in the place.stream.livestream schema. @@ -398,17 +421,22 @@ type Livestream_TeleportCanceled struct { TeleportUri string `json:"teleportUri"` } +// RecordTypeID implements glex.Record. +func (t *Livestream_TeleportCanceled) RecordTypeID() string { + return "place.stream.livestream#teleportCanceled" +} + func (t *Livestream_TeleportCanceled) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.livestream" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.livestream#teleportCanceled" + return glex.MarshalCBOR(w, t) } func (t *Livestream_TeleportCanceled) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Livestream_ViewerCount is a "viewerCount" in the place.stream.livestream schema. @@ -417,15 +445,18 @@ type Livestream_ViewerCount struct { Count int64 `json:"count"` } +// RecordTypeID implements glex.Record. +func (t *Livestream_ViewerCount) RecordTypeID() string { return "place.stream.livestream#viewerCount" } + func (t *Livestream_ViewerCount) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.livestream" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.livestream#viewerCount" + return glex.MarshalCBOR(w, t) } func (t *Livestream_ViewerCount) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/liveteleport.go b/pkg/placestream/liveteleport.go index 035bcb10..69004aa2 100644 --- a/pkg/placestream/liveteleport.go +++ b/pkg/placestream/liveteleport.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.live.teleport", &LiveTeleport{}) + glex.RegisterType("place.stream.live.teleport", &LiveTeleport{}) } // Record defining a 'teleport', that is active during a certain time. @@ -26,15 +26,18 @@ type LiveTeleport struct { Streamer string `json:"streamer"` } +// RecordTypeID implements glex.Record. +func (t *LiveTeleport) RecordTypeID() string { return "place.stream.live.teleport" } + func (t *LiveTeleport) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.live.teleport" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *LiveTeleport) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/liveviewercount.go b/pkg/placestream/liveviewercount.go index 8635981d..58c35898 100644 --- a/pkg/placestream/liveviewercount.go +++ b/pkg/placestream/liveviewercount.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.live.viewerCount", &LiveViewerCount{}) + glex.RegisterType("place.stream.live.viewerCount", &LiveViewerCount{}) } // Current viewer count for a livestream on a particular server. Record keys are streamer_did::server_did by convention. @@ -28,15 +28,18 @@ type LiveViewerCount struct { UpdatedAt *string `json:"updatedAt,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *LiveViewerCount) RecordTypeID() string { return "place.stream.live.viewerCount" } + func (t *LiveViewerCount) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.live.viewerCount" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *LiveViewerCount) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/mediacreateupload.go b/pkg/placestream/mediacreateupload.go index d71a2861..160d89e5 100644 --- a/pkg/placestream/mediacreateupload.go +++ b/pkg/placestream/mediacreateupload.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -24,17 +24,20 @@ type MediaCreateUpload_Input struct { Size int64 `json:"size"` } +// RecordTypeID implements glex.Record. +func (t *MediaCreateUpload_Input) RecordTypeID() string { return "place.stream.media.createUpload" } + func (t *MediaCreateUpload_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.createUpload#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.createUpload" + return glex.MarshalCBOR(w, t) } func (t *MediaCreateUpload_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type MediaCreateUpload_Output struct { @@ -49,26 +52,29 @@ type MediaCreateUpload_Output struct { UploadUrl string `json:"uploadUrl"` } +// RecordTypeID implements glex.Record. +func (t *MediaCreateUpload_Output) RecordTypeID() string { return "place.stream.media.createUpload" } + func (t *MediaCreateUpload_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.createUpload#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.createUpload" + return glex.MarshalCBOR(w, t) } func (t *MediaCreateUpload_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MediaCreateUpload calls the XRPC method "place.stream.media.createUpload". // // Start a resumable upload of arbitrary media content. Returns a TUS upload URL and a short-lived bearer token used to authenticate subsequent chunk requests (no DPoP required on chunks). The DID of the authenticated user is recorded against the upload; on completion a VOD processing task is enqueued. -func MediaCreateUpload(ctx context.Context, c glexrt.LexClient, input *MediaCreateUpload_Input) (*MediaCreateUpload_Output, error) { +func MediaCreateUpload(ctx context.Context, c glex.LexClient, input *MediaCreateUpload_Input) (*MediaCreateUpload_Output, error) { var out MediaCreateUpload_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.media.createUpload", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.media.createUpload", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/mediadefs.go b/pkg/placestream/mediadefs.go index 0d2eddde..eed32dbe 100644 --- a/pkg/placestream/mediadefs.go +++ b/pkg/placestream/mediadefs.go @@ -7,7 +7,7 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) @@ -31,17 +31,20 @@ type MediaDefs_MuxlTrack struct { TrackId string `json:"trackId"` } +// RecordTypeID implements glex.Record. +func (t *MediaDefs_MuxlTrack) RecordTypeID() string { return "place.stream.media.defs#muxlTrack" } + func (t *MediaDefs_MuxlTrack) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.defs#muxlTrack" + return glex.MarshalCBOR(w, t) } func (t *MediaDefs_MuxlTrack) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MediaDefs_SourceClip is a "sourceClip" in the place.stream.media.defs schema. @@ -57,17 +60,20 @@ type MediaDefs_SourceClip struct { Video string `json:"video"` } +// RecordTypeID implements glex.Record. +func (t *MediaDefs_SourceClip) RecordTypeID() string { return "place.stream.media.defs#sourceClip" } + func (t *MediaDefs_SourceClip) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.defs#sourceClip" + return glex.MarshalCBOR(w, t) } func (t *MediaDefs_SourceClip) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MediaDefs_SourceTracks is a "sourceTracks" in the place.stream.media.defs schema. @@ -79,15 +85,18 @@ type MediaDefs_SourceTracks struct { Tracks []comatproto.RepoStrongRef `json:"tracks"` } +// RecordTypeID implements glex.Record. +func (t *MediaDefs_SourceTracks) RecordTypeID() string { return "place.stream.media.defs#sourceTracks" } + func (t *MediaDefs_SourceTracks) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.defs#sourceTracks" + return glex.MarshalCBOR(w, t) } func (t *MediaDefs_SourceTracks) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/mediafinalizelivestream.go b/pkg/placestream/mediafinalizelivestream.go index aeaa228e..d08bae4c 100644 --- a/pkg/placestream/mediafinalizelivestream.go +++ b/pkg/placestream/mediafinalizelivestream.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,17 +18,22 @@ type MediaFinalizeLivestream_Input struct { Livestream string `json:"livestream"` } +// RecordTypeID implements glex.Record. +func (t *MediaFinalizeLivestream_Input) RecordTypeID() string { + return "place.stream.media.finalizeLivestream" +} + func (t *MediaFinalizeLivestream_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.finalizeLivestream#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.finalizeLivestream" + return glex.MarshalCBOR(w, t) } func (t *MediaFinalizeLivestream_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type MediaFinalizeLivestream_Output struct { @@ -39,26 +44,31 @@ type MediaFinalizeLivestream_Output struct { UploadId string `json:"uploadId"` } +// RecordTypeID implements glex.Record. +func (t *MediaFinalizeLivestream_Output) RecordTypeID() string { + return "place.stream.media.finalizeLivestream" +} + func (t *MediaFinalizeLivestream_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.finalizeLivestream#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.finalizeLivestream" + return glex.MarshalCBOR(w, t) } func (t *MediaFinalizeLivestream_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MediaFinalizeLivestream calls the XRPC method "place.stream.media.finalizeLivestream". // // Turn a finished livestream into a VOD. The server concatenates the MUXL segments it recorded for the livestream into a single content blob, derives the playback sidecars, and publishes the place.stream.media.track records. Processing completes server-side and creates a draft VOD; the client does not need to poll or publish — the user publishes the draft later via place.stream.vod.publishDraft. Returns the draft's ats:// URI so the client can navigate to it, alongside an uploadId for backwards compatibility. -func MediaFinalizeLivestream(ctx context.Context, c glexrt.LexClient, input *MediaFinalizeLivestream_Input) (*MediaFinalizeLivestream_Output, error) { +func MediaFinalizeLivestream(ctx context.Context, c glex.LexClient, input *MediaFinalizeLivestream_Input) (*MediaFinalizeLivestream_Output, error) { var out MediaFinalizeLivestream_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.media.finalizeLivestream", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.media.finalizeLivestream", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/mediagetuploadstatus.go b/pkg/placestream/mediagetuploadstatus.go index 8eea5d72..8d279ab1 100644 --- a/pkg/placestream/mediagetuploadstatus.go +++ b/pkg/placestream/mediagetuploadstatus.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -26,17 +26,22 @@ type MediaGetUploadStatus_Output struct { Tracks []MediaGetUploadStatus_TrackRef `json:"tracks,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *MediaGetUploadStatus_Output) RecordTypeID() string { + return "place.stream.media.getUploadStatus" +} + func (t *MediaGetUploadStatus_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.getUploadStatus#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.getUploadStatus" + return glex.MarshalCBOR(w, t) } func (t *MediaGetUploadStatus_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MediaGetUploadStatus calls the XRPC method "place.stream.media.getUploadStatus". @@ -44,13 +49,13 @@ func (t *MediaGetUploadStatus_Output) UnmarshalCBOR(r io.Reader) error { // Get the processing status of a previously created upload. Only accessible by the DID that created the upload. // // uploadId: The upload ID returned by place.stream.media.createUpload. -func MediaGetUploadStatus(ctx context.Context, c glexrt.LexClient, uploadId string) (*MediaGetUploadStatus_Output, error) { +func MediaGetUploadStatus(ctx context.Context, c glex.LexClient, uploadId string) (*MediaGetUploadStatus_Output, error) { var out MediaGetUploadStatus_Output params := map[string]interface{}{} params["uploadId"] = uploadId - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.media.getUploadStatus", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.media.getUploadStatus", params, nil, &out); err != nil { return nil, err } return &out, nil @@ -63,15 +68,20 @@ type MediaGetUploadStatus_TrackRef struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *MediaGetUploadStatus_TrackRef) RecordTypeID() string { + return "place.stream.media.getUploadStatus#trackRef" +} + func (t *MediaGetUploadStatus_TrackRef) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.getUploadStatus" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.getUploadStatus#trackRef" + return glex.MarshalCBOR(w, t) } func (t *MediaGetUploadStatus_TrackRef) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/mediagetvideo.go b/pkg/placestream/mediagetvideo.go index 8348e5c8..3c85dca9 100644 --- a/pkg/placestream/mediagetvideo.go +++ b/pkg/placestream/mediagetvideo.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" appbsky "stream.place/streamplace/pkg/appbsky" ) @@ -18,13 +18,13 @@ import ( // Get a hydrated view of a place.stream.video record — the record itself plus author info plus aggregated view counts summed across every reporting node we've indexed. View counts come from place.stream.media.viewCount records; consumers see one number per metric, with the underlying multi-reporter detail collapsed away. // // uri: AT-URI of the place.stream.video record. -func MediaGetVideo(ctx context.Context, c glexrt.LexClient, uri string) (*MediaGetVideo_VideoView, error) { +func MediaGetVideo(ctx context.Context, c glex.LexClient, uri string) (*MediaGetVideo_VideoView, error) { var out MediaGetVideo_VideoView params := map[string]interface{}{} params["uri"] = uri - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.media.getVideo", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.media.getVideo", params, nil, &out); err != nil { return nil, err } return &out, nil @@ -36,25 +36,30 @@ type MediaGetVideo_VideoView struct { Author appbsky.ActorDefs_ProfileViewBasic `json:"author"` Cid string `json:"cid"` // likeCount: Total number of place.stream.like records whose subject is this video. Always present; zero when none, so consumers can render a count unconditionally. - LikeCount int64 `json:"likeCount"` - Record *glexrt.LexiconTypeDecoder `json:"record"` - Tracks []MediaTrack_TrackView `json:"tracks,omitempty"` - Uri string `json:"uri"` + LikeCount int64 `json:"likeCount"` + Record *glex.LexiconTypeDecoder `json:"record"` + Tracks []MediaTrack_TrackView `json:"tracks,omitempty"` + Uri string `json:"uri"` // viewCounts: Aggregated view counts across every indexed reporter. Always present; zero-valued (count=0, reporters=0) when no place.stream.media.viewCount records have been observed yet, so consumers can render a count unconditionally. ViewCounts MediaGetVideo_ViewCountSummary `json:"viewCounts"` } +// RecordTypeID implements glex.Record. +func (t *MediaGetVideo_VideoView) RecordTypeID() string { + return "place.stream.media.getVideo#videoView" +} + func (t *MediaGetVideo_VideoView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.getVideo" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.getVideo#videoView" + return glex.MarshalCBOR(w, t) } func (t *MediaGetVideo_VideoView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MediaGetVideo_ViewCountSummary is a "viewCountSummary" in the place.stream.media.getVideo schema. @@ -72,15 +77,20 @@ type MediaGetVideo_ViewCountSummary struct { Reporters int64 `json:"reporters"` } +// RecordTypeID implements glex.Record. +func (t *MediaGetVideo_ViewCountSummary) RecordTypeID() string { + return "place.stream.media.getVideo#viewCountSummary" +} + func (t *MediaGetVideo_ViewCountSummary) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.getVideo" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.getVideo#viewCountSummary" + return glex.MarshalCBOR(w, t) } func (t *MediaGetVideo_ViewCountSummary) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/mediagetvideolist.go b/pkg/placestream/mediagetvideolist.go index 25bb976a..abd3c947 100644 --- a/pkg/placestream/mediagetvideolist.go +++ b/pkg/placestream/mediagetvideolist.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -19,17 +19,20 @@ type MediaGetVideoList_Output struct { Videos []MediaGetVideo_VideoView `json:"videos"` } +// RecordTypeID implements glex.Record. +func (t *MediaGetVideoList_Output) RecordTypeID() string { return "place.stream.media.getVideoList" } + func (t *MediaGetVideoList_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.getVideoList#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.getVideoList" + return glex.MarshalCBOR(w, t) } func (t *MediaGetVideoList_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MediaGetVideoList calls the XRPC method "place.stream.media.getVideoList". @@ -39,7 +42,7 @@ func (t *MediaGetVideoList_Output) UnmarshalCBOR(r io.Reader) error { // cursor: Pagination cursor from a previous response. // limit: Maximum number of videos to return. // repo: DID or handle of the repo whose videos to list. Omit to list videos globally across all repos. -func MediaGetVideoList(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, repo string) (*MediaGetVideoList_Output, error) { +func MediaGetVideoList(ctx context.Context, c glex.LexClient, cursor string, limit *int64, repo string) (*MediaGetVideoList_Output, error) { var out MediaGetVideoList_Output params := map[string]interface{}{} @@ -53,7 +56,7 @@ func MediaGetVideoList(ctx context.Context, c glexrt.LexClient, cursor string, l params["repo"] = repo } - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.media.getVideoList", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.media.getVideoList", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/mediaorigin.go b/pkg/placestream/mediaorigin.go index 3eaa2e1f..a6955b02 100644 --- a/pkg/placestream/mediaorigin.go +++ b/pkg/placestream/mediaorigin.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.media.origin", &MediaOrigin{}) + glex.RegisterType("place.stream.media.origin", &MediaOrigin{}) } // An attestation that a MUXL blob is available for download from the publishing node, retrievable via XRPC (com.atproto.repo.getBlob and similar). Published by the Streamplace node that hosts the blob, not by the user who owns the underlying video. The rkey is conventionally the blob's BDASL CID — atproto lexicon doesn't yet have a literal-rkey syntax so we settle for `key: any` and rely on the convention. @@ -26,15 +26,18 @@ type MediaOrigin struct { Size int64 `json:"size"` } +// RecordTypeID implements glex.Record. +func (t *MediaOrigin) RecordTypeID() string { return "place.stream.media.origin" } + func (t *MediaOrigin) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.media.origin" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *MediaOrigin) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/mediapublishvideo.go b/pkg/placestream/mediapublishvideo.go index ceede93b..0ef08472 100644 --- a/pkg/placestream/mediapublishvideo.go +++ b/pkg/placestream/mediapublishvideo.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -20,17 +20,20 @@ type MediaPublishVideo_Input struct { UploadId string `json:"uploadId"` } +// RecordTypeID implements glex.Record. +func (t *MediaPublishVideo_Input) RecordTypeID() string { return "place.stream.media.publishVideo" } + func (t *MediaPublishVideo_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.publishVideo#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.publishVideo" + return glex.MarshalCBOR(w, t) } func (t *MediaPublishVideo_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type MediaPublishVideo_Output struct { @@ -41,26 +44,29 @@ type MediaPublishVideo_Output struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *MediaPublishVideo_Output) RecordTypeID() string { return "place.stream.media.publishVideo" } + func (t *MediaPublishVideo_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.publishVideo#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.publishVideo" + return glex.MarshalCBOR(w, t) } func (t *MediaPublishVideo_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MediaPublishVideo calls the XRPC method "place.stream.media.publishVideo". // // Publish a place.stream.video record for a finished upload, server-side. The caller supplies the record it would otherwise putRecord itself; the server overrides the fields it is authoritative about (source tracks and durationMs, taken from the processed upload) and, if the record carries no thumb, generates one from the video and attaches it. The record is written to the authenticated user's repo. -func MediaPublishVideo(ctx context.Context, c glexrt.LexClient, input *MediaPublishVideo_Input) (*MediaPublishVideo_Output, error) { +func MediaPublishVideo(ctx context.Context, c glex.LexClient, input *MediaPublishVideo_Input) (*MediaPublishVideo_Output, error) { var out MediaPublishVideo_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.media.publishVideo", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.media.publishVideo", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/mediatrack.go b/pkg/placestream/mediatrack.go index aacd5385..d3718d76 100644 --- a/pkg/placestream/mediatrack.go +++ b/pkg/placestream/mediatrack.go @@ -10,14 +10,14 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" appbsky "stream.place/streamplace/pkg/appbsky" comatproto "stream.place/streamplace/pkg/comatproto" ) func init() { - glexrt.RegisterType("place.stream.media.track", &MediaTrack{}) + glex.RegisterType("place.stream.media.track", &MediaTrack{}) } // A track for a video stream, either part of the source or a custom additional track. One of: video, audio, subtitles. @@ -31,17 +31,20 @@ type MediaTrack struct { Video *string `json:"video,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *MediaTrack) RecordTypeID() string { return "place.stream.media.track" } + func (t *MediaTrack) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.media.track" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *MediaTrack) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type MediaTrack_Metadata struct { @@ -57,7 +60,7 @@ func (t *MediaTrack_Metadata) MarshalJSON() ([]byte, error) { } func (t *MediaTrack_Metadata) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -84,7 +87,7 @@ func (t *MediaTrack_Metadata) MarshalCBOR(w io.Writer) error { } func (t *MediaTrack_Metadata) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -111,7 +114,7 @@ func (t *MediaTrack_Track) MarshalJSON() ([]byte, error) { } func (t *MediaTrack_Track) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -138,7 +141,7 @@ func (t *MediaTrack_Track) MarshalCBOR(w io.Writer) error { } func (t *MediaTrack_Track) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -165,17 +168,22 @@ type MediaTrack_CommonMetadata struct { Video *Segment_Video `json:"video,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *MediaTrack_CommonMetadata) RecordTypeID() string { + return "place.stream.media.track#commonMetadata" +} + func (t *MediaTrack_CommonMetadata) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.track" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.track#commonMetadata" + return glex.MarshalCBOR(w, t) } func (t *MediaTrack_CommonMetadata) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MediaTrack_TrackView is a "trackView" in the place.stream.media.track schema. @@ -183,19 +191,22 @@ type MediaTrack_TrackView struct { LexiconTypeID string `json:"$type"` Author appbsky.ActorDefs_ProfileViewBasic `json:"author"` Cid string `json:"cid"` - Record *glexrt.LexiconTypeDecoder `json:"record"` + Record *glex.LexiconTypeDecoder `json:"record"` Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *MediaTrack_TrackView) RecordTypeID() string { return "place.stream.media.track#trackView" } + func (t *MediaTrack_TrackView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.track" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.track#trackView" + return glex.MarshalCBOR(w, t) } func (t *MediaTrack_TrackView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/mediaviewcount.go b/pkg/placestream/mediaviewcount.go index 4f3f1c98..77d6dc7b 100644 --- a/pkg/placestream/mediaviewcount.go +++ b/pkg/placestream/mediaviewcount.go @@ -7,13 +7,13 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) func init() { - glexrt.RegisterType("place.stream.media.viewCount", &MediaViewCount{}) + glex.RegisterType("place.stream.media.viewCount", &MediaViewCount{}) } // A streamplace node's report of view counts for one place.stream.video over a closed time window. Published in the reporting node's server repo (not the streamer's), so a video served by multiple nodes accumulates multiple records — consumers are expected to sum across trusted reporters. The rkey is conventionally `-` so re-running the aggregator over the same window is idempotent. Counts represent the reporting node's best effort given the data it has; the `tracks` array carries the objective byte / duration totals it observed. @@ -33,17 +33,20 @@ type MediaViewCount struct { WindowStart string `json:"windowStart"` } +// RecordTypeID implements glex.Record. +func (t *MediaViewCount) RecordTypeID() string { return "place.stream.media.viewCount" } + func (t *MediaViewCount) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.media.viewCount" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *MediaViewCount) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MediaViewCount_TrackUsage is a "trackUsage" in the place.stream.media.viewCount schema. @@ -59,15 +62,20 @@ type MediaViewCount_TrackUsage struct { Track comatproto.RepoStrongRef `json:"track"` } +// RecordTypeID implements glex.Record. +func (t *MediaViewCount_TrackUsage) RecordTypeID() string { + return "place.stream.media.viewCount#trackUsage" +} + func (t *MediaViewCount_TrackUsage) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.media.viewCount" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.media.viewCount#trackUsage" + return glex.MarshalCBOR(w, t) } func (t *MediaViewCount_TrackUsage) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/metadataconfiguration.go b/pkg/placestream/metadataconfiguration.go index 10697661..51523fb8 100644 --- a/pkg/placestream/metadataconfiguration.go +++ b/pkg/placestream/metadataconfiguration.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.metadata.configuration", &MetadataConfiguration{}) + glex.RegisterType("place.stream.metadata.configuration", &MetadataConfiguration{}) } // Default metadata record for livestream including content warnings, rights, and distribution policy @@ -23,15 +23,18 @@ type MetadataConfiguration struct { DistributionPolicy *MetadataDistributionPolicy `json:"distributionPolicy,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *MetadataConfiguration) RecordTypeID() string { return "place.stream.metadata.configuration" } + func (t *MetadataConfiguration) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.metadata.configuration" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *MetadataConfiguration) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/metadatacontentrights.go b/pkg/placestream/metadatacontentrights.go index 400ce2fd..5e18d6cf 100644 --- a/pkg/placestream/metadatacontentrights.go +++ b/pkg/placestream/metadatacontentrights.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.metadata.contentRights#main", &MetadataContentRights{}) + glex.RegisterType("place.stream.metadata.contentRights#main", &MetadataContentRights{}) } // Content rights and attribution information. @@ -30,15 +30,18 @@ type MetadataContentRights struct { License *string `json:"license,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *MetadataContentRights) RecordTypeID() string { return "place.stream.metadata.contentRights" } + func (t *MetadataContentRights) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.metadata.contentRights" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *MetadataContentRights) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/metadatacontentwarnings.go b/pkg/placestream/metadatacontentwarnings.go index 1aa6cb55..822a37da 100644 --- a/pkg/placestream/metadatacontentwarnings.go +++ b/pkg/placestream/metadatacontentwarnings.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.metadata.contentWarnings#main", &MetadataContentWarnings{}) + glex.RegisterType("place.stream.metadata.contentWarnings#main", &MetadataContentWarnings{}) } // Content warnings for a stream. @@ -21,15 +21,20 @@ type MetadataContentWarnings struct { Warnings []string `json:"warnings,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *MetadataContentWarnings) RecordTypeID() string { + return "place.stream.metadata.contentWarnings" +} + func (t *MetadataContentWarnings) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.metadata.contentWarnings" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *MetadataContentWarnings) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/metadatadistributionpolicy.go b/pkg/placestream/metadatadistributionpolicy.go index c39584ae..59eacb3a 100644 --- a/pkg/placestream/metadatadistributionpolicy.go +++ b/pkg/placestream/metadatadistributionpolicy.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.metadata.distributionPolicy#main", &MetadataDistributionPolicy{}) + glex.RegisterType("place.stream.metadata.distributionPolicy#main", &MetadataDistributionPolicy{}) } // Distribution and rebroadcast policy. @@ -24,15 +24,20 @@ type MetadataDistributionPolicy struct { DeleteAfter *int64 `json:"deleteAfter,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *MetadataDistributionPolicy) RecordTypeID() string { + return "place.stream.metadata.distributionPolicy" +} + func (t *MetadataDistributionPolicy) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.metadata.distributionPolicy" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *MetadataDistributionPolicy) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/moderationcreateblock.go b/pkg/placestream/moderationcreateblock.go index 5ce7b348..5a931419 100644 --- a/pkg/placestream/moderationcreateblock.go +++ b/pkg/placestream/moderationcreateblock.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -22,17 +22,22 @@ type ModerationCreateBlock_Input struct { Subject string `json:"subject"` } +// RecordTypeID implements glex.Record. +func (t *ModerationCreateBlock_Input) RecordTypeID() string { + return "place.stream.moderation.createBlock" +} + func (t *ModerationCreateBlock_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.createBlock#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.createBlock" + return glex.MarshalCBOR(w, t) } func (t *ModerationCreateBlock_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ModerationCreateBlock_Output struct { @@ -43,26 +48,31 @@ type ModerationCreateBlock_Output struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *ModerationCreateBlock_Output) RecordTypeID() string { + return "place.stream.moderation.createBlock" +} + func (t *ModerationCreateBlock_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.createBlock#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.createBlock" + return glex.MarshalCBOR(w, t) } func (t *ModerationCreateBlock_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ModerationCreateBlock calls the XRPC method "place.stream.moderation.createBlock". // // Create a block (ban) on behalf of a streamer. Requires 'ban' permission. Creates an app.bsky.graph.block record in the streamer's repository. -func ModerationCreateBlock(ctx context.Context, c glexrt.LexClient, input *ModerationCreateBlock_Input) (*ModerationCreateBlock_Output, error) { +func ModerationCreateBlock(ctx context.Context, c glex.LexClient, input *ModerationCreateBlock_Input) (*ModerationCreateBlock_Output, error) { var out ModerationCreateBlock_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.moderation.createBlock", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.moderation.createBlock", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/moderationcreategate.go b/pkg/placestream/moderationcreategate.go index 4cc7e450..df29cc98 100644 --- a/pkg/placestream/moderationcreategate.go +++ b/pkg/placestream/moderationcreategate.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -20,17 +20,22 @@ type ModerationCreateGate_Input struct { Streamer string `json:"streamer"` } +// RecordTypeID implements glex.Record. +func (t *ModerationCreateGate_Input) RecordTypeID() string { + return "place.stream.moderation.createGate" +} + func (t *ModerationCreateGate_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.createGate#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.createGate" + return glex.MarshalCBOR(w, t) } func (t *ModerationCreateGate_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ModerationCreateGate_Output struct { @@ -41,26 +46,31 @@ type ModerationCreateGate_Output struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *ModerationCreateGate_Output) RecordTypeID() string { + return "place.stream.moderation.createGate" +} + func (t *ModerationCreateGate_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.createGate#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.createGate" + return glex.MarshalCBOR(w, t) } func (t *ModerationCreateGate_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ModerationCreateGate calls the XRPC method "place.stream.moderation.createGate". // // Create a gate (hide message) on behalf of a streamer. Requires 'hide' permission. Creates a place.stream.chat.gate record in the streamer's repository. -func ModerationCreateGate(ctx context.Context, c glexrt.LexClient, input *ModerationCreateGate_Input) (*ModerationCreateGate_Output, error) { +func ModerationCreateGate(ctx context.Context, c glex.LexClient, input *ModerationCreateGate_Input) (*ModerationCreateGate_Output, error) { var out ModerationCreateGate_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.moderation.createGate", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.moderation.createGate", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/moderationcreatepin.go b/pkg/placestream/moderationcreatepin.go index 41eac194..1a38b9f8 100644 --- a/pkg/placestream/moderationcreatepin.go +++ b/pkg/placestream/moderationcreatepin.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -22,17 +22,20 @@ type ModerationCreatePin_Input struct { Streamer string `json:"streamer"` } +// RecordTypeID implements glex.Record. +func (t *ModerationCreatePin_Input) RecordTypeID() string { return "place.stream.moderation.createPin" } + func (t *ModerationCreatePin_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.createPin#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.createPin" + return glex.MarshalCBOR(w, t) } func (t *ModerationCreatePin_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ModerationCreatePin_Output struct { @@ -43,26 +46,31 @@ type ModerationCreatePin_Output struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *ModerationCreatePin_Output) RecordTypeID() string { + return "place.stream.moderation.createPin" +} + func (t *ModerationCreatePin_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.createPin#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.createPin" + return glex.MarshalCBOR(w, t) } func (t *ModerationCreatePin_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ModerationCreatePin calls the XRPC method "place.stream.moderation.createPin". // // Pin a chat message on behalf of a streamer. Requires 'message.pin' permission. Creates a place.stream.chat.pinnedRecord in the streamer's repo, replacing any existing pin. -func ModerationCreatePin(ctx context.Context, c glexrt.LexClient, input *ModerationCreatePin_Input) (*ModerationCreatePin_Output, error) { +func ModerationCreatePin(ctx context.Context, c glex.LexClient, input *ModerationCreatePin_Input) (*ModerationCreatePin_Output, error) { var out ModerationCreatePin_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.moderation.createPin", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.moderation.createPin", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/moderationcreatevodgate.go b/pkg/placestream/moderationcreatevodgate.go index 1fa227cd..7eb592cd 100644 --- a/pkg/placestream/moderationcreatevodgate.go +++ b/pkg/placestream/moderationcreatevodgate.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -20,17 +20,22 @@ type ModerationCreateVodGate_Input struct { Streamer string `json:"streamer"` } +// RecordTypeID implements glex.Record. +func (t *ModerationCreateVodGate_Input) RecordTypeID() string { + return "place.stream.moderation.createVodGate" +} + func (t *ModerationCreateVodGate_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.createVodGate#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.createVodGate" + return glex.MarshalCBOR(w, t) } func (t *ModerationCreateVodGate_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ModerationCreateVodGate_Output struct { @@ -41,26 +46,31 @@ type ModerationCreateVodGate_Output struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *ModerationCreateVodGate_Output) RecordTypeID() string { + return "place.stream.moderation.createVodGate" +} + func (t *ModerationCreateVodGate_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.createVodGate#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.createVodGate" + return glex.MarshalCBOR(w, t) } func (t *ModerationCreateVodGate_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ModerationCreateVodGate calls the XRPC method "place.stream.moderation.createVodGate". // // Create a gate (hide VOD comment) on behalf of a streamer. Requires 'vod.comment.hide' permission. Creates a place.stream.vod.gate record in the streamer's repository. -func ModerationCreateVodGate(ctx context.Context, c glexrt.LexClient, input *ModerationCreateVodGate_Input) (*ModerationCreateVodGate_Output, error) { +func ModerationCreateVodGate(ctx context.Context, c glex.LexClient, input *ModerationCreateVodGate_Input) (*ModerationCreateVodGate_Output, error) { var out ModerationCreateVodGate_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.moderation.createVodGate", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.moderation.createVodGate", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/moderationdefs.go b/pkg/placestream/moderationdefs.go index c56efe1d..666fa259 100644 --- a/pkg/placestream/moderationdefs.go +++ b/pkg/placestream/moderationdefs.go @@ -7,7 +7,7 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" appbsky "stream.place/streamplace/pkg/appbsky" ) @@ -20,20 +20,25 @@ type ModerationDefs_PermissionView struct { // cid: Content identifier of the permission record Cid string `json:"cid"` // record: The permission record itself - Record *glexrt.LexiconTypeDecoder `json:"record"` + Record *glex.LexiconTypeDecoder `json:"record"` // uri: AT-URI of the permission record Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *ModerationDefs_PermissionView) RecordTypeID() string { + return "place.stream.moderation.defs#permissionView" +} + func (t *ModerationDefs_PermissionView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.defs#permissionView" + return glex.MarshalCBOR(w, t) } func (t *ModerationDefs_PermissionView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/moderationdeleteblock.go b/pkg/placestream/moderationdeleteblock.go index caa5f430..4a0cb330 100644 --- a/pkg/placestream/moderationdeleteblock.go +++ b/pkg/placestream/moderationdeleteblock.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -20,43 +20,53 @@ type ModerationDeleteBlock_Input struct { Streamer string `json:"streamer"` } +// RecordTypeID implements glex.Record. +func (t *ModerationDeleteBlock_Input) RecordTypeID() string { + return "place.stream.moderation.deleteBlock" +} + func (t *ModerationDeleteBlock_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.deleteBlock#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.deleteBlock" + return glex.MarshalCBOR(w, t) } func (t *ModerationDeleteBlock_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ModerationDeleteBlock_Output struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *ModerationDeleteBlock_Output) RecordTypeID() string { + return "place.stream.moderation.deleteBlock" +} + func (t *ModerationDeleteBlock_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.deleteBlock#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.deleteBlock" + return glex.MarshalCBOR(w, t) } func (t *ModerationDeleteBlock_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ModerationDeleteBlock calls the XRPC method "place.stream.moderation.deleteBlock". // // Delete a block (unban) on behalf of a streamer. Requires 'ban' permission. Deletes an app.bsky.graph.block record from the streamer's repository. -func ModerationDeleteBlock(ctx context.Context, c glexrt.LexClient, input *ModerationDeleteBlock_Input) (*ModerationDeleteBlock_Output, error) { +func ModerationDeleteBlock(ctx context.Context, c glex.LexClient, input *ModerationDeleteBlock_Input) (*ModerationDeleteBlock_Output, error) { var out ModerationDeleteBlock_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.moderation.deleteBlock", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.moderation.deleteBlock", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/moderationdeletegate.go b/pkg/placestream/moderationdeletegate.go index 7a13b422..20a1c487 100644 --- a/pkg/placestream/moderationdeletegate.go +++ b/pkg/placestream/moderationdeletegate.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -20,43 +20,53 @@ type ModerationDeleteGate_Input struct { Streamer string `json:"streamer"` } +// RecordTypeID implements glex.Record. +func (t *ModerationDeleteGate_Input) RecordTypeID() string { + return "place.stream.moderation.deleteGate" +} + func (t *ModerationDeleteGate_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.deleteGate#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.deleteGate" + return glex.MarshalCBOR(w, t) } func (t *ModerationDeleteGate_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ModerationDeleteGate_Output struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *ModerationDeleteGate_Output) RecordTypeID() string { + return "place.stream.moderation.deleteGate" +} + func (t *ModerationDeleteGate_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.deleteGate#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.deleteGate" + return glex.MarshalCBOR(w, t) } func (t *ModerationDeleteGate_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ModerationDeleteGate calls the XRPC method "place.stream.moderation.deleteGate". // // Delete a gate (unhide message) on behalf of a streamer. Requires 'hide' permission. Deletes a place.stream.chat.gate record from the streamer's repository. -func ModerationDeleteGate(ctx context.Context, c glexrt.LexClient, input *ModerationDeleteGate_Input) (*ModerationDeleteGate_Output, error) { +func ModerationDeleteGate(ctx context.Context, c glex.LexClient, input *ModerationDeleteGate_Input) (*ModerationDeleteGate_Output, error) { var out ModerationDeleteGate_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.moderation.deleteGate", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.moderation.deleteGate", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/moderationdeletepin.go b/pkg/placestream/moderationdeletepin.go index d1c3e7fc..4cd53512 100644 --- a/pkg/placestream/moderationdeletepin.go +++ b/pkg/placestream/moderationdeletepin.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -20,43 +20,51 @@ type ModerationDeletePin_Input struct { Streamer string `json:"streamer"` } +// RecordTypeID implements glex.Record. +func (t *ModerationDeletePin_Input) RecordTypeID() string { return "place.stream.moderation.deletePin" } + func (t *ModerationDeletePin_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.deletePin#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.deletePin" + return glex.MarshalCBOR(w, t) } func (t *ModerationDeletePin_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ModerationDeletePin_Output struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *ModerationDeletePin_Output) RecordTypeID() string { + return "place.stream.moderation.deletePin" +} + func (t *ModerationDeletePin_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.deletePin#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.deletePin" + return glex.MarshalCBOR(w, t) } func (t *ModerationDeletePin_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ModerationDeletePin calls the XRPC method "place.stream.moderation.deletePin". // // Unpin a pinned chat message on behalf of a streamer. Requires 'message.pin' permission. Deletes the place.stream.chat.pinnedRecord from the streamer's repo. -func ModerationDeletePin(ctx context.Context, c glexrt.LexClient, input *ModerationDeletePin_Input) (*ModerationDeletePin_Output, error) { +func ModerationDeletePin(ctx context.Context, c glex.LexClient, input *ModerationDeletePin_Input) (*ModerationDeletePin_Output, error) { var out ModerationDeletePin_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.moderation.deletePin", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.moderation.deletePin", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/moderationdeletevodgate.go b/pkg/placestream/moderationdeletevodgate.go index 72e8b9a2..6bf1cd3c 100644 --- a/pkg/placestream/moderationdeletevodgate.go +++ b/pkg/placestream/moderationdeletevodgate.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -20,43 +20,53 @@ type ModerationDeleteVodGate_Input struct { Streamer string `json:"streamer"` } +// RecordTypeID implements glex.Record. +func (t *ModerationDeleteVodGate_Input) RecordTypeID() string { + return "place.stream.moderation.deleteVodGate" +} + func (t *ModerationDeleteVodGate_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.deleteVodGate#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.deleteVodGate" + return glex.MarshalCBOR(w, t) } func (t *ModerationDeleteVodGate_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ModerationDeleteVodGate_Output struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *ModerationDeleteVodGate_Output) RecordTypeID() string { + return "place.stream.moderation.deleteVodGate" +} + func (t *ModerationDeleteVodGate_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.deleteVodGate#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.deleteVodGate" + return glex.MarshalCBOR(w, t) } func (t *ModerationDeleteVodGate_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ModerationDeleteVodGate calls the XRPC method "place.stream.moderation.deleteVodGate". // // Delete a gate (unhide VOD comment) on behalf of a streamer. Requires 'vod.comment.hide' permission. Deletes a place.stream.vod.gate record from the streamer's repository. -func ModerationDeleteVodGate(ctx context.Context, c glexrt.LexClient, input *ModerationDeleteVodGate_Input) (*ModerationDeleteVodGate_Output, error) { +func ModerationDeleteVodGate(ctx context.Context, c glex.LexClient, input *ModerationDeleteVodGate_Input) (*ModerationDeleteVodGate_Output, error) { var out ModerationDeleteVodGate_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.moderation.deleteVodGate", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.moderation.deleteVodGate", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/moderationpermission.go b/pkg/placestream/moderationpermission.go index 13b8813b..c5579aca 100644 --- a/pkg/placestream/moderationpermission.go +++ b/pkg/placestream/moderationpermission.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.moderation.permission", &ModerationPermission{}) + glex.RegisterType("place.stream.moderation.permission", &ModerationPermission{}) } // Record granting moderation permissions to a user for this streamer's content. @@ -28,15 +28,18 @@ type ModerationPermission struct { Permissions []string `json:"permissions"` } +// RecordTypeID implements glex.Record. +func (t *ModerationPermission) RecordTypeID() string { return "place.stream.moderation.permission" } + func (t *ModerationPermission) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.moderation.permission" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *ModerationPermission) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/moderationupdatelivestream.go b/pkg/placestream/moderationupdatelivestream.go index 1fb0d2a6..da39271f 100644 --- a/pkg/placestream/moderationupdatelivestream.go +++ b/pkg/placestream/moderationupdatelivestream.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -22,17 +22,22 @@ type ModerationUpdateLivestream_Input struct { Title *string `json:"title,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ModerationUpdateLivestream_Input) RecordTypeID() string { + return "place.stream.moderation.updateLivestream" +} + func (t *ModerationUpdateLivestream_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.updateLivestream#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.updateLivestream" + return glex.MarshalCBOR(w, t) } func (t *ModerationUpdateLivestream_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ModerationUpdateLivestream_Output struct { @@ -43,26 +48,31 @@ type ModerationUpdateLivestream_Output struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *ModerationUpdateLivestream_Output) RecordTypeID() string { + return "place.stream.moderation.updateLivestream" +} + func (t *ModerationUpdateLivestream_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.moderation.updateLivestream#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.moderation.updateLivestream" + return glex.MarshalCBOR(w, t) } func (t *ModerationUpdateLivestream_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ModerationUpdateLivestream calls the XRPC method "place.stream.moderation.updateLivestream". // // Update livestream metadata on behalf of a streamer. Requires 'livestream.manage' permission. Updates a place.stream.livestream record in the streamer's repository. -func ModerationUpdateLivestream(ctx context.Context, c glexrt.LexClient, input *ModerationUpdateLivestream_Input) (*ModerationUpdateLivestream_Output, error) { +func ModerationUpdateLivestream(ctx context.Context, c glex.LexClient, input *ModerationUpdateLivestream_Input) (*ModerationUpdateLivestream_Output, error) { var out ModerationUpdateLivestream_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.moderation.updateLivestream", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.moderation.updateLivestream", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/multistreamcreatetarget.go b/pkg/placestream/multistreamcreatetarget.go index 65a86c75..6b681fa6 100644 --- a/pkg/placestream/multistreamcreatetarget.go +++ b/pkg/placestream/multistreamcreatetarget.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -17,26 +17,31 @@ type MultistreamCreateTarget_Input struct { MultistreamTarget MultistreamTarget `json:"multistreamTarget"` } +// RecordTypeID implements glex.Record. +func (t *MultistreamCreateTarget_Input) RecordTypeID() string { + return "place.stream.multistream.createTarget" +} + func (t *MultistreamCreateTarget_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.multistream.createTarget#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.multistream.createTarget" + return glex.MarshalCBOR(w, t) } func (t *MultistreamCreateTarget_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MultistreamCreateTarget calls the XRPC method "place.stream.multistream.createTarget". // // Create a new target for rebroadcasting a Streamplace stream. -func MultistreamCreateTarget(ctx context.Context, c glexrt.LexClient, input *MultistreamCreateTarget_Input) (*MultistreamDefs_TargetView, error) { +func MultistreamCreateTarget(ctx context.Context, c glex.LexClient, input *MultistreamCreateTarget_Input) (*MultistreamDefs_TargetView, error) { var out MultistreamDefs_TargetView - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.multistream.createTarget", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.multistream.createTarget", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/multistreamdefs.go b/pkg/placestream/multistreamdefs.go index b4434e23..d038b2df 100644 --- a/pkg/placestream/multistreamdefs.go +++ b/pkg/placestream/multistreamdefs.go @@ -7,7 +7,7 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -19,26 +19,34 @@ type MultistreamDefs_Event struct { Status string `json:"status"` } +// RecordTypeID implements glex.Record. +func (t *MultistreamDefs_Event) RecordTypeID() string { return "place.stream.multistream.defs#event" } + func (t *MultistreamDefs_Event) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.multistream.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.multistream.defs#event" + return glex.MarshalCBOR(w, t) } func (t *MultistreamDefs_Event) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MultistreamDefs_TargetView is a "targetView" in the place.stream.multistream.defs schema. type MultistreamDefs_TargetView struct { - LexiconTypeID string `json:"$type"` - Cid string `json:"cid"` - LatestEvent *MultistreamDefs_Event `json:"latestEvent,omitempty"` - Record *glexrt.LexiconTypeDecoder `json:"record"` - Uri string `json:"uri"` + LexiconTypeID string `json:"$type"` + Cid string `json:"cid"` + LatestEvent *MultistreamDefs_Event `json:"latestEvent,omitempty"` + Record *glex.LexiconTypeDecoder `json:"record"` + Uri string `json:"uri"` +} + +// RecordTypeID implements glex.Record. +func (t *MultistreamDefs_TargetView) RecordTypeID() string { + return "place.stream.multistream.defs#targetView" } func (t *MultistreamDefs_TargetView) MarshalCBOR(w io.Writer) error { @@ -46,10 +54,10 @@ func (t *MultistreamDefs_TargetView) MarshalCBOR(w io.Writer) error { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.multistream.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.multistream.defs#targetView" + return glex.MarshalCBOR(w, t) } func (t *MultistreamDefs_TargetView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/multistreamdeletetarget.go b/pkg/placestream/multistreamdeletetarget.go index 455c739f..ee54ce78 100644 --- a/pkg/placestream/multistreamdeletetarget.go +++ b/pkg/placestream/multistreamdeletetarget.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,43 +18,53 @@ type MultistreamDeleteTarget_Input struct { Rkey string `json:"rkey"` } +// RecordTypeID implements glex.Record. +func (t *MultistreamDeleteTarget_Input) RecordTypeID() string { + return "place.stream.multistream.deleteTarget" +} + func (t *MultistreamDeleteTarget_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.multistream.deleteTarget#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.multistream.deleteTarget" + return glex.MarshalCBOR(w, t) } func (t *MultistreamDeleteTarget_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type MultistreamDeleteTarget_Output struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *MultistreamDeleteTarget_Output) RecordTypeID() string { + return "place.stream.multistream.deleteTarget" +} + func (t *MultistreamDeleteTarget_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.multistream.deleteTarget#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.multistream.deleteTarget" + return glex.MarshalCBOR(w, t) } func (t *MultistreamDeleteTarget_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MultistreamDeleteTarget calls the XRPC method "place.stream.multistream.deleteTarget". // // Delete a target for rebroadcasting a Streamplace stream. -func MultistreamDeleteTarget(ctx context.Context, c glexrt.LexClient, input *MultistreamDeleteTarget_Input) (*MultistreamDeleteTarget_Output, error) { +func MultistreamDeleteTarget(ctx context.Context, c glex.LexClient, input *MultistreamDeleteTarget_Input) (*MultistreamDeleteTarget_Output, error) { var out MultistreamDeleteTarget_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.multistream.deleteTarget", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.multistream.deleteTarget", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/multistreamlisttargets.go b/pkg/placestream/multistreamlisttargets.go index 6bf0152c..71c2a9b8 100644 --- a/pkg/placestream/multistreamlisttargets.go +++ b/pkg/placestream/multistreamlisttargets.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,17 +18,22 @@ type MultistreamListTargets_Output struct { Targets []MultistreamDefs_TargetView `json:"targets"` } +// RecordTypeID implements glex.Record. +func (t *MultistreamListTargets_Output) RecordTypeID() string { + return "place.stream.multistream.listTargets" +} + func (t *MultistreamListTargets_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.multistream.listTargets#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.multistream.listTargets" + return glex.MarshalCBOR(w, t) } func (t *MultistreamListTargets_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MultistreamListTargets calls the XRPC method "place.stream.multistream.listTargets". @@ -36,7 +41,7 @@ func (t *MultistreamListTargets_Output) UnmarshalCBOR(r io.Reader) error { // List a range of targets for rebroadcasting a Streamplace stream. // // limit: The number of targets to return. -func MultistreamListTargets(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64) (*MultistreamListTargets_Output, error) { +func MultistreamListTargets(ctx context.Context, c glex.LexClient, cursor string, limit *int64) (*MultistreamListTargets_Output, error) { var out MultistreamListTargets_Output params := map[string]interface{}{} @@ -47,7 +52,7 @@ func MultistreamListTargets(ctx context.Context, c glexrt.LexClient, cursor stri params["limit"] = *limit } - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.multistream.listTargets", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.multistream.listTargets", params, nil, &out); err != nil { return nil, err } return &out, nil @@ -55,10 +60,15 @@ func MultistreamListTargets(ctx context.Context, c glexrt.LexClient, cursor stri // MultistreamListTargets_Record is a "record" in the place.stream.multistream.listTargets schema. type MultistreamListTargets_Record struct { - LexiconTypeID string `json:"$type"` - Cid string `json:"cid"` - Uri string `json:"uri"` - Value *glexrt.LexiconTypeDecoder `json:"value"` + LexiconTypeID string `json:"$type"` + Cid string `json:"cid"` + Uri string `json:"uri"` + Value *glex.LexiconTypeDecoder `json:"value"` +} + +// RecordTypeID implements glex.Record. +func (t *MultistreamListTargets_Record) RecordTypeID() string { + return "place.stream.multistream.listTargets#record" } func (t *MultistreamListTargets_Record) MarshalCBOR(w io.Writer) error { @@ -66,10 +76,10 @@ func (t *MultistreamListTargets_Record) MarshalCBOR(w io.Writer) error { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.multistream.listTargets" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.multistream.listTargets#record" + return glex.MarshalCBOR(w, t) } func (t *MultistreamListTargets_Record) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/multistreamputtarget.go b/pkg/placestream/multistreamputtarget.go index 3acc1fbe..46d35ffb 100644 --- a/pkg/placestream/multistreamputtarget.go +++ b/pkg/placestream/multistreamputtarget.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -19,26 +19,31 @@ type MultistreamPutTarget_Input struct { Rkey *string `json:"rkey,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *MultistreamPutTarget_Input) RecordTypeID() string { + return "place.stream.multistream.putTarget" +} + func (t *MultistreamPutTarget_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.multistream.putTarget#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.multistream.putTarget" + return glex.MarshalCBOR(w, t) } func (t *MultistreamPutTarget_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // MultistreamPutTarget calls the XRPC method "place.stream.multistream.putTarget". // // Update an existing target for rebroadcasting a Streamplace stream. -func MultistreamPutTarget(ctx context.Context, c glexrt.LexClient, input *MultistreamPutTarget_Input) (*MultistreamDefs_TargetView, error) { +func MultistreamPutTarget(ctx context.Context, c glex.LexClient, input *MultistreamPutTarget_Input) (*MultistreamDefs_TargetView, error) { var out MultistreamDefs_TargetView - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.multistream.putTarget", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.multistream.putTarget", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/multistreamtarget.go b/pkg/placestream/multistreamtarget.go index d4791253..1ab2c9d9 100644 --- a/pkg/placestream/multistreamtarget.go +++ b/pkg/placestream/multistreamtarget.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.multistream.target", &MultistreamTarget{}) + glex.RegisterType("place.stream.multistream.target", &MultistreamTarget{}) } // An external server for rebroadcasting a Streamplace stream @@ -28,15 +28,18 @@ type MultistreamTarget struct { Url string `json:"url"` } +// RecordTypeID implements glex.Record. +func (t *MultistreamTarget) RecordTypeID() string { return "place.stream.multistream.target" } + func (t *MultistreamTarget) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.multistream.target" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *MultistreamTarget) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/playbackgetliveplaylist.go b/pkg/placestream/playbackgetliveplaylist.go index eb01b34d..39d73c5a 100644 --- a/pkg/placestream/playbackgetliveplaylist.go +++ b/pkg/placestream/playbackgetliveplaylist.go @@ -8,7 +8,7 @@ import ( "bytes" "context" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" ) // PlaybackGetLivePlaylist calls the XRPC method "place.stream.playback.getLivePlaylist". @@ -18,7 +18,7 @@ import ( // sid: Opaque playback session identifier. Omit on the master playlist request; the server generates one and threads it through the sub-playlist + segment URLs it returns, for view-count correlation. // streamer: The streamer to play back: a DID (did:plc/did:web/did:key) or a Bluesky handle, which is resolved to its DID. // track: Track ID (stringified u32 matching the MUXL container) for a single-track media playlist. Omit for the master playlist. -func PlaybackGetLivePlaylist(ctx context.Context, c glexrt.LexClient, sid string, streamer string, track string) ([]byte, error) { +func PlaybackGetLivePlaylist(ctx context.Context, c glex.LexClient, sid string, streamer string, track string) ([]byte, error) { buf := new(bytes.Buffer) params := map[string]interface{}{} @@ -30,7 +30,7 @@ func PlaybackGetLivePlaylist(ctx context.Context, c glexrt.LexClient, sid string } params["streamer"] = streamer - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.playback.getLivePlaylist", params, nil, buf); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.playback.getLivePlaylist", params, nil, buf); err != nil { return nil, err } return buf.Bytes(), nil diff --git a/pkg/placestream/playbackgetlivesegment.go b/pkg/placestream/playbackgetlivesegment.go index 0089e827..2f5dc171 100644 --- a/pkg/placestream/playbackgetlivesegment.go +++ b/pkg/placestream/playbackgetlivesegment.go @@ -8,7 +8,7 @@ import ( "bytes" "context" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" ) // PlaybackGetLiveSegment calls the XRPC method "place.stream.playback.getLiveSegment". @@ -19,7 +19,7 @@ import ( // sid: Opaque playback session identifier, propagated from the media playlist that referenced this segment. Logged for view-count correlation; not used for access control. // streamer: The streamer: a DID or a Bluesky handle (resolved to its DID). // track: Track ID (stringified u32 matching the MUXL container). -func PlaybackGetLiveSegment(ctx context.Context, c glexrt.LexClient, seg string, sid string, streamer string, track string) ([]byte, error) { +func PlaybackGetLiveSegment(ctx context.Context, c glex.LexClient, seg string, sid string, streamer string, track string) ([]byte, error) { buf := new(bytes.Buffer) params := map[string]interface{}{} @@ -30,7 +30,7 @@ func PlaybackGetLiveSegment(ctx context.Context, c glexrt.LexClient, seg string, params["streamer"] = streamer params["track"] = track - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.playback.getLiveSegment", params, nil, buf); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.playback.getLiveSegment", params, nil, buf); err != nil { return nil, err } return buf.Bytes(), nil diff --git a/pkg/placestream/playbackgetplaybackserver.go b/pkg/placestream/playbackgetplaybackserver.go index bf5f06da..d155db48 100644 --- a/pkg/placestream/playbackgetplaybackserver.go +++ b/pkg/placestream/playbackgetplaybackserver.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,17 +18,22 @@ type PlaybackGetPlaybackServer_Output struct { Servers []string `json:"servers"` } +// RecordTypeID implements glex.Record. +func (t *PlaybackGetPlaybackServer_Output) RecordTypeID() string { + return "place.stream.playback.getPlaybackServer" +} + func (t *PlaybackGetPlaybackServer_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.playback.getPlaybackServer#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.playback.getPlaybackServer" + return glex.MarshalCBOR(w, t) } func (t *PlaybackGetPlaybackServer_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // PlaybackGetPlaybackServer calls the XRPC method "place.stream.playback.getPlaybackServer". @@ -36,13 +41,13 @@ func (t *PlaybackGetPlaybackServer_Output) UnmarshalCBOR(r io.Reader) error { // Get available playback servers for a livestream. // // stream: Identifier of the stream to get playback servers for -func PlaybackGetPlaybackServer(ctx context.Context, c glexrt.LexClient, stream string) (*PlaybackGetPlaybackServer_Output, error) { +func PlaybackGetPlaybackServer(ctx context.Context, c glex.LexClient, stream string) (*PlaybackGetPlaybackServer_Output, error) { var out PlaybackGetPlaybackServer_Output params := map[string]interface{}{} params["stream"] = stream - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.playback.getPlaybackServer", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.playback.getPlaybackServer", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/playbackgetvideoblob.go b/pkg/placestream/playbackgetvideoblob.go index d7302696..b93927b1 100644 --- a/pkg/placestream/playbackgetvideoblob.go +++ b/pkg/placestream/playbackgetvideoblob.go @@ -8,7 +8,7 @@ import ( "bytes" "context" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" ) // PlaybackGetVideoBlob calls the XRPC method "place.stream.playback.getVideoBlob". @@ -18,7 +18,7 @@ import ( // cid: BLAKE-3 BDASL CID of the requested blob. // did: DID of the account that owns the record this blob is being served for. Used for egress/usage accounting, not for access control — the blob is served purely by CID. // sid: Opaque playback session identifier, propagated unmodified from the media playlist that referenced this blob. Logged for view-count correlation; not used for access control. -func PlaybackGetVideoBlob(ctx context.Context, c glexrt.LexClient, cid string, did string, sid string) ([]byte, error) { +func PlaybackGetVideoBlob(ctx context.Context, c glex.LexClient, cid string, did string, sid string) ([]byte, error) { buf := new(bytes.Buffer) params := map[string]interface{}{} @@ -28,7 +28,7 @@ func PlaybackGetVideoBlob(ctx context.Context, c glexrt.LexClient, cid string, d params["cid"] = cid params["did"] = did - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.playback.getVideoBlob", params, nil, buf); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.playback.getVideoBlob", params, nil, buf); err != nil { return nil, err } return buf.Bytes(), nil diff --git a/pkg/placestream/playbackgetvideoplaylist.go b/pkg/placestream/playbackgetvideoplaylist.go index bc31f8f6..2993d299 100644 --- a/pkg/placestream/playbackgetvideoplaylist.go +++ b/pkg/placestream/playbackgetvideoplaylist.go @@ -8,7 +8,7 @@ import ( "bytes" "context" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" ) // PlaybackGetVideoPlaylist calls the XRPC method "place.stream.playback.getVideoPlaylist". @@ -20,7 +20,7 @@ import ( // start: Start time in milliseconds from the beginning of the video. Defaults to 0. For a place.stream.video record whose source is a place.stream.media.defs#sourceClip, this is in the clip's local timeline (0 == the clip's start). // track: Track ID (stringified u32 matching the MUXL container) for a single-track media playlist. Omit for the master playlist. // uri: AT-URI of the record to play back (e.g. at://did:plc:.../place.stream.video/). -func PlaybackGetVideoPlaylist(ctx context.Context, c glexrt.LexClient, end *int64, sid string, start *int64, track string, uri string) ([]byte, error) { +func PlaybackGetVideoPlaylist(ctx context.Context, c glex.LexClient, end *int64, sid string, start *int64, track string, uri string) ([]byte, error) { buf := new(bytes.Buffer) params := map[string]interface{}{} @@ -38,7 +38,7 @@ func PlaybackGetVideoPlaylist(ctx context.Context, c glexrt.LexClient, end *int6 } params["uri"] = uri - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.playback.getVideoPlaylist", params, nil, buf); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.playback.getVideoPlaylist", params, nil, buf); err != nil { return nil, err } return buf.Bytes(), nil diff --git a/pkg/placestream/playbackwhep.go b/pkg/placestream/playbackwhep.go index a0d1f265..0c0d64ef 100644 --- a/pkg/placestream/playbackwhep.go +++ b/pkg/placestream/playbackwhep.go @@ -9,7 +9,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" ) // PlaybackWhep calls the XRPC method "place.stream.playback.whep". @@ -18,14 +18,14 @@ import ( // // rendition: The rendition of the stream to play. // streamer: The DID of the streamer to play. -func PlaybackWhep(ctx context.Context, c glexrt.LexClient, rendition string, streamer string, input io.Reader) ([]byte, error) { +func PlaybackWhep(ctx context.Context, c glex.LexClient, rendition string, streamer string, input io.Reader) ([]byte, error) { buf := new(bytes.Buffer) params := map[string]interface{}{} params["rendition"] = rendition params["streamer"] = streamer - if err := c.LexDo(ctx, glexrt.Procedure, "*/*", "place.stream.playback.whep", params, input, buf); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "*/*", "place.stream.playback.whep", params, input, buf); err != nil { return nil, err } return buf.Bytes(), nil diff --git a/pkg/placestream/richtextfacet.go b/pkg/placestream/richtextfacet.go index ffa12c38..6831fd82 100644 --- a/pkg/placestream/richtextfacet.go +++ b/pkg/placestream/richtextfacet.go @@ -10,13 +10,13 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" appbsky "stream.place/streamplace/pkg/appbsky" ) func init() { - glexrt.RegisterType("place.stream.richtext.facet#main", &RichtextFacet{}) + glex.RegisterType("place.stream.richtext.facet#main", &RichtextFacet{}) } // Annotation of a sub-string within rich text in a livestream chat message. @@ -26,17 +26,20 @@ type RichtextFacet struct { Index appbsky.RichtextFacet_ByteSlice `json:"index"` } +// RecordTypeID implements glex.Record. +func (t *RichtextFacet) RecordTypeID() string { return "place.stream.richtext.facet" } + func (t *RichtextFacet) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.richtext.facet" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *RichtextFacet) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type RichtextFacet_Features_Elem struct { @@ -57,7 +60,7 @@ func (t *RichtextFacet_Features_Elem) MarshalJSON() ([]byte, error) { } func (t *RichtextFacet_Features_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -90,7 +93,7 @@ func (t *RichtextFacet_Features_Elem) MarshalCBOR(w io.Writer) error { } func (t *RichtextFacet_Features_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } diff --git a/pkg/placestream/richtextvideofacet.go b/pkg/placestream/richtextvideofacet.go index 95b94fb3..045ea4e6 100644 --- a/pkg/placestream/richtextvideofacet.go +++ b/pkg/placestream/richtextvideofacet.go @@ -10,13 +10,13 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" appbsky "stream.place/streamplace/pkg/appbsky" ) func init() { - glexrt.RegisterType("place.stream.richtext.videoFacet#main", &RichtextVideoFacet{}) + glex.RegisterType("place.stream.richtext.videoFacet#main", &RichtextVideoFacet{}) } // Annotation of a sub-string within rich text in a VOD description or comment. @@ -26,17 +26,20 @@ type RichtextVideoFacet struct { Index appbsky.RichtextFacet_ByteSlice `json:"index"` } +// RecordTypeID implements glex.Record. +func (t *RichtextVideoFacet) RecordTypeID() string { return "place.stream.richtext.videoFacet" } + func (t *RichtextVideoFacet) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.richtext.videoFacet" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *RichtextVideoFacet) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type RichtextVideoFacet_Features_Elem struct { @@ -57,7 +60,7 @@ func (t *RichtextVideoFacet_Features_Elem) MarshalJSON() ([]byte, error) { } func (t *RichtextVideoFacet_Features_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -90,7 +93,7 @@ func (t *RichtextVideoFacet_Features_Elem) MarshalCBOR(w io.Writer) error { } func (t *RichtextVideoFacet_Features_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } diff --git a/pkg/placestream/segment.go b/pkg/placestream/segment.go index 7be3cc27..7213a4da 100644 --- a/pkg/placestream/segment.go +++ b/pkg/placestream/segment.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.segment", &Segment{}) + glex.RegisterType("place.stream.segment", &Segment{}) } // Media file representing a segment of a livestream @@ -36,17 +36,20 @@ type Segment struct { Video []Segment_Video `json:"video,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Segment) RecordTypeID() string { return "place.stream.segment" } + func (t *Segment) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.segment" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *Segment) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Segment_Audio is a "audio" in the place.stream.segment schema. @@ -57,17 +60,20 @@ type Segment_Audio struct { Rate int64 `json:"rate"` } +// RecordTypeID implements glex.Record. +func (t *Segment_Audio) RecordTypeID() string { return "place.stream.segment#audio" } + func (t *Segment_Audio) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.segment" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.segment#audio" + return glex.MarshalCBOR(w, t) } func (t *Segment_Audio) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Segment_Framerate is a "framerate" in the place.stream.segment schema. @@ -77,37 +83,43 @@ type Segment_Framerate struct { Num int64 `json:"num"` } +// RecordTypeID implements glex.Record. +func (t *Segment_Framerate) RecordTypeID() string { return "place.stream.segment#framerate" } + func (t *Segment_Framerate) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.segment" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.segment#framerate" + return glex.MarshalCBOR(w, t) } func (t *Segment_Framerate) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Segment_SegmentView is a "segmentView" in the place.stream.segment schema. type Segment_SegmentView struct { - LexiconTypeID string `json:"$type"` - Cid string `json:"cid"` - Record *glexrt.LexiconTypeDecoder `json:"record"` + LexiconTypeID string `json:"$type"` + Cid string `json:"cid"` + Record *glex.LexiconTypeDecoder `json:"record"` } +// RecordTypeID implements glex.Record. +func (t *Segment_SegmentView) RecordTypeID() string { return "place.stream.segment#segmentView" } + func (t *Segment_SegmentView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.segment" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.segment#segmentView" + return glex.MarshalCBOR(w, t) } func (t *Segment_SegmentView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // Segment_Video is a "video" in the place.stream.segment schema. @@ -120,15 +132,18 @@ type Segment_Video struct { Width int64 `json:"width"` } +// RecordTypeID implements glex.Record. +func (t *Segment_Video) RecordTypeID() string { return "place.stream.segment#video" } + func (t *Segment_Video) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.segment" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.segment#video" + return glex.MarshalCBOR(w, t) } func (t *Segment_Video) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/servercreatewebhook.go b/pkg/placestream/servercreatewebhook.go index b0a598ff..bda585fc 100644 --- a/pkg/placestream/servercreatewebhook.go +++ b/pkg/placestream/servercreatewebhook.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -34,17 +34,20 @@ type ServerCreateWebhook_Input struct { Url string `json:"url"` } +// RecordTypeID implements glex.Record. +func (t *ServerCreateWebhook_Input) RecordTypeID() string { return "place.stream.server.createWebhook" } + func (t *ServerCreateWebhook_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.createWebhook#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.createWebhook" + return glex.MarshalCBOR(w, t) } func (t *ServerCreateWebhook_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ServerCreateWebhook_Output struct { @@ -52,26 +55,31 @@ type ServerCreateWebhook_Output struct { Webhook ServerDefs_Webhook `json:"webhook"` } +// RecordTypeID implements glex.Record. +func (t *ServerCreateWebhook_Output) RecordTypeID() string { + return "place.stream.server.createWebhook" +} + func (t *ServerCreateWebhook_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.createWebhook#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.createWebhook" + return glex.MarshalCBOR(w, t) } func (t *ServerCreateWebhook_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ServerCreateWebhook calls the XRPC method "place.stream.server.createWebhook". // // Create a new webhook for receiving Streamplace events. -func ServerCreateWebhook(ctx context.Context, c glexrt.LexClient, input *ServerCreateWebhook_Input) (*ServerCreateWebhook_Output, error) { +func ServerCreateWebhook(ctx context.Context, c glex.LexClient, input *ServerCreateWebhook_Input) (*ServerCreateWebhook_Output, error) { var out ServerCreateWebhook_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.server.createWebhook", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.server.createWebhook", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/serverdefs.go b/pkg/placestream/serverdefs.go index a3fe9550..f8521a2c 100644 --- a/pkg/placestream/serverdefs.go +++ b/pkg/placestream/serverdefs.go @@ -7,7 +7,7 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -20,17 +20,20 @@ type ServerDefs_RewriteRule struct { To string `json:"to"` } +// RecordTypeID implements glex.Record. +func (t *ServerDefs_RewriteRule) RecordTypeID() string { return "place.stream.server.defs#rewriteRule" } + func (t *ServerDefs_RewriteRule) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.defs#rewriteRule" + return glex.MarshalCBOR(w, t) } func (t *ServerDefs_RewriteRule) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ServerDefs_Storage is a "storage" in the place.stream.server.defs schema. @@ -44,17 +47,20 @@ type ServerDefs_Storage struct { Url string `json:"url"` } +// RecordTypeID implements glex.Record. +func (t *ServerDefs_Storage) RecordTypeID() string { return "place.stream.server.defs#storage" } + func (t *ServerDefs_Storage) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.defs#storage" + return glex.MarshalCBOR(w, t) } func (t *ServerDefs_Storage) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ServerDefs_Webhook is a "webhook" in the place.stream.server.defs schema. @@ -92,15 +98,18 @@ type ServerDefs_Webhook struct { Url string `json:"url"` } +// RecordTypeID implements glex.Record. +func (t *ServerDefs_Webhook) RecordTypeID() string { return "place.stream.server.defs#webhook" } + func (t *ServerDefs_Webhook) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.defs#webhook" + return glex.MarshalCBOR(w, t) } func (t *ServerDefs_Webhook) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/serverdeletestorage.go b/pkg/placestream/serverdeletestorage.go index 3ee25802..44b03335 100644 --- a/pkg/placestream/serverdeletestorage.go +++ b/pkg/placestream/serverdeletestorage.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -17,26 +17,31 @@ type ServerDeleteStorage_Output struct { Success bool `json:"success"` } +// RecordTypeID implements glex.Record. +func (t *ServerDeleteStorage_Output) RecordTypeID() string { + return "place.stream.server.deleteStorage" +} + func (t *ServerDeleteStorage_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.deleteStorage#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.deleteStorage" + return glex.MarshalCBOR(w, t) } func (t *ServerDeleteStorage_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ServerDeleteStorage calls the XRPC method "place.stream.server.deleteStorage". // // Delete S3 storage configuration. -func ServerDeleteStorage(ctx context.Context, c glexrt.LexClient) (*ServerDeleteStorage_Output, error) { +func ServerDeleteStorage(ctx context.Context, c glex.LexClient) (*ServerDeleteStorage_Output, error) { var out ServerDeleteStorage_Output - if err := c.LexDo(ctx, glexrt.Procedure, "", "place.stream.server.deleteStorage", nil, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "", "place.stream.server.deleteStorage", nil, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/serverdeletewebhook.go b/pkg/placestream/serverdeletewebhook.go index 77446804..782a459b 100644 --- a/pkg/placestream/serverdeletewebhook.go +++ b/pkg/placestream/serverdeletewebhook.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,17 +18,20 @@ type ServerDeleteWebhook_Input struct { Id string `json:"id"` } +// RecordTypeID implements glex.Record. +func (t *ServerDeleteWebhook_Input) RecordTypeID() string { return "place.stream.server.deleteWebhook" } + func (t *ServerDeleteWebhook_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.deleteWebhook#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.deleteWebhook" + return glex.MarshalCBOR(w, t) } func (t *ServerDeleteWebhook_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ServerDeleteWebhook_Output struct { @@ -37,26 +40,31 @@ type ServerDeleteWebhook_Output struct { Success bool `json:"success"` } +// RecordTypeID implements glex.Record. +func (t *ServerDeleteWebhook_Output) RecordTypeID() string { + return "place.stream.server.deleteWebhook" +} + func (t *ServerDeleteWebhook_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.deleteWebhook#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.deleteWebhook" + return glex.MarshalCBOR(w, t) } func (t *ServerDeleteWebhook_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ServerDeleteWebhook calls the XRPC method "place.stream.server.deleteWebhook". // // Delete an existing webhook. -func ServerDeleteWebhook(ctx context.Context, c glexrt.LexClient, input *ServerDeleteWebhook_Input) (*ServerDeleteWebhook_Output, error) { +func ServerDeleteWebhook(ctx context.Context, c glex.LexClient, input *ServerDeleteWebhook_Input) (*ServerDeleteWebhook_Output, error) { var out ServerDeleteWebhook_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.server.deleteWebhook", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.server.deleteWebhook", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/servergetservertime.go b/pkg/placestream/servergetservertime.go index ee5c2468..33a8f0a1 100644 --- a/pkg/placestream/servergetservertime.go +++ b/pkg/placestream/servergetservertime.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,26 +18,31 @@ type ServerGetServerTime_Output struct { ServerTime string `json:"serverTime"` } +// RecordTypeID implements glex.Record. +func (t *ServerGetServerTime_Output) RecordTypeID() string { + return "place.stream.server.getServerTime" +} + func (t *ServerGetServerTime_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.getServerTime#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.getServerTime" + return glex.MarshalCBOR(w, t) } func (t *ServerGetServerTime_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ServerGetServerTime calls the XRPC method "place.stream.server.getServerTime". // // Get the current server time for client clock synchronization -func ServerGetServerTime(ctx context.Context, c glexrt.LexClient) (*ServerGetServerTime_Output, error) { +func ServerGetServerTime(ctx context.Context, c glex.LexClient) (*ServerGetServerTime_Output, error) { var out ServerGetServerTime_Output - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.server.getServerTime", nil, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.server.getServerTime", nil, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/servergetstorage.go b/pkg/placestream/servergetstorage.go index 41be17f6..a2a131d3 100644 --- a/pkg/placestream/servergetstorage.go +++ b/pkg/placestream/servergetstorage.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -17,26 +17,29 @@ type ServerGetStorage_Output struct { Storage *ServerDefs_Storage `json:"storage,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ServerGetStorage_Output) RecordTypeID() string { return "place.stream.server.getStorage" } + func (t *ServerGetStorage_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.getStorage#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.getStorage" + return glex.MarshalCBOR(w, t) } func (t *ServerGetStorage_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ServerGetStorage calls the XRPC method "place.stream.server.getStorage". // // Get S3 storage configuration (with masked secret key). -func ServerGetStorage(ctx context.Context, c glexrt.LexClient) (*ServerGetStorage_Output, error) { +func ServerGetStorage(ctx context.Context, c glex.LexClient) (*ServerGetStorage_Output, error) { var out ServerGetStorage_Output - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.server.getStorage", nil, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.server.getStorage", nil, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/servergetwebhook.go b/pkg/placestream/servergetwebhook.go index 8681c7e2..9d9aec84 100644 --- a/pkg/placestream/servergetwebhook.go +++ b/pkg/placestream/servergetwebhook.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -17,17 +17,20 @@ type ServerGetWebhook_Output struct { Webhook ServerDefs_Webhook `json:"webhook"` } +// RecordTypeID implements glex.Record. +func (t *ServerGetWebhook_Output) RecordTypeID() string { return "place.stream.server.getWebhook" } + func (t *ServerGetWebhook_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.getWebhook#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.getWebhook" + return glex.MarshalCBOR(w, t) } func (t *ServerGetWebhook_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ServerGetWebhook calls the XRPC method "place.stream.server.getWebhook". @@ -35,13 +38,13 @@ func (t *ServerGetWebhook_Output) UnmarshalCBOR(r io.Reader) error { // Get details for a specific webhook. // // id: The ID of the webhook to retrieve. -func ServerGetWebhook(ctx context.Context, c glexrt.LexClient, id string) (*ServerGetWebhook_Output, error) { +func ServerGetWebhook(ctx context.Context, c glex.LexClient, id string) (*ServerGetWebhook_Output, error) { var out ServerGetWebhook_Output params := map[string]interface{}{} params["id"] = id - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.server.getWebhook", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.server.getWebhook", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/serverlistwebhooks.go b/pkg/placestream/serverlistwebhooks.go index 3ae967b6..a49b6f3b 100644 --- a/pkg/placestream/serverlistwebhooks.go +++ b/pkg/placestream/serverlistwebhooks.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -19,17 +19,20 @@ type ServerListWebhooks_Output struct { Webhooks []ServerDefs_Webhook `json:"webhooks"` } +// RecordTypeID implements glex.Record. +func (t *ServerListWebhooks_Output) RecordTypeID() string { return "place.stream.server.listWebhooks" } + func (t *ServerListWebhooks_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.listWebhooks#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.listWebhooks" + return glex.MarshalCBOR(w, t) } func (t *ServerListWebhooks_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ServerListWebhooks calls the XRPC method "place.stream.server.listWebhooks". @@ -40,7 +43,7 @@ func (t *ServerListWebhooks_Output) UnmarshalCBOR(r io.Reader) error { // cursor: An optional cursor for pagination. // event: Filter webhooks that handle this event type. // limit: The number of webhooks to return. -func ServerListWebhooks(ctx context.Context, c glexrt.LexClient, active *bool, cursor string, event string, limit *int64) (*ServerListWebhooks_Output, error) { +func ServerListWebhooks(ctx context.Context, c glex.LexClient, active *bool, cursor string, event string, limit *int64) (*ServerListWebhooks_Output, error) { var out ServerListWebhooks_Output params := map[string]interface{}{} @@ -57,7 +60,7 @@ func ServerListWebhooks(ctx context.Context, c glexrt.LexClient, active *bool, c params["limit"] = *limit } - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.server.listWebhooks", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.server.listWebhooks", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/serversettings.go b/pkg/placestream/serversettings.go index 138db26a..db204590 100644 --- a/pkg/placestream/serversettings.go +++ b/pkg/placestream/serversettings.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.server.settings", &ServerSettings{}) + glex.RegisterType("place.stream.server.settings", &ServerSettings{}) } // Record containing user settings for a particular Streamplace node @@ -24,15 +24,18 @@ type ServerSettings struct { LivestreamRecording *bool `json:"livestreamRecording,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ServerSettings) RecordTypeID() string { return "place.stream.server.settings" } + func (t *ServerSettings) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.server.settings" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *ServerSettings) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/serverupdatewebhook.go b/pkg/placestream/serverupdatewebhook.go index 127e1b28..5f1fb7c8 100644 --- a/pkg/placestream/serverupdatewebhook.go +++ b/pkg/placestream/serverupdatewebhook.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -36,17 +36,20 @@ type ServerUpdateWebhook_Input struct { Url *string `json:"url,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ServerUpdateWebhook_Input) RecordTypeID() string { return "place.stream.server.updateWebhook" } + func (t *ServerUpdateWebhook_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.updateWebhook#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.updateWebhook" + return glex.MarshalCBOR(w, t) } func (t *ServerUpdateWebhook_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ServerUpdateWebhook_Output struct { @@ -54,26 +57,31 @@ type ServerUpdateWebhook_Output struct { Webhook ServerDefs_Webhook `json:"webhook"` } +// RecordTypeID implements glex.Record. +func (t *ServerUpdateWebhook_Output) RecordTypeID() string { + return "place.stream.server.updateWebhook" +} + func (t *ServerUpdateWebhook_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.updateWebhook#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.updateWebhook" + return glex.MarshalCBOR(w, t) } func (t *ServerUpdateWebhook_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ServerUpdateWebhook calls the XRPC method "place.stream.server.updateWebhook". // // Update an existing webhook configuration. -func ServerUpdateWebhook(ctx context.Context, c glexrt.LexClient, input *ServerUpdateWebhook_Input) (*ServerUpdateWebhook_Output, error) { +func ServerUpdateWebhook(ctx context.Context, c glex.LexClient, input *ServerUpdateWebhook_Input) (*ServerUpdateWebhook_Output, error) { var out ServerUpdateWebhook_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.server.updateWebhook", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.server.updateWebhook", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/serverupsertstorage.go b/pkg/placestream/serverupsertstorage.go index f559fd55..aa38917d 100644 --- a/pkg/placestream/serverupsertstorage.go +++ b/pkg/placestream/serverupsertstorage.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -20,17 +20,20 @@ type ServerUpsertStorage_Input struct { Url *string `json:"url,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *ServerUpsertStorage_Input) RecordTypeID() string { return "place.stream.server.upsertStorage" } + func (t *ServerUpsertStorage_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.upsertStorage#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.upsertStorage" + return glex.MarshalCBOR(w, t) } func (t *ServerUpsertStorage_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type ServerUpsertStorage_Output struct { @@ -38,26 +41,31 @@ type ServerUpsertStorage_Output struct { Storage ServerDefs_Storage `json:"storage"` } +// RecordTypeID implements glex.Record. +func (t *ServerUpsertStorage_Output) RecordTypeID() string { + return "place.stream.server.upsertStorage" +} + func (t *ServerUpsertStorage_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.server.upsertStorage#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.server.upsertStorage" + return glex.MarshalCBOR(w, t) } func (t *ServerUpsertStorage_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // ServerUpsertStorage calls the XRPC method "place.stream.server.upsertStorage". // // Create or update S3 storage configuration for backups. -func ServerUpsertStorage(ctx context.Context, c glexrt.LexClient, input *ServerUpsertStorage_Input) (*ServerUpsertStorage_Output, error) { +func ServerUpsertStorage(ctx context.Context, c glex.LexClient, input *ServerUpsertStorage_Input) (*ServerUpsertStorage_Output, error) { var out ServerUpsertStorage_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.server.upsertStorage", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.server.upsertStorage", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/video.go b/pkg/placestream/video.go index 0bb70552..b642679f 100644 --- a/pkg/placestream/video.go +++ b/pkg/placestream/video.go @@ -10,13 +10,13 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) func init() { - glexrt.RegisterType("place.stream.video", &Video{}) + glex.RegisterType("place.stream.video", &Video{}) } // Some audiovisual content. @@ -43,22 +43,25 @@ type Video struct { // tags: Freeform tags for this stream. Each tag must be alphanumeric (a-z, A-Z, 0-9) plus colon. Tags with colons indicate a specific tag group (e.g. 'lang:en' indicates the stream's primary language). Tags []string `json:"tags,omitempty"` // thumb: Thumbnail image for the video. - Thumb *glexrt.Blob `json:"thumb,omitempty"` + Thumb *glex.Blob `json:"thumb,omitempty"` // title: Title of the video referenced by this record Title string `json:"title"` } +// RecordTypeID implements glex.Record. +func (t *Video) RecordTypeID() string { return "place.stream.video" } + func (t *Video) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.video" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *Video) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // The game or activity in the video. @@ -80,7 +83,7 @@ func (t *Video_Activity) MarshalJSON() ([]byte, error) { } func (t *Video_Activity) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -113,7 +116,7 @@ func (t *Video_Activity) MarshalCBOR(w io.Writer) error { } func (t *Video_Activity) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -143,7 +146,7 @@ func (t *Video_Connections_Elem) MarshalJSON() ([]byte, error) { } func (t *Video_Connections_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -170,7 +173,7 @@ func (t *Video_Connections_Elem) MarshalCBOR(w io.Writer) error { } func (t *Video_Connections_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -203,7 +206,7 @@ func (t *Video_Source) MarshalJSON() ([]byte, error) { } func (t *Video_Source) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -236,7 +239,7 @@ func (t *Video_Source) MarshalCBOR(w io.Writer) error { } func (t *Video_Source) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -259,15 +262,18 @@ type Video_Connection struct { Ref *comatproto.RepoStrongRef `json:"ref,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *Video_Connection) RecordTypeID() string { return "place.stream.video#connection" } + func (t *Video_Connection) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.video" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.video#connection" + return glex.MarshalCBOR(w, t) } func (t *Video_Connection) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/vodcomment.go b/pkg/placestream/vodcomment.go index f6f4ae20..37034e59 100644 --- a/pkg/placestream/vodcomment.go +++ b/pkg/placestream/vodcomment.go @@ -7,13 +7,13 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" comatproto "stream.place/streamplace/pkg/comatproto" ) func init() { - glexrt.RegisterType("place.stream.vod.comment", &VodComment{}) + glex.RegisterType("place.stream.vod.comment", &VodComment{}) } // Record containing a comment on a VOD. @@ -30,17 +30,20 @@ type VodComment struct { Video string `json:"video"` } +// RecordTypeID implements glex.Record. +func (t *VodComment) RecordTypeID() string { return "place.stream.vod.comment" } + func (t *VodComment) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.vod.comment" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *VodComment) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // VodComment_ReplyRef is a "replyRef" in the place.stream.vod.comment schema. @@ -50,15 +53,18 @@ type VodComment_ReplyRef struct { Root comatproto.RepoStrongRef `json:"root"` } +// RecordTypeID implements glex.Record. +func (t *VodComment_ReplyRef) RecordTypeID() string { return "place.stream.vod.comment#replyRef" } + func (t *VodComment_ReplyRef) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.comment" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.comment#replyRef" + return glex.MarshalCBOR(w, t) } func (t *VodComment_ReplyRef) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/vodcreatedraft.go b/pkg/placestream/vodcreatedraft.go index 30e57cdd..06e98862 100644 --- a/pkg/placestream/vodcreatedraft.go +++ b/pkg/placestream/vodcreatedraft.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -16,17 +16,20 @@ type VodCreateDraft_Input struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *VodCreateDraft_Input) RecordTypeID() string { return "place.stream.vod.createDraft" } + func (t *VodCreateDraft_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.createDraft#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.createDraft" + return glex.MarshalCBOR(w, t) } func (t *VodCreateDraft_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type VodCreateDraft_Output struct { @@ -35,26 +38,29 @@ type VodCreateDraft_Output struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *VodCreateDraft_Output) RecordTypeID() string { return "place.stream.vod.createDraft" } + func (t *VodCreateDraft_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.createDraft#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.createDraft" + return glex.MarshalCBOR(w, t) } func (t *VodCreateDraft_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // VodCreateDraft calls the XRPC method "place.stream.vod.createDraft". // // Create an empty draft VOD in the 'processing' state. The draft is the durable anchor for an upload: the client creates it first, then passes its URI to place.stream.media.createUpload so the upload's processing fills this draft. Lets the user start editing metadata while the upload runs, and supports re-upload (a failed upload leaves the draft intact; a new createUpload with the same draftUri re-points it). -func VodCreateDraft(ctx context.Context, c glexrt.LexClient, input *VodCreateDraft_Input) (*VodCreateDraft_Output, error) { +func VodCreateDraft(ctx context.Context, c glex.LexClient, input *VodCreateDraft_Input) (*VodCreateDraft_Output, error) { var out VodCreateDraft_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.vod.createDraft", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.vod.createDraft", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/voddefs.go b/pkg/placestream/voddefs.go index 7b770e74..2791c6ce 100644 --- a/pkg/placestream/voddefs.go +++ b/pkg/placestream/voddefs.go @@ -10,7 +10,7 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" appbsky "stream.place/streamplace/pkg/appbsky" ) @@ -22,24 +22,27 @@ type VodDefs_CommentView struct { Cid string `json:"cid"` IndexedAt string `json:"indexedAt"` // likeCount: Number of likes on this comment. - LikeCount int64 `json:"likeCount"` - Record *glexrt.LexiconTypeDecoder `json:"record"` + LikeCount int64 `json:"likeCount"` + Record *glex.LexiconTypeDecoder `json:"record"` // replyTo: The parent comment this one replies to, if any. A non-recursive view (it carries no replyTo of its own), so the thread is flattened to a single hop; walk `record.reply` to follow the chain further. ReplyTo *VodDefs_CommentView_ReplyTo `json:"replyTo,omitempty"` Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *VodDefs_CommentView) RecordTypeID() string { return "place.stream.vod.defs#commentView" } + func (t *VodDefs_CommentView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.defs#commentView" + return glex.MarshalCBOR(w, t) } func (t *VodDefs_CommentView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // The parent comment this one replies to, if any. A non-recursive view (it carries no replyTo of its own), so the thread is flattened to a single hop; walk `record.reply` to follow the chain further. @@ -56,7 +59,7 @@ func (t *VodDefs_CommentView_ReplyTo) MarshalJSON() ([]byte, error) { } func (t *VodDefs_CommentView_ReplyTo) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -83,7 +86,7 @@ func (t *VodDefs_CommentView_ReplyTo) MarshalCBOR(w io.Writer) error { } func (t *VodDefs_CommentView_ReplyTo) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -106,9 +109,14 @@ type VodDefs_CommentViewBasic struct { Cid string `json:"cid"` IndexedAt string `json:"indexedAt"` // likeCount: Number of likes on this comment. - LikeCount int64 `json:"likeCount"` - Record *glexrt.LexiconTypeDecoder `json:"record"` - Uri string `json:"uri"` + LikeCount int64 `json:"likeCount"` + Record *glex.LexiconTypeDecoder `json:"record"` + Uri string `json:"uri"` +} + +// RecordTypeID implements glex.Record. +func (t *VodDefs_CommentViewBasic) RecordTypeID() string { + return "place.stream.vod.defs#commentViewBasic" } func (t *VodDefs_CommentViewBasic) MarshalCBOR(w io.Writer) error { @@ -116,10 +124,10 @@ func (t *VodDefs_CommentViewBasic) MarshalCBOR(w io.Writer) error { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.defs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.defs#commentViewBasic" + return glex.MarshalCBOR(w, t) } func (t *VodDefs_CommentViewBasic) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/voddeletedraft.go b/pkg/placestream/voddeletedraft.go index f7891218..d003e6ea 100644 --- a/pkg/placestream/voddeletedraft.go +++ b/pkg/placestream/voddeletedraft.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,43 +18,49 @@ type VodDeleteDraft_Input struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *VodDeleteDraft_Input) RecordTypeID() string { return "place.stream.vod.deleteDraft" } + func (t *VodDeleteDraft_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.deleteDraft#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.deleteDraft" + return glex.MarshalCBOR(w, t) } func (t *VodDeleteDraft_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type VodDeleteDraft_Output struct { LexiconTypeID string `json:"$type"` } +// RecordTypeID implements glex.Record. +func (t *VodDeleteDraft_Output) RecordTypeID() string { return "place.stream.vod.deleteDraft" } + func (t *VodDeleteDraft_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.deleteDraft#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.deleteDraft" + return glex.MarshalCBOR(w, t) } func (t *VodDeleteDraft_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // VodDeleteDraft calls the XRPC method "place.stream.vod.deleteDraft". // // Discard a draft VOD. The processed content blob is not deleted (it may be referenced elsewhere). Only the draft record is removed. -func VodDeleteDraft(ctx context.Context, c glexrt.LexClient, input *VodDeleteDraft_Input) (*VodDeleteDraft_Output, error) { +func VodDeleteDraft(ctx context.Context, c glex.LexClient, input *VodDeleteDraft_Input) (*VodDeleteDraft_Output, error) { var out VodDeleteDraft_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.vod.deleteDraft", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.vod.deleteDraft", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/voddraftdefs.go b/pkg/placestream/voddraftdefs.go index a4de264b..3d952fa3 100644 --- a/pkg/placestream/voddraftdefs.go +++ b/pkg/placestream/voddraftdefs.go @@ -7,7 +7,7 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -19,20 +19,23 @@ type VodDraftDefs_DraftView struct { // cid: CID (sha256 of CBOR record bytes, base32) of the draft record. Cid string `json:"cid"` // record: The place.stream.vod.draftVideo record body. Typed as unknown (matching commentView/livestreamView/videoView) because the @atproto/api client validator cannot validate a ref to a record-type lexicon. - Record *glexrt.LexiconTypeDecoder `json:"record"` + Record *glex.LexiconTypeDecoder `json:"record"` // uri: The ats:// URI of the draft record. Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *VodDraftDefs_DraftView) RecordTypeID() string { return "place.stream.vod.draftDefs#draftView" } + func (t *VodDraftDefs_DraftView) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.draftDefs" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.draftDefs#draftView" + return glex.MarshalCBOR(w, t) } func (t *VodDraftDefs_DraftView) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/voddraftvideo.go b/pkg/placestream/voddraftvideo.go index e6b6f85b..6963ee2e 100644 --- a/pkg/placestream/voddraftvideo.go +++ b/pkg/placestream/voddraftvideo.go @@ -10,12 +10,12 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.vod.draftVideo", &VodDraftVideo{}) + glex.RegisterType("place.stream.vod.draftVideo", &VodDraftVideo{}) } // A draft VOD: pre-publication video metadata and processing state. Modeled as a permissioned-data-style record (CBOR-serialized, addressed by an ats:// URI) stored in statedb until the permissioned-data spec ships (bluesky-social/proposals PR #94, the 0016-permissioned-data proposal). Publishing promotes it to a public place.stream.video record. @@ -43,22 +43,25 @@ type VodDraftVideo struct { // tags: Freeform tags (same rules as place.stream.video). Tags []string `json:"tags,omitempty"` // thumb: Thumbnail image. Generated by the server at publish time if absent. - Thumb *glexrt.Blob `json:"thumb,omitempty"` + Thumb *glex.Blob `json:"thumb,omitempty"` // title: Title of the video. May be a placeholder while processing; the user edits before publishing. Title string `json:"title"` } +// RecordTypeID implements glex.Record. +func (t *VodDraftVideo) RecordTypeID() string { return "place.stream.vod.draftVideo" } + func (t *VodDraftVideo) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.vod.draftVideo" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *VodDraftVideo) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // The game or activity in the video. @@ -80,7 +83,7 @@ func (t *VodDraftVideo_Activity) MarshalJSON() ([]byte, error) { } func (t *VodDraftVideo_Activity) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -113,7 +116,7 @@ func (t *VodDraftVideo_Activity) MarshalCBOR(w io.Writer) error { } func (t *VodDraftVideo_Activity) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -143,7 +146,7 @@ func (t *VodDraftVideo_Connections_Elem) MarshalJSON() ([]byte, error) { } func (t *VodDraftVideo_Connections_Elem) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -170,7 +173,7 @@ func (t *VodDraftVideo_Connections_Elem) MarshalCBOR(w io.Writer) error { } func (t *VodDraftVideo_Connections_Elem) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -203,7 +206,7 @@ func (t *VodDraftVideo_Source) MarshalJSON() ([]byte, error) { } func (t *VodDraftVideo_Source) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -236,7 +239,7 @@ func (t *VodDraftVideo_Source) MarshalCBOR(w io.Writer) error { } func (t *VodDraftVideo_Source) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } diff --git a/pkg/placestream/vodgate.go b/pkg/placestream/vodgate.go index 9ec475e4..fec86dd1 100644 --- a/pkg/placestream/vodgate.go +++ b/pkg/placestream/vodgate.go @@ -7,12 +7,12 @@ package placestream import ( "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) func init() { - glexrt.RegisterType("place.stream.vod.gate", &VodGate{}) + glex.RegisterType("place.stream.vod.gate", &VodGate{}) } // Record defining a single gated VOD comment. @@ -22,15 +22,18 @@ type VodGate struct { HiddenComment string `json:"hiddenComment"` } +// RecordTypeID implements glex.Record. +func (t *VodGate) RecordTypeID() string { return "place.stream.vod.gate" } + func (t *VodGate) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } t.LexiconTypeID = "place.stream.vod.gate" - return glexrt.MarshalCBOR(w, t) + return glex.MarshalCBOR(w, t) } func (t *VodGate) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } diff --git a/pkg/placestream/vodgetcomments.go b/pkg/placestream/vodgetcomments.go index c21c5e58..7a94b209 100644 --- a/pkg/placestream/vodgetcomments.go +++ b/pkg/placestream/vodgetcomments.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,17 +18,20 @@ type VodGetComments_Output struct { Cursor *string `json:"cursor,omitempty"` } +// RecordTypeID implements glex.Record. +func (t *VodGetComments_Output) RecordTypeID() string { return "place.stream.vod.getComments" } + func (t *VodGetComments_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.getComments#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.getComments" + return glex.MarshalCBOR(w, t) } func (t *VodGetComments_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // VodGetComments calls the XRPC method "place.stream.vod.getComments". @@ -38,7 +41,7 @@ func (t *VodGetComments_Output) UnmarshalCBOR(r io.Reader) error { // cursor: Optional pagination cursor. // limit: Maximum number of comments to return. // video: AT-URI of the place.stream.video record. -func VodGetComments(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64, video string) (*VodGetComments_Output, error) { +func VodGetComments(ctx context.Context, c glex.LexClient, cursor string, limit *int64, video string) (*VodGetComments_Output, error) { var out VodGetComments_Output params := map[string]interface{}{} @@ -50,7 +53,7 @@ func VodGetComments(ctx context.Context, c glexrt.LexClient, cursor string, limi } params["video"] = video - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.vod.getComments", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.vod.getComments", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/vodgetdraft.go b/pkg/placestream/vodgetdraft.go index d3243404..4c7fb8d0 100644 --- a/pkg/placestream/vodgetdraft.go +++ b/pkg/placestream/vodgetdraft.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -17,17 +17,20 @@ type VodGetDraft_Output struct { Draft VodDraftDefs_DraftView `json:"draft"` } +// RecordTypeID implements glex.Record. +func (t *VodGetDraft_Output) RecordTypeID() string { return "place.stream.vod.getDraft" } + func (t *VodGetDraft_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.getDraft#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.getDraft" + return glex.MarshalCBOR(w, t) } func (t *VodGetDraft_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // VodGetDraft calls the XRPC method "place.stream.vod.getDraft". @@ -35,13 +38,13 @@ func (t *VodGetDraft_Output) UnmarshalCBOR(r io.Reader) error { // Get a single draft VOD by its ats:// URI. Only accessible by the draft's author. // // uri: The ats:// URI of the draft record. -func VodGetDraft(ctx context.Context, c glexrt.LexClient, uri string) (*VodGetDraft_Output, error) { +func VodGetDraft(ctx context.Context, c glex.LexClient, uri string) (*VodGetDraft_Output, error) { var out VodGetDraft_Output params := map[string]interface{}{} params["uri"] = uri - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.vod.getDraft", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.vod.getDraft", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/vodlistdrafts.go b/pkg/placestream/vodlistdrafts.go index c0fff19f..b9b6b8e5 100644 --- a/pkg/placestream/vodlistdrafts.go +++ b/pkg/placestream/vodlistdrafts.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -19,17 +19,20 @@ type VodListDrafts_Output struct { Drafts []VodDraftDefs_DraftView `json:"drafts"` } +// RecordTypeID implements glex.Record. +func (t *VodListDrafts_Output) RecordTypeID() string { return "place.stream.vod.listDrafts" } + func (t *VodListDrafts_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.listDrafts#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.listDrafts" + return glex.MarshalCBOR(w, t) } func (t *VodListDrafts_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // VodListDrafts calls the XRPC method "place.stream.vod.listDrafts". @@ -38,7 +41,7 @@ func (t *VodListDrafts_Output) UnmarshalCBOR(r io.Reader) error { // // cursor: Pagination cursor from a previous response. // limit: Number of drafts to return. -func VodListDrafts(ctx context.Context, c glexrt.LexClient, cursor string, limit *int64) (*VodListDrafts_Output, error) { +func VodListDrafts(ctx context.Context, c glex.LexClient, cursor string, limit *int64) (*VodListDrafts_Output, error) { var out VodListDrafts_Output params := map[string]interface{}{} @@ -49,7 +52,7 @@ func VodListDrafts(ctx context.Context, c glexrt.LexClient, cursor string, limit params["limit"] = *limit } - if err := c.LexDo(ctx, glexrt.Query, "", "place.stream.vod.listDrafts", params, nil, &out); err != nil { + if err := c.LexDo(ctx, glex.Query, "", "place.stream.vod.listDrafts", params, nil, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/vodpublishdraft.go b/pkg/placestream/vodpublishdraft.go index 5107b00b..48c53950 100644 --- a/pkg/placestream/vodpublishdraft.go +++ b/pkg/placestream/vodpublishdraft.go @@ -8,7 +8,7 @@ import ( "context" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -18,17 +18,20 @@ type VodPublishDraft_Input struct { Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *VodPublishDraft_Input) RecordTypeID() string { return "place.stream.vod.publishDraft" } + func (t *VodPublishDraft_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.publishDraft#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.publishDraft" + return glex.MarshalCBOR(w, t) } func (t *VodPublishDraft_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type VodPublishDraft_Output struct { @@ -39,26 +42,29 @@ type VodPublishDraft_Output struct { VideoUri string `json:"videoUri"` } +// RecordTypeID implements glex.Record. +func (t *VodPublishDraft_Output) RecordTypeID() string { return "place.stream.vod.publishDraft" } + func (t *VodPublishDraft_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.publishDraft#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.publishDraft" + return glex.MarshalCBOR(w, t) } func (t *VodPublishDraft_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // VodPublishDraft calls the XRPC method "place.stream.vod.publishDraft". // // Promote a ready draft VOD to a public place.stream.video record. The server carries over source and durationMs from the draft, backfills a generated thumbnail if the draft has none, writes the video record via putRecord, then deletes the draft. -func VodPublishDraft(ctx context.Context, c glexrt.LexClient, input *VodPublishDraft_Input) (*VodPublishDraft_Output, error) { +func VodPublishDraft(ctx context.Context, c glex.LexClient, input *VodPublishDraft_Input) (*VodPublishDraft_Output, error) { var out VodPublishDraft_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.vod.publishDraft", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.vod.publishDraft", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/placestream/vodupdatedraft.go b/pkg/placestream/vodupdatedraft.go index 8db5d1bd..aa55eb95 100644 --- a/pkg/placestream/vodupdatedraft.go +++ b/pkg/placestream/vodupdatedraft.go @@ -11,7 +11,7 @@ import ( "fmt" "io" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" cbg "github.com/whyrusleeping/cbor-gen" ) @@ -23,23 +23,26 @@ type VodUpdateDraft_Input struct { Description *string `json:"description,omitempty"` DescriptionFacets []RichtextVideoFacet `json:"descriptionFacets,omitempty"` Tags []string `json:"tags,omitempty"` - Thumb *glexrt.Blob `json:"thumb,omitempty"` + Thumb *glex.Blob `json:"thumb,omitempty"` Title *string `json:"title,omitempty"` // uri: The ats:// URI of the draft to update. Uri string `json:"uri"` } +// RecordTypeID implements glex.Record. +func (t *VodUpdateDraft_Input) RecordTypeID() string { return "place.stream.vod.updateDraft" } + func (t *VodUpdateDraft_Input) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.updateDraft#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.updateDraft" + return glex.MarshalCBOR(w, t) } func (t *VodUpdateDraft_Input) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } type VodUpdateDraft_Input_Activity struct { @@ -60,7 +63,7 @@ func (t *VodUpdateDraft_Input_Activity) MarshalJSON() ([]byte, error) { } func (t *VodUpdateDraft_Input_Activity) UnmarshalJSON(b []byte) error { - typ, err := glexrt.TypeExtract(b) + typ, err := glex.TypeExtract(b) if err != nil { return err } @@ -93,7 +96,7 @@ func (t *VodUpdateDraft_Input_Activity) MarshalCBOR(w io.Writer) error { } func (t *VodUpdateDraft_Input_Activity) UnmarshalCBOR(r io.Reader) error { - typ, b, err := glexrt.CborTypeExtractReader(r) + typ, b, err := glex.CborTypeExtractReader(r) if err != nil { return err } @@ -115,26 +118,29 @@ type VodUpdateDraft_Output struct { Draft VodDraftDefs_DraftView `json:"draft"` } +// RecordTypeID implements glex.Record. +func (t *VodUpdateDraft_Output) RecordTypeID() string { return "place.stream.vod.updateDraft" } + func (t *VodUpdateDraft_Output) MarshalCBOR(w io.Writer) error { if t == nil { _, err := w.Write(cbg.CborNull) return err } - t.LexiconTypeID = "place.stream.vod.updateDraft#main" - return glexrt.MarshalCBOR(w, t) + t.LexiconTypeID = "place.stream.vod.updateDraft" + return glex.MarshalCBOR(w, t) } func (t *VodUpdateDraft_Output) UnmarshalCBOR(r io.Reader) error { - return glexrt.UnmarshalCBOR(r, t) + return glex.UnmarshalCBOR(r, t) } // VodUpdateDraft calls the XRPC method "place.stream.vod.updateDraft". // // Update a draft VOD's editable metadata. Server-authoritative fields (source, durationMs, status) are preserved. Editing is allowed in any status, so the user can pre-fill metadata while processing. All fields except uri are optional (partial update). -func VodUpdateDraft(ctx context.Context, c glexrt.LexClient, input *VodUpdateDraft_Input) (*VodUpdateDraft_Output, error) { +func VodUpdateDraft(ctx context.Context, c glex.LexClient, input *VodUpdateDraft_Input) (*VodUpdateDraft_Output, error) { var out VodUpdateDraft_Output - if err := c.LexDo(ctx, glexrt.Procedure, "application/json", "place.stream.vod.updateDraft", nil, input, &out); err != nil { + if err := c.LexDo(ctx, glex.Procedure, "application/json", "place.stream.vod.updateDraft", nil, input, &out); err != nil { return nil, err } return &out, nil diff --git a/pkg/renditions/renditions.go b/pkg/renditions/renditions.go index d5b081ef..9967210b 100644 --- a/pkg/renditions/renditions.go +++ b/pkg/renditions/renditions.go @@ -143,10 +143,10 @@ var DesiredRenditions = []Rendition{ // GenerateRenditions generates renditions for a given spseg func GenerateRenditions(spseg *placestream.Segment) (Renditions, error) { - vid := spseg.Video[0] - if vid.Codec == "" { + if len(spseg.Video) == 0 { return nil, fmt.Errorf("no video stream found") } + vid := spseg.Video[0] rs := []Rendition{} for _, r := range DesiredRenditions { vidWidth := int64(vid.Width) diff --git a/pkg/renditions/renditions_test.go b/pkg/renditions/renditions_test.go index bc0d57dc..e20ba99e 100644 --- a/pkg/renditions/renditions_test.go +++ b/pkg/renditions/renditions_test.go @@ -10,7 +10,7 @@ import ( func seg(width int, height int, fpsNum int, fpsDen int) *placestream.Segment { return &placestream.Segment{ - Video: []*placestream.Segment_Video{ + Video: []placestream.Segment_Video{ { Width: int64(width), Height: int64(height), diff --git a/pkg/spxrpc/app_bsky_actor.go b/pkg/spxrpc/app_bsky_actor.go index 0a99cf22..bf44379d 100644 --- a/pkg/spxrpc/app_bsky_actor.go +++ b/pkg/spxrpc/app_bsky_actor.go @@ -36,7 +36,7 @@ func (s *Server) handleAppBskyActorGetProfile(ctx context.Context, actor string) } // user valid but we couldn't find their bsky profile, return a minimum thing - if false { + if profile == nil { return &appbskytypes.ActorDefs_ProfileViewDetailed{ Did: repo.DID, Handle: repo.Handle, diff --git a/pkg/spxrpc/com_atproto_repo.go b/pkg/spxrpc/com_atproto_repo.go index 12b36b3b..a2c77e1c 100644 --- a/pkg/spxrpc/com_atproto_repo.go +++ b/pkg/spxrpc/com_atproto_repo.go @@ -5,7 +5,7 @@ import ( "context" "errors" "fmt" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "io" "net/http" "strings" @@ -96,19 +96,27 @@ func (s *Server) handleComAtprotoRepoDescribeRepo(ctx context.Context, repo stri if err != nil { return nil, fmt.Errorf("list server repo collections: %w", err) } + didDoc, err := glex.RawJSON(atproto.DIDDoc(s.cli.ServerHost, atproto.ServerPubMultibase)) + if err != nil { + return nil, fmt.Errorf("marshal did doc: %w", err) + } return &comatproto.RepoDescribeRepo_Output{ Handle: s.cli.ServerDID(), Did: s.cli.ServerDID(), - DidDoc: &glexrt.LexiconTypeDecoder{Val: atproto.DIDDoc(s.cli.ServerHost, atproto.ServerPubMultibase)}, + DidDoc: &glex.LexiconTypeDecoder{Val: didDoc}, Collections: collections, HandleIsCorrect: true, }, nil } + didDoc, err := glex.RawJSON(atproto.DIDDoc(s.cli.BroadcasterHost, atproto.LexiconPubMultibase)) + if err != nil { + return nil, fmt.Errorf("marshal did doc: %w", err) + } return &comatproto.RepoDescribeRepo_Output{ Handle: s.cli.BroadcasterDID(), Did: s.cli.BroadcasterDID(), - DidDoc: &glexrt.LexiconTypeDecoder{Val: atproto.DIDDoc(s.cli.BroadcasterHost, atproto.LexiconPubMultibase)}, + DidDoc: &glex.LexiconTypeDecoder{Val: didDoc}, Collections: []string{ "com.atproto.lexicon.schema", }, diff --git a/pkg/spxrpc/labels_test.go b/pkg/spxrpc/labels_test.go index 7569185b..c3c0ed88 100644 --- a/pkg/spxrpc/labels_test.go +++ b/pkg/spxrpc/labels_test.go @@ -120,7 +120,7 @@ func setupBlobTest(t *testing.T) (*Server, model.Model) { require.NoError(t, m.UpsertMediaTrack(context.Background(), placestream.MediaTrack{ LexiconTypeID: "place.stream.media.track", Track: placestream.MediaTrack_Track{ - MediaDefs_MuxlTrack: placestream.MediaDefs_MuxlTrack{ + MediaDefs_MuxlTrack: &placestream.MediaDefs_MuxlTrack{ LexiconTypeID: "place.stream.media.defs#muxlTrack", Blob: testContentCID, TrackId: "1", diff --git a/pkg/spxrpc/place_stream_badge.go b/pkg/spxrpc/place_stream_badge.go index b5a7dcb6..b005e29e 100644 --- a/pkg/spxrpc/place_stream_badge.go +++ b/pkg/spxrpc/place_stream_badge.go @@ -62,7 +62,7 @@ func (s *Server) handlePlaceStreamBadgeGetIssuedBadges(ctx context.Context, stre spcp, err := chatProfile.ToStreamplaceChatProfile() if err == nil && true && spcp.Badges != nil { for _, sel := range spcp.Badges.Streamer { - if sel.Badge.Uri != "" && sel.Badge.Uri != "" { + if sel.Badge.Uri != "" { selectedURIs[sel.Badge.Uri] = true } } diff --git a/pkg/spxrpc/place_stream_branding.go b/pkg/spxrpc/place_stream_branding.go index 8f5f3372..14fa51c4 100644 --- a/pkg/spxrpc/place_stream_branding.go +++ b/pkg/spxrpc/place_stream_branding.go @@ -8,14 +8,13 @@ import ( "fmt" "io" "net/http" - placestream "stream.place/streamplace/pkg/placestream" "github.com/labstack/echo/v4" "github.com/streamplace/oatproxy/pkg/oatproxy" "gorm.io/gorm" "stream.place/streamplace/js/app" "stream.place/streamplace/pkg/log" - placestreamtypes "stream.place/streamplace/pkg/placestream" + "stream.place/streamplace/pkg/placestream" ) var defaultBrandingAssets = map[string]struct { @@ -69,12 +68,12 @@ func (s *Server) HandlePlaceStreamBrandingGetBlobDirect(ctx context.Context, bro return bytes.NewReader(data), nil } -func (s *Server) handlePlaceStreamBrandingGetBranding(ctx context.Context, broadcasterDID string) (*placestreamtypes.BrandingGetBranding_Output, error) { +func (s *Server) handlePlaceStreamBrandingGetBranding(ctx context.Context, broadcasterDID string) (*placestream.BrandingGetBranding_Output, error) { return s.HandlePlaceStreamBrandingGetBrandingDirect(ctx, broadcasterDID) } // HandlePlaceStreamBrandingGetBrandingDirect is the exported version for direct calls -func (s *Server) HandlePlaceStreamBrandingGetBrandingDirect(ctx context.Context, broadcasterDID string) (*placestreamtypes.BrandingGetBranding_Output, error) { +func (s *Server) HandlePlaceStreamBrandingGetBrandingDirect(ctx context.Context, broadcasterDID string) (*placestream.BrandingGetBranding_Output, error) { broadcasterID := s.getBroadcasterID(ctx, broadcasterDID) // get all keys from database @@ -100,7 +99,7 @@ func (s *Server) HandlePlaceStreamBrandingGetBrandingDirect(ctx context.Context, continue // skip if error } - asset := &placestreamtypes.BrandingGetBranding_BrandingAsset{ + asset := &placestream.BrandingGetBranding_BrandingAsset{ Key: key, MimeType: mimeType, } @@ -127,7 +126,7 @@ func (s *Server) HandlePlaceStreamBrandingGetBrandingDirect(ctx context.Context, assets = append(assets, *asset) } - return &placestreamtypes.BrandingGetBranding_Output{ + return &placestream.BrandingGetBranding_Output{ Assets: assets, }, nil } @@ -141,7 +140,7 @@ func (s *Server) isAdminDID(did string) bool { return false } -func (s *Server) handlePlaceStreamBrandingUpdateBlob(ctx context.Context, input *placestreamtypes.BrandingUpdateBlob_Input) (*placestreamtypes.BrandingUpdateBlob_Output, error) { +func (s *Server) handlePlaceStreamBrandingUpdateBlob(ctx context.Context, input *placestream.BrandingUpdateBlob_Input) (*placestream.BrandingUpdateBlob_Output, error) { // check authentication session, _ := oatproxy.GetOAuthSession(ctx) if session == nil { @@ -195,12 +194,12 @@ func (s *Server) handlePlaceStreamBrandingUpdateBlob(ctx context.Context, input return nil, echo.NewHTTPError(http.StatusInternalServerError, "unable to store branding blob") } - return &placestreamtypes.BrandingUpdateBlob_Output{ + return &placestream.BrandingUpdateBlob_Output{ Success: true, }, nil } -func (s *Server) handlePlaceStreamBrandingDeleteBlob(ctx context.Context, input *placestreamtypes.BrandingDeleteBlob_Input) (*placestreamtypes.BrandingDeleteBlob_Output, error) { +func (s *Server) handlePlaceStreamBrandingDeleteBlob(ctx context.Context, input *placestream.BrandingDeleteBlob_Input) (*placestream.BrandingDeleteBlob_Output, error) { // check authentication session, _ := oatproxy.GetOAuthSession(ctx) if session == nil { @@ -228,7 +227,7 @@ func (s *Server) handlePlaceStreamBrandingDeleteBlob(ctx context.Context, input return nil, echo.NewHTTPError(http.StatusInternalServerError, "unable to delete branding blob") } - return &placestreamtypes.BrandingDeleteBlob_Output{ + return &placestream.BrandingDeleteBlob_Output{ Success: true, }, nil } diff --git a/pkg/spxrpc/place_stream_live.go b/pkg/spxrpc/place_stream_live.go index 59dcd4ce..525f91ae 100644 --- a/pkg/spxrpc/place_stream_live.go +++ b/pkg/spxrpc/place_stream_live.go @@ -17,12 +17,11 @@ import ( "github.com/bluesky-social/indigo/xrpc" "github.com/gorilla/websocket" "github.com/labstack/echo/v4" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "github.com/streamplace/oatproxy/pkg/oatproxy" "stream.place/streamplace/pkg/appbsky" "stream.place/streamplace/pkg/atproto" "stream.place/streamplace/pkg/comatproto" - "stream.place/streamplace/pkg/lex" "stream.place/streamplace/pkg/log" "stream.place/streamplace/pkg/spid" "stream.place/streamplace/pkg/spmetrics" @@ -200,7 +199,7 @@ func (s *Server) handlePlaceStreamLiveGetSegments(ctx context.Context, before st if err != nil { return nil, echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("Failed to get CID: %s", err)) } - ltd := &glexrt.LexiconTypeDecoder{Val: record} + ltd := &glex.LexiconTypeDecoder{Val: record} output.Segments[i] = placestream.Segment_SegmentView{ Record: ltd, @@ -560,7 +559,7 @@ func (s *Server) handlePlaceStreamLiveStartLivestream(ctx context.Context, body if livestream.Thumb == nil { // Upload the user's current thumbnail to their PDS as the livestream image. - var thumb *lex.Blob + var thumb *glex.Blob thumbData, err := os.ReadFile(s.cli.ThumbnailFilePath(session.DID)) if err != nil { log.Error(ctx, "failed to read thumbnail file", "err", err) @@ -640,7 +639,7 @@ func (s *Server) handlePlaceStreamLiveStartLivestream(ctx context.Context, body postInput := comatproto.RepoCreateRecord_Input{ Collection: "app.bsky.feed.post", - Record: &glexrt.LexiconTypeDecoder{Val: postRecord}, + Record: &glex.LexiconTypeDecoder{Val: &postRecord}, Repo: session.DID, } var postOutput comatproto.RepoCreateRecord_Output @@ -658,7 +657,7 @@ func (s *Server) handlePlaceStreamLiveStartLivestream(ctx context.Context, body // Step 4: create the place.stream.livestream record lsInput := comatproto.RepoCreateRecord_Input{ Collection: "place.stream.livestream", - Record: &glexrt.LexiconTypeDecoder{Val: livestream}, + Record: &glex.LexiconTypeDecoder{Val: &livestream}, Repo: session.DID, } var lsOutput comatproto.RepoCreateRecord_Output @@ -731,7 +730,7 @@ func (s *Server) endPriorLivestream(ctx context.Context, repoDID string, client inp := comatproto.RepoPutRecord_Input{ Collection: "place.stream.livestream", - Record: &glexrt.LexiconTypeDecoder{Val: priorRec}, + Record: &glex.LexiconTypeDecoder{Val: priorRec}, Rkey: aturi.RecordKey().String(), Repo: repoDID, SwapRecord: swapRecord, @@ -796,7 +795,7 @@ func (s *Server) handlePlaceStreamLiveStopLivestream(ctx context.Context, body * lsInput := comatproto.RepoPutRecord_Input{ Collection: "place.stream.livestream", - Record: &glexrt.LexiconTypeDecoder{Val: livestreamRecord}, + Record: &glex.LexiconTypeDecoder{Val: livestreamRecord}, Rkey: aturi.RecordKey().String(), Repo: session.DID, SwapRecord: swapRecord, diff --git a/pkg/spxrpc/place_stream_media_getvideo.go b/pkg/spxrpc/place_stream_media_getvideo.go index 18428a58..31f88d91 100644 --- a/pkg/spxrpc/place_stream_media_getvideo.go +++ b/pkg/spxrpc/place_stream_media_getvideo.go @@ -27,8 +27,8 @@ func (s *Server) handlePlaceStreamMediaGetVideo(ctx context.Context, uri string) if err != nil { return nil, echo.NewHTTPError(http.StatusInternalServerError, err.Error()) } - if false { + if view == nil { return nil, echo.NewHTTPError(http.StatusNotFound, "VideoNotFound") } - return &view, nil + return view, nil } diff --git a/pkg/spxrpc/place_stream_media_publishvideo.go b/pkg/spxrpc/place_stream_media_publishvideo.go index e4028d11..cc3d3161 100644 --- a/pkg/spxrpc/place_stream_media_publishvideo.go +++ b/pkg/spxrpc/place_stream_media_publishvideo.go @@ -24,9 +24,6 @@ func (s *Server) handlePlaceStreamMediaPublishVideo(ctx context.Context, body *p if body.UploadId == "" { return nil, echo.NewHTTPError(http.StatusBadRequest, "uploadId is required") } - if false { - return nil, echo.NewHTTPError(http.StatusBadRequest, "record is required") - } if s.playbackStore == nil { return nil, echo.NewHTTPError(http.StatusServiceUnavailable, "playback store not configured") } diff --git a/pkg/spxrpc/place_stream_moderation.go b/pkg/spxrpc/place_stream_moderation.go index 4b55b291..06b07bf4 100644 --- a/pkg/spxrpc/place_stream_moderation.go +++ b/pkg/spxrpc/place_stream_moderation.go @@ -2,7 +2,6 @@ package spxrpc import ( "context" - "encoding/json" "fmt" "net/http" "time" @@ -10,7 +9,7 @@ import ( "github.com/bluesky-social/indigo/atproto/syntax" "github.com/bluesky-social/indigo/xrpc" "github.com/labstack/echo/v4" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "stream.place/streamplace/pkg/appbsky" "stream.place/streamplace/pkg/comatproto" "stream.place/streamplace/pkg/constants" @@ -43,7 +42,7 @@ func (s *Server) handlePlaceStreamModerationCreateBlock(ctx context.Context, inp createInput := comatproto.RepoCreateRecord_Input{ Collection: constants.APP_BSKY_GRAPH_BLOCK, - Record: &glexrt.LexiconTypeDecoder{Val: block}, + Record: &glex.LexiconTypeDecoder{Val: &block}, Repo: input.Streamer, } createOutput := comatproto.RepoCreateRecord_Output{} @@ -140,7 +139,7 @@ func (s *Server) handlePlaceStreamModerationCreateGate(ctx context.Context, inpu createInput := comatproto.RepoCreateRecord_Input{ Collection: constants.PLACE_STREAM_CHAT_GATE, - Record: &glexrt.LexiconTypeDecoder{Val: gate}, + Record: &glex.LexiconTypeDecoder{Val: &gate}, Repo: input.Streamer, } createOutput := comatproto.RepoCreateRecord_Output{} @@ -259,17 +258,12 @@ func (s *Server) handlePlaceStreamModerationUpdateLivestream(ctx context.Context } // Convert the decoded value to our struct - livestream := placestream.Livestream{} - recordBytes, err := json.Marshal(getOutput.Value.Val) + existing, err := glex.RecordAs[placestream.Livestream](getOutput.Value.Val) if err != nil { - log.Error(ctx, "failed to marshal livestream record", "err", err) - return nil, echo.NewHTTPError(http.StatusInternalServerError, "failed to decode livestream record") - } - err = json.Unmarshal(recordBytes, livestream) - if err != nil { - log.Error(ctx, "failed to unmarshal livestream record", "err", err) + log.Error(ctx, "failed to decode livestream record", "err", err) return nil, echo.NewHTTPError(http.StatusInternalServerError, "failed to decode livestream record") } + livestream := *existing // Create new record (don't edit existing - old records serve as "chapter markers") // Copy fields from existing record and update title @@ -290,7 +284,7 @@ func (s *Server) handlePlaceStreamModerationUpdateLivestream(ctx context.Context // Create new record instead of updating existing createInput := comatproto.RepoCreateRecord_Input{ Collection: constants.PLACE_STREAM_LIVESTREAM, - Record: &glexrt.LexiconTypeDecoder{Val: livestream}, + Record: &glex.LexiconTypeDecoder{Val: &livestream}, Repo: input.Streamer, } createOutput := comatproto.RepoCreateRecord_Output{} @@ -386,7 +380,7 @@ func (s *Server) handlePlaceStreamModerationCreatePin(ctx context.Context, input createInput := comatproto.RepoCreateRecord_Input{ Collection: constants.PLACE_STREAM_CHAT_PINNED_RECORD, - Record: &glexrt.LexiconTypeDecoder{Val: pinnedRecord}, + Record: &glex.LexiconTypeDecoder{Val: &pinnedRecord}, Repo: input.Streamer, } createOutput := comatproto.RepoCreateRecord_Output{} @@ -481,7 +475,7 @@ func (s *Server) handlePlaceStreamModerationCreateVodGate(ctx context.Context, i createInput := comatproto.RepoCreateRecord_Input{ Collection: constants.PLACE_STREAM_VOD_GATE, - Record: &glexrt.LexiconTypeDecoder{Val: gate}, + Record: &glex.LexiconTypeDecoder{Val: &gate}, Repo: input.Streamer, } createOutput := comatproto.RepoCreateRecord_Output{} diff --git a/pkg/spxrpc/place_stream_playback_getvideo.go b/pkg/spxrpc/place_stream_playback_getvideo.go index ca4f8972..b823916d 100644 --- a/pkg/spxrpc/place_stream_playback_getvideo.go +++ b/pkg/spxrpc/place_stream_playback_getvideo.go @@ -402,14 +402,14 @@ func (s *Server) resolveVideoBlob(ctx context.Context, uri string) (*resolvedVid } switch { - case videoRec.Source.MediaDefs_SourceTracks != nil && videoRec.Source.MediaDefs_SourceTracks != nil: + case videoRec.Source.MediaDefs_SourceTracks != nil: blobCID, err := s.firstTrackBlob(ctx, videoRec.Source.MediaDefs_SourceTracks) if err != nil { return nil, err } return &resolvedVideo{blobCID: blobCID}, nil - case videoRec.Source.MediaDefs_SourceTracks != nil && videoRec.Source.MediaDefs_SourceClip != nil: + case videoRec.Source.MediaDefs_SourceClip != nil: clip := videoRec.Source.MediaDefs_SourceClip if clip.Video == "" { return nil, echo.NewHTTPError(http.StatusUnprocessableEntity, "sourceClip missing parent video URI") @@ -423,7 +423,7 @@ func (s *Server) resolveVideoBlob(ctx context.Context, uri string) (*resolvedVid } // One level only — clip-of-clip is rejected to keep playback // resolution bounded and predictable. - if parentRec.Source.MediaDefs_SourceTracks == nil && parentRec.Source.MediaDefs_SourceClip == nil || parentRec.Source.MediaDefs_SourceTracks == nil { + if parentRec.Source.MediaDefs_SourceTracks == nil { return nil, echo.NewHTTPError(http.StatusUnprocessableEntity, "sourceClip's parent video must use sourceTracks (clip-of-clip is not supported)") } @@ -452,10 +452,10 @@ func (s *Server) loadVideoRecord(ctx context.Context, uri string) (*placestream. log.Error(ctx, "playback: GetVideoByURI failed", "uri", uri, "error", err) return nil, echo.NewHTTPError(http.StatusInternalServerError, err.Error()) } - if false { + if videoRec == nil { return nil, echo.NewHTTPError(http.StatusNotFound, "VideoNotFound") } - return &videoRec, nil + return videoRec, nil } // firstTrackBlob returns the muxlTrack.blob CID of the first ref in a @@ -466,7 +466,7 @@ func (s *Server) firstTrackBlob(ctx context.Context, src *placestream.MediaDefs_ return "", echo.NewHTTPError(http.StatusUnprocessableEntity, "video record has no tracks") } firstRef := src.Tracks[0] - if firstRef.Uri == "" || firstRef.Uri == "" { + if firstRef.Uri == "" { return "", echo.NewHTTPError(http.StatusUnprocessableEntity, "video record's first track ref is empty") } track, err := s.model.GetMediaTrackByURI(ctx, firstRef.Uri) @@ -474,7 +474,7 @@ func (s *Server) firstTrackBlob(ctx context.Context, src *placestream.MediaDefs_ log.Error(ctx, "playback: GetMediaTrackByURI failed", "uri", firstRef.Uri, "error", err) return "", echo.NewHTTPError(http.StatusInternalServerError, err.Error()) } - if track.Track.MediaDefs_MuxlTrack == nil || track.Track.MediaDefs_MuxlTrack == nil { + if track == nil || track.Track.MediaDefs_MuxlTrack == nil { return "", echo.NewHTTPError(http.StatusNotFound, "TrackNotFound") } blob := track.Track.MediaDefs_MuxlTrack.Blob diff --git a/pkg/spxrpc/place_stream_playback_getvideo_test.go b/pkg/spxrpc/place_stream_playback_getvideo_test.go index c94c901f..6c62dbfd 100644 --- a/pkg/spxrpc/place_stream_playback_getvideo_test.go +++ b/pkg/spxrpc/place_stream_playback_getvideo_test.go @@ -321,7 +321,7 @@ func TestResolveVideoBlob_SourceClip(t *testing.T) { require.NoError(t, m.UpsertMediaTrack(ctx, placestream.MediaTrack{ LexiconTypeID: "place.stream.media.track", Track: placestream.MediaTrack_Track{ - MediaDefs_MuxlTrack: placestream.MediaDefs_MuxlTrack{ + MediaDefs_MuxlTrack: &placestream.MediaDefs_MuxlTrack{ LexiconTypeID: "place.stream.media.defs#muxlTrack", Blob: parentCID, TrackId: "1", @@ -334,9 +334,9 @@ func TestResolveVideoBlob_SourceClip(t *testing.T) { LexiconTypeID: "place.stream.video", Title: "parent", Source: placestream.Video_Source{ - MediaDefs_SourceTracks: placestream.MediaDefs_SourceTracks{ + MediaDefs_SourceTracks: &placestream.MediaDefs_SourceTracks{ LexiconTypeID: "place.stream.media.defs#sourceTracks", - Tracks: []*comatproto.RepoStrongRef{ + Tracks: []comatproto.RepoStrongRef{ {Uri: trackURI, Cid: "bafyrefcid"}, }, }, @@ -348,7 +348,7 @@ func TestResolveVideoBlob_SourceClip(t *testing.T) { LexiconTypeID: "place.stream.video", Title: "5s..10s of parent", Source: placestream.Video_Source{ - MediaDefs_SourceClip: placestream.MediaDefs_SourceClip{ + MediaDefs_SourceClip: &placestream.MediaDefs_SourceClip{ LexiconTypeID: "place.stream.media.defs#sourceClip", Video: parentURI, Start: 5_000, @@ -384,7 +384,7 @@ func TestResolveVideoBlob_SourceClip(t *testing.T) { LexiconTypeID: "place.stream.video", Title: "nested clip", Source: placestream.Video_Source{ - MediaDefs_SourceClip: placestream.MediaDefs_SourceClip{ + MediaDefs_SourceClip: &placestream.MediaDefs_SourceClip{ LexiconTypeID: "place.stream.media.defs#sourceClip", Video: clipURI, Start: 100, diff --git a/pkg/statedb/draft_video.go b/pkg/statedb/draft_video.go index 2303d8ba..741a8254 100644 --- a/pkg/statedb/draft_video.go +++ b/pkg/statedb/draft_video.go @@ -8,7 +8,7 @@ import ( "fmt" "time" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "gorm.io/gorm/clause" "stream.place/streamplace/pkg/comatproto" @@ -346,7 +346,7 @@ func (state *StatefulDB) DeleteDraft(ctx context.Context, uri string) (bool, err // ToDraftView converts a stored row + its CBOR record into the lexicon view. // The record field is typed as `unknown` in the lexicon (the @atproto/api // client validator can't validate a ref to a record-type lexicon), which -// generates a *glexrt.LexiconTypeDecoder in Go — so we wrap the decoded +// generates a *glex.LexiconTypeDecoder in Go — so we wrap the decoded // record the same way commentView/livestreamView do. func (dv *DraftVideo) ToDraftView() (placestream.VodDraftDefs_DraftView, error) { rec, err := unmarshalDraft(dv.Data) @@ -359,6 +359,6 @@ func (dv *DraftVideo) ToDraftView() (placestream.VodDraftDefs_DraftView, error) return placestream.VodDraftDefs_DraftView{ Uri: dv.URI, Cid: dv.CID, - Record: &glexrt.LexiconTypeDecoder{Val: rec}, + Record: &glex.LexiconTypeDecoder{Val: &rec}, }, nil } diff --git a/pkg/statedb/draft_video_test.go b/pkg/statedb/draft_video_test.go index d235b8de..b2590a0c 100644 --- a/pkg/statedb/draft_video_test.go +++ b/pkg/statedb/draft_video_test.go @@ -126,7 +126,7 @@ func TestSetDraftReadyAndError(t *testing.T) { require.NoError(t, err) sourceTracks := placestream.VodDraftVideo_Source{ - MediaDefs_SourceTracks: placestream.MediaDefs_SourceTracks{ + MediaDefs_SourceTracks: &placestream.MediaDefs_SourceTracks{ LexiconTypeID: "place.stream.media.defs#sourceTracks", Tracks: nil, }, @@ -163,7 +163,7 @@ func TestSetDraftReadyAndError(t *testing.T) { func TestSetDraftOnMissingUploadIsNoOp(t *testing.T) { WithAllDatabases(t, func(state *StatefulDB) { // A pre-drafts-era upload (no draft row) must not error. - err := state.SetDraftReady(t.Context(), "no-such-upload", nil, 0, "") + err := state.SetDraftReady(t.Context(), "no-such-upload", placestream.VodDraftVideo_Source{}, 0, "") require.NoError(t, err) err = state.SetDraftError(t.Context(), "no-such-upload", "x") require.NoError(t, err) diff --git a/pkg/statedb/multistream_target.go b/pkg/statedb/multistream_target.go index dbdf034c..edbda033 100644 --- a/pkg/statedb/multistream_target.go +++ b/pkg/statedb/multistream_target.go @@ -6,7 +6,7 @@ import ( "time" "github.com/bluesky-social/indigo/util" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "stream.place/streamplace/pkg/placestream" "stream.place/streamplace/pkg/spid" ) @@ -78,7 +78,7 @@ func (state *StatefulDB) CreateMultistreamTarget(input placestream.MultistreamCr return placestream.MultistreamDefs_TargetView{ Uri: uri, Cid: cid.String(), - Record: &glexrt.LexiconTypeDecoder{Val: input.MultistreamTarget}, + Record: &glex.LexiconTypeDecoder{Val: &input.MultistreamTarget}, }, nil } @@ -130,7 +130,7 @@ func (state *StatefulDB) ListMultistreamTargets(repoDID string, limit int, offse targetView := placestream.MultistreamDefs_TargetView{ Uri: target.URI, Cid: cid.String(), - Record: &glexrt.LexiconTypeDecoder{Val: &multistreamTarget}, + Record: &glex.LexiconTypeDecoder{Val: &multistreamTarget}, } // Add the latest event if it exists @@ -150,10 +150,6 @@ func (state *StatefulDB) ListMultistreamTargets(repoDID string, limit int, offse } func (state *StatefulDB) UpdateMultistreamTarget(uri string, input placestream.MultistreamPutTarget_Input) (placestream.MultistreamDefs_TargetView, error) { - if false { - return placestream.MultistreamDefs_TargetView{}, fmt.Errorf("multistream target is required") - } - // Get the current target to check repo ownership and current active status var currentTarget MultistreamTarget err := state.DB.Where("uri = ?", uri).First(¤tTarget).Error @@ -204,7 +200,7 @@ func (state *StatefulDB) UpdateMultistreamTarget(uri string, input placestream.M return placestream.MultistreamDefs_TargetView{ Uri: uri, Cid: cid.String(), - Record: &glexrt.LexiconTypeDecoder{Val: input.MultistreamTarget}, + Record: &glex.LexiconTypeDecoder{Val: &input.MultistreamTarget}, }, nil } diff --git a/pkg/statedb/queue_processor.go b/pkg/statedb/queue_processor.go index aaa47f38..6121483a 100644 --- a/pkg/statedb/queue_processor.go +++ b/pkg/statedb/queue_processor.go @@ -10,7 +10,7 @@ import ( "github.com/bluesky-social/indigo/atproto/syntax" "github.com/bluesky-social/indigo/util" "github.com/bluesky-social/indigo/xrpc" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "golang.org/x/sync/errgroup" "gorm.io/gorm" "stream.place/streamplace/pkg/appbsky" @@ -394,7 +394,7 @@ func (state *StatefulDB) processFinalizeLivestreamTask(ctx context.Context, task inp := comatproto.RepoPutRecord_Input{ Collection: "place.stream.livestream", - Record: &glexrt.LexiconTypeDecoder{Val: rec}, + Record: &glex.LexiconTypeDecoder{Val: rec}, Rkey: uri.RecordKey().String(), Repo: livestream.RepoDID, SwapRecord: &livestream.CID, @@ -417,9 +417,9 @@ func (state *StatefulDB) processNotificationTask(ctx context.Context, task *AppT return err } lsv := notificationTask.Livestream - rec, ok := lsv.Record.Val.(placestream.Livestream) - if !ok { - return fmt.Errorf("invalid livestream record") + rec, err := glex.RecordAs[placestream.Livestream](lsv.Record.Val) + if err != nil { + return fmt.Errorf("invalid livestream record: %w", err) } userDID := lsv.Author.Did @@ -443,10 +443,10 @@ func (state *StatefulDB) processNotificationTask(ctx context.Context, task *AppT if state.noter != nil { nb := ¬ificationpkg.NotificationBlast{ - Title: fmt.Sprintf("🔴 @%s is LIVE!", &lsv.Author.Handle), + Title: fmt.Sprintf("🔴 @%s is LIVE!", lsv.Author.Handle), Body: rec.Title, Data: map[string]string{ - "path": fmt.Sprintf("/%s", &lsv.Author.Handle), + "path": fmt.Sprintf("/%s", lsv.Author.Handle), }, } err = state.noter.Blast(ctx, notifications, nb) @@ -533,9 +533,9 @@ func (state *StatefulDB) processChatMessageTask(ctx context.Context, task *AppTa return err } scm := chatTask.MessageView - rec, ok := scm.Record.Val.(placestream.ChatMessage) - if !ok { - return fmt.Errorf("invalid chat message record") + rec, err := glex.RecordAs[placestream.ChatMessage](scm.Record.Val) + if err != nil { + return fmt.Errorf("invalid chat message record: %w", err) } // Send to webhooks using webhook manager diff --git a/pkg/statedb/xrpc_stream_event.go b/pkg/statedb/xrpc_stream_event.go index 1d83de6f..eb44f0a5 100644 --- a/pkg/statedb/xrpc_stream_event.go +++ b/pkg/statedb/xrpc_stream_event.go @@ -7,7 +7,7 @@ import ( "github.com/bluesky-social/indigo/util" "github.com/ipfs/go-cid" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "gorm.io/gorm" "stream.place/streamplace/pkg/comatproto" ) @@ -52,7 +52,7 @@ func (state *StatefulDB) CreateCommitEvent(commit *comatproto.SyncSubscribeRepos if err != nil { return err } - ll := glexrt.Link(c) + ll := glex.Link(c) commit.PrevData = &ll commit.Since = prevCommit.Rev } else { diff --git a/pkg/viewlog/aggregate_test.go b/pkg/viewlog/aggregate_test.go index 84c53414..c1cf0dbf 100644 --- a/pkg/viewlog/aggregate_test.go +++ b/pkg/viewlog/aggregate_test.go @@ -7,9 +7,9 @@ import ( "testing" "time" - comatproto "github.com/bluesky-social/indigo/api/atproto" "github.com/bluesky-social/indigo/atproto/syntax" "github.com/stretchr/testify/require" + "stream.place/streamplace/pkg/comatproto" "stream.place/streamplace/pkg/blob" "stream.place/streamplace/pkg/vod" @@ -18,8 +18,8 @@ import ( // fixtureTrackRefs returns the strongRefs that pair with the fixture // metafile, keyed by in-container trackId. Same shape the real // resolver in cmd/streamplace.go produces from MediaTrack rows. -func fixtureTrackRefs() map[string]*comatproto.RepoStrongRef { - return map[string]*comatproto.RepoStrongRef{ +func fixtureTrackRefs() map[string]comatproto.RepoStrongRef { + return map[string]comatproto.RepoStrongRef{ "1": { LexiconTypeID: "com.atproto.repo.strongRef", Uri: "at://did:plc:alice/place.stream.media.track/track-video-1", @@ -434,7 +434,7 @@ func TestAggregateWindowTrackUsage(t *testing.T) { require.Equal(t, cidA, cid) return fixtureMetafile(), nil }, - FetchTrackRefs: func(ctx context.Context, cid string) (map[string]*comatproto.RepoStrongRef, error) { + FetchTrackRefs: func(ctx context.Context, cid string) (map[string]comatproto.RepoStrongRef, error) { require.Equal(t, cidA, cid) return refs, nil }, @@ -485,7 +485,7 @@ func TestAggregateWindowVideoWithUsageButNoCount(t *testing.T) { FetchMetafile: func(ctx context.Context, cid string) (*vod.Metafile, error) { return fixtureMetafile(), nil }, - FetchTrackRefs: func(ctx context.Context, cid string) (map[string]*comatproto.RepoStrongRef, error) { + FetchTrackRefs: func(ctx context.Context, cid string) (map[string]comatproto.RepoStrongRef, error) { return refs, nil }, }) @@ -521,14 +521,14 @@ func TestAggregateWindowTidWithoutStrongRefIsDropped(t *testing.T) { store, err := blob.NewFileStore(root) require.NoError(t, err) refs := fixtureTrackRefs() - partial := map[string]*comatproto.RepoStrongRef{"1": refs["1"]} + partial := map[string]comatproto.RepoStrongRef{"1": refs["1"]} res, err := AggregateWindow(context.Background(), store, AggregateInput{ WindowStart: now.Add(-time.Minute), WindowEnd: now.Add(time.Minute), FetchMetafile: func(ctx context.Context, cid string) (*vod.Metafile, error) { return fixtureMetafile(), nil }, - FetchTrackRefs: func(ctx context.Context, cid string) (map[string]*comatproto.RepoStrongRef, error) { + FetchTrackRefs: func(ctx context.Context, cid string) (map[string]comatproto.RepoStrongRef, error) { return partial, nil }, }) diff --git a/pkg/vod/publish.go b/pkg/vod/publish.go index 98a3ecc1..de39a63e 100644 --- a/pkg/vod/publish.go +++ b/pkg/vod/publish.go @@ -6,7 +6,7 @@ import ( "fmt" "github.com/bluesky-social/indigo/xrpc" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" @@ -260,7 +260,7 @@ func publishTrack(ctx context.Context, client XRPCClient, did, cid string, blobS rkey := spid.TIDClock.Next().String() inp := comatproto.RepoPutRecord_Input{ Collection: constants.PLACE_STREAM_MEDIA_TRACK, - Record: &glexrt.LexiconTypeDecoder{Val: rec}, + Record: &glex.LexiconTypeDecoder{Val: rec}, Rkey: rkey, Repo: did, } diff --git a/pkg/vod/publish_draft.go b/pkg/vod/publish_draft.go index 1bbb5dfb..e5134367 100644 --- a/pkg/vod/publish_draft.go +++ b/pkg/vod/publish_draft.go @@ -9,7 +9,7 @@ import ( "time" "github.com/bluesky-social/indigo/xrpc" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" @@ -144,7 +144,7 @@ func PublishDraft(ctx context.Context, state *statedb.StatefulDB, store blob.Sto inp := comatproto.RepoPutRecord_Input{ Collection: constants.PLACE_STREAM_VIDEO, - Record: &glexrt.LexiconTypeDecoder{Val: video}, + Record: &glex.LexiconTypeDecoder{Val: video}, Rkey: rkey, Repo: did, } @@ -255,12 +255,10 @@ func draftConnectionsToVideo(in []placestream.VodDraftVideo_Connections_Elem) [] } out := make([]placestream.Video_Connections_Elem, 0, len(in)) for _, c := range in { - if false || c.Video_Connection == nil { + if c.Video_Connection == nil { continue } - out = append(out, placestream.Video_Connections_Elem{ - Video_Connection: c.Video_Connection, - }) + out = append(out, placestream.Video_Connections_Elem(c)) } return out } diff --git a/pkg/vod/publish_draft_test.go b/pkg/vod/publish_draft_test.go index e29d5fd9..56fb821e 100644 --- a/pkg/vod/publish_draft_test.go +++ b/pkg/vod/publish_draft_test.go @@ -41,7 +41,7 @@ func TestPublishDraftNotFoundForOtherUsersDraft(t *testing.T) { ctx := context.Background() // Alice owns the draft; Bob tries to publish it. - dv, err := state.CreateDraft(ctx, "did:plc:alice", "up-1", &placestream.VodDraftVideo{ + dv, err := state.CreateDraft(ctx, "did:plc:alice", "up-1", placestream.VodDraftVideo{ LexiconTypeID: "place.stream.vod.draftVideo", Title: "Alice's draft", Status: "ready", @@ -59,7 +59,7 @@ func TestPublishDraftNotReadyWhileProcessing(t *testing.T) { require.NoError(t, err) ctx := context.Background() - dv, err := state.CreateDraft(ctx, "did:plc:alice", "up-2", &placestream.VodDraftVideo{ + dv, err := state.CreateDraft(ctx, "did:plc:alice", "up-2", placestream.VodDraftVideo{ LexiconTypeID: "place.stream.vod.draftVideo", Title: "Still cooking", Status: "processing", @@ -77,7 +77,7 @@ func TestPublishDraftNotReadyWhenErrored(t *testing.T) { require.NoError(t, err) ctx := context.Background() - dv, err := state.CreateDraft(ctx, "did:plc:alice", "up-3", &placestream.VodDraftVideo{ + dv, err := state.CreateDraft(ctx, "did:plc:alice", "up-3", placestream.VodDraftVideo{ LexiconTypeID: "place.stream.vod.draftVideo", Title: "Failed", Status: "error", @@ -96,7 +96,7 @@ func TestDraftConnectionAndActivityMapping(t *testing.T) { require.Nil(t, draftConnectionsToVideo(nil)) conn := &placestream.Video_Connection{LexiconTypeID: "place.stream.video#connection"} - in := []*placestream.VodDraftVideo_Connections_Elem{{Video_Connection: conn}, nil} + in := []placestream.VodDraftVideo_Connections_Elem{{Video_Connection: conn}, {}} out := draftConnectionsToVideo(in) require.Len(t, out, 1) require.Equal(t, conn, out[0].Video_Connection) diff --git a/pkg/vod/publish_video.go b/pkg/vod/publish_video.go index dde1c3e4..0e13c488 100644 --- a/pkg/vod/publish_video.go +++ b/pkg/vod/publish_video.go @@ -9,7 +9,7 @@ import ( "time" "github.com/bluesky-social/indigo/xrpc" - glexrt "github.com/streamplace/glex/runtime" + glex "github.com/streamplace/glex/runtime" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" @@ -17,7 +17,6 @@ import ( "stream.place/streamplace/pkg/blob" "stream.place/streamplace/pkg/constants" - "stream.place/streamplace/pkg/lex" "stream.place/streamplace/pkg/log" "stream.place/streamplace/pkg/placestream" "stream.place/streamplace/pkg/spid" @@ -103,7 +102,7 @@ func PublishVideo(ctx context.Context, state *statedb.StatefulDB, store blob.Sto rkey := spid.TIDClock.Next().String() inp := comatproto.RepoPutRecord_Input{ Collection: constants.PLACE_STREAM_VIDEO, - Record: &glexrt.LexiconTypeDecoder{Val: video}, + Record: &glex.LexiconTypeDecoder{Val: video}, Rkey: rkey, Repo: did, } @@ -139,7 +138,7 @@ func sourceTracksFromUpload(upload *statedb.Upload) ([]comatproto.RepoStrongRef, // generateAndUploadThumbnail renders a thumbnail from the processed video // blob (via the same path as vod-test) and uploads it to the user's PDS, // returning the resulting blob ref. -func generateAndUploadThumbnail(ctx context.Context, client XRPCClient, store blob.Store, contentCID string) (*lex.Blob, error) { +func generateAndUploadThumbnail(ctx context.Context, client XRPCClient, store blob.Store, contentCID string) (*glex.Blob, error) { metafile, err := readMetafile(ctx, store, contentCID) if err != nil { return nil, fmt.Errorf("read metafile: %w", err)