@atproto/pds 0.3.13 → 0.3.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -112,6 +112,7 @@ export type Preferences = (
112
112
  | PersonalDetailsPref
113
113
  | FeedViewPref
114
114
  | ThreadViewPref
115
+ | InterestsPref
115
116
  | { $type: string; [k: string]: unknown }
116
117
  )[]
117
118
 
@@ -233,3 +234,21 @@ export function isThreadViewPref(v: unknown): v is ThreadViewPref {
233
234
  export function validateThreadViewPref(v: unknown): ValidationResult {
234
235
  return lexicons.validate('app.bsky.actor.defs#threadViewPref', v)
235
236
  }
237
+
238
+ export interface InterestsPref {
239
+ /** A list of tags which describe the account owner's interests gathered during onboarding. */
240
+ tags: string[]
241
+ [k: string]: unknown
242
+ }
243
+
244
+ export function isInterestsPref(v: unknown): v is InterestsPref {
245
+ return (
246
+ isObj(v) &&
247
+ hasProp(v, '$type') &&
248
+ v.$type === 'app.bsky.actor.defs#interestsPref'
249
+ )
250
+ }
251
+
252
+ export function validateInterestsPref(v: unknown): ValidationResult {
253
+ return lexicons.validate('app.bsky.actor.defs#interestsPref', v)
254
+ }
@@ -102,3 +102,44 @@ export function isListViewerState(v: unknown): v is ListViewerState {
102
102
  export function validateListViewerState(v: unknown): ValidationResult {
103
103
  return lexicons.validate('app.bsky.graph.defs#listViewerState', v)
104
104
  }
105
+
106
+ /** indicates that a handle or DID could not be resolved */
107
+ export interface NotFoundActor {
108
+ actor: string
109
+ notFound: true
110
+ [k: string]: unknown
111
+ }
112
+
113
+ export function isNotFoundActor(v: unknown): v is NotFoundActor {
114
+ return (
115
+ isObj(v) &&
116
+ hasProp(v, '$type') &&
117
+ v.$type === 'app.bsky.graph.defs#notFoundActor'
118
+ )
119
+ }
120
+
121
+ export function validateNotFoundActor(v: unknown): ValidationResult {
122
+ return lexicons.validate('app.bsky.graph.defs#notFoundActor', v)
123
+ }
124
+
125
+ /** lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object) */
126
+ export interface Relationship {
127
+ did: string
128
+ /** if the actor follows this DID, this is the AT-URI of the follow record */
129
+ following?: string
130
+ /** if the actor is followed by this DID, contains the AT-URI of the follow record */
131
+ followedBy?: string
132
+ [k: string]: unknown
133
+ }
134
+
135
+ export function isRelationship(v: unknown): v is Relationship {
136
+ return (
137
+ isObj(v) &&
138
+ hasProp(v, '$type') &&
139
+ v.$type === 'app.bsky.graph.defs#relationship'
140
+ )
141
+ }
142
+
143
+ export function validateRelationship(v: unknown): ValidationResult {
144
+ return lexicons.validate('app.bsky.graph.defs#relationship', v)
145
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { isObj, hasProp } from '../../../../util'
8
+ import { CID } from 'multiformats/cid'
9
+ import { HandlerAuth } from '@atproto/xrpc-server'
10
+ import * as AppBskyGraphDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ actor: string
14
+ others?: string[]
15
+ }
16
+
17
+ export type InputSchema = undefined
18
+
19
+ export interface OutputSchema {
20
+ actor?: string
21
+ relationships: (
22
+ | AppBskyGraphDefs.Relationship
23
+ | AppBskyGraphDefs.NotFoundActor
24
+ | { $type: string; [k: string]: unknown }
25
+ )[]
26
+ [k: string]: unknown
27
+ }
28
+
29
+ export type HandlerInput = undefined
30
+
31
+ export interface HandlerSuccess {
32
+ encoding: 'application/json'
33
+ body: OutputSchema
34
+ headers?: { [key: string]: string }
35
+ }
36
+
37
+ export interface HandlerError {
38
+ status: number
39
+ message?: string
40
+ error?: 'ActorNotFound'
41
+ }
42
+
43
+ export type HandlerOutput = HandlerError | HandlerSuccess
44
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
45
+ auth: HA
46
+ params: QueryParams
47
+ input: HandlerInput
48
+ req: express.Request
49
+ res: express.Response
50
+ }
51
+ export type Handler<HA extends HandlerAuth = never> = (
52
+ ctx: HandlerReqCtx<HA>,
53
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,65 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { isObj, hasProp } from '../../../../util'
8
+ import { CID } from 'multiformats/cid'
9
+ import { HandlerAuth } from '@atproto/xrpc-server'
10
+
11
+ export interface QueryParams {}
12
+
13
+ export type InputSchema = undefined
14
+
15
+ export interface OutputSchema {
16
+ suggestions: Suggestion[]
17
+ [k: string]: unknown
18
+ }
19
+
20
+ export type HandlerInput = undefined
21
+
22
+ export interface HandlerSuccess {
23
+ encoding: 'application/json'
24
+ body: OutputSchema
25
+ headers?: { [key: string]: string }
26
+ }
27
+
28
+ export interface HandlerError {
29
+ status: number
30
+ message?: string
31
+ }
32
+
33
+ export type HandlerOutput = HandlerError | HandlerSuccess
34
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
35
+ auth: HA
36
+ params: QueryParams
37
+ input: HandlerInput
38
+ req: express.Request
39
+ res: express.Response
40
+ }
41
+ export type Handler<HA extends HandlerAuth = never> = (
42
+ ctx: HandlerReqCtx<HA>,
43
+ ) => Promise<HandlerOutput> | HandlerOutput
44
+
45
+ export interface Suggestion {
46
+ tag: string
47
+ subjectType: 'actor' | 'feed' | (string & {})
48
+ subject: string
49
+ [k: string]: unknown
50
+ }
51
+
52
+ export function isSuggestion(v: unknown): v is Suggestion {
53
+ return (
54
+ isObj(v) &&
55
+ hasProp(v, '$type') &&
56
+ v.$type === 'app.bsky.unspecced.getTaggedSuggestions#suggestion'
57
+ )
58
+ }
59
+
60
+ export function validateSuggestion(v: unknown): ValidationResult {
61
+ return lexicons.validate(
62
+ 'app.bsky.unspecced.getTaggedSuggestions#suggestion',
63
+ v,
64
+ )
65
+ }