@atproto/pds 0.4.31 → 0.4.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/account-manager/helpers/account.d.ts.map +1 -1
- package/dist/account-manager/helpers/account.js +4 -1
- package/dist/account-manager/helpers/account.js.map +1 -1
- package/dist/api/com/atproto/admin/updateSubjectStatus.d.ts.map +1 -1
- package/dist/api/com/atproto/admin/updateSubjectStatus.js +4 -2
- package/dist/api/com/atproto/admin/updateSubjectStatus.js.map +1 -1
- package/dist/api/com/atproto/server/activateAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/activateAccount.js +7 -1
- package/dist/api/com/atproto/server/activateAccount.js.map +1 -1
- package/dist/api/com/atproto/server/deactivateAccount.d.ts.map +1 -1
- package/dist/api/com/atproto/server/deactivateAccount.js +7 -1
- package/dist/api/com/atproto/server/deactivateAccount.js.map +1 -1
- package/dist/lexicon/index.d.ts +11 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +32 -1
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +180 -0
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +184 -0
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts +9 -0
- package/dist/lexicon/types/app/bsky/actor/defs.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js +11 -1
- package/dist/lexicon/types/app/bsky/actor/defs.js.map +1 -1
- package/dist/lexicon/types/app/bsky/graph/getKnownFollowers.d.ts +40 -0
- package/dist/lexicon/types/app/bsky/graph/getKnownFollowers.d.ts.map +1 -0
- package/dist/lexicon/types/app/bsky/graph/getKnownFollowers.js +3 -0
- package/dist/lexicon/types/app/bsky/graph/getKnownFollowers.js.map +1 -0
- package/dist/lexicon/types/com/atproto/admin/searchAccounts.d.ts +39 -0
- package/dist/lexicon/types/com/atproto/admin/searchAccounts.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/admin/searchAccounts.js +3 -0
- package/dist/lexicon/types/com/atproto/admin/searchAccounts.js.map +1 -0
- package/dist/lexicon/types/tools/ozone/server/getConfig.d.ts +51 -0
- package/dist/lexicon/types/tools/ozone/server/getConfig.d.ts.map +1 -0
- package/dist/lexicon/types/tools/ozone/server/getConfig.js +26 -0
- package/dist/lexicon/types/tools/ozone/server/getConfig.js.map +1 -0
- package/package.json +4 -4
- package/src/account-manager/helpers/account.ts +4 -1
- package/src/api/com/atproto/admin/updateSubjectStatus.ts +5 -2
- package/src/api/com/atproto/server/activateAccount.ts +11 -1
- package/src/api/com/atproto/server/deactivateAccount.ts +11 -1
- package/src/lexicon/index.ts +46 -0
- package/src/lexicon/lexicons.ts +185 -0
- package/src/lexicon/types/app/bsky/actor/defs.ts +20 -0
- package/src/lexicon/types/app/bsky/graph/getKnownFollowers.ts +50 -0
- package/src/lexicon/types/com/atproto/admin/searchAccounts.ts +49 -0
- package/src/lexicon/types/tools/ozone/server/getConfig.ts +85 -0
- package/tests/handle-validation.test.ts +1 -1
- package/tests/proxied/__snapshots__/views.test.ts.snap +77 -4
package/src/lexicon/lexicons.ts
CHANGED
|
@@ -378,6 +378,52 @@ export const schemaDict = {
|
|
|
378
378
|
},
|
|
379
379
|
},
|
|
380
380
|
},
|
|
381
|
+
ComAtprotoAdminSearchAccounts: {
|
|
382
|
+
lexicon: 1,
|
|
383
|
+
id: 'com.atproto.admin.searchAccounts',
|
|
384
|
+
defs: {
|
|
385
|
+
main: {
|
|
386
|
+
type: 'query',
|
|
387
|
+
description: 'Get list of accounts that matches your search query.',
|
|
388
|
+
parameters: {
|
|
389
|
+
type: 'params',
|
|
390
|
+
properties: {
|
|
391
|
+
email: {
|
|
392
|
+
type: 'string',
|
|
393
|
+
},
|
|
394
|
+
cursor: {
|
|
395
|
+
type: 'string',
|
|
396
|
+
},
|
|
397
|
+
limit: {
|
|
398
|
+
type: 'integer',
|
|
399
|
+
minimum: 1,
|
|
400
|
+
maximum: 100,
|
|
401
|
+
default: 50,
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
},
|
|
405
|
+
output: {
|
|
406
|
+
encoding: 'application/json',
|
|
407
|
+
schema: {
|
|
408
|
+
type: 'object',
|
|
409
|
+
required: ['accounts'],
|
|
410
|
+
properties: {
|
|
411
|
+
cursor: {
|
|
412
|
+
type: 'string',
|
|
413
|
+
},
|
|
414
|
+
accounts: {
|
|
415
|
+
type: 'array',
|
|
416
|
+
items: {
|
|
417
|
+
type: 'ref',
|
|
418
|
+
ref: 'lex:com.atproto.admin.defs#accountView',
|
|
419
|
+
},
|
|
420
|
+
},
|
|
421
|
+
},
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
},
|
|
426
|
+
},
|
|
381
427
|
ComAtprotoAdminSendEmail: {
|
|
382
428
|
lexicon: 1,
|
|
383
429
|
id: 'com.atproto.admin.sendEmail',
|
|
@@ -4061,6 +4107,29 @@ export const schemaDict = {
|
|
|
4061
4107
|
type: 'string',
|
|
4062
4108
|
format: 'at-uri',
|
|
4063
4109
|
},
|
|
4110
|
+
knownFollowers: {
|
|
4111
|
+
type: 'ref',
|
|
4112
|
+
ref: 'lex:app.bsky.actor.defs#knownFollowers',
|
|
4113
|
+
},
|
|
4114
|
+
},
|
|
4115
|
+
},
|
|
4116
|
+
knownFollowers: {
|
|
4117
|
+
type: 'object',
|
|
4118
|
+
description: "The subject's followers whom you also follow",
|
|
4119
|
+
required: ['count', 'followers'],
|
|
4120
|
+
properties: {
|
|
4121
|
+
count: {
|
|
4122
|
+
type: 'integer',
|
|
4123
|
+
},
|
|
4124
|
+
followers: {
|
|
4125
|
+
type: 'array',
|
|
4126
|
+
minLength: 0,
|
|
4127
|
+
maxLength: 5,
|
|
4128
|
+
items: {
|
|
4129
|
+
type: 'ref',
|
|
4130
|
+
ref: 'lex:app.bsky.actor.defs#profileViewBasic',
|
|
4131
|
+
},
|
|
4132
|
+
},
|
|
4064
4133
|
},
|
|
4065
4134
|
},
|
|
4066
4135
|
preferences: {
|
|
@@ -7055,6 +7124,59 @@ export const schemaDict = {
|
|
|
7055
7124
|
},
|
|
7056
7125
|
},
|
|
7057
7126
|
},
|
|
7127
|
+
AppBskyGraphGetKnownFollowers: {
|
|
7128
|
+
lexicon: 1,
|
|
7129
|
+
id: 'app.bsky.graph.getKnownFollowers',
|
|
7130
|
+
defs: {
|
|
7131
|
+
main: {
|
|
7132
|
+
type: 'query',
|
|
7133
|
+
description:
|
|
7134
|
+
'Enumerates accounts which follow a specified account (actor) and are followed by the viewer.',
|
|
7135
|
+
parameters: {
|
|
7136
|
+
type: 'params',
|
|
7137
|
+
required: ['actor'],
|
|
7138
|
+
properties: {
|
|
7139
|
+
actor: {
|
|
7140
|
+
type: 'string',
|
|
7141
|
+
format: 'at-identifier',
|
|
7142
|
+
},
|
|
7143
|
+
limit: {
|
|
7144
|
+
type: 'integer',
|
|
7145
|
+
minimum: 1,
|
|
7146
|
+
maximum: 100,
|
|
7147
|
+
default: 50,
|
|
7148
|
+
},
|
|
7149
|
+
cursor: {
|
|
7150
|
+
type: 'string',
|
|
7151
|
+
},
|
|
7152
|
+
},
|
|
7153
|
+
},
|
|
7154
|
+
output: {
|
|
7155
|
+
encoding: 'application/json',
|
|
7156
|
+
schema: {
|
|
7157
|
+
type: 'object',
|
|
7158
|
+
required: ['subject', 'followers'],
|
|
7159
|
+
properties: {
|
|
7160
|
+
subject: {
|
|
7161
|
+
type: 'ref',
|
|
7162
|
+
ref: 'lex:app.bsky.actor.defs#profileView',
|
|
7163
|
+
},
|
|
7164
|
+
cursor: {
|
|
7165
|
+
type: 'string',
|
|
7166
|
+
},
|
|
7167
|
+
followers: {
|
|
7168
|
+
type: 'array',
|
|
7169
|
+
items: {
|
|
7170
|
+
type: 'ref',
|
|
7171
|
+
ref: 'lex:app.bsky.actor.defs#profileView',
|
|
7172
|
+
},
|
|
7173
|
+
},
|
|
7174
|
+
},
|
|
7175
|
+
},
|
|
7176
|
+
},
|
|
7177
|
+
},
|
|
7178
|
+
},
|
|
7179
|
+
},
|
|
7058
7180
|
AppBskyGraphGetList: {
|
|
7059
7181
|
lexicon: 1,
|
|
7060
7182
|
id: 'app.bsky.graph.getList',
|
|
@@ -10774,6 +10896,66 @@ export const schemaDict = {
|
|
|
10774
10896
|
},
|
|
10775
10897
|
},
|
|
10776
10898
|
},
|
|
10899
|
+
ToolsOzoneServerGetConfig: {
|
|
10900
|
+
lexicon: 1,
|
|
10901
|
+
id: 'tools.ozone.server.getConfig',
|
|
10902
|
+
defs: {
|
|
10903
|
+
main: {
|
|
10904
|
+
type: 'query',
|
|
10905
|
+
description: "Get details about ozone's server configuration.",
|
|
10906
|
+
output: {
|
|
10907
|
+
encoding: 'application/json',
|
|
10908
|
+
schema: {
|
|
10909
|
+
type: 'object',
|
|
10910
|
+
properties: {
|
|
10911
|
+
appview: {
|
|
10912
|
+
type: 'ref',
|
|
10913
|
+
ref: 'lex:tools.ozone.server.getConfig#serviceConfig',
|
|
10914
|
+
},
|
|
10915
|
+
pds: {
|
|
10916
|
+
type: 'ref',
|
|
10917
|
+
ref: 'lex:tools.ozone.server.getConfig#serviceConfig',
|
|
10918
|
+
},
|
|
10919
|
+
blobDivert: {
|
|
10920
|
+
type: 'ref',
|
|
10921
|
+
ref: 'lex:tools.ozone.server.getConfig#serviceConfig',
|
|
10922
|
+
},
|
|
10923
|
+
chat: {
|
|
10924
|
+
type: 'ref',
|
|
10925
|
+
ref: 'lex:tools.ozone.server.getConfig#serviceConfig',
|
|
10926
|
+
},
|
|
10927
|
+
viewer: {
|
|
10928
|
+
type: 'ref',
|
|
10929
|
+
ref: 'lex:tools.ozone.server.getConfig#viewerConfig',
|
|
10930
|
+
},
|
|
10931
|
+
},
|
|
10932
|
+
},
|
|
10933
|
+
},
|
|
10934
|
+
},
|
|
10935
|
+
serviceConfig: {
|
|
10936
|
+
type: 'object',
|
|
10937
|
+
properties: {
|
|
10938
|
+
url: {
|
|
10939
|
+
type: 'string',
|
|
10940
|
+
format: 'uri',
|
|
10941
|
+
},
|
|
10942
|
+
},
|
|
10943
|
+
},
|
|
10944
|
+
viewerConfig: {
|
|
10945
|
+
type: 'object',
|
|
10946
|
+
properties: {
|
|
10947
|
+
role: {
|
|
10948
|
+
type: 'string',
|
|
10949
|
+
knownValues: [
|
|
10950
|
+
'tools.ozone.team.defs#roleAdmin',
|
|
10951
|
+
'tools.ozone.team.defs#roleModerator',
|
|
10952
|
+
'tools.ozone.team.defs#roleTriage',
|
|
10953
|
+
],
|
|
10954
|
+
},
|
|
10955
|
+
},
|
|
10956
|
+
},
|
|
10957
|
+
},
|
|
10958
|
+
},
|
|
10777
10959
|
}
|
|
10778
10960
|
export const schemas: LexiconDoc[] = Object.values(schemaDict) as LexiconDoc[]
|
|
10779
10961
|
export const lexicons: Lexicons = new Lexicons(schemas)
|
|
@@ -10788,6 +10970,7 @@ export const ids = {
|
|
|
10788
10970
|
ComAtprotoAdminGetAccountInfos: 'com.atproto.admin.getAccountInfos',
|
|
10789
10971
|
ComAtprotoAdminGetInviteCodes: 'com.atproto.admin.getInviteCodes',
|
|
10790
10972
|
ComAtprotoAdminGetSubjectStatus: 'com.atproto.admin.getSubjectStatus',
|
|
10973
|
+
ComAtprotoAdminSearchAccounts: 'com.atproto.admin.searchAccounts',
|
|
10791
10974
|
ComAtprotoAdminSendEmail: 'com.atproto.admin.sendEmail',
|
|
10792
10975
|
ComAtprotoAdminUpdateAccountEmail: 'com.atproto.admin.updateAccountEmail',
|
|
10793
10976
|
ComAtprotoAdminUpdateAccountHandle: 'com.atproto.admin.updateAccountHandle',
|
|
@@ -10908,6 +11091,7 @@ export const ids = {
|
|
|
10908
11091
|
AppBskyGraphGetBlocks: 'app.bsky.graph.getBlocks',
|
|
10909
11092
|
AppBskyGraphGetFollowers: 'app.bsky.graph.getFollowers',
|
|
10910
11093
|
AppBskyGraphGetFollows: 'app.bsky.graph.getFollows',
|
|
11094
|
+
AppBskyGraphGetKnownFollowers: 'app.bsky.graph.getKnownFollowers',
|
|
10911
11095
|
AppBskyGraphGetList: 'app.bsky.graph.getList',
|
|
10912
11096
|
AppBskyGraphGetListBlocks: 'app.bsky.graph.getListBlocks',
|
|
10913
11097
|
AppBskyGraphGetListMutes: 'app.bsky.graph.getListMutes',
|
|
@@ -10979,4 +11163,5 @@ export const ids = {
|
|
|
10979
11163
|
ToolsOzoneModerationQueryEvents: 'tools.ozone.moderation.queryEvents',
|
|
10980
11164
|
ToolsOzoneModerationQueryStatuses: 'tools.ozone.moderation.queryStatuses',
|
|
10981
11165
|
ToolsOzoneModerationSearchRepos: 'tools.ozone.moderation.searchRepos',
|
|
11166
|
+
ToolsOzoneServerGetConfig: 'tools.ozone.server.getConfig',
|
|
10982
11167
|
}
|
|
@@ -133,6 +133,7 @@ export interface ViewerState {
|
|
|
133
133
|
blockingByList?: AppBskyGraphDefs.ListViewBasic
|
|
134
134
|
following?: string
|
|
135
135
|
followedBy?: string
|
|
136
|
+
knownFollowers?: KnownFollowers
|
|
136
137
|
[k: string]: unknown
|
|
137
138
|
}
|
|
138
139
|
|
|
@@ -148,6 +149,25 @@ export function validateViewerState(v: unknown): ValidationResult {
|
|
|
148
149
|
return lexicons.validate('app.bsky.actor.defs#viewerState', v)
|
|
149
150
|
}
|
|
150
151
|
|
|
152
|
+
/** The subject's followers whom you also follow */
|
|
153
|
+
export interface KnownFollowers {
|
|
154
|
+
count: number
|
|
155
|
+
followers: ProfileViewBasic[]
|
|
156
|
+
[k: string]: unknown
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export function isKnownFollowers(v: unknown): v is KnownFollowers {
|
|
160
|
+
return (
|
|
161
|
+
isObj(v) &&
|
|
162
|
+
hasProp(v, '$type') &&
|
|
163
|
+
v.$type === 'app.bsky.actor.defs#knownFollowers'
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export function validateKnownFollowers(v: unknown): ValidationResult {
|
|
168
|
+
return lexicons.validate('app.bsky.actor.defs#knownFollowers', v)
|
|
169
|
+
}
|
|
170
|
+
|
|
151
171
|
export type Preferences = (
|
|
152
172
|
| AdultContentPref
|
|
153
173
|
| ContentLabelPref
|
|
@@ -0,0 +1,50 @@
|
|
|
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, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
10
|
+
import * as AppBskyActorDefs from '../actor/defs'
|
|
11
|
+
|
|
12
|
+
export interface QueryParams {
|
|
13
|
+
actor: string
|
|
14
|
+
limit: number
|
|
15
|
+
cursor?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type InputSchema = undefined
|
|
19
|
+
|
|
20
|
+
export interface OutputSchema {
|
|
21
|
+
subject: AppBskyActorDefs.ProfileView
|
|
22
|
+
cursor?: string
|
|
23
|
+
followers: AppBskyActorDefs.ProfileView[]
|
|
24
|
+
[k: string]: unknown
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type HandlerInput = undefined
|
|
28
|
+
|
|
29
|
+
export interface HandlerSuccess {
|
|
30
|
+
encoding: 'application/json'
|
|
31
|
+
body: OutputSchema
|
|
32
|
+
headers?: { [key: string]: string }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface HandlerError {
|
|
36
|
+
status: number
|
|
37
|
+
message?: string
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
|
41
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
42
|
+
auth: HA
|
|
43
|
+
params: QueryParams
|
|
44
|
+
input: HandlerInput
|
|
45
|
+
req: express.Request
|
|
46
|
+
res: express.Response
|
|
47
|
+
}
|
|
48
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
49
|
+
ctx: HandlerReqCtx<HA>,
|
|
50
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
@@ -0,0 +1,49 @@
|
|
|
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, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
10
|
+
import * as ComAtprotoAdminDefs from './defs'
|
|
11
|
+
|
|
12
|
+
export interface QueryParams {
|
|
13
|
+
email?: string
|
|
14
|
+
cursor?: string
|
|
15
|
+
limit: number
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type InputSchema = undefined
|
|
19
|
+
|
|
20
|
+
export interface OutputSchema {
|
|
21
|
+
cursor?: string
|
|
22
|
+
accounts: ComAtprotoAdminDefs.AccountView[]
|
|
23
|
+
[k: string]: unknown
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type HandlerInput = undefined
|
|
27
|
+
|
|
28
|
+
export interface HandlerSuccess {
|
|
29
|
+
encoding: 'application/json'
|
|
30
|
+
body: OutputSchema
|
|
31
|
+
headers?: { [key: string]: string }
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface HandlerError {
|
|
35
|
+
status: number
|
|
36
|
+
message?: string
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
|
40
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
41
|
+
auth: HA
|
|
42
|
+
params: QueryParams
|
|
43
|
+
input: HandlerInput
|
|
44
|
+
req: express.Request
|
|
45
|
+
res: express.Response
|
|
46
|
+
}
|
|
47
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
48
|
+
ctx: HandlerReqCtx<HA>,
|
|
49
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
@@ -0,0 +1,85 @@
|
|
|
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, HandlerPipeThrough } from '@atproto/xrpc-server'
|
|
10
|
+
|
|
11
|
+
export interface QueryParams {}
|
|
12
|
+
|
|
13
|
+
export type InputSchema = undefined
|
|
14
|
+
|
|
15
|
+
export interface OutputSchema {
|
|
16
|
+
appview?: ServiceConfig
|
|
17
|
+
pds?: ServiceConfig
|
|
18
|
+
blobDivert?: ServiceConfig
|
|
19
|
+
chat?: ServiceConfig
|
|
20
|
+
viewer?: ViewerConfig
|
|
21
|
+
[k: string]: unknown
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type HandlerInput = undefined
|
|
25
|
+
|
|
26
|
+
export interface HandlerSuccess {
|
|
27
|
+
encoding: 'application/json'
|
|
28
|
+
body: OutputSchema
|
|
29
|
+
headers?: { [key: string]: string }
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface HandlerError {
|
|
33
|
+
status: number
|
|
34
|
+
message?: string
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
|
|
38
|
+
export type HandlerReqCtx<HA extends HandlerAuth = never> = {
|
|
39
|
+
auth: HA
|
|
40
|
+
params: QueryParams
|
|
41
|
+
input: HandlerInput
|
|
42
|
+
req: express.Request
|
|
43
|
+
res: express.Response
|
|
44
|
+
}
|
|
45
|
+
export type Handler<HA extends HandlerAuth = never> = (
|
|
46
|
+
ctx: HandlerReqCtx<HA>,
|
|
47
|
+
) => Promise<HandlerOutput> | HandlerOutput
|
|
48
|
+
|
|
49
|
+
export interface ServiceConfig {
|
|
50
|
+
url?: string
|
|
51
|
+
[k: string]: unknown
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function isServiceConfig(v: unknown): v is ServiceConfig {
|
|
55
|
+
return (
|
|
56
|
+
isObj(v) &&
|
|
57
|
+
hasProp(v, '$type') &&
|
|
58
|
+
v.$type === 'tools.ozone.server.getConfig#serviceConfig'
|
|
59
|
+
)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function validateServiceConfig(v: unknown): ValidationResult {
|
|
63
|
+
return lexicons.validate('tools.ozone.server.getConfig#serviceConfig', v)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ViewerConfig {
|
|
67
|
+
role?:
|
|
68
|
+
| 'tools.ozone.team.defs#roleAdmin'
|
|
69
|
+
| 'tools.ozone.team.defs#roleModerator'
|
|
70
|
+
| 'tools.ozone.team.defs#roleTriage'
|
|
71
|
+
| (string & {})
|
|
72
|
+
[k: string]: unknown
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function isViewerConfig(v: unknown): v is ViewerConfig {
|
|
76
|
+
return (
|
|
77
|
+
isObj(v) &&
|
|
78
|
+
hasProp(v, '$type') &&
|
|
79
|
+
v.$type === 'tools.ozone.server.getConfig#viewerConfig'
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function validateViewerConfig(v: unknown): ValidationResult {
|
|
84
|
+
return lexicons.validate('tools.ozone.server.getConfig#viewerConfig', v)
|
|
85
|
+
}
|
|
@@ -34,7 +34,7 @@ describe('handle validation', () => {
|
|
|
34
34
|
const expectThrow = (handle: string, err: string) => {
|
|
35
35
|
expect(() => ensureHandleServiceConstraints(handle, domains)).toThrow(err)
|
|
36
36
|
}
|
|
37
|
-
const expectNotThrow = (handle: string,
|
|
37
|
+
const expectNotThrow = (handle: string, _memo: string) => {
|
|
38
38
|
expect(() =>
|
|
39
39
|
ensureHandleServiceConstraints(handle, domains),
|
|
40
40
|
).not.toThrow()
|
|
@@ -21,6 +21,28 @@ Object {
|
|
|
21
21
|
"blockedBy": false,
|
|
22
22
|
"followedBy": "record(1)",
|
|
23
23
|
"following": "record(0)",
|
|
24
|
+
"knownFollowers": Object {
|
|
25
|
+
"count": 1,
|
|
26
|
+
"followers": Array [
|
|
27
|
+
Object {
|
|
28
|
+
"did": "user(2)",
|
|
29
|
+
"handle": "dan.test",
|
|
30
|
+
"labels": Array [
|
|
31
|
+
Object {
|
|
32
|
+
"cts": "1970-01-01T00:00:00.000Z",
|
|
33
|
+
"src": "did:example:labeler",
|
|
34
|
+
"uri": "user(2)",
|
|
35
|
+
"val": "repo-action-label",
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
"viewer": Object {
|
|
39
|
+
"blockedBy": false,
|
|
40
|
+
"following": "record(2)",
|
|
41
|
+
"muted": false,
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
24
46
|
"muted": false,
|
|
25
47
|
},
|
|
26
48
|
}
|
|
@@ -48,20 +70,49 @@ Object {
|
|
|
48
70
|
"cid": "cids(1)",
|
|
49
71
|
"cts": "1970-01-01T00:00:00.000Z",
|
|
50
72
|
"src": "user(0)",
|
|
51
|
-
"uri": "record(
|
|
73
|
+
"uri": "record(4)",
|
|
52
74
|
"val": "self-label-a",
|
|
53
75
|
},
|
|
54
76
|
Object {
|
|
55
77
|
"cid": "cids(1)",
|
|
56
78
|
"cts": "1970-01-01T00:00:00.000Z",
|
|
57
79
|
"src": "user(0)",
|
|
58
|
-
"uri": "record(
|
|
80
|
+
"uri": "record(4)",
|
|
59
81
|
"val": "self-label-b",
|
|
60
82
|
},
|
|
61
83
|
],
|
|
62
84
|
"postsCount": 4,
|
|
63
85
|
"viewer": Object {
|
|
64
86
|
"blockedBy": false,
|
|
87
|
+
"knownFollowers": Object {
|
|
88
|
+
"count": 2,
|
|
89
|
+
"followers": Array [
|
|
90
|
+
Object {
|
|
91
|
+
"avatar": "https://bsky.public.url/img/avatar/plain/user(3)/cids(0)@jpeg",
|
|
92
|
+
"did": "user(2)",
|
|
93
|
+
"displayName": "bobby",
|
|
94
|
+
"handle": "bob.test",
|
|
95
|
+
"labels": Array [],
|
|
96
|
+
"viewer": Object {
|
|
97
|
+
"blockedBy": false,
|
|
98
|
+
"followedBy": "record(1)",
|
|
99
|
+
"following": "record(0)",
|
|
100
|
+
"muted": false,
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
Object {
|
|
104
|
+
"did": "user(4)",
|
|
105
|
+
"handle": "carol.test",
|
|
106
|
+
"labels": Array [],
|
|
107
|
+
"viewer": Object {
|
|
108
|
+
"blockedBy": false,
|
|
109
|
+
"followedBy": "record(3)",
|
|
110
|
+
"following": "record(2)",
|
|
111
|
+
"muted": false,
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
},
|
|
65
116
|
"muted": false,
|
|
66
117
|
},
|
|
67
118
|
},
|
|
@@ -83,8 +134,30 @@ Object {
|
|
|
83
134
|
"postsCount": 3,
|
|
84
135
|
"viewer": Object {
|
|
85
136
|
"blockedBy": false,
|
|
86
|
-
"followedBy": "record(
|
|
87
|
-
"following": "record(
|
|
137
|
+
"followedBy": "record(1)",
|
|
138
|
+
"following": "record(0)",
|
|
139
|
+
"knownFollowers": Object {
|
|
140
|
+
"count": 1,
|
|
141
|
+
"followers": Array [
|
|
142
|
+
Object {
|
|
143
|
+
"did": "user(5)",
|
|
144
|
+
"handle": "dan.test",
|
|
145
|
+
"labels": Array [
|
|
146
|
+
Object {
|
|
147
|
+
"cts": "1970-01-01T00:00:00.000Z",
|
|
148
|
+
"src": "did:example:labeler",
|
|
149
|
+
"uri": "user(5)",
|
|
150
|
+
"val": "repo-action-label",
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
"viewer": Object {
|
|
154
|
+
"blockedBy": false,
|
|
155
|
+
"following": "record(5)",
|
|
156
|
+
"muted": false,
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
],
|
|
160
|
+
},
|
|
88
161
|
"muted": false,
|
|
89
162
|
},
|
|
90
163
|
},
|