add @bsky.app/sdk + @atproto/lex, vendor lexicons, codegen via lex cli

This commit is contained in:
Samuel Newman
2026-07-15 16:06:20 +03:00
parent 17c1ee4869
commit 15e232749a
306 changed files with 22544 additions and 2 deletions
+57
View File
@@ -0,0 +1,57 @@
{
"lexicon": 1,
"id": "app.bsky.contact.defs",
"defs": {
"matchAndContactIndex": {
"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": "object",
"required": ["match", "contactIndex"],
"properties": {
"match": {
"description": "Profile of the matched user.",
"type": "ref",
"ref": "app.bsky.actor.defs#profileView"
},
"contactIndex": {
"description": "The index of this match in the import contact input.",
"type": "integer",
"minimum": 0,
"maximum": 999
}
}
},
"syncStatus": {
"type": "object",
"required": ["syncedAt", "matchesCount"],
"properties": {
"syncedAt": {
"description": "Last date when contacts where imported.",
"type": "string",
"format": "datetime"
},
"matchesCount": {
"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.",
"type": "integer",
"minimum": 0
}
}
},
"notification": {
"description": "A stash object to be sent via bsync representing a notification to be created.",
"type": "object",
"required": ["from", "to"],
"properties": {
"from": {
"description": "The DID of who this notification comes from.",
"type": "string",
"format": "did"
},
"to": {
"description": "The DID of who this notification should go to.",
"type": "string",
"format": "did"
}
}
}
}
}
@@ -0,0 +1,39 @@
{
"lexicon": 1,
"id": "app.bsky.contact.dismissMatch",
"defs": {
"main": {
"type": "procedure",
"description": "Removes a match that was found via contact import. It shouldn't appear again if the same contact is re-imported. Requires authentication.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["subject"],
"properties": {
"subject": {
"description": "The subject's DID to dismiss the match with.",
"type": "string",
"format": "did"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {}
}
},
"errors": [
{
"name": "InvalidDid"
},
{
"name": "InternalError"
}
]
}
}
}
+57
View File
@@ -0,0 +1,57 @@
{
"lexicon": 1,
"id": "app.bsky.contact.getMatches",
"defs": {
"main": {
"type": "query",
"description": "Returns the matched contacts (contacts that were mutually imported). Excludes dismissed matches. Requires authentication.",
"parameters": {
"type": "params",
"properties": {
"limit": {
"type": "integer",
"minimum": 1,
"maximum": 100,
"default": 50
},
"cursor": {
"type": "string"
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["matches"],
"properties": {
"cursor": {
"type": "string"
},
"matches": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.actor.defs#profileView"
}
}
}
}
},
"errors": [
{
"name": "InvalidDid"
},
{
"name": "InvalidLimit"
},
{
"name": "InvalidCursor"
},
{
"name": "InternalError"
}
]
}
}
}
@@ -0,0 +1,35 @@
{
"lexicon": 1,
"id": "app.bsky.contact.getSyncStatus",
"defs": {
"main": {
"type": "query",
"description": "Gets the user's current contact import status. Requires authentication.",
"parameters": {
"type": "params",
"properties": {}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {
"syncStatus": {
"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.",
"type": "ref",
"ref": "app.bsky.contact.defs#syncStatus"
}
}
}
},
"errors": [
{
"name": "InvalidDid"
},
{
"name": "InternalError"
}
]
}
}
}
@@ -0,0 +1,66 @@
{
"lexicon": 1,
"id": "app.bsky.contact.importContacts",
"defs": {
"main": {
"type": "procedure",
"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.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["token", "contacts"],
"properties": {
"token": {
"description": "JWT to authenticate the call. Use the JWT received as a response to the call to `app.bsky.contact.verifyPhone`.",
"type": "string"
},
"contacts": {
"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`.",
"type": "array",
"items": {
"type": "string"
},
"minLength": 1,
"maxLength": 1000
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["matchesAndContactIndexes"],
"properties": {
"matchesAndContactIndexes": {
"description": "The users that matched during import and their indexes on the input contacts, so the client can correlate with its local list.",
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.contact.defs#matchAndContactIndex"
}
}
}
}
},
"errors": [
{
"name": "InvalidDid"
},
{
"name": "InvalidContacts"
},
{
"name": "TooManyContacts"
},
{
"name": "InvalidToken"
},
{
"name": "InternalError"
}
]
}
}
}
+32
View File
@@ -0,0 +1,32 @@
{
"lexicon": 1,
"id": "app.bsky.contact.removeData",
"defs": {
"main": {
"type": "procedure",
"description": "Removes all stored hashes used for contact matching, existing matches, and sync status. Requires authentication.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {}
}
},
"errors": [
{
"name": "InvalidDid"
},
{
"name": "InternalError"
}
]
}
}
}
@@ -0,0 +1,36 @@
{
"lexicon": 1,
"id": "app.bsky.contact.sendNotification",
"defs": {
"main": {
"type": "procedure",
"description": "System endpoint to send notifications related to contact imports. Requires role authentication.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["from", "to"],
"properties": {
"from": {
"description": "The DID of who this notification comes from.",
"type": "string",
"format": "did"
},
"to": {
"description": "The DID of who this notification should go to.",
"type": "string",
"format": "did"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {}
}
}
}
}
}
@@ -0,0 +1,44 @@
{
"lexicon": 1,
"id": "app.bsky.contact.startPhoneVerification",
"defs": {
"main": {
"type": "procedure",
"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.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["phone"],
"properties": {
"phone": {
"description": "The phone number to receive the code via SMS.",
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {}
}
},
"errors": [
{
"name": "RateLimitExceeded"
},
{
"name": "InvalidDid"
},
{
"name": "InvalidPhone"
},
{
"name": "InternalError"
}
]
}
}
}
@@ -0,0 +1,57 @@
{
"lexicon": 1,
"id": "app.bsky.contact.verifyPhone",
"defs": {
"main": {
"type": "procedure",
"description": "Verifies control over a phone number with a code received via SMS and starts a contact import session. Requires authentication.",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["phone", "code"],
"properties": {
"phone": {
"description": "The phone number to verify. Should be the same as the one passed to `app.bsky.contact.startPhoneVerification`.",
"type": "string"
},
"code": {
"description": "The code received via SMS as a result of the call to `app.bsky.contact.startPhoneVerification`.",
"type": "string"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["token"],
"properties": {
"token": {
"description": "JWT to be used in a call to `app.bsky.contact.importContacts`. It is only valid for a single call.",
"type": "string"
}
}
}
},
"errors": [
{
"name": "RateLimitExceeded"
},
{
"name": "InvalidDid"
},
{
"name": "InvalidPhone"
},
{
"name": "InvalidCode"
},
{
"name": "InternalError"
}
]
}
}
}