-
Notifications
You must be signed in to change notification settings - Fork 573
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'multi-pds-auth' into signup-queueing-take2
- Loading branch information
Showing
18 changed files
with
513 additions
and
23 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
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,42 @@ | ||
{ | ||
"lexicon": 1, | ||
"id": "app.bsky.unspecced.getTaggedSuggestions", | ||
"defs": { | ||
"main": { | ||
"type": "query", | ||
"description": "Get a list of suggestions (feeds and users) tagged with categories", | ||
"parameters": { | ||
"type": "params", | ||
"properties": {} | ||
}, | ||
"output": { | ||
"encoding": "application/json", | ||
"schema": { | ||
"type": "object", | ||
"required": ["suggestions"], | ||
"properties": { | ||
"suggestions": { | ||
"type": "array", | ||
"items": { | ||
"type": "ref", | ||
"ref": "#suggestion" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"suggestion": { | ||
"type": "object", | ||
"required": ["tag", "subjectType", "subject"], | ||
"properties": { | ||
"tag": { "type": "string" }, | ||
"subjectType": { | ||
"type": "string", | ||
"knownValues": ["actor", "feed"] | ||
}, | ||
"subject": { "type": "string", "format": "uri" } | ||
} | ||
} | ||
} | ||
} |
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
55 changes: 55 additions & 0 deletions
55
packages/api/src/client/types/app/bsky/unspecced/getTaggedSuggestions.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,55 @@ | ||
/** | ||
* 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' | ||
|
||
export interface QueryParams {} | ||
|
||
export type InputSchema = undefined | ||
|
||
export interface OutputSchema { | ||
suggestions: Suggestion[] | ||
[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 | ||
} | ||
|
||
export interface Suggestion { | ||
tag: string | ||
subjectType: 'actor' | 'feed' | (string & {}) | ||
subject: string | ||
[k: string]: unknown | ||
} | ||
|
||
export function isSuggestion(v: unknown): v is Suggestion { | ||
return ( | ||
isObj(v) && | ||
hasProp(v, '$type') && | ||
v.$type === 'app.bsky.unspecced.getTaggedSuggestions#suggestion' | ||
) | ||
} | ||
|
||
export function validateSuggestion(v: unknown): ValidationResult { | ||
return lexicons.validate( | ||
'app.bsky.unspecced.getTaggedSuggestions#suggestion', | ||
v, | ||
) | ||
} |
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
65 changes: 65 additions & 0 deletions
65
packages/bsky/src/lexicon/types/app/bsky/unspecced/getTaggedSuggestions.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,65 @@ | ||
/** | ||
* 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 } from '@atproto/xrpc-server' | ||
|
||
export interface QueryParams {} | ||
|
||
export type InputSchema = undefined | ||
|
||
export interface OutputSchema { | ||
suggestions: Suggestion[] | ||
[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 | ||
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 | ||
|
||
export interface Suggestion { | ||
tag: string | ||
subjectType: 'actor' | 'feed' | (string & {}) | ||
subject: string | ||
[k: string]: unknown | ||
} | ||
|
||
export function isSuggestion(v: unknown): v is Suggestion { | ||
return ( | ||
isObj(v) && | ||
hasProp(v, '$type') && | ||
v.$type === 'app.bsky.unspecced.getTaggedSuggestions#suggestion' | ||
) | ||
} | ||
|
||
export function validateSuggestion(v: unknown): ValidationResult { | ||
return lexicons.validate( | ||
'app.bsky.unspecced.getTaggedSuggestions#suggestion', | ||
v, | ||
) | ||
} |
Oops, something went wrong.