add lexicon codegen: vendored lexicons, lex cli and generation scripts
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"id": "app.bsky.draft.createDraft",
|
||||
"defs": {
|
||||
"main": {
|
||||
"type": "procedure",
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"draft"
|
||||
],
|
||||
"properties": {
|
||||
"draft": {
|
||||
"ref": "app.bsky.draft.defs#draft",
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
},
|
||||
"encoding": "application/json"
|
||||
},
|
||||
"errors": [
|
||||
{
|
||||
"name": "DraftLimitReached",
|
||||
"description": "Trying to insert a new draft when the limit was already reached."
|
||||
}
|
||||
],
|
||||
"output": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "The ID of the created draft."
|
||||
}
|
||||
}
|
||||
},
|
||||
"encoding": "application/json"
|
||||
},
|
||||
"description": "Inserts a draft using private storage (stash). An upper limit of drafts might be enforced. Requires authentication."
|
||||
}
|
||||
},
|
||||
"$type": "com.atproto.lexicon.schema",
|
||||
"lexicon": 1
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
{
|
||||
"id": "app.bsky.draft.defs",
|
||||
"defs": {
|
||||
"draft": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"posts"
|
||||
],
|
||||
"properties": {
|
||||
"langs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"format": "language"
|
||||
},
|
||||
"maxLength": 3,
|
||||
"description": "Indicates human language of posts primary text content."
|
||||
},
|
||||
"posts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"ref": "#draftPost",
|
||||
"type": "ref"
|
||||
},
|
||||
"maxLength": 100,
|
||||
"minLength": 1,
|
||||
"description": "Array of draft posts that compose this draft."
|
||||
},
|
||||
"deviceId": {
|
||||
"type": "string",
|
||||
"maxLength": 100,
|
||||
"description": "UUIDv4 identifier of the device that created this draft."
|
||||
},
|
||||
"deviceName": {
|
||||
"type": "string",
|
||||
"maxLength": 100,
|
||||
"description": "The device and/or platform on which the draft was created."
|
||||
},
|
||||
"threadgateAllow": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"refs": [
|
||||
"app.bsky.feed.threadgate#mentionRule",
|
||||
"app.bsky.feed.threadgate#followerRule",
|
||||
"app.bsky.feed.threadgate#followingRule",
|
||||
"app.bsky.feed.threadgate#listRule"
|
||||
],
|
||||
"type": "union"
|
||||
},
|
||||
"maxLength": 5,
|
||||
"description": "Allow-rules for the threadgate to be created when this draft is published."
|
||||
},
|
||||
"postgateEmbeddingRules": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"refs": [
|
||||
"app.bsky.feed.postgate#disableRule"
|
||||
],
|
||||
"type": "union"
|
||||
},
|
||||
"maxLength": 5,
|
||||
"description": "Embedding rules for the postgates to be created when this draft is published."
|
||||
}
|
||||
},
|
||||
"description": "A draft containing an array of draft posts."
|
||||
},
|
||||
"draftPost": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"text"
|
||||
],
|
||||
"properties": {
|
||||
"text": {
|
||||
"type": "string",
|
||||
"maxLength": 10000,
|
||||
"description": "The primary post content. It has a higher limit than post contents to allow storing a larger text that can later be refined into smaller posts.",
|
||||
"maxGraphemes": 1000
|
||||
},
|
||||
"labels": {
|
||||
"refs": [
|
||||
"com.atproto.label.defs#selfLabels"
|
||||
],
|
||||
"type": "union",
|
||||
"description": "Self-label values for this post. Effectively content warnings."
|
||||
},
|
||||
"embedImages": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"ref": "#draftEmbedImage",
|
||||
"type": "ref"
|
||||
},
|
||||
"maxLength": 4
|
||||
},
|
||||
"embedVideos": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"ref": "#draftEmbedVideo",
|
||||
"type": "ref"
|
||||
},
|
||||
"maxLength": 1
|
||||
},
|
||||
"embedGallery": {
|
||||
"ref": "#draftEmbedGallery",
|
||||
"type": "ref"
|
||||
},
|
||||
"embedRecords": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"ref": "#draftEmbedRecord",
|
||||
"type": "ref"
|
||||
},
|
||||
"maxLength": 1
|
||||
},
|
||||
"embedExternals": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"ref": "#draftEmbedExternal",
|
||||
"type": "ref"
|
||||
},
|
||||
"maxLength": 1
|
||||
}
|
||||
},
|
||||
"description": "One of the posts that compose a draft."
|
||||
},
|
||||
"draftView": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"draft",
|
||||
"createdAt",
|
||||
"updatedAt"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "tid",
|
||||
"description": "A TID to be used as a draft identifier."
|
||||
},
|
||||
"draft": {
|
||||
"ref": "#draft",
|
||||
"type": "ref"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string",
|
||||
"format": "datetime",
|
||||
"description": "The time the draft was created."
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string",
|
||||
"format": "datetime",
|
||||
"description": "The time the draft was last updated."
|
||||
}
|
||||
},
|
||||
"description": "View to present drafts data to users."
|
||||
},
|
||||
"draftWithId": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id",
|
||||
"draft"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "tid",
|
||||
"description": "A TID to be used as a draft identifier."
|
||||
},
|
||||
"draft": {
|
||||
"ref": "#draft",
|
||||
"type": "ref"
|
||||
}
|
||||
},
|
||||
"description": "A draft with an identifier, used to store drafts in private storage (stash)."
|
||||
},
|
||||
"draftEmbedImage": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"localRef"
|
||||
],
|
||||
"properties": {
|
||||
"alt": {
|
||||
"type": "string",
|
||||
"maxGraphemes": 2000
|
||||
},
|
||||
"localRef": {
|
||||
"ref": "#draftEmbedLocalRef",
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
},
|
||||
"draftEmbedVideo": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"localRef"
|
||||
],
|
||||
"properties": {
|
||||
"alt": {
|
||||
"type": "string",
|
||||
"maxGraphemes": 2000
|
||||
},
|
||||
"captions": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"ref": "#draftEmbedCaption",
|
||||
"type": "ref"
|
||||
},
|
||||
"maxLength": 20
|
||||
},
|
||||
"localRef": {
|
||||
"ref": "#draftEmbedLocalRef",
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
},
|
||||
"draftEmbedRecord": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"record"
|
||||
],
|
||||
"properties": {
|
||||
"record": {
|
||||
"ref": "com.atproto.repo.strongRef",
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
},
|
||||
"draftEmbedCaption": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"lang",
|
||||
"content"
|
||||
],
|
||||
"properties": {
|
||||
"lang": {
|
||||
"type": "string",
|
||||
"format": "language"
|
||||
},
|
||||
"content": {
|
||||
"type": "string",
|
||||
"maxLength": 10000
|
||||
}
|
||||
}
|
||||
},
|
||||
"draftEmbedGallery": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"items"
|
||||
],
|
||||
"properties": {
|
||||
"items": {
|
||||
"ref": "#draftEmbedGalleryItems",
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
},
|
||||
"draftEmbedExternal": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"uri"
|
||||
],
|
||||
"properties": {
|
||||
"uri": {
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
}
|
||||
}
|
||||
},
|
||||
"draftEmbedLocalRef": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"path"
|
||||
],
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": "string",
|
||||
"maxLength": 1024,
|
||||
"minLength": 1,
|
||||
"description": "Local, on-device ref to file to be embedded. Embeds are currently device-bound for drafts."
|
||||
}
|
||||
}
|
||||
},
|
||||
"draftEmbedGalleryItems": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"refs": [
|
||||
"#draftEmbedImage"
|
||||
],
|
||||
"type": "union"
|
||||
},
|
||||
"maxLength": 20,
|
||||
"description": "The schema-level maxLength of 20 is a future-proof ceiling. Clients should currently enforce a soft limit of 10 items in authoring UIs."
|
||||
}
|
||||
},
|
||||
"$type": "com.atproto.lexicon.schema",
|
||||
"lexicon": 1
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"id": "app.bsky.draft.deleteDraft",
|
||||
"defs": {
|
||||
"main": {
|
||||
"type": "procedure",
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"id"
|
||||
],
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "tid"
|
||||
}
|
||||
}
|
||||
},
|
||||
"encoding": "application/json"
|
||||
},
|
||||
"description": "Deletes a draft by ID. Requires authentication."
|
||||
}
|
||||
},
|
||||
"$type": "com.atproto.lexicon.schema",
|
||||
"lexicon": 1
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"id": "app.bsky.draft.getDrafts",
|
||||
"defs": {
|
||||
"main": {
|
||||
"type": "query",
|
||||
"output": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"drafts"
|
||||
],
|
||||
"properties": {
|
||||
"cursor": {
|
||||
"type": "string"
|
||||
},
|
||||
"drafts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"ref": "app.bsky.draft.defs#draftView",
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"encoding": "application/json"
|
||||
},
|
||||
"parameters": {
|
||||
"type": "params",
|
||||
"properties": {
|
||||
"limit": {
|
||||
"type": "integer",
|
||||
"default": 50,
|
||||
"maximum": 100,
|
||||
"minimum": 1
|
||||
},
|
||||
"cursor": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"description": "Gets views of user drafts. Requires authentication."
|
||||
}
|
||||
},
|
||||
"$type": "com.atproto.lexicon.schema",
|
||||
"lexicon": 1
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"id": "app.bsky.draft.updateDraft",
|
||||
"defs": {
|
||||
"main": {
|
||||
"type": "procedure",
|
||||
"input": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"draft"
|
||||
],
|
||||
"properties": {
|
||||
"draft": {
|
||||
"ref": "app.bsky.draft.defs#draftWithId",
|
||||
"type": "ref"
|
||||
}
|
||||
}
|
||||
},
|
||||
"encoding": "application/json"
|
||||
},
|
||||
"description": "Updates a draft using private storage (stash). If the draft ID points to a non-existing ID, the update will be silently ignored. This is done because updates don't enforce draft limit, so it accepts all writes, but will ignore invalid ones. Requires authentication."
|
||||
}
|
||||
},
|
||||
"$type": "com.atproto.lexicon.schema",
|
||||
"lexicon": 1
|
||||
}
|
||||
Reference in New Issue
Block a user