-
Notifications
You must be signed in to change notification settings - Fork 554
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
getSuggestionsSkeleton lexicon (#2399)
* schema * codegen * add skeletonActor def * add optional viewer param * codegen * make move route to unspecced * use unspecced skeleton actor
- Loading branch information
Showing
13 changed files
with
496 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "app.bsky.unspecced.getSuggestionsSkeleton", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Get a skeleton of suggested actors. Intended to be called and then hydrated through app.bsky.actor.getSuggestions", | ||
"parameters": { | ||
"type": "params", | ||
"properties": { | ||
"viewer": { | ||
"type": "string", | ||
"format": "did", | ||
"description": "DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking." | ||
}, | ||
"limit": { | ||
"type": "integer", | ||
"minimum": 1, | ||
"maximum": 100, | ||
"default": 50 | ||
}, | ||
"cursor": { "type": "string" } | ||
} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["actors"], | ||
"properties": { | ||
"cursor": { "type": "string" }, | ||
"actors": { | ||
"type": "array", | ||
"items": { | ||
"type": "ref", | ||
"ref": "app.bsky.unspecced.defs#skeletonSearchActor" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
packages/api/src/client/types/app/bsky/unspecced/getSuggestionsSkeleton.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* GENERATED CODE - DO NOT MODIFY | ||
*/ | ||
import { Headers, XRPCError } from '@atproto/xrpc' | ||
import { ValidationResult, BlobRef } from '@atproto/lexicon' | ||
import { isObj, hasProp } from '../../../../util' | ||
import { lexicons } from '../../../../lexicons' | ||
import { CID } from 'multiformats/cid' | ||
import * as AppBskyUnspeccedDefs from './defs' | ||
|
||
export interface QueryParams { | ||
/** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */ | ||
viewer?: string | ||
limit?: number | ||
cursor?: string | ||
} | ||
|
||
export type InputSchema = undefined | ||
|
||
export interface OutputSchema { | ||
cursor?: string | ||
actors: AppBskyUnspeccedDefs.SkeletonSearchActor[] | ||
[k: string]: unknown | ||
} | ||
|
||
export interface CallOptions { | ||
headers?: Headers | ||
} | ||
|
||
export interface Response { | ||
success: boolean | ||
headers: Headers | ||
data: OutputSchema | ||
} | ||
|
||
export function toKnownErr(e: any) { | ||
if (e instanceof XRPCError) { | ||
} | ||
return e | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
packages/bsky/src/lexicon/types/app/bsky/unspecced/getSuggestionsSkeleton.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* GENERATED CODE - DO NOT MODIFY | ||
*/ | ||
import express from 'express' | ||
import { ValidationResult, BlobRef } from '@atproto/lexicon' | ||
import { lexicons } from '../../../../lexicons' | ||
import { isObj, hasProp } from '../../../../util' | ||
import { CID } from 'multiformats/cid' | ||
import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server' | ||
import * as AppBskyUnspeccedDefs from './defs' | ||
|
||
export interface QueryParams { | ||
/** DID of the account making the request (not included for public/unauthenticated queries). Used to boost followed accounts in ranking. */ | ||
viewer?: string | ||
limit: number | ||
cursor?: string | ||
} | ||
|
||
export type InputSchema = undefined | ||
|
||
export interface OutputSchema { | ||
cursor?: string | ||
actors: AppBskyUnspeccedDefs.SkeletonSearchActor[] | ||
[k: string]: unknown | ||
} | ||
|
||
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 | ||
} | ||
export type Handler<HA extends HandlerAuth = never> = ( | ||
ctx: HandlerReqCtx<HA>, | ||
) => Promise<HandlerOutput> | HandlerOutput |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.