···3737check: ## Compile everything, checking syntax (does not output binaries)
3838 go build ./...
39394040+.PHONY: lexgen
4141+lexgen: ## Generate lexicon type packages from lexicon schemas
4242+ glot codegen --output-dir api lexicons/social/scrumble
4343+4044.env:
4145 if [ ! -f ".env" ]; then cp example.dev.env .env; fi
+12
api/socialscrumble/betaaccountjoin.go
···11+// Code generated by indigo lexgen tool. DO NOT EDIT MANUALLY.
22+33+// Lexicon schema: social.scrumble.beta.account.join
44+55+package socialscrumble
66+77+// Indicates that an account (user) wants to to be part of a scene. The key must be the DID of the scene.
88+type BetaAccountJoin struct {
99+ LexiconTypeID string `json:"$type" cborgen:"$type,const=social.scrumble.beta.account.join"`
1010+ CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"`
1111+ Scene *string `json:"scene,omitempty" cborgen:"scene,omitempty"`
1212+}
+16
api/socialscrumble/betaaccountprofile.go
···11+// Code generated by indigo lexgen tool. DO NOT EDIT MANUALLY.
22+33+// Lexicon schema: social.scrumble.beta.account.profile
44+55+package socialscrumble
66+77+import (
88+ lexutil "github.com/bluesky-social/indigo/lex/util"
99+)
1010+1111+// Scrumble user profile. Presence of this record indicates that the account is a scrumble user. Scene community accounts should also include this record.
1212+type BetaAccountProfile struct {
1313+ LexiconTypeID string `json:"$type" cborgen:"$type,const=social.scrumble.beta.account.profile"`
1414+ Avatar *lexutil.LexBlob `json:"avatar,omitempty" cborgen:"avatar,omitempty"`
1515+ CreatedAt *string `json:"createdAt,omitempty" cborgen:"createdAt,omitempty"`
1616+}
+20
api/socialscrumble/betacollectioncomment.go
···11+// Code generated by indigo lexgen tool. DO NOT EDIT MANUALLY.
22+33+// Lexicon schema: social.scrumble.beta.collection.comment
44+55+package socialscrumble
66+77+import (
88+ comatproto "github.com/bluesky-social/indigo/api/atproto"
99+)
1010+1111+// Threaded discussion comment on an item.
1212+type BetaCollectionComment struct {
1313+ LexiconTypeID string `json:"$type" cborgen:"$type,const=social.scrumble.beta.collection.comment"`
1414+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
1515+ Item comatproto.RepoStrongRef `json:"item" cborgen:"item"`
1616+ Parent *comatproto.RepoStrongRef `json:"parent,omitempty" cborgen:"parent,omitempty"`
1717+ Scene string `json:"scene" cborgen:"scene"`
1818+ // text: TODO: length limit, and whether this is markdown (probably yes, but what subset)
1919+ Text string `json:"text" cborgen:"text"`
2020+}
+18
api/socialscrumble/betacollectionfeedback.go
···11+// Code generated by indigo lexgen tool. DO NOT EDIT MANUALLY.
22+33+// Lexicon schema: social.scrumble.beta.collection.feedback
44+55+package socialscrumble
66+77+import (
88+ comatproto "github.com/bluesky-social/indigo/api/atproto"
99+)
1010+1111+// Up/Down feedback on an item of content in a scene, from an account. Aggregating services must check for duplicate feedback.
1212+type BetaCollectionFeedback struct {
1313+ LexiconTypeID string `json:"$type" cborgen:"$type,const=social.scrumble.beta.collection.feedback"`
1414+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
1515+ Feedback string `json:"feedback" cborgen:"feedback"`
1616+ Scene string `json:"scene" cborgen:"scene"`
1717+ Subject comatproto.RepoStrongRef `json:"subject" cborgen:"subject"`
1818+}
+120
api/socialscrumble/betacollectionitem.go
···11+// Code generated by indigo lexgen tool. DO NOT EDIT MANUALLY.
22+33+// Lexicon schema: social.scrumble.beta.collection.item
44+55+package socialscrumble
66+77+import (
88+ "encoding/json"
99+ "fmt"
1010+1111+ lexutil "github.com/bluesky-social/indigo/lex/util"
1212+)
1313+1414+// Individual item submitted to a scene.
1515+type BetaCollectionItem struct {
1616+ LexiconTypeID string `json:"$type" cborgen:"$type,const=social.scrumble.beta.collection.item"`
1717+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
1818+ Item BetaCollectionItem_Item `json:"item" cborgen:"item"`
1919+ Scene string `json:"scene" cborgen:"scene"`
2020+ Tags []string `json:"tags,omitempty" cborgen:"tags,omitempty"`
2121+}
2222+2323+type BetaCollectionItem_Item struct {
2424+ BetaCollectionItem_AtpItem *BetaCollectionItem_AtpItem
2525+ BetaCollectionItem_ImageItem *BetaCollectionItem_ImageItem
2626+ BetaCollectionItem_TextItem *BetaCollectionItem_TextItem
2727+ BetaCollectionItem_WebItem *BetaCollectionItem_WebItem
2828+}
2929+3030+func (t *BetaCollectionItem_Item) MarshalJSON() ([]byte, error) {
3131+ if t.BetaCollectionItem_AtpItem != nil {
3232+ t.BetaCollectionItem_AtpItem.LexiconTypeID = "social.scrumble.beta.collection.item#atpItem"
3333+ return json.Marshal(t.BetaCollectionItem_AtpItem)
3434+ }
3535+ if t.BetaCollectionItem_ImageItem != nil {
3636+ t.BetaCollectionItem_ImageItem.LexiconTypeID = "social.scrumble.beta.collection.item#imageItem"
3737+ return json.Marshal(t.BetaCollectionItem_ImageItem)
3838+ }
3939+ if t.BetaCollectionItem_TextItem != nil {
4040+ t.BetaCollectionItem_TextItem.LexiconTypeID = "social.scrumble.beta.collection.item#textItem"
4141+ return json.Marshal(t.BetaCollectionItem_TextItem)
4242+ }
4343+ if t.BetaCollectionItem_WebItem != nil {
4444+ t.BetaCollectionItem_WebItem.LexiconTypeID = "social.scrumble.beta.collection.item#webItem"
4545+ return json.Marshal(t.BetaCollectionItem_WebItem)
4646+ }
4747+ return nil, fmt.Errorf("can not marshal empty union as JSON")
4848+}
4949+5050+func (t *BetaCollectionItem_Item) UnmarshalJSON(b []byte) error {
5151+ typ, err := lexutil.TypeExtract(b)
5252+ if err != nil {
5353+ return err
5454+ }
5555+5656+ switch typ {
5757+ case "social.scrumble.beta.collection.item#atpItem":
5858+ t.BetaCollectionItem_AtpItem = new(BetaCollectionItem_AtpItem)
5959+ return json.Unmarshal(b, t.BetaCollectionItem_AtpItem)
6060+ case "social.scrumble.beta.collection.item#imageItem":
6161+ t.BetaCollectionItem_ImageItem = new(BetaCollectionItem_ImageItem)
6262+ return json.Unmarshal(b, t.BetaCollectionItem_ImageItem)
6363+ case "social.scrumble.beta.collection.item#textItem":
6464+ t.BetaCollectionItem_TextItem = new(BetaCollectionItem_TextItem)
6565+ return json.Unmarshal(b, t.BetaCollectionItem_TextItem)
6666+ case "social.scrumble.beta.collection.item#webItem":
6767+ t.BetaCollectionItem_WebItem = new(BetaCollectionItem_WebItem)
6868+ return json.Unmarshal(b, t.BetaCollectionItem_WebItem)
6969+ default:
7070+ return nil
7171+ }
7272+}
7373+7474+// BetaCollectionItem_AspectRatio is a "aspectRatio" in the social.scrumble.beta.collection.item schema.
7575+//
7676+// width:height represents an aspect ratio. It may be approximate, and may not correspond to absolute dimensions in any given unit.
7777+type BetaCollectionItem_AspectRatio struct {
7878+ LexiconTypeID string `json:"$type,omitempty" cborgen:"$type,const=social.scrumble.beta.collection.item#aspectRatio,omitempty"`
7979+ Height int64 `json:"height" cborgen:"height"`
8080+ Width int64 `json:"width" cborgen:"width"`
8181+}
8282+8383+// BetaCollectionItem_AtpItem is a "atpItem" in the social.scrumble.beta.collection.item schema.
8484+type BetaCollectionItem_AtpItem struct {
8585+ LexiconTypeID string `json:"$type,omitempty" cborgen:"$type,const=social.scrumble.beta.collection.item#atpItem,omitempty"`
8686+ Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"`
8787+ Uri string `json:"uri" cborgen:"uri"`
8888+}
8989+9090+// BetaCollectionItem_Image is a "image" in the social.scrumble.beta.collection.item schema.
9191+type BetaCollectionItem_Image struct {
9292+ LexiconTypeID string `json:"$type,omitempty" cborgen:"$type,const=social.scrumble.beta.collection.item#image,omitempty"`
9393+ Alt *string `json:"alt,omitempty" cborgen:"alt,omitempty"`
9494+ AspectRatio *BetaCollectionItem_AspectRatio `json:"aspectRatio,omitempty" cborgen:"aspectRatio,omitempty"`
9595+ Attribution *string `json:"attribution,omitempty" cborgen:"attribution,omitempty"`
9696+ Image lexutil.LexBlob `json:"image" cborgen:"image"`
9797+ License *string `json:"license,omitempty" cborgen:"license,omitempty"`
9898+}
9999+100100+// BetaCollectionItem_ImageItem is a "imageItem" in the social.scrumble.beta.collection.item schema.
101101+type BetaCollectionItem_ImageItem struct {
102102+ LexiconTypeID string `json:"$type,omitempty" cborgen:"$type,const=social.scrumble.beta.collection.item#imageItem,omitempty"`
103103+ Images []BetaCollectionItem_Image `json:"images" cborgen:"images"`
104104+}
105105+106106+// BetaCollectionItem_TextItem is a "textItem" in the social.scrumble.beta.collection.item schema.
107107+type BetaCollectionItem_TextItem struct {
108108+ LexiconTypeID string `json:"$type,omitempty" cborgen:"$type,const=social.scrumble.beta.collection.item#textItem,omitempty"`
109109+ Text string `json:"text" cborgen:"text"`
110110+ Title *string `json:"title,omitempty" cborgen:"title,omitempty"`
111111+}
112112+113113+// BetaCollectionItem_WebItem is a "webItem" in the social.scrumble.beta.collection.item schema.
114114+type BetaCollectionItem_WebItem struct {
115115+ LexiconTypeID string `json:"$type,omitempty" cborgen:"$type,const=social.scrumble.beta.collection.item#webItem,omitempty"`
116116+ Description *string `json:"description,omitempty" cborgen:"description,omitempty"`
117117+ Thumb *lexutil.LexBlob `json:"thumb,omitempty" cborgen:"thumb,omitempty"`
118118+ Title *string `json:"title,omitempty" cborgen:"title,omitempty"`
119119+ Url string `json:"url" cborgen:"url"`
120120+}
+18
api/socialscrumble/betacollectionreaction.go
···11+// Code generated by indigo lexgen tool. DO NOT EDIT MANUALLY.
22+33+// Lexicon schema: social.scrumble.beta.collection.reaction
44+55+package socialscrumble
66+77+import (
88+ comatproto "github.com/bluesky-social/indigo/api/atproto"
99+)
1010+1111+// Emoji reaction. Aggregators need to de-duplicate.
1212+type BetaCollectionReaction struct {
1313+ LexiconTypeID string `json:"$type" cborgen:"$type,const=social.scrumble.beta.collection.reaction"`
1414+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
1515+ Emoji string `json:"emoji" cborgen:"emoji"`
1616+ Scene string `json:"scene" cborgen:"scene"`
1717+ Subject comatproto.RepoStrongRef `json:"subject" cborgen:"subject"`
1818+}
+55
api/socialscrumble/betascenedeclaration.go
···11+// Code generated by indigo lexgen tool. DO NOT EDIT MANUALLY.
22+33+// Lexicon schema: social.scrumble.beta.scene.declaration
44+55+package socialscrumble
66+77+import (
88+ appbsky "github.com/bluesky-social/indigo/api/bsky"
99+ lexutil "github.com/bluesky-social/indigo/lex/util"
1010+)
1111+1212+// Scene metadata and configuration. This record should live under the scene community account.
1313+type BetaSceneDeclaration struct {
1414+ LexiconTypeID string `json:"$type" cborgen:"$type,const=social.scrumble.beta.scene.declaration"`
1515+ Avatar *lexutil.LexBlob `json:"avatar,omitempty" cborgen:"avatar,omitempty"`
1616+ Config BetaSceneDeclaration_SceneConfig `json:"config" cborgen:"config"`
1717+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
1818+ Description *string `json:"description,omitempty" cborgen:"description,omitempty"`
1919+ DescriptionFacets []appbsky.RichtextFacet `json:"descriptionFacets,omitempty" cborgen:"descriptionFacets,omitempty"`
2020+ DisplayName *string `json:"displayName,omitempty" cborgen:"displayName,omitempty"`
2121+ Guidelines []BetaSceneDeclaration_SceneGuideline `json:"guidelines" cborgen:"guidelines"`
2222+}
2323+2424+// BetaSceneDeclaration_ConfigItems is a "configItems" in the social.scrumble.beta.scene.declaration schema.
2525+//
2626+// Configuration parameters for the scene (TODO)
2727+type BetaSceneDeclaration_ConfigItems struct {
2828+ LexiconTypeID string `json:"$type,omitempty" cborgen:"$type,const=social.scrumble.beta.scene.declaration#configItems,omitempty"`
2929+ Types []string `json:"types,omitempty" cborgen:"types,omitempty"`
3030+}
3131+3232+// BetaSceneDeclaration_ConfigLabeler is a "configLabeler" in the social.scrumble.beta.scene.declaration schema.
3333+//
3434+// Configuration parameters for the scene (TODO)
3535+type BetaSceneDeclaration_ConfigLabeler struct {
3636+ LexiconTypeID string `json:"$type,omitempty" cborgen:"$type,const=social.scrumble.beta.scene.declaration#configLabeler,omitempty"`
3737+ Did string `json:"did" cborgen:"did"`
3838+}
3939+4040+// BetaSceneDeclaration_SceneConfig is a "sceneConfig" in the social.scrumble.beta.scene.declaration schema.
4141+//
4242+// Configuration parameters for the scene
4343+type BetaSceneDeclaration_SceneConfig struct {
4444+ LexiconTypeID string `json:"$type,omitempty" cborgen:"$type,const=social.scrumble.beta.scene.declaration#sceneConfig,omitempty"`
4545+ Items *BetaSceneDeclaration_ConfigItems `json:"items,omitempty" cborgen:"items,omitempty"`
4646+ Labelers []BetaSceneDeclaration_ConfigLabeler `json:"labelers,omitempty" cborgen:"labelers,omitempty"`
4747+}
4848+4949+// BetaSceneDeclaration_SceneGuideline is a "sceneGuideline" in the social.scrumble.beta.scene.declaration schema.
5050+//
5151+// An individual criteria or rule describing sumbissions and behaviors in the scene
5252+type BetaSceneDeclaration_SceneGuideline struct {
5353+ LexiconTypeID string `json:"$type,omitempty" cborgen:"$type,const=social.scrumble.beta.scene.declaration#sceneGuideline,omitempty"`
5454+ Text string `json:"text" cborgen:"text"`
5555+}
+14
api/socialscrumble/betascenemember.go
···11+// Code generated by indigo lexgen tool. DO NOT EDIT MANUALLY.
22+33+// Lexicon schema: social.scrumble.beta.scene.member
44+55+package socialscrumble
66+77+// Indicates that an account is a member of the scene. This records gets written to the scene community account. The key should be the account's DID.
88+type BetaSceneMember struct {
99+ LexiconTypeID string `json:"$type" cborgen:"$type,const=social.scrumble.beta.scene.member"`
1010+ CreatedAt string `json:"createdAt" cborgen:"createdAt"`
1111+ Did string `json:"did" cborgen:"did"`
1212+ // role: TODO: make these refs to a defs file?
1313+ Role string `json:"role" cborgen:"role"`
1414+}
+89
lexicons/app/bsky/richtext/facet.json
···11+{
22+ "defs": {
33+ "byteSlice": {
44+ "description": "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. NOTE: some languages, like Javascript, use UTF-16 or Unicode codepoints for string slice indexing; in these languages, convert to byte arrays before working with facets.",
55+ "properties": {
66+ "byteEnd": {
77+ "minimum": 0,
88+ "type": "integer"
99+ },
1010+ "byteStart": {
1111+ "minimum": 0,
1212+ "type": "integer"
1313+ }
1414+ },
1515+ "required": [
1616+ "byteStart",
1717+ "byteEnd"
1818+ ],
1919+ "type": "object"
2020+ },
2121+ "link": {
2222+ "description": "Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.",
2323+ "properties": {
2424+ "uri": {
2525+ "format": "uri",
2626+ "type": "string"
2727+ }
2828+ },
2929+ "required": [
3030+ "uri"
3131+ ],
3232+ "type": "object"
3333+ },
3434+ "main": {
3535+ "description": "Annotation of a sub-string within rich text.",
3636+ "properties": {
3737+ "features": {
3838+ "items": {
3939+ "refs": [
4040+ "#mention",
4141+ "#link",
4242+ "#tag"
4343+ ],
4444+ "type": "union"
4545+ },
4646+ "type": "array"
4747+ },
4848+ "index": {
4949+ "ref": "#byteSlice",
5050+ "type": "ref"
5151+ }
5252+ },
5353+ "required": [
5454+ "index",
5555+ "features"
5656+ ],
5757+ "type": "object"
5858+ },
5959+ "mention": {
6060+ "description": "Facet feature for mention of another account. The text is usually a handle, including a '@' prefix, but the facet reference is a DID.",
6161+ "properties": {
6262+ "did": {
6363+ "format": "did",
6464+ "type": "string"
6565+ }
6666+ },
6767+ "required": [
6868+ "did"
6969+ ],
7070+ "type": "object"
7171+ },
7272+ "tag": {
7373+ "description": "Facet feature for a hashtag. The text usually includes a '#' prefix, but the facet reference should not (except in the case of 'double hash tags').",
7474+ "properties": {
7575+ "tag": {
7676+ "maxGraphemes": 64,
7777+ "maxLength": 640,
7878+ "type": "string"
7979+ }
8080+ },
8181+ "required": [
8282+ "tag"
8383+ ],
8484+ "type": "object"
8585+ }
8686+ },
8787+ "id": "app.bsky.richtext.facet",
8888+ "lexicon": 1
8989+}