Update chat lexicons (#3564)

* new chat lex

* changeset
This commit is contained in:
rafael 2025-02-21 05:01:37 -08:00 committed by GitHub
parent 01874c4be7
commit 22af31a898
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
34 changed files with 1474 additions and 14 deletions

View File

@ -0,0 +1,5 @@
---
"@atproto/api": patch
---
Update chat lexicons

View File

@ -0,0 +1,31 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.acceptConvo",
"defs": {
"main": {
"type": "procedure",
"input": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["convoId"],
"properties": {
"convoId": { "type": "string" }
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"properties": {
"rev": {
"description": "Rev when the convo was accepted. If not present, the convo was already accepted.",
"type": "string"
}
}
}
}
}
}
}

View File

@ -90,7 +90,10 @@
"refs": ["#messageView", "#deletedMessageView"]
},
"muted": { "type": "boolean" },
"opened": { "type": "boolean" },
"status": {
"type": "string",
"knownValues": ["request", "accepted"]
},
"unreadCount": { "type": "integer" }
}
},
@ -102,6 +105,14 @@
"convoId": { "type": "string" }
}
},
"logAcceptConvo": {
"type": "object",
"required": ["rev", "convoId"],
"properties": {
"rev": { "type": "string" },
"convoId": { "type": "string" }
}
},
"logLeaveConvo": {
"type": "object",
"required": ["rev", "convoId"],
@ -110,6 +121,22 @@
"convoId": { "type": "string" }
}
},
"logMuteConvo": {
"type": "object",
"required": ["rev", "convoId"],
"properties": {
"rev": { "type": "string" },
"convoId": { "type": "string" }
}
},
"logUnmuteConvo": {
"type": "object",
"required": ["rev", "convoId"],
"properties": {
"rev": { "type": "string" },
"convoId": { "type": "string" }
}
},
"logCreateMessage": {
"type": "object",
"required": ["rev", "convoId", "message"],
@ -133,6 +160,18 @@
"refs": ["#messageView", "#deletedMessageView"]
}
}
},
"logReadMessage": {
"type": "object",
"required": ["rev", "convoId", "message"],
"properties": {
"rev": { "type": "string" },
"convoId": { "type": "string" },
"message": {
"type": "union",
"refs": ["#messageView", "#deletedMessageView"]
}
}
}
}
}

View File

@ -0,0 +1,41 @@
{
"lexicon": 1,
"id": "chat.bsky.convo.getConvoAvailability",
"defs": {
"main": {
"type": "query",
"description": "Get whether the requester and the other members can chat. If an existing convo is found for these members, it is returned.",
"parameters": {
"type": "params",
"required": ["members"],
"properties": {
"members": {
"type": "array",
"minLength": 1,
"maxLength": 10,
"items": {
"type": "string",
"format": "did"
}
}
}
},
"output": {
"encoding": "application/json",
"schema": {
"type": "object",
"required": ["canChat"],
"properties": {
"canChat": {
"type": "boolean"
},
"convo": {
"type": "ref",
"ref": "chat.bsky.convo.defs#convoView"
}
}
}
}
}
}
}

View File

@ -24,6 +24,7 @@
"type": "union",
"refs": [
"chat.bsky.convo.defs#logBeginConvo",
"chat.bsky.convo.defs#logAcceptConvo",
"chat.bsky.convo.defs#logLeaveConvo",
"chat.bsky.convo.defs#logCreateMessage",
"chat.bsky.convo.defs#logDeleteMessage"

View File

@ -13,7 +13,15 @@
"maximum": 100,
"default": 50
},
"cursor": { "type": "string" }
"cursor": { "type": "string" },
"readState": {
"type": "string",
"knownValues": ["unread"]
},
"status": {
"type": "string",
"knownValues": ["request", "accepted"]
}
}
},
"output": {

View File

@ -182,9 +182,11 @@ import * as ChatBskyActorDeclaration from './types/chat/bsky/actor/declaration.j
import * as ChatBskyActorDefs from './types/chat/bsky/actor/defs.js'
import * as ChatBskyActorDeleteAccount from './types/chat/bsky/actor/deleteAccount.js'
import * as ChatBskyActorExportAccountData from './types/chat/bsky/actor/exportAccountData.js'
import * as ChatBskyConvoAcceptConvo from './types/chat/bsky/convo/acceptConvo.js'
import * as ChatBskyConvoDefs from './types/chat/bsky/convo/defs.js'
import * as ChatBskyConvoDeleteMessageForSelf from './types/chat/bsky/convo/deleteMessageForSelf.js'
import * as ChatBskyConvoGetConvo from './types/chat/bsky/convo/getConvo.js'
import * as ChatBskyConvoGetConvoAvailability from './types/chat/bsky/convo/getConvoAvailability.js'
import * as ChatBskyConvoGetConvoForMembers from './types/chat/bsky/convo/getConvoForMembers.js'
import * as ChatBskyConvoGetLog from './types/chat/bsky/convo/getLog.js'
import * as ChatBskyConvoGetMessages from './types/chat/bsky/convo/getMessages.js'
@ -413,9 +415,11 @@ export * as ChatBskyActorDeclaration from './types/chat/bsky/actor/declaration.j
export * as ChatBskyActorDefs from './types/chat/bsky/actor/defs.js'
export * as ChatBskyActorDeleteAccount from './types/chat/bsky/actor/deleteAccount.js'
export * as ChatBskyActorExportAccountData from './types/chat/bsky/actor/exportAccountData.js'
export * as ChatBskyConvoAcceptConvo from './types/chat/bsky/convo/acceptConvo.js'
export * as ChatBskyConvoDefs from './types/chat/bsky/convo/defs.js'
export * as ChatBskyConvoDeleteMessageForSelf from './types/chat/bsky/convo/deleteMessageForSelf.js'
export * as ChatBskyConvoGetConvo from './types/chat/bsky/convo/getConvo.js'
export * as ChatBskyConvoGetConvoAvailability from './types/chat/bsky/convo/getConvoAvailability.js'
export * as ChatBskyConvoGetConvoForMembers from './types/chat/bsky/convo/getConvoForMembers.js'
export * as ChatBskyConvoGetLog from './types/chat/bsky/convo/getLog.js'
export * as ChatBskyConvoGetMessages from './types/chat/bsky/convo/getMessages.js'
@ -3419,6 +3423,18 @@ export class ChatBskyConvoNS {
this._client = client
}
acceptConvo(
data?: ChatBskyConvoAcceptConvo.InputSchema,
opts?: ChatBskyConvoAcceptConvo.CallOptions,
): Promise<ChatBskyConvoAcceptConvo.Response> {
return this._client.call(
'chat.bsky.convo.acceptConvo',
opts?.qp,
data,
opts,
)
}
deleteMessageForSelf(
data?: ChatBskyConvoDeleteMessageForSelf.InputSchema,
opts?: ChatBskyConvoDeleteMessageForSelf.CallOptions,
@ -3443,6 +3459,18 @@ export class ChatBskyConvoNS {
)
}
getConvoAvailability(
params?: ChatBskyConvoGetConvoAvailability.QueryParams,
opts?: ChatBskyConvoGetConvoAvailability.CallOptions,
): Promise<ChatBskyConvoGetConvoAvailability.Response> {
return this._client.call(
'chat.bsky.convo.getConvoAvailability',
params,
undefined,
opts,
)
}
getConvoForMembers(
params?: ChatBskyConvoGetConvoForMembers.QueryParams,
opts?: ChatBskyConvoGetConvoForMembers.CallOptions,

View File

@ -10206,6 +10206,40 @@ export const schemaDict = {
},
},
},
ChatBskyConvoAcceptConvo: {
lexicon: 1,
id: 'chat.bsky.convo.acceptConvo',
defs: {
main: {
type: 'procedure',
input: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['convoId'],
properties: {
convoId: {
type: 'string',
},
},
},
},
output: {
encoding: 'application/json',
schema: {
type: 'object',
properties: {
rev: {
description:
'Rev when the convo was accepted. If not present, the convo was already accepted.',
type: 'string',
},
},
},
},
},
},
},
ChatBskyConvoDefs: {
lexicon: 1,
id: 'chat.bsky.convo.defs',
@ -10343,8 +10377,9 @@ export const schemaDict = {
muted: {
type: 'boolean',
},
opened: {
type: 'boolean',
status: {
type: 'string',
knownValues: ['request', 'accepted'],
},
unreadCount: {
type: 'integer',
@ -10363,6 +10398,18 @@ export const schemaDict = {
},
},
},
logAcceptConvo: {
type: 'object',
required: ['rev', 'convoId'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
},
},
logLeaveConvo: {
type: 'object',
required: ['rev', 'convoId'],
@ -10375,6 +10422,30 @@ export const schemaDict = {
},
},
},
logMuteConvo: {
type: 'object',
required: ['rev', 'convoId'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
},
},
logUnmuteConvo: {
type: 'object',
required: ['rev', 'convoId'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
},
},
logCreateMessage: {
type: 'object',
required: ['rev', 'convoId', 'message'],
@ -10413,6 +10484,25 @@ export const schemaDict = {
},
},
},
logReadMessage: {
type: 'object',
required: ['rev', 'convoId', 'message'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
message: {
type: 'union',
refs: [
'lex:chat.bsky.convo.defs#messageView',
'lex:chat.bsky.convo.defs#deletedMessageView',
],
},
},
},
},
},
ChatBskyConvoDeleteMessageForSelf: {
@ -10477,6 +10567,48 @@ export const schemaDict = {
},
},
},
ChatBskyConvoGetConvoAvailability: {
lexicon: 1,
id: 'chat.bsky.convo.getConvoAvailability',
defs: {
main: {
type: 'query',
description:
'Get whether the requester and the other members can chat. If an existing convo is found for these members, it is returned.',
parameters: {
type: 'params',
required: ['members'],
properties: {
members: {
type: 'array',
minLength: 1,
maxLength: 10,
items: {
type: 'string',
format: 'did',
},
},
},
},
output: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['canChat'],
properties: {
canChat: {
type: 'boolean',
},
convo: {
type: 'ref',
ref: 'lex:chat.bsky.convo.defs#convoView',
},
},
},
},
},
},
},
ChatBskyConvoGetConvoForMembers: {
lexicon: 1,
id: 'chat.bsky.convo.getConvoForMembers',
@ -10544,6 +10676,7 @@ export const schemaDict = {
type: 'union',
refs: [
'lex:chat.bsky.convo.defs#logBeginConvo',
'lex:chat.bsky.convo.defs#logAcceptConvo',
'lex:chat.bsky.convo.defs#logLeaveConvo',
'lex:chat.bsky.convo.defs#logCreateMessage',
'lex:chat.bsky.convo.defs#logDeleteMessage',
@ -10659,6 +10792,14 @@ export const schemaDict = {
cursor: {
type: 'string',
},
readState: {
type: 'string',
knownValues: ['unread'],
},
status: {
type: 'string',
knownValues: ['request', 'accepted'],
},
},
},
output: {
@ -14289,9 +14430,11 @@ export const ids = {
ChatBskyActorDefs: 'chat.bsky.actor.defs',
ChatBskyActorDeleteAccount: 'chat.bsky.actor.deleteAccount',
ChatBskyActorExportAccountData: 'chat.bsky.actor.exportAccountData',
ChatBskyConvoAcceptConvo: 'chat.bsky.convo.acceptConvo',
ChatBskyConvoDefs: 'chat.bsky.convo.defs',
ChatBskyConvoDeleteMessageForSelf: 'chat.bsky.convo.deleteMessageForSelf',
ChatBskyConvoGetConvo: 'chat.bsky.convo.getConvo',
ChatBskyConvoGetConvoAvailability: 'chat.bsky.convo.getConvoAvailability',
ChatBskyConvoGetConvoForMembers: 'chat.bsky.convo.getConvoForMembers',
ChatBskyConvoGetLog: 'chat.bsky.convo.getLog',
ChatBskyConvoGetMessages: 'chat.bsky.convo.getMessages',

View File

@ -0,0 +1,40 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
const is$typed = _is$typed,
validate = _validate
const id = 'chat.bsky.convo.acceptConvo'
export interface QueryParams {}
export interface InputSchema {
convoId: string
}
export interface OutputSchema {
/** Rev when the convo was accepted. If not present, the convo was already accepted. */
rev?: string
}
export interface CallOptions {
signal?: AbortSignal
headers?: HeadersMap
qp?: QueryParams
encoding?: 'application/json'
}
export interface Response {
success: boolean
headers: HeadersMap
data: OutputSchema
}
export function toKnownErr(e: any) {
return e
}

View File

@ -113,7 +113,7 @@ export interface ConvoView {
| $Typed<DeletedMessageView>
| { $type: string }
muted: boolean
opened?: boolean
status?: 'request' | 'accepted' | (string & {})
unreadCount: number
}
@ -143,6 +143,22 @@ export function validateLogBeginConvo<V>(v: V) {
return validate<LogBeginConvo & V>(v, id, hashLogBeginConvo)
}
export interface LogAcceptConvo {
$type?: 'chat.bsky.convo.defs#logAcceptConvo'
rev: string
convoId: string
}
const hashLogAcceptConvo = 'logAcceptConvo'
export function isLogAcceptConvo<V>(v: V) {
return is$typed(v, id, hashLogAcceptConvo)
}
export function validateLogAcceptConvo<V>(v: V) {
return validate<LogAcceptConvo & V>(v, id, hashLogAcceptConvo)
}
export interface LogLeaveConvo {
$type?: 'chat.bsky.convo.defs#logLeaveConvo'
rev: string
@ -159,6 +175,38 @@ export function validateLogLeaveConvo<V>(v: V) {
return validate<LogLeaveConvo & V>(v, id, hashLogLeaveConvo)
}
export interface LogMuteConvo {
$type?: 'chat.bsky.convo.defs#logMuteConvo'
rev: string
convoId: string
}
const hashLogMuteConvo = 'logMuteConvo'
export function isLogMuteConvo<V>(v: V) {
return is$typed(v, id, hashLogMuteConvo)
}
export function validateLogMuteConvo<V>(v: V) {
return validate<LogMuteConvo & V>(v, id, hashLogMuteConvo)
}
export interface LogUnmuteConvo {
$type?: 'chat.bsky.convo.defs#logUnmuteConvo'
rev: string
convoId: string
}
const hashLogUnmuteConvo = 'logUnmuteConvo'
export function isLogUnmuteConvo<V>(v: V) {
return is$typed(v, id, hashLogUnmuteConvo)
}
export function validateLogUnmuteConvo<V>(v: V) {
return validate<LogUnmuteConvo & V>(v, id, hashLogUnmuteConvo)
}
export interface LogCreateMessage {
$type?: 'chat.bsky.convo.defs#logCreateMessage'
rev: string
@ -192,3 +240,20 @@ export function isLogDeleteMessage<V>(v: V) {
export function validateLogDeleteMessage<V>(v: V) {
return validate<LogDeleteMessage & V>(v, id, hashLogDeleteMessage)
}
export interface LogReadMessage {
$type?: 'chat.bsky.convo.defs#logReadMessage'
rev: string
convoId: string
message: $Typed<MessageView> | $Typed<DeletedMessageView> | { $type: string }
}
const hashLogReadMessage = 'logReadMessage'
export function isLogReadMessage<V>(v: V) {
return is$typed(v, id, hashLogReadMessage)
}
export function validateLogReadMessage<V>(v: V) {
return validate<LogReadMessage & V>(v, id, hashLogReadMessage)
}

View File

@ -0,0 +1,39 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import { HeadersMap, XRPCError } from '@atproto/xrpc'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import type * as ChatBskyConvoDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'chat.bsky.convo.getConvoAvailability'
export interface QueryParams {
members: string[]
}
export type InputSchema = undefined
export interface OutputSchema {
canChat: boolean
convo?: ChatBskyConvoDefs.ConvoView
}
export interface CallOptions {
signal?: AbortSignal
headers?: HeadersMap
}
export interface Response {
success: boolean
headers: HeadersMap
data: OutputSchema
}
export function toKnownErr(e: any) {
return e
}

View File

@ -22,6 +22,7 @@ export interface OutputSchema {
cursor?: string
logs: (
| $Typed<ChatBskyConvoDefs.LogBeginConvo>
| $Typed<ChatBskyConvoDefs.LogAcceptConvo>
| $Typed<ChatBskyConvoDefs.LogLeaveConvo>
| $Typed<ChatBskyConvoDefs.LogCreateMessage>
| $Typed<ChatBskyConvoDefs.LogDeleteMessage>

View File

@ -15,6 +15,8 @@ const id = 'chat.bsky.convo.listConvos'
export interface QueryParams {
limit?: number
cursor?: string
readState?: 'unread' | (string & {})
status?: 'request' | 'accepted' | (string & {})
}
export type InputSchema = undefined

View File

@ -150,8 +150,10 @@ import * as AppBskyVideoGetUploadLimits from './types/app/bsky/video/getUploadLi
import * as AppBskyVideoUploadVideo from './types/app/bsky/video/uploadVideo.js'
import * as ChatBskyActorDeleteAccount from './types/chat/bsky/actor/deleteAccount.js'
import * as ChatBskyActorExportAccountData from './types/chat/bsky/actor/exportAccountData.js'
import * as ChatBskyConvoAcceptConvo from './types/chat/bsky/convo/acceptConvo.js'
import * as ChatBskyConvoDeleteMessageForSelf from './types/chat/bsky/convo/deleteMessageForSelf.js'
import * as ChatBskyConvoGetConvo from './types/chat/bsky/convo/getConvo.js'
import * as ChatBskyConvoGetConvoAvailability from './types/chat/bsky/convo/getConvoAvailability.js'
import * as ChatBskyConvoGetConvoForMembers from './types/chat/bsky/convo/getConvoForMembers.js'
import * as ChatBskyConvoGetLog from './types/chat/bsky/convo/getLog.js'
import * as ChatBskyConvoGetMessages from './types/chat/bsky/convo/getMessages.js'
@ -2025,6 +2027,17 @@ export class ChatBskyConvoNS {
this._server = server
}
acceptConvo<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ChatBskyConvoAcceptConvo.Handler<ExtractAuth<AV>>,
ChatBskyConvoAcceptConvo.HandlerReqCtx<ExtractAuth<AV>>
>,
) {
const nsid = 'chat.bsky.convo.acceptConvo' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
deleteMessageForSelf<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
@ -2047,6 +2060,17 @@ export class ChatBskyConvoNS {
return this._server.xrpc.method(nsid, cfg)
}
getConvoAvailability<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ChatBskyConvoGetConvoAvailability.Handler<ExtractAuth<AV>>,
ChatBskyConvoGetConvoAvailability.HandlerReqCtx<ExtractAuth<AV>>
>,
) {
const nsid = 'chat.bsky.convo.getConvoAvailability' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getConvoForMembers<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,

View File

@ -10206,6 +10206,40 @@ export const schemaDict = {
},
},
},
ChatBskyConvoAcceptConvo: {
lexicon: 1,
id: 'chat.bsky.convo.acceptConvo',
defs: {
main: {
type: 'procedure',
input: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['convoId'],
properties: {
convoId: {
type: 'string',
},
},
},
},
output: {
encoding: 'application/json',
schema: {
type: 'object',
properties: {
rev: {
description:
'Rev when the convo was accepted. If not present, the convo was already accepted.',
type: 'string',
},
},
},
},
},
},
},
ChatBskyConvoDefs: {
lexicon: 1,
id: 'chat.bsky.convo.defs',
@ -10343,8 +10377,9 @@ export const schemaDict = {
muted: {
type: 'boolean',
},
opened: {
type: 'boolean',
status: {
type: 'string',
knownValues: ['request', 'accepted'],
},
unreadCount: {
type: 'integer',
@ -10363,6 +10398,18 @@ export const schemaDict = {
},
},
},
logAcceptConvo: {
type: 'object',
required: ['rev', 'convoId'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
},
},
logLeaveConvo: {
type: 'object',
required: ['rev', 'convoId'],
@ -10375,6 +10422,30 @@ export const schemaDict = {
},
},
},
logMuteConvo: {
type: 'object',
required: ['rev', 'convoId'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
},
},
logUnmuteConvo: {
type: 'object',
required: ['rev', 'convoId'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
},
},
logCreateMessage: {
type: 'object',
required: ['rev', 'convoId', 'message'],
@ -10413,6 +10484,25 @@ export const schemaDict = {
},
},
},
logReadMessage: {
type: 'object',
required: ['rev', 'convoId', 'message'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
message: {
type: 'union',
refs: [
'lex:chat.bsky.convo.defs#messageView',
'lex:chat.bsky.convo.defs#deletedMessageView',
],
},
},
},
},
},
ChatBskyConvoDeleteMessageForSelf: {
@ -10477,6 +10567,48 @@ export const schemaDict = {
},
},
},
ChatBskyConvoGetConvoAvailability: {
lexicon: 1,
id: 'chat.bsky.convo.getConvoAvailability',
defs: {
main: {
type: 'query',
description:
'Get whether the requester and the other members can chat. If an existing convo is found for these members, it is returned.',
parameters: {
type: 'params',
required: ['members'],
properties: {
members: {
type: 'array',
minLength: 1,
maxLength: 10,
items: {
type: 'string',
format: 'did',
},
},
},
},
output: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['canChat'],
properties: {
canChat: {
type: 'boolean',
},
convo: {
type: 'ref',
ref: 'lex:chat.bsky.convo.defs#convoView',
},
},
},
},
},
},
},
ChatBskyConvoGetConvoForMembers: {
lexicon: 1,
id: 'chat.bsky.convo.getConvoForMembers',
@ -10544,6 +10676,7 @@ export const schemaDict = {
type: 'union',
refs: [
'lex:chat.bsky.convo.defs#logBeginConvo',
'lex:chat.bsky.convo.defs#logAcceptConvo',
'lex:chat.bsky.convo.defs#logLeaveConvo',
'lex:chat.bsky.convo.defs#logCreateMessage',
'lex:chat.bsky.convo.defs#logDeleteMessage',
@ -10659,6 +10792,14 @@ export const schemaDict = {
cursor: {
type: 'string',
},
readState: {
type: 'string',
knownValues: ['unread'],
},
status: {
type: 'string',
knownValues: ['request', 'accepted'],
},
},
},
output: {
@ -11244,9 +11385,11 @@ export const ids = {
ChatBskyActorDefs: 'chat.bsky.actor.defs',
ChatBskyActorDeleteAccount: 'chat.bsky.actor.deleteAccount',
ChatBskyActorExportAccountData: 'chat.bsky.actor.exportAccountData',
ChatBskyConvoAcceptConvo: 'chat.bsky.convo.acceptConvo',
ChatBskyConvoDefs: 'chat.bsky.convo.defs',
ChatBskyConvoDeleteMessageForSelf: 'chat.bsky.convo.deleteMessageForSelf',
ChatBskyConvoGetConvo: 'chat.bsky.convo.getConvo',
ChatBskyConvoGetConvoAvailability: 'chat.bsky.convo.getConvoAvailability',
ChatBskyConvoGetConvoForMembers: 'chat.bsky.convo.getConvoForMembers',
ChatBskyConvoGetLog: 'chat.bsky.convo.getLog',
ChatBskyConvoGetMessages: 'chat.bsky.convo.getMessages',

View File

@ -0,0 +1,53 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
const is$typed = _is$typed,
validate = _validate
const id = 'chat.bsky.convo.acceptConvo'
export interface QueryParams {}
export interface InputSchema {
convoId: string
}
export interface OutputSchema {
/** Rev when the convo was accepted. If not present, the convo was already accepted. */
rev?: string
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
resetRouteRateLimits: () => Promise<void>
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -113,7 +113,7 @@ export interface ConvoView {
| $Typed<DeletedMessageView>
| { $type: string }
muted: boolean
opened?: boolean
status?: 'request' | 'accepted' | (string & {})
unreadCount: number
}
@ -143,6 +143,22 @@ export function validateLogBeginConvo<V>(v: V) {
return validate<LogBeginConvo & V>(v, id, hashLogBeginConvo)
}
export interface LogAcceptConvo {
$type?: 'chat.bsky.convo.defs#logAcceptConvo'
rev: string
convoId: string
}
const hashLogAcceptConvo = 'logAcceptConvo'
export function isLogAcceptConvo<V>(v: V) {
return is$typed(v, id, hashLogAcceptConvo)
}
export function validateLogAcceptConvo<V>(v: V) {
return validate<LogAcceptConvo & V>(v, id, hashLogAcceptConvo)
}
export interface LogLeaveConvo {
$type?: 'chat.bsky.convo.defs#logLeaveConvo'
rev: string
@ -159,6 +175,38 @@ export function validateLogLeaveConvo<V>(v: V) {
return validate<LogLeaveConvo & V>(v, id, hashLogLeaveConvo)
}
export interface LogMuteConvo {
$type?: 'chat.bsky.convo.defs#logMuteConvo'
rev: string
convoId: string
}
const hashLogMuteConvo = 'logMuteConvo'
export function isLogMuteConvo<V>(v: V) {
return is$typed(v, id, hashLogMuteConvo)
}
export function validateLogMuteConvo<V>(v: V) {
return validate<LogMuteConvo & V>(v, id, hashLogMuteConvo)
}
export interface LogUnmuteConvo {
$type?: 'chat.bsky.convo.defs#logUnmuteConvo'
rev: string
convoId: string
}
const hashLogUnmuteConvo = 'logUnmuteConvo'
export function isLogUnmuteConvo<V>(v: V) {
return is$typed(v, id, hashLogUnmuteConvo)
}
export function validateLogUnmuteConvo<V>(v: V) {
return validate<LogUnmuteConvo & V>(v, id, hashLogUnmuteConvo)
}
export interface LogCreateMessage {
$type?: 'chat.bsky.convo.defs#logCreateMessage'
rev: string
@ -192,3 +240,20 @@ export function isLogDeleteMessage<V>(v: V) {
export function validateLogDeleteMessage<V>(v: V) {
return validate<LogDeleteMessage & V>(v, id, hashLogDeleteMessage)
}
export interface LogReadMessage {
$type?: 'chat.bsky.convo.defs#logReadMessage'
rev: string
convoId: string
message: $Typed<MessageView> | $Typed<DeletedMessageView> | { $type: string }
}
const hashLogReadMessage = 'logReadMessage'
export function isLogReadMessage<V>(v: V) {
return is$typed(v, id, hashLogReadMessage)
}
export function validateLogReadMessage<V>(v: V) {
return validate<LogReadMessage & V>(v, id, hashLogReadMessage)
}

View File

@ -0,0 +1,51 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
import type * as ChatBskyConvoDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'chat.bsky.convo.getConvoAvailability'
export interface QueryParams {
members: string[]
}
export type InputSchema = undefined
export interface OutputSchema {
canChat: boolean
convo?: ChatBskyConvoDefs.ConvoView
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
resetRouteRateLimits: () => Promise<void>
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -23,6 +23,7 @@ export interface OutputSchema {
cursor?: string
logs: (
| $Typed<ChatBskyConvoDefs.LogBeginConvo>
| $Typed<ChatBskyConvoDefs.LogAcceptConvo>
| $Typed<ChatBskyConvoDefs.LogLeaveConvo>
| $Typed<ChatBskyConvoDefs.LogCreateMessage>
| $Typed<ChatBskyConvoDefs.LogDeleteMessage>

View File

@ -16,6 +16,8 @@ const id = 'chat.bsky.convo.listConvos'
export interface QueryParams {
limit: number
cursor?: string
readState?: 'unread' | (string & {})
status?: 'request' | 'accepted' | (string & {})
}
export type InputSchema = undefined

View File

@ -150,8 +150,10 @@ import * as AppBskyVideoGetUploadLimits from './types/app/bsky/video/getUploadLi
import * as AppBskyVideoUploadVideo from './types/app/bsky/video/uploadVideo.js'
import * as ChatBskyActorDeleteAccount from './types/chat/bsky/actor/deleteAccount.js'
import * as ChatBskyActorExportAccountData from './types/chat/bsky/actor/exportAccountData.js'
import * as ChatBskyConvoAcceptConvo from './types/chat/bsky/convo/acceptConvo.js'
import * as ChatBskyConvoDeleteMessageForSelf from './types/chat/bsky/convo/deleteMessageForSelf.js'
import * as ChatBskyConvoGetConvo from './types/chat/bsky/convo/getConvo.js'
import * as ChatBskyConvoGetConvoAvailability from './types/chat/bsky/convo/getConvoAvailability.js'
import * as ChatBskyConvoGetConvoForMembers from './types/chat/bsky/convo/getConvoForMembers.js'
import * as ChatBskyConvoGetLog from './types/chat/bsky/convo/getLog.js'
import * as ChatBskyConvoGetMessages from './types/chat/bsky/convo/getMessages.js'
@ -2069,6 +2071,17 @@ export class ChatBskyConvoNS {
this._server = server
}
acceptConvo<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ChatBskyConvoAcceptConvo.Handler<ExtractAuth<AV>>,
ChatBskyConvoAcceptConvo.HandlerReqCtx<ExtractAuth<AV>>
>,
) {
const nsid = 'chat.bsky.convo.acceptConvo' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
deleteMessageForSelf<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
@ -2091,6 +2104,17 @@ export class ChatBskyConvoNS {
return this._server.xrpc.method(nsid, cfg)
}
getConvoAvailability<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ChatBskyConvoGetConvoAvailability.Handler<ExtractAuth<AV>>,
ChatBskyConvoGetConvoAvailability.HandlerReqCtx<ExtractAuth<AV>>
>,
) {
const nsid = 'chat.bsky.convo.getConvoAvailability' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getConvoForMembers<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,

View File

@ -10206,6 +10206,40 @@ export const schemaDict = {
},
},
},
ChatBskyConvoAcceptConvo: {
lexicon: 1,
id: 'chat.bsky.convo.acceptConvo',
defs: {
main: {
type: 'procedure',
input: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['convoId'],
properties: {
convoId: {
type: 'string',
},
},
},
},
output: {
encoding: 'application/json',
schema: {
type: 'object',
properties: {
rev: {
description:
'Rev when the convo was accepted. If not present, the convo was already accepted.',
type: 'string',
},
},
},
},
},
},
},
ChatBskyConvoDefs: {
lexicon: 1,
id: 'chat.bsky.convo.defs',
@ -10343,8 +10377,9 @@ export const schemaDict = {
muted: {
type: 'boolean',
},
opened: {
type: 'boolean',
status: {
type: 'string',
knownValues: ['request', 'accepted'],
},
unreadCount: {
type: 'integer',
@ -10363,6 +10398,18 @@ export const schemaDict = {
},
},
},
logAcceptConvo: {
type: 'object',
required: ['rev', 'convoId'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
},
},
logLeaveConvo: {
type: 'object',
required: ['rev', 'convoId'],
@ -10375,6 +10422,30 @@ export const schemaDict = {
},
},
},
logMuteConvo: {
type: 'object',
required: ['rev', 'convoId'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
},
},
logUnmuteConvo: {
type: 'object',
required: ['rev', 'convoId'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
},
},
logCreateMessage: {
type: 'object',
required: ['rev', 'convoId', 'message'],
@ -10413,6 +10484,25 @@ export const schemaDict = {
},
},
},
logReadMessage: {
type: 'object',
required: ['rev', 'convoId', 'message'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
message: {
type: 'union',
refs: [
'lex:chat.bsky.convo.defs#messageView',
'lex:chat.bsky.convo.defs#deletedMessageView',
],
},
},
},
},
},
ChatBskyConvoDeleteMessageForSelf: {
@ -10477,6 +10567,48 @@ export const schemaDict = {
},
},
},
ChatBskyConvoGetConvoAvailability: {
lexicon: 1,
id: 'chat.bsky.convo.getConvoAvailability',
defs: {
main: {
type: 'query',
description:
'Get whether the requester and the other members can chat. If an existing convo is found for these members, it is returned.',
parameters: {
type: 'params',
required: ['members'],
properties: {
members: {
type: 'array',
minLength: 1,
maxLength: 10,
items: {
type: 'string',
format: 'did',
},
},
},
},
output: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['canChat'],
properties: {
canChat: {
type: 'boolean',
},
convo: {
type: 'ref',
ref: 'lex:chat.bsky.convo.defs#convoView',
},
},
},
},
},
},
},
ChatBskyConvoGetConvoForMembers: {
lexicon: 1,
id: 'chat.bsky.convo.getConvoForMembers',
@ -10544,6 +10676,7 @@ export const schemaDict = {
type: 'union',
refs: [
'lex:chat.bsky.convo.defs#logBeginConvo',
'lex:chat.bsky.convo.defs#logAcceptConvo',
'lex:chat.bsky.convo.defs#logLeaveConvo',
'lex:chat.bsky.convo.defs#logCreateMessage',
'lex:chat.bsky.convo.defs#logDeleteMessage',
@ -10659,6 +10792,14 @@ export const schemaDict = {
cursor: {
type: 'string',
},
readState: {
type: 'string',
knownValues: ['unread'],
},
status: {
type: 'string',
knownValues: ['request', 'accepted'],
},
},
},
output: {
@ -14289,9 +14430,11 @@ export const ids = {
ChatBskyActorDefs: 'chat.bsky.actor.defs',
ChatBskyActorDeleteAccount: 'chat.bsky.actor.deleteAccount',
ChatBskyActorExportAccountData: 'chat.bsky.actor.exportAccountData',
ChatBskyConvoAcceptConvo: 'chat.bsky.convo.acceptConvo',
ChatBskyConvoDefs: 'chat.bsky.convo.defs',
ChatBskyConvoDeleteMessageForSelf: 'chat.bsky.convo.deleteMessageForSelf',
ChatBskyConvoGetConvo: 'chat.bsky.convo.getConvo',
ChatBskyConvoGetConvoAvailability: 'chat.bsky.convo.getConvoAvailability',
ChatBskyConvoGetConvoForMembers: 'chat.bsky.convo.getConvoForMembers',
ChatBskyConvoGetLog: 'chat.bsky.convo.getLog',
ChatBskyConvoGetMessages: 'chat.bsky.convo.getMessages',

View File

@ -0,0 +1,53 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
const is$typed = _is$typed,
validate = _validate
const id = 'chat.bsky.convo.acceptConvo'
export interface QueryParams {}
export interface InputSchema {
convoId: string
}
export interface OutputSchema {
/** Rev when the convo was accepted. If not present, the convo was already accepted. */
rev?: string
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
resetRouteRateLimits: () => Promise<void>
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -113,7 +113,7 @@ export interface ConvoView {
| $Typed<DeletedMessageView>
| { $type: string }
muted: boolean
opened?: boolean
status?: 'request' | 'accepted' | (string & {})
unreadCount: number
}
@ -143,6 +143,22 @@ export function validateLogBeginConvo<V>(v: V) {
return validate<LogBeginConvo & V>(v, id, hashLogBeginConvo)
}
export interface LogAcceptConvo {
$type?: 'chat.bsky.convo.defs#logAcceptConvo'
rev: string
convoId: string
}
const hashLogAcceptConvo = 'logAcceptConvo'
export function isLogAcceptConvo<V>(v: V) {
return is$typed(v, id, hashLogAcceptConvo)
}
export function validateLogAcceptConvo<V>(v: V) {
return validate<LogAcceptConvo & V>(v, id, hashLogAcceptConvo)
}
export interface LogLeaveConvo {
$type?: 'chat.bsky.convo.defs#logLeaveConvo'
rev: string
@ -159,6 +175,38 @@ export function validateLogLeaveConvo<V>(v: V) {
return validate<LogLeaveConvo & V>(v, id, hashLogLeaveConvo)
}
export interface LogMuteConvo {
$type?: 'chat.bsky.convo.defs#logMuteConvo'
rev: string
convoId: string
}
const hashLogMuteConvo = 'logMuteConvo'
export function isLogMuteConvo<V>(v: V) {
return is$typed(v, id, hashLogMuteConvo)
}
export function validateLogMuteConvo<V>(v: V) {
return validate<LogMuteConvo & V>(v, id, hashLogMuteConvo)
}
export interface LogUnmuteConvo {
$type?: 'chat.bsky.convo.defs#logUnmuteConvo'
rev: string
convoId: string
}
const hashLogUnmuteConvo = 'logUnmuteConvo'
export function isLogUnmuteConvo<V>(v: V) {
return is$typed(v, id, hashLogUnmuteConvo)
}
export function validateLogUnmuteConvo<V>(v: V) {
return validate<LogUnmuteConvo & V>(v, id, hashLogUnmuteConvo)
}
export interface LogCreateMessage {
$type?: 'chat.bsky.convo.defs#logCreateMessage'
rev: string
@ -192,3 +240,20 @@ export function isLogDeleteMessage<V>(v: V) {
export function validateLogDeleteMessage<V>(v: V) {
return validate<LogDeleteMessage & V>(v, id, hashLogDeleteMessage)
}
export interface LogReadMessage {
$type?: 'chat.bsky.convo.defs#logReadMessage'
rev: string
convoId: string
message: $Typed<MessageView> | $Typed<DeletedMessageView> | { $type: string }
}
const hashLogReadMessage = 'logReadMessage'
export function isLogReadMessage<V>(v: V) {
return is$typed(v, id, hashLogReadMessage)
}
export function validateLogReadMessage<V>(v: V) {
return validate<LogReadMessage & V>(v, id, hashLogReadMessage)
}

View File

@ -0,0 +1,51 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
import type * as ChatBskyConvoDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'chat.bsky.convo.getConvoAvailability'
export interface QueryParams {
members: string[]
}
export type InputSchema = undefined
export interface OutputSchema {
canChat: boolean
convo?: ChatBskyConvoDefs.ConvoView
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
resetRouteRateLimits: () => Promise<void>
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -23,6 +23,7 @@ export interface OutputSchema {
cursor?: string
logs: (
| $Typed<ChatBskyConvoDefs.LogBeginConvo>
| $Typed<ChatBskyConvoDefs.LogAcceptConvo>
| $Typed<ChatBskyConvoDefs.LogLeaveConvo>
| $Typed<ChatBskyConvoDefs.LogCreateMessage>
| $Typed<ChatBskyConvoDefs.LogDeleteMessage>

View File

@ -16,6 +16,8 @@ const id = 'chat.bsky.convo.listConvos'
export interface QueryParams {
limit: number
cursor?: string
readState?: 'unread' | (string & {})
status?: 'request' | 'accepted' | (string & {})
}
export type InputSchema = undefined

View File

@ -150,8 +150,10 @@ import * as AppBskyVideoGetUploadLimits from './types/app/bsky/video/getUploadLi
import * as AppBskyVideoUploadVideo from './types/app/bsky/video/uploadVideo.js'
import * as ChatBskyActorDeleteAccount from './types/chat/bsky/actor/deleteAccount.js'
import * as ChatBskyActorExportAccountData from './types/chat/bsky/actor/exportAccountData.js'
import * as ChatBskyConvoAcceptConvo from './types/chat/bsky/convo/acceptConvo.js'
import * as ChatBskyConvoDeleteMessageForSelf from './types/chat/bsky/convo/deleteMessageForSelf.js'
import * as ChatBskyConvoGetConvo from './types/chat/bsky/convo/getConvo.js'
import * as ChatBskyConvoGetConvoAvailability from './types/chat/bsky/convo/getConvoAvailability.js'
import * as ChatBskyConvoGetConvoForMembers from './types/chat/bsky/convo/getConvoForMembers.js'
import * as ChatBskyConvoGetLog from './types/chat/bsky/convo/getLog.js'
import * as ChatBskyConvoGetMessages from './types/chat/bsky/convo/getMessages.js'
@ -2069,6 +2071,17 @@ export class ChatBskyConvoNS {
this._server = server
}
acceptConvo<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ChatBskyConvoAcceptConvo.Handler<ExtractAuth<AV>>,
ChatBskyConvoAcceptConvo.HandlerReqCtx<ExtractAuth<AV>>
>,
) {
const nsid = 'chat.bsky.convo.acceptConvo' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
deleteMessageForSelf<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
@ -2091,6 +2104,17 @@ export class ChatBskyConvoNS {
return this._server.xrpc.method(nsid, cfg)
}
getConvoAvailability<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,
ChatBskyConvoGetConvoAvailability.Handler<ExtractAuth<AV>>,
ChatBskyConvoGetConvoAvailability.HandlerReqCtx<ExtractAuth<AV>>
>,
) {
const nsid = 'chat.bsky.convo.getConvoAvailability' // @ts-ignore
return this._server.xrpc.method(nsid, cfg)
}
getConvoForMembers<AV extends AuthVerifier>(
cfg: ConfigOf<
AV,

View File

@ -10206,6 +10206,40 @@ export const schemaDict = {
},
},
},
ChatBskyConvoAcceptConvo: {
lexicon: 1,
id: 'chat.bsky.convo.acceptConvo',
defs: {
main: {
type: 'procedure',
input: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['convoId'],
properties: {
convoId: {
type: 'string',
},
},
},
},
output: {
encoding: 'application/json',
schema: {
type: 'object',
properties: {
rev: {
description:
'Rev when the convo was accepted. If not present, the convo was already accepted.',
type: 'string',
},
},
},
},
},
},
},
ChatBskyConvoDefs: {
lexicon: 1,
id: 'chat.bsky.convo.defs',
@ -10343,8 +10377,9 @@ export const schemaDict = {
muted: {
type: 'boolean',
},
opened: {
type: 'boolean',
status: {
type: 'string',
knownValues: ['request', 'accepted'],
},
unreadCount: {
type: 'integer',
@ -10363,6 +10398,18 @@ export const schemaDict = {
},
},
},
logAcceptConvo: {
type: 'object',
required: ['rev', 'convoId'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
},
},
logLeaveConvo: {
type: 'object',
required: ['rev', 'convoId'],
@ -10375,6 +10422,30 @@ export const schemaDict = {
},
},
},
logMuteConvo: {
type: 'object',
required: ['rev', 'convoId'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
},
},
logUnmuteConvo: {
type: 'object',
required: ['rev', 'convoId'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
},
},
logCreateMessage: {
type: 'object',
required: ['rev', 'convoId', 'message'],
@ -10413,6 +10484,25 @@ export const schemaDict = {
},
},
},
logReadMessage: {
type: 'object',
required: ['rev', 'convoId', 'message'],
properties: {
rev: {
type: 'string',
},
convoId: {
type: 'string',
},
message: {
type: 'union',
refs: [
'lex:chat.bsky.convo.defs#messageView',
'lex:chat.bsky.convo.defs#deletedMessageView',
],
},
},
},
},
},
ChatBskyConvoDeleteMessageForSelf: {
@ -10477,6 +10567,48 @@ export const schemaDict = {
},
},
},
ChatBskyConvoGetConvoAvailability: {
lexicon: 1,
id: 'chat.bsky.convo.getConvoAvailability',
defs: {
main: {
type: 'query',
description:
'Get whether the requester and the other members can chat. If an existing convo is found for these members, it is returned.',
parameters: {
type: 'params',
required: ['members'],
properties: {
members: {
type: 'array',
minLength: 1,
maxLength: 10,
items: {
type: 'string',
format: 'did',
},
},
},
},
output: {
encoding: 'application/json',
schema: {
type: 'object',
required: ['canChat'],
properties: {
canChat: {
type: 'boolean',
},
convo: {
type: 'ref',
ref: 'lex:chat.bsky.convo.defs#convoView',
},
},
},
},
},
},
},
ChatBskyConvoGetConvoForMembers: {
lexicon: 1,
id: 'chat.bsky.convo.getConvoForMembers',
@ -10544,6 +10676,7 @@ export const schemaDict = {
type: 'union',
refs: [
'lex:chat.bsky.convo.defs#logBeginConvo',
'lex:chat.bsky.convo.defs#logAcceptConvo',
'lex:chat.bsky.convo.defs#logLeaveConvo',
'lex:chat.bsky.convo.defs#logCreateMessage',
'lex:chat.bsky.convo.defs#logDeleteMessage',
@ -10659,6 +10792,14 @@ export const schemaDict = {
cursor: {
type: 'string',
},
readState: {
type: 'string',
knownValues: ['unread'],
},
status: {
type: 'string',
knownValues: ['request', 'accepted'],
},
},
},
output: {
@ -14289,9 +14430,11 @@ export const ids = {
ChatBskyActorDefs: 'chat.bsky.actor.defs',
ChatBskyActorDeleteAccount: 'chat.bsky.actor.deleteAccount',
ChatBskyActorExportAccountData: 'chat.bsky.actor.exportAccountData',
ChatBskyConvoAcceptConvo: 'chat.bsky.convo.acceptConvo',
ChatBskyConvoDefs: 'chat.bsky.convo.defs',
ChatBskyConvoDeleteMessageForSelf: 'chat.bsky.convo.deleteMessageForSelf',
ChatBskyConvoGetConvo: 'chat.bsky.convo.getConvo',
ChatBskyConvoGetConvoAvailability: 'chat.bsky.convo.getConvoAvailability',
ChatBskyConvoGetConvoForMembers: 'chat.bsky.convo.getConvoForMembers',
ChatBskyConvoGetLog: 'chat.bsky.convo.getLog',
ChatBskyConvoGetMessages: 'chat.bsky.convo.getMessages',

View File

@ -0,0 +1,53 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
const is$typed = _is$typed,
validate = _validate
const id = 'chat.bsky.convo.acceptConvo'
export interface QueryParams {}
export interface InputSchema {
convoId: string
}
export interface OutputSchema {
/** Rev when the convo was accepted. If not present, the convo was already accepted. */
rev?: string
}
export interface HandlerInput {
encoding: 'application/json'
body: InputSchema
}
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
resetRouteRateLimits: () => Promise<void>
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -113,7 +113,7 @@ export interface ConvoView {
| $Typed<DeletedMessageView>
| { $type: string }
muted: boolean
opened?: boolean
status?: 'request' | 'accepted' | (string & {})
unreadCount: number
}
@ -143,6 +143,22 @@ export function validateLogBeginConvo<V>(v: V) {
return validate<LogBeginConvo & V>(v, id, hashLogBeginConvo)
}
export interface LogAcceptConvo {
$type?: 'chat.bsky.convo.defs#logAcceptConvo'
rev: string
convoId: string
}
const hashLogAcceptConvo = 'logAcceptConvo'
export function isLogAcceptConvo<V>(v: V) {
return is$typed(v, id, hashLogAcceptConvo)
}
export function validateLogAcceptConvo<V>(v: V) {
return validate<LogAcceptConvo & V>(v, id, hashLogAcceptConvo)
}
export interface LogLeaveConvo {
$type?: 'chat.bsky.convo.defs#logLeaveConvo'
rev: string
@ -159,6 +175,38 @@ export function validateLogLeaveConvo<V>(v: V) {
return validate<LogLeaveConvo & V>(v, id, hashLogLeaveConvo)
}
export interface LogMuteConvo {
$type?: 'chat.bsky.convo.defs#logMuteConvo'
rev: string
convoId: string
}
const hashLogMuteConvo = 'logMuteConvo'
export function isLogMuteConvo<V>(v: V) {
return is$typed(v, id, hashLogMuteConvo)
}
export function validateLogMuteConvo<V>(v: V) {
return validate<LogMuteConvo & V>(v, id, hashLogMuteConvo)
}
export interface LogUnmuteConvo {
$type?: 'chat.bsky.convo.defs#logUnmuteConvo'
rev: string
convoId: string
}
const hashLogUnmuteConvo = 'logUnmuteConvo'
export function isLogUnmuteConvo<V>(v: V) {
return is$typed(v, id, hashLogUnmuteConvo)
}
export function validateLogUnmuteConvo<V>(v: V) {
return validate<LogUnmuteConvo & V>(v, id, hashLogUnmuteConvo)
}
export interface LogCreateMessage {
$type?: 'chat.bsky.convo.defs#logCreateMessage'
rev: string
@ -192,3 +240,20 @@ export function isLogDeleteMessage<V>(v: V) {
export function validateLogDeleteMessage<V>(v: V) {
return validate<LogDeleteMessage & V>(v, id, hashLogDeleteMessage)
}
export interface LogReadMessage {
$type?: 'chat.bsky.convo.defs#logReadMessage'
rev: string
convoId: string
message: $Typed<MessageView> | $Typed<DeletedMessageView> | { $type: string }
}
const hashLogReadMessage = 'logReadMessage'
export function isLogReadMessage<V>(v: V) {
return is$typed(v, id, hashLogReadMessage)
}
export function validateLogReadMessage<V>(v: V) {
return validate<LogReadMessage & V>(v, id, hashLogReadMessage)
}

View File

@ -0,0 +1,51 @@
/**
* GENERATED CODE - DO NOT MODIFY
*/
import express from 'express'
import { ValidationResult, BlobRef } from '@atproto/lexicon'
import { CID } from 'multiformats/cid'
import { validate as _validate } from '../../../../lexicons'
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
import type * as ChatBskyConvoDefs from './defs.js'
const is$typed = _is$typed,
validate = _validate
const id = 'chat.bsky.convo.getConvoAvailability'
export interface QueryParams {
members: string[]
}
export type InputSchema = undefined
export interface OutputSchema {
canChat: boolean
convo?: ChatBskyConvoDefs.ConvoView
}
export type HandlerInput = undefined
export interface HandlerSuccess {
encoding: 'application/json'
body: OutputSchema
headers?: { [key: string]: string }
}
export interface HandlerError {
status: number
message?: string
}
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
auth: HA
params: QueryParams
input: HandlerInput
req: express.Request
res: express.Response
resetRouteRateLimits: () => Promise<void>
}
export type Handler<HA extends HandlerAuth = never> = (
ctx: HandlerReqCtx<HA>,
) => Promise<HandlerOutput> | HandlerOutput

View File

@ -23,6 +23,7 @@ export interface OutputSchema {
cursor?: string
logs: (
| $Typed<ChatBskyConvoDefs.LogBeginConvo>
| $Typed<ChatBskyConvoDefs.LogAcceptConvo>
| $Typed<ChatBskyConvoDefs.LogLeaveConvo>
| $Typed<ChatBskyConvoDefs.LogCreateMessage>
| $Typed<ChatBskyConvoDefs.LogDeleteMessage>

View File

@ -16,6 +16,8 @@ const id = 'chat.bsky.convo.listConvos'
export interface QueryParams {
limit: number
cursor?: string
readState?: 'unread' | (string & {})
status?: 'request' | 'accepted' | (string & {})
}
export type InputSchema = undefined