@atproto/ozone 0.1.86 → 0.1.88
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 +20 -0
- package/dist/api/team/addMember.d.ts.map +1 -1
- package/dist/api/team/addMember.js +5 -1
- package/dist/api/team/addMember.js.map +1 -1
- package/dist/api/team/listMembers.js +1 -1
- package/dist/api/team/listMembers.js.map +1 -1
- package/dist/api/team/updateMember.js +1 -1
- package/dist/api/team/updateMember.js.map +1 -1
- package/dist/config/config.d.ts +1 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +1 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/env.d.ts +1 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +1 -0
- package/dist/config/env.js.map +1 -1
- package/dist/context.d.ts.map +1 -1
- package/dist/context.js +1 -1
- package/dist/context.js.map +1 -1
- package/dist/daemon/context.d.ts +3 -0
- package/dist/daemon/context.d.ts.map +1 -1
- package/dist/daemon/context.js +11 -0
- package/dist/daemon/context.js.map +1 -1
- package/dist/daemon/team-profile-synchronizer.d.ts +6 -0
- package/dist/daemon/team-profile-synchronizer.d.ts.map +1 -0
- package/dist/daemon/team-profile-synchronizer.js +14 -0
- package/dist/daemon/team-profile-synchronizer.js.map +1 -0
- package/dist/db/migrations/20250221T132135150Z-member-details.d.ts +4 -0
- package/dist/db/migrations/20250221T132135150Z-member-details.d.ts.map +1 -0
- package/dist/db/migrations/20250221T132135150Z-member-details.js +16 -0
- package/dist/db/migrations/20250221T132135150Z-member-details.js.map +1 -0
- package/dist/db/migrations/index.d.ts +1 -0
- package/dist/db/migrations/index.d.ts.map +1 -1
- package/dist/db/migrations/index.js +2 -1
- package/dist/db/migrations/index.js.map +1 -1
- package/dist/db/schema/member.d.ts +2 -0
- package/dist/db/schema/member.d.ts.map +1 -1
- package/dist/lexicon/index.d.ts +6 -0
- package/dist/lexicon/index.d.ts.map +1 -1
- package/dist/lexicon/index.js +12 -0
- package/dist/lexicon/index.js.map +1 -1
- package/dist/lexicon/lexicons.d.ts +310 -130
- package/dist/lexicon/lexicons.d.ts.map +1 -1
- package/dist/lexicon/lexicons.js +171 -67
- package/dist/lexicon/lexicons.js.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/video.d.ts +1 -0
- package/dist/lexicon/types/app/bsky/embed/video.d.ts.map +1 -1
- package/dist/lexicon/types/app/bsky/embed/video.js.map +1 -1
- package/dist/lexicon/types/com/atproto/identity/defs.d.ts +17 -0
- package/dist/lexicon/types/com/atproto/identity/defs.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/identity/defs.js +16 -0
- package/dist/lexicon/types/com/atproto/identity/defs.js.map +1 -0
- package/dist/lexicon/types/com/atproto/identity/refreshIdentity.d.ts +39 -0
- package/dist/lexicon/types/com/atproto/identity/refreshIdentity.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/identity/refreshIdentity.js +7 -0
- package/dist/lexicon/types/com/atproto/identity/refreshIdentity.js.map +1 -0
- package/dist/lexicon/types/com/atproto/identity/resolveDid.d.ts +40 -0
- package/dist/lexicon/types/com/atproto/identity/resolveDid.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/identity/resolveDid.js +7 -0
- package/dist/lexicon/types/com/atproto/identity/resolveDid.js.map +1 -0
- package/dist/lexicon/types/com/atproto/identity/resolveHandle.d.ts +1 -0
- package/dist/lexicon/types/com/atproto/identity/resolveHandle.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/identity/resolveIdentity.d.ts +36 -0
- package/dist/lexicon/types/com/atproto/identity/resolveIdentity.d.ts.map +1 -0
- package/dist/lexicon/types/com/atproto/identity/resolveIdentity.js +7 -0
- package/dist/lexicon/types/com/atproto/identity/resolveIdentity.js.map +1 -0
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts +1 -30
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js +0 -27
- package/dist/lexicon/types/com/atproto/sync/subscribeRepos.js.map +1 -1
- package/dist/lexicon/types/tools/ozone/team/listMembers.d.ts +1 -0
- package/dist/lexicon/types/tools/ozone/team/listMembers.d.ts.map +1 -1
- package/dist/team/index.d.ts +12 -6
- package/dist/team/index.d.ts.map +1 -1
- package/dist/team/index.js +58 -9
- package/dist/team/index.js.map +1 -1
- package/package.json +8 -8
- package/src/api/team/addMember.ts +6 -1
- package/src/api/team/listMembers.ts +1 -1
- package/src/api/team/updateMember.ts +1 -1
- package/src/config/config.ts +2 -0
- package/src/config/env.ts +4 -0
- package/src/context.ts +5 -1
- package/src/daemon/context.ts +21 -0
- package/src/daemon/team-profile-synchronizer.ts +15 -0
- package/src/db/migrations/20250221T132135150Z-member-details.ts +14 -0
- package/src/db/migrations/index.ts +1 -0
- package/src/db/schema/member.ts +2 -0
- package/src/lexicon/index.ts +36 -0
- package/src/lexicon/lexicons.ts +186 -67
- package/src/lexicon/types/app/bsky/embed/video.ts +1 -0
- package/src/lexicon/types/com/atproto/identity/defs.ts +30 -0
- package/src/lexicon/types/com/atproto/identity/refreshIdentity.ts +52 -0
- package/src/lexicon/types/com/atproto/identity/resolveDid.ts +52 -0
- package/src/lexicon/types/com/atproto/identity/resolveHandle.ts +1 -0
- package/src/lexicon/types/com/atproto/identity/resolveIdentity.ts +48 -0
- package/src/lexicon/types/com/atproto/sync/subscribeRepos.ts +0 -59
- package/src/lexicon/types/tools/ozone/team/listMembers.ts +1 -0
- package/src/team/index.ts +66 -18
- package/tests/team.test.ts +23 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/ozone",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.88",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Backend service for moderating the Bluesky network.",
|
|
6
6
|
"keywords": [
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"typed-emitter": "^2.1.0",
|
|
36
36
|
"uint8arrays": "3.0.0",
|
|
37
37
|
"undici": "^6.14.1",
|
|
38
|
-
"@atproto/api": "^0.14.
|
|
38
|
+
"@atproto/api": "^0.14.9",
|
|
39
39
|
"@atproto/common": "^0.4.8",
|
|
40
40
|
"@atproto/crypto": "^0.4.4",
|
|
41
41
|
"@atproto/identity": "^0.4.6",
|
|
42
|
-
"@atproto/
|
|
43
|
-
"@atproto/
|
|
44
|
-
"@atproto/
|
|
45
|
-
"@atproto/xrpc": "^0.
|
|
42
|
+
"@atproto/lexicon": "^0.4.8",
|
|
43
|
+
"@atproto/syntax": "^0.3.4",
|
|
44
|
+
"@atproto/xrpc": "^0.6.10",
|
|
45
|
+
"@atproto/xrpc-server": "^0.7.12"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@did-plc/server": "^0.0.1",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"jest": "^28.1.2",
|
|
55
55
|
"ts-node": "^10.8.2",
|
|
56
56
|
"typescript": "^5.6.3",
|
|
57
|
-
"@atproto/lex-cli": "^0.6.
|
|
58
|
-
"@atproto/pds": "^0.4.
|
|
57
|
+
"@atproto/lex-cli": "^0.6.2",
|
|
58
|
+
"@atproto/pds": "^0.4.106"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|
|
61
61
|
"codegen": "lex gen-server --yes ./src/lexicon ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/* ../../lexicons/chat/bsky/*/* ../../lexicons/tools/ozone/*/*",
|
|
@@ -26,14 +26,19 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
26
26
|
)
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
const profiles = await teamService.getProfiles([did])
|
|
30
|
+
const profile = profiles.get(did)
|
|
31
|
+
|
|
29
32
|
const member = await teamService.create({
|
|
30
33
|
did,
|
|
34
|
+
handle: profile?.handle || null,
|
|
35
|
+
displayName: profile?.displayName || null,
|
|
31
36
|
disabled: false,
|
|
32
37
|
role: getMemberRole(role),
|
|
33
38
|
lastUpdatedBy:
|
|
34
39
|
access.type === 'admin_token' ? 'admin_token' : access.iss,
|
|
35
40
|
})
|
|
36
|
-
const memberView = await teamService.view([member]
|
|
41
|
+
const memberView = await teamService.view([member])
|
|
37
42
|
return memberView[0]
|
|
38
43
|
})
|
|
39
44
|
|
|
@@ -34,7 +34,7 @@ export default function (server: Server, ctx: AppContext) {
|
|
|
34
34
|
lastUpdatedBy:
|
|
35
35
|
access.type === 'admin_token' ? 'admin_token' : access.iss,
|
|
36
36
|
})
|
|
37
|
-
const memberView = await teamService.view([updated]
|
|
37
|
+
const memberView = await teamService.view([updated])
|
|
38
38
|
return memberView[0]
|
|
39
39
|
})
|
|
40
40
|
|
package/src/config/config.ts
CHANGED
|
@@ -25,6 +25,7 @@ export const envToCfg = (env: OzoneEnvironment): OzoneConfig => {
|
|
|
25
25
|
poolMaxUses: env.dbPoolMaxUses,
|
|
26
26
|
poolIdleTimeoutMs: env.dbPoolIdleTimeoutMs,
|
|
27
27
|
materializedViewRefreshIntervalMs: env.dbMaterializedViewRefreshIntervalMs,
|
|
28
|
+
teamProfileRefreshIntervalMs: env.dbTeamProfileRefreshIntervalMs,
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
assert(env.appviewUrl, 'appviewUrl is required')
|
|
@@ -124,6 +125,7 @@ export type DatabaseConfig = {
|
|
|
124
125
|
poolMaxUses?: number
|
|
125
126
|
poolIdleTimeoutMs?: number
|
|
126
127
|
materializedViewRefreshIntervalMs?: number
|
|
128
|
+
teamProfileRefreshIntervalMs?: number
|
|
127
129
|
}
|
|
128
130
|
|
|
129
131
|
export type AppviewConfig = {
|
package/src/config/env.ts
CHANGED
|
@@ -23,6 +23,9 @@ export const readEnv = (): OzoneEnvironment => {
|
|
|
23
23
|
dbMaterializedViewRefreshIntervalMs: envInt(
|
|
24
24
|
'OZONE_DB_MATERIALIZED_VIEW_REFRESH_INTERVAL_MS',
|
|
25
25
|
),
|
|
26
|
+
dbTeamProfileRefreshIntervalMs: envInt(
|
|
27
|
+
'OZONE_DB_TEAM_PROFILE_REFRESH_INTERVAL_MS',
|
|
28
|
+
),
|
|
26
29
|
didPlcUrl: envStr('OZONE_DID_PLC_URL'),
|
|
27
30
|
didCacheStaleTTL: envInt('OZONE_DID_CACHE_STALE_TTL'),
|
|
28
31
|
didCacheMaxTTL: envInt('OZONE_DID_CACHE_MAX_TTL'),
|
|
@@ -57,6 +60,7 @@ export type OzoneEnvironment = {
|
|
|
57
60
|
dbPoolMaxUses?: number
|
|
58
61
|
dbPoolIdleTimeoutMs?: number
|
|
59
62
|
dbMaterializedViewRefreshIntervalMs?: number
|
|
63
|
+
dbTeamProfileRefreshIntervalMs?: number
|
|
60
64
|
didPlcUrl?: string
|
|
61
65
|
didCacheStaleTTL?: number
|
|
62
66
|
didCacheMaxTTL?: number
|
package/src/context.ts
CHANGED
|
@@ -120,7 +120,11 @@ export class AppContext {
|
|
|
120
120
|
)
|
|
121
121
|
|
|
122
122
|
const communicationTemplateService = CommunicationTemplateService.creator()
|
|
123
|
-
const teamService = TeamService.creator(
|
|
123
|
+
const teamService = TeamService.creator(
|
|
124
|
+
appviewAgent,
|
|
125
|
+
cfg.appview.did,
|
|
126
|
+
createAuthHeaders,
|
|
127
|
+
)
|
|
124
128
|
const setService = SetService.creator()
|
|
125
129
|
const settingService = SettingService.creator()
|
|
126
130
|
|
package/src/daemon/context.ts
CHANGED
|
@@ -7,10 +7,12 @@ import { BackgroundQueue } from '../background'
|
|
|
7
7
|
import { OzoneConfig, OzoneSecrets } from '../config'
|
|
8
8
|
import { Database } from '../db'
|
|
9
9
|
import { ModerationService } from '../mod-service'
|
|
10
|
+
import { TeamService } from '../team'
|
|
10
11
|
import { getSigningKeyId } from '../util'
|
|
11
12
|
import { EventPusher } from './event-pusher'
|
|
12
13
|
import { EventReverser } from './event-reverser'
|
|
13
14
|
import { MaterializedViewRefresher } from './materialized-view-refresher'
|
|
15
|
+
import { TeamProfileSynchronizer } from './team-profile-synchronizer'
|
|
14
16
|
|
|
15
17
|
export type DaemonContextOptions = {
|
|
16
18
|
db: Database
|
|
@@ -20,6 +22,7 @@ export type DaemonContextOptions = {
|
|
|
20
22
|
eventPusher: EventPusher
|
|
21
23
|
eventReverser: EventReverser
|
|
22
24
|
materializedViewRefresher: MaterializedViewRefresher
|
|
25
|
+
teamProfileSynchronizer: TeamProfileSynchronizer
|
|
23
26
|
}
|
|
24
27
|
|
|
25
28
|
export class DaemonContext {
|
|
@@ -67,6 +70,16 @@ export class DaemonContext {
|
|
|
67
70
|
appviewAgent,
|
|
68
71
|
createAuthHeaders,
|
|
69
72
|
)
|
|
73
|
+
const teamService = TeamService.creator(
|
|
74
|
+
appviewAgent,
|
|
75
|
+
cfg.appview.did,
|
|
76
|
+
createAuthHeaders,
|
|
77
|
+
)
|
|
78
|
+
const teamProfileSynchronizer = new TeamProfileSynchronizer(
|
|
79
|
+
backgroundQueue,
|
|
80
|
+
teamService(db),
|
|
81
|
+
cfg.db.teamProfileRefreshIntervalMs,
|
|
82
|
+
)
|
|
70
83
|
|
|
71
84
|
const eventReverser = new EventReverser(db, modService)
|
|
72
85
|
|
|
@@ -83,6 +96,7 @@ export class DaemonContext {
|
|
|
83
96
|
eventPusher,
|
|
84
97
|
eventReverser,
|
|
85
98
|
materializedViewRefresher,
|
|
99
|
+
teamProfileSynchronizer,
|
|
86
100
|
...(overrides ?? {}),
|
|
87
101
|
})
|
|
88
102
|
}
|
|
@@ -111,16 +125,22 @@ export class DaemonContext {
|
|
|
111
125
|
return this.opts.materializedViewRefresher
|
|
112
126
|
}
|
|
113
127
|
|
|
128
|
+
get teamProfileSynchronizer(): TeamProfileSynchronizer {
|
|
129
|
+
return this.opts.teamProfileSynchronizer
|
|
130
|
+
}
|
|
131
|
+
|
|
114
132
|
async start() {
|
|
115
133
|
this.eventPusher.start()
|
|
116
134
|
this.eventReverser.start()
|
|
117
135
|
this.materializedViewRefresher.start()
|
|
136
|
+
this.teamProfileSynchronizer.start()
|
|
118
137
|
}
|
|
119
138
|
|
|
120
139
|
async processAll() {
|
|
121
140
|
// Sequential because the materialized view values depend on the events.
|
|
122
141
|
await this.eventPusher.processAll()
|
|
123
142
|
await this.materializedViewRefresher.run()
|
|
143
|
+
await this.teamProfileSynchronizer.run()
|
|
124
144
|
}
|
|
125
145
|
|
|
126
146
|
async destroy() {
|
|
@@ -129,6 +149,7 @@ export class DaemonContext {
|
|
|
129
149
|
this.eventReverser.destroy(),
|
|
130
150
|
this.eventPusher.destroy(),
|
|
131
151
|
this.materializedViewRefresher.destroy(),
|
|
152
|
+
this.teamProfileSynchronizer.destroy(),
|
|
132
153
|
])
|
|
133
154
|
} finally {
|
|
134
155
|
await this.backgroundQueue.destroy()
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { HOUR } from '@atproto/common'
|
|
2
|
+
import { BackgroundQueue, PeriodicBackgroundTask } from '../background'
|
|
3
|
+
import { TeamService } from '../team'
|
|
4
|
+
|
|
5
|
+
export class TeamProfileSynchronizer extends PeriodicBackgroundTask {
|
|
6
|
+
constructor(
|
|
7
|
+
backgroundQueue: BackgroundQueue,
|
|
8
|
+
teamService: TeamService,
|
|
9
|
+
interval = 24 * HOUR,
|
|
10
|
+
) {
|
|
11
|
+
super(backgroundQueue, interval, async () => {
|
|
12
|
+
await teamService.syncMemberProfiles()
|
|
13
|
+
})
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Kysely } from 'kysely'
|
|
2
|
+
|
|
3
|
+
export async function up(db: Kysely<unknown>): Promise<void> {
|
|
4
|
+
await db.schema.alterTable('member').addColumn('handle', 'text').execute()
|
|
5
|
+
await db.schema
|
|
6
|
+
.alterTable('member')
|
|
7
|
+
.addColumn('displayName', 'text')
|
|
8
|
+
.execute()
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export async function down(db: Kysely<unknown>): Promise<void> {
|
|
12
|
+
await db.schema.alterTable('member').dropColumn('handle').execute()
|
|
13
|
+
await db.schema.alterTable('member').dropColumn('displayName').execute()
|
|
14
|
+
}
|
|
@@ -21,3 +21,4 @@ export * as _20241220T144630860Z from './20241220T144630860Z-stats-materialized-
|
|
|
21
21
|
export * as _20250204T003647759Z from './20250204T003647759Z-add-subject-priority-score'
|
|
22
22
|
export * as _20250211T003647759Z from './20250211T003647759Z-add-reporter-stats-index'
|
|
23
23
|
export * as _20250211T132135150Z from './20250211T132135150Z-moderation-event-message-partial-idx'
|
|
24
|
+
export * as _20250221T132135150Z from './20250221T132135150Z-member-details'
|
package/src/db/schema/member.ts
CHANGED
package/src/lexicon/index.ts
CHANGED
|
@@ -24,8 +24,11 @@ import * as ComAtprotoAdminUpdateAccountHandle from './types/com/atproto/admin/u
|
|
|
24
24
|
import * as ComAtprotoAdminUpdateAccountPassword from './types/com/atproto/admin/updateAccountPassword.js'
|
|
25
25
|
import * as ComAtprotoAdminUpdateSubjectStatus from './types/com/atproto/admin/updateSubjectStatus.js'
|
|
26
26
|
import * as ComAtprotoIdentityGetRecommendedDidCredentials from './types/com/atproto/identity/getRecommendedDidCredentials.js'
|
|
27
|
+
import * as ComAtprotoIdentityRefreshIdentity from './types/com/atproto/identity/refreshIdentity.js'
|
|
27
28
|
import * as ComAtprotoIdentityRequestPlcOperationSignature from './types/com/atproto/identity/requestPlcOperationSignature.js'
|
|
29
|
+
import * as ComAtprotoIdentityResolveDid from './types/com/atproto/identity/resolveDid.js'
|
|
28
30
|
import * as ComAtprotoIdentityResolveHandle from './types/com/atproto/identity/resolveHandle.js'
|
|
31
|
+
import * as ComAtprotoIdentityResolveIdentity from './types/com/atproto/identity/resolveIdentity.js'
|
|
29
32
|
import * as ComAtprotoIdentitySignPlcOperation from './types/com/atproto/identity/signPlcOperation.js'
|
|
30
33
|
import * as ComAtprotoIdentitySubmitPlcOperation from './types/com/atproto/identity/submitPlcOperation.js'
|
|
31
34
|
import * as ComAtprotoIdentityUpdateHandle from './types/com/atproto/identity/updateHandle.js'
|
|
@@ -480,6 +483,17 @@ export class ComAtprotoIdentityNS {
|
|
|
480
483
|
return this._server.xrpc.method(nsid, cfg)
|
|
481
484
|
}
|
|
482
485
|
|
|
486
|
+
refreshIdentity<AV extends AuthVerifier>(
|
|
487
|
+
cfg: ConfigOf<
|
|
488
|
+
AV,
|
|
489
|
+
ComAtprotoIdentityRefreshIdentity.Handler<ExtractAuth<AV>>,
|
|
490
|
+
ComAtprotoIdentityRefreshIdentity.HandlerReqCtx<ExtractAuth<AV>>
|
|
491
|
+
>,
|
|
492
|
+
) {
|
|
493
|
+
const nsid = 'com.atproto.identity.refreshIdentity' // @ts-ignore
|
|
494
|
+
return this._server.xrpc.method(nsid, cfg)
|
|
495
|
+
}
|
|
496
|
+
|
|
483
497
|
requestPlcOperationSignature<AV extends AuthVerifier>(
|
|
484
498
|
cfg: ConfigOf<
|
|
485
499
|
AV,
|
|
@@ -493,6 +507,17 @@ export class ComAtprotoIdentityNS {
|
|
|
493
507
|
return this._server.xrpc.method(nsid, cfg)
|
|
494
508
|
}
|
|
495
509
|
|
|
510
|
+
resolveDid<AV extends AuthVerifier>(
|
|
511
|
+
cfg: ConfigOf<
|
|
512
|
+
AV,
|
|
513
|
+
ComAtprotoIdentityResolveDid.Handler<ExtractAuth<AV>>,
|
|
514
|
+
ComAtprotoIdentityResolveDid.HandlerReqCtx<ExtractAuth<AV>>
|
|
515
|
+
>,
|
|
516
|
+
) {
|
|
517
|
+
const nsid = 'com.atproto.identity.resolveDid' // @ts-ignore
|
|
518
|
+
return this._server.xrpc.method(nsid, cfg)
|
|
519
|
+
}
|
|
520
|
+
|
|
496
521
|
resolveHandle<AV extends AuthVerifier>(
|
|
497
522
|
cfg: ConfigOf<
|
|
498
523
|
AV,
|
|
@@ -504,6 +529,17 @@ export class ComAtprotoIdentityNS {
|
|
|
504
529
|
return this._server.xrpc.method(nsid, cfg)
|
|
505
530
|
}
|
|
506
531
|
|
|
532
|
+
resolveIdentity<AV extends AuthVerifier>(
|
|
533
|
+
cfg: ConfigOf<
|
|
534
|
+
AV,
|
|
535
|
+
ComAtprotoIdentityResolveIdentity.Handler<ExtractAuth<AV>>,
|
|
536
|
+
ComAtprotoIdentityResolveIdentity.HandlerReqCtx<ExtractAuth<AV>>
|
|
537
|
+
>,
|
|
538
|
+
) {
|
|
539
|
+
const nsid = 'com.atproto.identity.resolveIdentity' // @ts-ignore
|
|
540
|
+
return this._server.xrpc.method(nsid, cfg)
|
|
541
|
+
}
|
|
542
|
+
|
|
507
543
|
signPlcOperation<AV extends AuthVerifier>(
|
|
508
544
|
cfg: ConfigOf<
|
|
509
545
|
AV,
|
package/src/lexicon/lexicons.ts
CHANGED
|
@@ -637,6 +637,32 @@ export const schemaDict = {
|
|
|
637
637
|
},
|
|
638
638
|
},
|
|
639
639
|
},
|
|
640
|
+
ComAtprotoIdentityDefs: {
|
|
641
|
+
lexicon: 1,
|
|
642
|
+
id: 'com.atproto.identity.defs',
|
|
643
|
+
defs: {
|
|
644
|
+
identityInfo: {
|
|
645
|
+
type: 'object',
|
|
646
|
+
required: ['did', 'handle', 'didDoc'],
|
|
647
|
+
properties: {
|
|
648
|
+
did: {
|
|
649
|
+
type: 'string',
|
|
650
|
+
format: 'did',
|
|
651
|
+
},
|
|
652
|
+
handle: {
|
|
653
|
+
type: 'string',
|
|
654
|
+
format: 'handle',
|
|
655
|
+
description:
|
|
656
|
+
"The validated handle of the account; or 'handle.invalid' if the handle did not bi-directionally match the DID document.",
|
|
657
|
+
},
|
|
658
|
+
didDoc: {
|
|
659
|
+
type: 'unknown',
|
|
660
|
+
description: 'The complete DID document for the identity.',
|
|
661
|
+
},
|
|
662
|
+
},
|
|
663
|
+
},
|
|
664
|
+
},
|
|
665
|
+
},
|
|
640
666
|
ComAtprotoIdentityGetRecommendedDidCredentials: {
|
|
641
667
|
lexicon: 1,
|
|
642
668
|
id: 'com.atproto.identity.getRecommendedDidCredentials',
|
|
@@ -676,6 +702,54 @@ export const schemaDict = {
|
|
|
676
702
|
},
|
|
677
703
|
},
|
|
678
704
|
},
|
|
705
|
+
ComAtprotoIdentityRefreshIdentity: {
|
|
706
|
+
lexicon: 1,
|
|
707
|
+
id: 'com.atproto.identity.refreshIdentity',
|
|
708
|
+
defs: {
|
|
709
|
+
main: {
|
|
710
|
+
type: 'procedure',
|
|
711
|
+
description:
|
|
712
|
+
'Request that the server re-resolve an identity (DID and handle). The server may ignore this request, or require authentication, depending on the role, implementation, and policy of the server.',
|
|
713
|
+
input: {
|
|
714
|
+
encoding: 'application/json',
|
|
715
|
+
schema: {
|
|
716
|
+
type: 'object',
|
|
717
|
+
required: ['identifier'],
|
|
718
|
+
properties: {
|
|
719
|
+
identifier: {
|
|
720
|
+
type: 'string',
|
|
721
|
+
format: 'at-identifier',
|
|
722
|
+
},
|
|
723
|
+
},
|
|
724
|
+
},
|
|
725
|
+
},
|
|
726
|
+
output: {
|
|
727
|
+
encoding: 'application/json',
|
|
728
|
+
schema: {
|
|
729
|
+
type: 'ref',
|
|
730
|
+
ref: 'lex:com.atproto.identity.defs#identityInfo',
|
|
731
|
+
},
|
|
732
|
+
},
|
|
733
|
+
errors: [
|
|
734
|
+
{
|
|
735
|
+
name: 'HandleNotFound',
|
|
736
|
+
description:
|
|
737
|
+
'The resolution process confirmed that the handle does not resolve to any DID.',
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
name: 'DidNotFound',
|
|
741
|
+
description:
|
|
742
|
+
'The DID resolution process confirmed that there is no current DID.',
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
name: 'DidDeactivated',
|
|
746
|
+
description:
|
|
747
|
+
'The DID previously existed, but has been deactivated.',
|
|
748
|
+
},
|
|
749
|
+
],
|
|
750
|
+
},
|
|
751
|
+
},
|
|
752
|
+
},
|
|
679
753
|
ComAtprotoIdentityRequestPlcOperationSignature: {
|
|
680
754
|
lexicon: 1,
|
|
681
755
|
id: 'com.atproto.identity.requestPlcOperationSignature',
|
|
@@ -687,13 +761,61 @@ export const schemaDict = {
|
|
|
687
761
|
},
|
|
688
762
|
},
|
|
689
763
|
},
|
|
764
|
+
ComAtprotoIdentityResolveDid: {
|
|
765
|
+
lexicon: 1,
|
|
766
|
+
id: 'com.atproto.identity.resolveDid',
|
|
767
|
+
defs: {
|
|
768
|
+
main: {
|
|
769
|
+
type: 'query',
|
|
770
|
+
description:
|
|
771
|
+
'Resolves DID to DID document. Does not bi-directionally verify handle.',
|
|
772
|
+
parameters: {
|
|
773
|
+
type: 'params',
|
|
774
|
+
required: ['did'],
|
|
775
|
+
properties: {
|
|
776
|
+
did: {
|
|
777
|
+
type: 'string',
|
|
778
|
+
format: 'did',
|
|
779
|
+
description: 'DID to resolve.',
|
|
780
|
+
},
|
|
781
|
+
},
|
|
782
|
+
},
|
|
783
|
+
output: {
|
|
784
|
+
encoding: 'application/json',
|
|
785
|
+
schema: {
|
|
786
|
+
type: 'object',
|
|
787
|
+
required: ['didDoc'],
|
|
788
|
+
properties: {
|
|
789
|
+
didDoc: {
|
|
790
|
+
type: 'unknown',
|
|
791
|
+
description: 'The complete DID document for the identity.',
|
|
792
|
+
},
|
|
793
|
+
},
|
|
794
|
+
},
|
|
795
|
+
},
|
|
796
|
+
errors: [
|
|
797
|
+
{
|
|
798
|
+
name: 'DidNotFound',
|
|
799
|
+
description:
|
|
800
|
+
'The DID resolution process confirmed that there is no current DID.',
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
name: 'DidDeactivated',
|
|
804
|
+
description:
|
|
805
|
+
'The DID previously existed, but has been deactivated.',
|
|
806
|
+
},
|
|
807
|
+
],
|
|
808
|
+
},
|
|
809
|
+
},
|
|
810
|
+
},
|
|
690
811
|
ComAtprotoIdentityResolveHandle: {
|
|
691
812
|
lexicon: 1,
|
|
692
813
|
id: 'com.atproto.identity.resolveHandle',
|
|
693
814
|
defs: {
|
|
694
815
|
main: {
|
|
695
816
|
type: 'query',
|
|
696
|
-
description:
|
|
817
|
+
description:
|
|
818
|
+
'Resolves an atproto handle (hostname) to a DID. Does not necessarily bi-directionally verify against the the DID document.',
|
|
697
819
|
parameters: {
|
|
698
820
|
type: 'params',
|
|
699
821
|
required: ['handle'],
|
|
@@ -718,6 +840,59 @@ export const schemaDict = {
|
|
|
718
840
|
},
|
|
719
841
|
},
|
|
720
842
|
},
|
|
843
|
+
errors: [
|
|
844
|
+
{
|
|
845
|
+
name: 'HandleNotFound',
|
|
846
|
+
description:
|
|
847
|
+
'The resolution process confirmed that the handle does not resolve to any DID.',
|
|
848
|
+
},
|
|
849
|
+
],
|
|
850
|
+
},
|
|
851
|
+
},
|
|
852
|
+
},
|
|
853
|
+
ComAtprotoIdentityResolveIdentity: {
|
|
854
|
+
lexicon: 1,
|
|
855
|
+
id: 'com.atproto.identity.resolveIdentity',
|
|
856
|
+
defs: {
|
|
857
|
+
main: {
|
|
858
|
+
type: 'query',
|
|
859
|
+
description:
|
|
860
|
+
'Resolves an identity (DID or Handle) to a full identity (DID document and verified handle).',
|
|
861
|
+
parameters: {
|
|
862
|
+
type: 'params',
|
|
863
|
+
required: ['identifier'],
|
|
864
|
+
properties: {
|
|
865
|
+
identifier: {
|
|
866
|
+
type: 'string',
|
|
867
|
+
format: 'at-identifier',
|
|
868
|
+
description: 'Handle or DID to resolve.',
|
|
869
|
+
},
|
|
870
|
+
},
|
|
871
|
+
},
|
|
872
|
+
output: {
|
|
873
|
+
encoding: 'application/json',
|
|
874
|
+
schema: {
|
|
875
|
+
type: 'ref',
|
|
876
|
+
ref: 'lex:com.atproto.identity.defs#identityInfo',
|
|
877
|
+
},
|
|
878
|
+
},
|
|
879
|
+
errors: [
|
|
880
|
+
{
|
|
881
|
+
name: 'HandleNotFound',
|
|
882
|
+
description:
|
|
883
|
+
'The resolution process confirmed that the handle does not resolve to any DID.',
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
name: 'DidNotFound',
|
|
887
|
+
description:
|
|
888
|
+
'The DID resolution process confirmed that there is no current DID.',
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
name: 'DidDeactivated',
|
|
892
|
+
description:
|
|
893
|
+
'The DID previously existed, but has been deactivated.',
|
|
894
|
+
},
|
|
895
|
+
],
|
|
721
896
|
},
|
|
722
897
|
},
|
|
723
898
|
},
|
|
@@ -3816,9 +3991,6 @@ export const schemaDict = {
|
|
|
3816
3991
|
'lex:com.atproto.sync.subscribeRepos#sync',
|
|
3817
3992
|
'lex:com.atproto.sync.subscribeRepos#identity',
|
|
3818
3993
|
'lex:com.atproto.sync.subscribeRepos#account',
|
|
3819
|
-
'lex:com.atproto.sync.subscribeRepos#handle',
|
|
3820
|
-
'lex:com.atproto.sync.subscribeRepos#migrate',
|
|
3821
|
-
'lex:com.atproto.sync.subscribeRepos#tombstone',
|
|
3822
3994
|
'lex:com.atproto.sync.subscribeRepos#info',
|
|
3823
3995
|
],
|
|
3824
3996
|
},
|
|
@@ -4022,68 +4194,6 @@ export const schemaDict = {
|
|
|
4022
4194
|
},
|
|
4023
4195
|
},
|
|
4024
4196
|
},
|
|
4025
|
-
handle: {
|
|
4026
|
-
type: 'object',
|
|
4027
|
-
description: 'DEPRECATED -- Use #identity event instead',
|
|
4028
|
-
required: ['seq', 'did', 'handle', 'time'],
|
|
4029
|
-
properties: {
|
|
4030
|
-
seq: {
|
|
4031
|
-
type: 'integer',
|
|
4032
|
-
},
|
|
4033
|
-
did: {
|
|
4034
|
-
type: 'string',
|
|
4035
|
-
format: 'did',
|
|
4036
|
-
},
|
|
4037
|
-
handle: {
|
|
4038
|
-
type: 'string',
|
|
4039
|
-
format: 'handle',
|
|
4040
|
-
},
|
|
4041
|
-
time: {
|
|
4042
|
-
type: 'string',
|
|
4043
|
-
format: 'datetime',
|
|
4044
|
-
},
|
|
4045
|
-
},
|
|
4046
|
-
},
|
|
4047
|
-
migrate: {
|
|
4048
|
-
type: 'object',
|
|
4049
|
-
description: 'DEPRECATED -- Use #account event instead',
|
|
4050
|
-
required: ['seq', 'did', 'migrateTo', 'time'],
|
|
4051
|
-
nullable: ['migrateTo'],
|
|
4052
|
-
properties: {
|
|
4053
|
-
seq: {
|
|
4054
|
-
type: 'integer',
|
|
4055
|
-
},
|
|
4056
|
-
did: {
|
|
4057
|
-
type: 'string',
|
|
4058
|
-
format: 'did',
|
|
4059
|
-
},
|
|
4060
|
-
migrateTo: {
|
|
4061
|
-
type: 'string',
|
|
4062
|
-
},
|
|
4063
|
-
time: {
|
|
4064
|
-
type: 'string',
|
|
4065
|
-
format: 'datetime',
|
|
4066
|
-
},
|
|
4067
|
-
},
|
|
4068
|
-
},
|
|
4069
|
-
tombstone: {
|
|
4070
|
-
type: 'object',
|
|
4071
|
-
description: 'DEPRECATED -- Use #account event instead',
|
|
4072
|
-
required: ['seq', 'did', 'time'],
|
|
4073
|
-
properties: {
|
|
4074
|
-
seq: {
|
|
4075
|
-
type: 'integer',
|
|
4076
|
-
},
|
|
4077
|
-
did: {
|
|
4078
|
-
type: 'string',
|
|
4079
|
-
format: 'did',
|
|
4080
|
-
},
|
|
4081
|
-
time: {
|
|
4082
|
-
type: 'string',
|
|
4083
|
-
format: 'datetime',
|
|
4084
|
-
},
|
|
4085
|
-
},
|
|
4086
|
-
},
|
|
4087
4197
|
info: {
|
|
4088
4198
|
type: 'object',
|
|
4089
4199
|
required: ['name'],
|
|
@@ -5583,8 +5693,10 @@ export const schemaDict = {
|
|
|
5583
5693
|
properties: {
|
|
5584
5694
|
video: {
|
|
5585
5695
|
type: 'blob',
|
|
5696
|
+
description:
|
|
5697
|
+
'The mp4 video file. May be up to 100mb, formerly limited to 50mb.',
|
|
5586
5698
|
accept: ['video/mp4'],
|
|
5587
|
-
maxSize:
|
|
5699
|
+
maxSize: 100000000,
|
|
5588
5700
|
},
|
|
5589
5701
|
captions: {
|
|
5590
5702
|
type: 'array',
|
|
@@ -14253,6 +14365,9 @@ export const schemaDict = {
|
|
|
14253
14365
|
parameters: {
|
|
14254
14366
|
type: 'params',
|
|
14255
14367
|
properties: {
|
|
14368
|
+
q: {
|
|
14369
|
+
type: 'string',
|
|
14370
|
+
},
|
|
14256
14371
|
disabled: {
|
|
14257
14372
|
type: 'boolean',
|
|
14258
14373
|
},
|
|
@@ -14394,11 +14509,15 @@ export const ids = {
|
|
|
14394
14509
|
ComAtprotoAdminUpdateAccountPassword:
|
|
14395
14510
|
'com.atproto.admin.updateAccountPassword',
|
|
14396
14511
|
ComAtprotoAdminUpdateSubjectStatus: 'com.atproto.admin.updateSubjectStatus',
|
|
14512
|
+
ComAtprotoIdentityDefs: 'com.atproto.identity.defs',
|
|
14397
14513
|
ComAtprotoIdentityGetRecommendedDidCredentials:
|
|
14398
14514
|
'com.atproto.identity.getRecommendedDidCredentials',
|
|
14515
|
+
ComAtprotoIdentityRefreshIdentity: 'com.atproto.identity.refreshIdentity',
|
|
14399
14516
|
ComAtprotoIdentityRequestPlcOperationSignature:
|
|
14400
14517
|
'com.atproto.identity.requestPlcOperationSignature',
|
|
14518
|
+
ComAtprotoIdentityResolveDid: 'com.atproto.identity.resolveDid',
|
|
14401
14519
|
ComAtprotoIdentityResolveHandle: 'com.atproto.identity.resolveHandle',
|
|
14520
|
+
ComAtprotoIdentityResolveIdentity: 'com.atproto.identity.resolveIdentity',
|
|
14402
14521
|
ComAtprotoIdentitySignPlcOperation: 'com.atproto.identity.signPlcOperation',
|
|
14403
14522
|
ComAtprotoIdentitySubmitPlcOperation:
|
|
14404
14523
|
'com.atproto.identity.submitPlcOperation',
|
|
@@ -13,6 +13,7 @@ const id = 'app.bsky.embed.video'
|
|
|
13
13
|
|
|
14
14
|
export interface Main {
|
|
15
15
|
$type?: 'app.bsky.embed.video'
|
|
16
|
+
/** The mp4 video file. May be up to 100mb, formerly limited to 50mb. */
|
|
16
17
|
video: BlobRef
|
|
17
18
|
captions?: Caption[]
|
|
18
19
|
/** Alt text description of the video, for accessibility. */
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GENERATED CODE - DO NOT MODIFY
|
|
3
|
+
*/
|
|
4
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
|
+
import { CID } from 'multiformats/cid'
|
|
6
|
+
import { validate as _validate } from '../../../../lexicons'
|
|
7
|
+
import { $Typed, is$typed as _is$typed, OmitKey } from '../../../../util'
|
|
8
|
+
|
|
9
|
+
const is$typed = _is$typed,
|
|
10
|
+
validate = _validate
|
|
11
|
+
const id = 'com.atproto.identity.defs'
|
|
12
|
+
|
|
13
|
+
export interface IdentityInfo {
|
|
14
|
+
$type?: 'com.atproto.identity.defs#identityInfo'
|
|
15
|
+
did: string
|
|
16
|
+
/** The validated handle of the account; or 'handle.invalid' if the handle did not bi-directionally match the DID document. */
|
|
17
|
+
handle: string
|
|
18
|
+
/** The complete DID document for the identity. */
|
|
19
|
+
didDoc: { [_ in string]: unknown }
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const hashIdentityInfo = 'identityInfo'
|
|
23
|
+
|
|
24
|
+
export function isIdentityInfo<V>(v: V) {
|
|
25
|
+
return is$typed(v, id, hashIdentityInfo)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function validateIdentityInfo<V>(v: V) {
|
|
29
|
+
return validate<IdentityInfo & V>(v, id, hashIdentityInfo)
|
|
30
|
+
}
|