add lexicon codegen: vendored lexicons, lex cli and generation scripts

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-08-03 12:06:59 +03:00
parent a2129885c6
commit a3243820c9
311 changed files with 23342 additions and 14 deletions
+67
View File
@@ -0,0 +1,67 @@
{
"id": "app.bsky.contact.defs",
"defs": {
"syncStatus": {
"type": "object",
"required": [
"syncedAt",
"matchesCount"
],
"properties": {
"syncedAt": {
"type": "string",
"format": "datetime",
"description": "Last date when contacts where imported."
},
"matchesCount": {
"type": "integer",
"minimum": 0,
"description": "Number of existing contact matches resulting of the user imports and of their imported contacts having imported the user. Matches stop being counted when the user either follows the matched contact or dismisses the match."
}
}
},
"notification": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"to": {
"type": "string",
"format": "did",
"description": "The DID of who this notification should go to."
},
"from": {
"type": "string",
"format": "did",
"description": "The DID of who this notification comes from."
}
},
"description": "A stash object to be sent via bsync representing a notification to be created."
},
"matchAndContactIndex": {
"type": "object",
"required": [
"match",
"contactIndex"
],
"properties": {
"match": {
"ref": "app.bsky.actor.defs#profileView",
"type": "ref",
"description": "Profile of the matched user."
},
"contactIndex": {
"type": "integer",
"maximum": 999,
"minimum": 0,
"description": "The index of this match in the import contact input."
}
},
"description": "Associates a profile with the positional index of the contact import input in the call to `app.bsky.contact.importContacts`, so clients can know which phone caused a particular match."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
@@ -0,0 +1,42 @@
{
"id": "app.bsky.contact.dismissMatch",
"defs": {
"main": {
"type": "procedure",
"input": {
"schema": {
"type": "object",
"required": [
"subject"
],
"properties": {
"subject": {
"type": "string",
"format": "did",
"description": "The subject's DID to dismiss the match with."
}
}
},
"encoding": "application/json"
},
"errors": [
{
"name": "InvalidDid"
},
{
"name": "InternalError"
}
],
"output": {
"schema": {
"type": "object",
"properties": {}
},
"encoding": "application/json"
},
"description": "Removes a match that was found via contact import. It shouldn't appear again if the same contact is re-imported. Requires authentication."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
+60
View File
@@ -0,0 +1,60 @@
{
"id": "app.bsky.contact.getMatches",
"defs": {
"main": {
"type": "query",
"errors": [
{
"name": "InvalidDid"
},
{
"name": "InvalidLimit"
},
{
"name": "InvalidCursor"
},
{
"name": "InternalError"
}
],
"output": {
"schema": {
"type": "object",
"required": [
"matches"
],
"properties": {
"cursor": {
"type": "string"
},
"matches": {
"type": "array",
"items": {
"ref": "app.bsky.actor.defs#profileView",
"type": "ref"
}
}
}
},
"encoding": "application/json"
},
"parameters": {
"type": "params",
"properties": {
"limit": {
"type": "integer",
"default": 50,
"maximum": 100,
"minimum": 1
},
"cursor": {
"type": "string"
}
}
},
"description": "Returns the matched contacts (contacts that were mutually imported). Excludes dismissed matches. Requires authentication."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
@@ -0,0 +1,36 @@
{
"id": "app.bsky.contact.getSyncStatus",
"defs": {
"main": {
"type": "query",
"errors": [
{
"name": "InvalidDid"
},
{
"name": "InternalError"
}
],
"output": {
"schema": {
"type": "object",
"properties": {
"syncStatus": {
"ref": "app.bsky.contact.defs#syncStatus",
"type": "ref",
"description": "If present, indicates the user has imported their contacts. If not present, indicates the user never used the feature or called `app.bsky.contact.removeData` and didn't import again since."
}
}
},
"encoding": "application/json"
},
"parameters": {
"type": "params",
"properties": {}
},
"description": "Gets the user's current contact import status. Requires authentication."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
@@ -0,0 +1,72 @@
{
"id": "app.bsky.contact.importContacts",
"defs": {
"main": {
"type": "procedure",
"input": {
"schema": {
"type": "object",
"required": [
"token",
"contacts"
],
"properties": {
"token": {
"type": "string",
"description": "JWT to authenticate the call. Use the JWT received as a response to the call to `app.bsky.contact.verifyPhone`."
},
"contacts": {
"type": "array",
"items": {
"type": "string"
},
"maxLength": 1000,
"minLength": 1,
"description": "List of phone numbers in global E.164 format (e.g., '+12125550123'). Phone numbers that cannot be normalized into a valid phone number will be discarded. Should not repeat the 'phone' input used in `app.bsky.contact.verifyPhone`."
}
}
},
"encoding": "application/json"
},
"errors": [
{
"name": "InvalidDid"
},
{
"name": "InvalidContacts"
},
{
"name": "TooManyContacts"
},
{
"name": "InvalidToken"
},
{
"name": "InternalError"
}
],
"output": {
"schema": {
"type": "object",
"required": [
"matchesAndContactIndexes"
],
"properties": {
"matchesAndContactIndexes": {
"type": "array",
"items": {
"ref": "app.bsky.contact.defs#matchAndContactIndex",
"type": "ref"
},
"description": "The users that matched during import and their indexes on the input contacts, so the client can correlate with its local list."
}
}
},
"encoding": "application/json"
},
"description": "Import contacts for securely matching with other users. This follows the protocol explained in https://docs.bsky.app/blog/contact-import-rfc. Requires authentication."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
+33
View File
@@ -0,0 +1,33 @@
{
"id": "app.bsky.contact.removeData",
"defs": {
"main": {
"type": "procedure",
"input": {
"schema": {
"type": "object",
"properties": {}
},
"encoding": "application/json"
},
"errors": [
{
"name": "InvalidDid"
},
{
"name": "InternalError"
}
],
"output": {
"schema": {
"type": "object",
"properties": {}
},
"encoding": "application/json"
},
"description": "Removes all stored hashes used for contact matching, existing matches, and sync status. Requires authentication."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
@@ -0,0 +1,40 @@
{
"id": "app.bsky.contact.sendNotification",
"defs": {
"main": {
"type": "procedure",
"input": {
"schema": {
"type": "object",
"required": [
"from",
"to"
],
"properties": {
"to": {
"type": "string",
"format": "did",
"description": "The DID of who this notification should go to."
},
"from": {
"type": "string",
"format": "did",
"description": "The DID of who this notification comes from."
}
}
},
"encoding": "application/json"
},
"output": {
"schema": {
"type": "object",
"properties": {}
},
"encoding": "application/json"
},
"description": "System endpoint to send notifications related to contact imports. Requires role authentication."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
@@ -0,0 +1,47 @@
{
"id": "app.bsky.contact.startPhoneVerification",
"defs": {
"main": {
"type": "procedure",
"input": {
"schema": {
"type": "object",
"required": [
"phone"
],
"properties": {
"phone": {
"type": "string",
"description": "The phone number to receive the code via SMS."
}
}
},
"encoding": "application/json"
},
"errors": [
{
"name": "RateLimitExceeded"
},
{
"name": "InvalidDid"
},
{
"name": "InvalidPhone"
},
{
"name": "InternalError"
}
],
"output": {
"schema": {
"type": "object",
"properties": {}
},
"encoding": "application/json"
},
"description": "Starts a phone verification flow. The phone passed will receive a code via SMS that should be passed to `app.bsky.contact.verifyPhone`. Requires authentication."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}
@@ -0,0 +1,63 @@
{
"id": "app.bsky.contact.verifyPhone",
"defs": {
"main": {
"type": "procedure",
"input": {
"schema": {
"type": "object",
"required": [
"phone",
"code"
],
"properties": {
"code": {
"type": "string",
"description": "The code received via SMS as a result of the call to `app.bsky.contact.startPhoneVerification`."
},
"phone": {
"type": "string",
"description": "The phone number to verify. Should be the same as the one passed to `app.bsky.contact.startPhoneVerification`."
}
}
},
"encoding": "application/json"
},
"errors": [
{
"name": "RateLimitExceeded"
},
{
"name": "InvalidDid"
},
{
"name": "InvalidPhone"
},
{
"name": "InvalidCode"
},
{
"name": "InternalError"
}
],
"output": {
"schema": {
"type": "object",
"required": [
"token"
],
"properties": {
"token": {
"type": "string",
"description": "JWT to be used in a call to `app.bsky.contact.importContacts`. It is only valid for a single call."
}
}
},
"encoding": "application/json"
},
"description": "Verifies control over a phone number with a code received via SMS and starts a contact import session. Requires authentication."
}
},
"$type": "com.atproto.lexicon.schema",
"lexicon": 1
}