@atproto/ozone 0.1.106 → 0.1.107

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.
@@ -6,7 +6,7 @@ export default function (server: Server, ctx: AppContext) {
6
6
  server.app.bsky.actor.getProfile({
7
7
  auth: ctx.authVerifier.moderator,
8
8
  handler: async (request) => {
9
- const res = await ctx.appviewAgent.api.app.bsky.actor.getProfile(
9
+ const res = await ctx.appviewAgent.app.bsky.actor.getProfile(
10
10
  request.params,
11
11
  await ctx.appviewAuth(ids.AppBskyActorGetProfile),
12
12
  )
@@ -20,7 +20,7 @@ export default function (server: Server, ctx: AppContext) {
20
20
  server.app.bsky.actor.getProfiles({
21
21
  auth: ctx.authVerifier.modOrAdminToken,
22
22
  handler: async (request) => {
23
- const res = await ctx.appviewAgent.api.app.bsky.actor.getProfiles(
23
+ const res = await ctx.appviewAgent.app.bsky.actor.getProfiles(
24
24
  request.params,
25
25
  await ctx.appviewAuth(ids.AppBskyActorGetProfiles),
26
26
  )
@@ -34,7 +34,7 @@ export default function (server: Server, ctx: AppContext) {
34
34
  server.app.bsky.feed.getAuthorFeed({
35
35
  auth: ctx.authVerifier.modOrAdminToken,
36
36
  handler: async (request) => {
37
- const res = await ctx.appviewAgent.api.app.bsky.feed.getAuthorFeed(
37
+ const res = await ctx.appviewAgent.app.bsky.feed.getAuthorFeed(
38
38
  request.params,
39
39
  await ctx.appviewAuth(ids.AppBskyFeedGetAuthorFeed),
40
40
  )
@@ -48,7 +48,7 @@ export default function (server: Server, ctx: AppContext) {
48
48
  server.app.bsky.feed.searchPosts({
49
49
  auth: ctx.authVerifier.moderator,
50
50
  handler: async (request) => {
51
- const res = await ctx.appviewAgent.api.app.bsky.feed.searchPosts(
51
+ const res = await ctx.appviewAgent.app.bsky.feed.searchPosts(
52
52
  request.params,
53
53
  await ctx.appviewAuth(ids.AppBskyFeedSearchPosts),
54
54
  )
@@ -62,7 +62,7 @@ export default function (server: Server, ctx: AppContext) {
62
62
  server.app.bsky.feed.getPostThread({
63
63
  auth: ctx.authVerifier.modOrAdminToken,
64
64
  handler: async (request) => {
65
- const res = await ctx.appviewAgent.api.app.bsky.feed.getPostThread(
65
+ const res = await ctx.appviewAgent.app.bsky.feed.getPostThread(
66
66
  request.params,
67
67
  await ctx.appviewAuth(ids.AppBskyFeedGetPostThread),
68
68
  )
@@ -76,7 +76,7 @@ export default function (server: Server, ctx: AppContext) {
76
76
  server.app.bsky.feed.getFeedGenerator({
77
77
  auth: ctx.authVerifier.moderator,
78
78
  handler: async (request) => {
79
- const res = await ctx.appviewAgent.api.app.bsky.feed.getFeedGenerator(
79
+ const res = await ctx.appviewAgent.app.bsky.feed.getFeedGenerator(
80
80
  request.params,
81
81
  await ctx.appviewAuth(ids.AppBskyFeedGetFeedGenerator),
82
82
  )
@@ -90,7 +90,7 @@ export default function (server: Server, ctx: AppContext) {
90
90
  server.app.bsky.graph.getFollows({
91
91
  auth: ctx.authVerifier.modOrAdminToken,
92
92
  handler: async (request) => {
93
- const res = await ctx.appviewAgent.api.app.bsky.graph.getFollows(
93
+ const res = await ctx.appviewAgent.app.bsky.graph.getFollows(
94
94
  request.params,
95
95
  await ctx.appviewAuth(ids.AppBskyGraphGetFollows),
96
96
  )
@@ -104,7 +104,7 @@ export default function (server: Server, ctx: AppContext) {
104
104
  server.app.bsky.graph.getFollowers({
105
105
  auth: ctx.authVerifier.modOrAdminToken,
106
106
  handler: async (request) => {
107
- const res = await ctx.appviewAgent.api.app.bsky.graph.getFollowers(
107
+ const res = await ctx.appviewAgent.app.bsky.graph.getFollowers(
108
108
  request.params,
109
109
  await ctx.appviewAuth(ids.AppBskyGraphGetFollowers),
110
110
  )
@@ -118,7 +118,7 @@ export default function (server: Server, ctx: AppContext) {
118
118
  server.app.bsky.graph.getList({
119
119
  auth: ctx.authVerifier.modOrAdminToken,
120
120
  handler: async (request) => {
121
- const res = await ctx.appviewAgent.api.app.bsky.graph.getList(
121
+ const res = await ctx.appviewAgent.app.bsky.graph.getList(
122
122
  request.params,
123
123
  await ctx.appviewAuth(ids.AppBskyGraphGetList),
124
124
  )
@@ -132,7 +132,7 @@ export default function (server: Server, ctx: AppContext) {
132
132
  server.app.bsky.graph.getLists({
133
133
  auth: ctx.authVerifier.modOrAdminToken,
134
134
  handler: async (request) => {
135
- const res = await ctx.appviewAgent.api.app.bsky.graph.getLists(
135
+ const res = await ctx.appviewAgent.app.bsky.graph.getLists(
136
136
  request.params,
137
137
  await ctx.appviewAuth(ids.AppBskyGraphGetLists),
138
138
  )
@@ -149,7 +149,7 @@ export default function (server: Server, ctx: AppContext) {
149
149
  if (!ctx.pdsAgent) {
150
150
  throw new Error('PDS not configured')
151
151
  }
152
- const res = await ctx.pdsAgent.api.com.atproto.admin.searchAccounts(
152
+ const res = await ctx.pdsAgent.com.atproto.admin.searchAccounts(
153
153
  request.params,
154
154
  await ctx.pdsAuth(ids.ComAtprotoAdminSearchAccounts),
155
155
  )
@@ -160,6 +160,23 @@ export default function (server: Server, ctx: AppContext) {
160
160
  },
161
161
  })
162
162
 
163
+ server.tools.ozone.hosting.getAccountHistory({
164
+ auth: ctx.authVerifier.moderator,
165
+ handler: async (request) => {
166
+ if (!ctx.pdsAgent) {
167
+ throw new Error('PDS not configured')
168
+ }
169
+ const res = await ctx.pdsAgent.tools.ozone.hosting.getAccountHistory(
170
+ request.params,
171
+ await ctx.pdsAuth(ids.ToolsOzoneHostingGetAccountHistory),
172
+ )
173
+ return {
174
+ encoding: 'application/json',
175
+ body: res.data,
176
+ }
177
+ },
178
+ })
179
+
163
180
  server.tools.ozone.signature.findRelatedAccounts({
164
181
  auth: ctx.authVerifier.moderator,
165
182
  handler: async (request) => {
@@ -228,7 +245,7 @@ export default function (server: Server, ctx: AppContext) {
228
245
  server.app.bsky.graph.getStarterPacks({
229
246
  auth: ctx.authVerifier.modOrAdminToken,
230
247
  handler: async (request) => {
231
- const res = await ctx.appviewAgent.api.app.bsky.graph.getStarterPacks(
248
+ const res = await ctx.appviewAgent.app.bsky.graph.getStarterPacks(
232
249
  request.params,
233
250
  await ctx.appviewAuth(ids.AppBskyGraphGetStarterPacks),
234
251
  )
@@ -242,11 +259,10 @@ export default function (server: Server, ctx: AppContext) {
242
259
  server.app.bsky.graph.getActorStarterPacks({
243
260
  auth: ctx.authVerifier.modOrAdminToken,
244
261
  handler: async (request) => {
245
- const res =
246
- await ctx.appviewAgent.api.app.bsky.graph.getActorStarterPacks(
247
- request.params,
248
- await ctx.appviewAuth(ids.AppBskyGraphGetActorStarterPacks),
249
- )
262
+ const res = await ctx.appviewAgent.app.bsky.graph.getActorStarterPacks(
263
+ request.params,
264
+ await ctx.appviewAuth(ids.AppBskyGraphGetActorStarterPacks),
265
+ )
250
266
  return {
251
267
  encoding: 'application/json',
252
268
  body: res.data,
@@ -257,7 +273,7 @@ export default function (server: Server, ctx: AppContext) {
257
273
  server.app.bsky.feed.getLikes({
258
274
  auth: ctx.authVerifier.modOrAdminToken,
259
275
  handler: async (request) => {
260
- const res = await ctx.appviewAgent.api.app.bsky.feed.getLikes(
276
+ const res = await ctx.appviewAgent.app.bsky.feed.getLikes(
261
277
  request.params,
262
278
  await ctx.appviewAuth(ids.AppBskyFeedGetLikes),
263
279
  )
@@ -271,7 +287,7 @@ export default function (server: Server, ctx: AppContext) {
271
287
  server.app.bsky.feed.getRepostedBy({
272
288
  auth: ctx.authVerifier.moderator,
273
289
  handler: async (request) => {
274
- const res = await ctx.appviewAgent.api.app.bsky.feed.getRepostedBy(
290
+ const res = await ctx.appviewAgent.app.bsky.feed.getRepostedBy(
275
291
  request.params,
276
292
  await ctx.appviewAuth(ids.AppBskyFeedGetRepostedBy),
277
293
  )
@@ -285,11 +301,10 @@ export default function (server: Server, ctx: AppContext) {
285
301
  server.app.bsky.actor.searchActorsTypeahead({
286
302
  auth: ctx.authVerifier.moderator,
287
303
  handler: async (request) => {
288
- const res =
289
- await ctx.appviewAgent.api.app.bsky.actor.searchActorsTypeahead(
290
- request.params,
291
- await ctx.appviewAuth(ids.AppBskyActorSearchActorsTypeahead),
292
- )
304
+ const res = await ctx.appviewAgent.app.bsky.actor.searchActorsTypeahead(
305
+ request.params,
306
+ await ctx.appviewAuth(ids.AppBskyActorSearchActorsTypeahead),
307
+ )
293
308
  return {
294
309
  encoding: 'application/json',
295
310
  body: res.data,
@@ -188,6 +188,7 @@ import * as ToolsOzoneCommunicationCreateTemplate from './types/tools/ozone/comm
188
188
  import * as ToolsOzoneCommunicationDeleteTemplate from './types/tools/ozone/communication/deleteTemplate.js'
189
189
  import * as ToolsOzoneCommunicationListTemplates from './types/tools/ozone/communication/listTemplates.js'
190
190
  import * as ToolsOzoneCommunicationUpdateTemplate from './types/tools/ozone/communication/updateTemplate.js'
191
+ import * as ToolsOzoneHostingGetAccountHistory from './types/tools/ozone/hosting/getAccountHistory.js'
191
192
  import * as ToolsOzoneModerationEmitEvent from './types/tools/ozone/moderation/emitEvent.js'
192
193
  import * as ToolsOzoneModerationGetEvent from './types/tools/ozone/moderation/getEvent.js'
193
194
  import * as ToolsOzoneModerationGetRecord from './types/tools/ozone/moderation/getRecord.js'
@@ -2487,6 +2488,7 @@ export class ToolsNS {
2487
2488
  export class ToolsOzoneNS {
2488
2489
  _server: Server
2489
2490
  communication: ToolsOzoneCommunicationNS
2491
+ hosting: ToolsOzoneHostingNS
2490
2492
  moderation: ToolsOzoneModerationNS
2491
2493
  server: ToolsOzoneServerNS
2492
2494
  set: ToolsOzoneSetNS
@@ -2497,6 +2499,7 @@ export class ToolsOzoneNS {
2497
2499
  constructor(server: Server) {
2498
2500
  this._server = server
2499
2501
  this.communication = new ToolsOzoneCommunicationNS(server)
2502
+ this.hosting = new ToolsOzoneHostingNS(server)
2500
2503
  this.moderation = new ToolsOzoneModerationNS(server)
2501
2504
  this.server = new ToolsOzoneServerNS(server)
2502
2505
  this.set = new ToolsOzoneSetNS(server)
@@ -2558,6 +2561,25 @@ export class ToolsOzoneCommunicationNS {
2558
2561
  }
2559
2562
  }
2560
2563
 
2564
+ export class ToolsOzoneHostingNS {
2565
+ _server: Server
2566
+
2567
+ constructor(server: Server) {
2568
+ this._server = server
2569
+ }
2570
+
2571
+ getAccountHistory<AV extends AuthVerifier>(
2572
+ cfg: ConfigOf<
2573
+ AV,
2574
+ ToolsOzoneHostingGetAccountHistory.Handler<ExtractAuth<AV>>,
2575
+ ToolsOzoneHostingGetAccountHistory.HandlerReqCtx<ExtractAuth<AV>>
2576
+ >,
2577
+ ) {
2578
+ const nsid = 'tools.ozone.hosting.getAccountHistory' // @ts-ignore
2579
+ return this._server.xrpc.method(nsid, cfg)
2580
+ }
2581
+ }
2582
+
2561
2583
  export class ToolsOzoneModerationNS {
2562
2584
  _server: Server
2563
2585
 
@@ -11104,7 +11104,7 @@ export const schemaDict = {
11104
11104
  chatDisabled: {
11105
11105
  type: 'boolean',
11106
11106
  description:
11107
- 'Set to true when the actor cannot actively participate in converations',
11107
+ 'Set to true when the actor cannot actively participate in conversations',
11108
11108
  },
11109
11109
  verification: {
11110
11110
  type: 'ref',
@@ -12575,6 +12575,137 @@ export const schemaDict = {
12575
12575
  },
12576
12576
  },
12577
12577
  },
12578
+ ToolsOzoneHostingGetAccountHistory: {
12579
+ lexicon: 1,
12580
+ id: 'tools.ozone.hosting.getAccountHistory',
12581
+ defs: {
12582
+ main: {
12583
+ type: 'query',
12584
+ description:
12585
+ 'Get account history, e.g. log of updated email addresses or other identity information.',
12586
+ parameters: {
12587
+ type: 'params',
12588
+ required: ['did'],
12589
+ properties: {
12590
+ did: {
12591
+ type: 'string',
12592
+ format: 'did',
12593
+ },
12594
+ events: {
12595
+ type: 'array',
12596
+ items: {
12597
+ type: 'string',
12598
+ knownValues: [
12599
+ 'accountCreated',
12600
+ 'emailUpdated',
12601
+ 'emailConfirmed',
12602
+ 'passwordUpdated',
12603
+ 'handleUpdated',
12604
+ ],
12605
+ },
12606
+ },
12607
+ cursor: {
12608
+ type: 'string',
12609
+ },
12610
+ limit: {
12611
+ type: 'integer',
12612
+ minimum: 1,
12613
+ maximum: 100,
12614
+ default: 50,
12615
+ },
12616
+ },
12617
+ },
12618
+ output: {
12619
+ encoding: 'application/json',
12620
+ schema: {
12621
+ type: 'object',
12622
+ required: ['events'],
12623
+ properties: {
12624
+ cursor: {
12625
+ type: 'string',
12626
+ },
12627
+ events: {
12628
+ type: 'array',
12629
+ items: {
12630
+ type: 'ref',
12631
+ ref: 'lex:tools.ozone.hosting.getAccountHistory#event',
12632
+ },
12633
+ },
12634
+ },
12635
+ },
12636
+ },
12637
+ },
12638
+ event: {
12639
+ type: 'object',
12640
+ required: ['details', 'createdBy', 'createdAt'],
12641
+ properties: {
12642
+ details: {
12643
+ type: 'union',
12644
+ refs: [
12645
+ 'lex:tools.ozone.hosting.getAccountHistory#accountCreated',
12646
+ 'lex:tools.ozone.hosting.getAccountHistory#emailUpdated',
12647
+ 'lex:tools.ozone.hosting.getAccountHistory#emailConfirmed',
12648
+ 'lex:tools.ozone.hosting.getAccountHistory#passwordUpdated',
12649
+ 'lex:tools.ozone.hosting.getAccountHistory#handleUpdated',
12650
+ ],
12651
+ },
12652
+ createdBy: {
12653
+ type: 'string',
12654
+ },
12655
+ createdAt: {
12656
+ type: 'string',
12657
+ format: 'datetime',
12658
+ },
12659
+ },
12660
+ },
12661
+ accountCreated: {
12662
+ type: 'object',
12663
+ required: [],
12664
+ properties: {
12665
+ email: {
12666
+ type: 'string',
12667
+ },
12668
+ handle: {
12669
+ type: 'string',
12670
+ format: 'handle',
12671
+ },
12672
+ },
12673
+ },
12674
+ emailUpdated: {
12675
+ type: 'object',
12676
+ required: ['email'],
12677
+ properties: {
12678
+ email: {
12679
+ type: 'string',
12680
+ },
12681
+ },
12682
+ },
12683
+ emailConfirmed: {
12684
+ type: 'object',
12685
+ required: ['email'],
12686
+ properties: {
12687
+ email: {
12688
+ type: 'string',
12689
+ },
12690
+ },
12691
+ },
12692
+ passwordUpdated: {
12693
+ type: 'object',
12694
+ required: [],
12695
+ properties: {},
12696
+ },
12697
+ handleUpdated: {
12698
+ type: 'object',
12699
+ required: ['handle'],
12700
+ properties: {
12701
+ handle: {
12702
+ type: 'string',
12703
+ format: 'handle',
12704
+ },
12705
+ },
12706
+ },
12707
+ },
12708
+ },
12578
12709
  ToolsOzoneModerationDefs: {
12579
12710
  lexicon: 1,
12580
12711
  id: 'tools.ozone.moderation.defs',
@@ -15753,6 +15884,7 @@ export const ids = {
15753
15884
  'tools.ozone.communication.listTemplates',
15754
15885
  ToolsOzoneCommunicationUpdateTemplate:
15755
15886
  'tools.ozone.communication.updateTemplate',
15887
+ ToolsOzoneHostingGetAccountHistory: 'tools.ozone.hosting.getAccountHistory',
15756
15888
  ToolsOzoneModerationDefs: 'tools.ozone.moderation.defs',
15757
15889
  ToolsOzoneModerationEmitEvent: 'tools.ozone.moderation.emitEvent',
15758
15890
  ToolsOzoneModerationGetEvent: 'tools.ozone.moderation.getEvent',
@@ -25,7 +25,7 @@ export interface ProfileViewBasic {
25
25
  associated?: AppBskyActorDefs.ProfileAssociated
26
26
  viewer?: AppBskyActorDefs.ViewerState
27
27
  labels?: ComAtprotoLabelDefs.Label[]
28
- /** Set to true when the actor cannot actively participate in converations */
28
+ /** Set to true when the actor cannot actively participate in conversations */
29
29
  chatDisabled?: boolean
30
30
  verification?: AppBskyActorDefs.VerificationState
31
31
  }
@@ -0,0 +1,161 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { type ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { CID } from 'multiformats/cid'
7
+ import { validate as _validate } from '../../../../lexicons'
8
+ import {
9
+ type $Typed,
10
+ is$typed as _is$typed,
11
+ type OmitKey,
12
+ } from '../../../../util'
13
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
14
+
15
+ const is$typed = _is$typed,
16
+ validate = _validate
17
+ const id = 'tools.ozone.hosting.getAccountHistory'
18
+
19
+ export interface QueryParams {
20
+ did: string
21
+ events?:
22
+ | 'accountCreated'
23
+ | 'emailUpdated'
24
+ | 'emailConfirmed'
25
+ | 'passwordUpdated'
26
+ | 'handleUpdated'
27
+ | (string & {})[]
28
+ cursor?: string
29
+ limit: number
30
+ }
31
+
32
+ export type InputSchema = undefined
33
+
34
+ export interface OutputSchema {
35
+ cursor?: string
36
+ events: Event[]
37
+ }
38
+
39
+ export type HandlerInput = undefined
40
+
41
+ export interface HandlerSuccess {
42
+ encoding: 'application/json'
43
+ body: OutputSchema
44
+ headers?: { [key: string]: string }
45
+ }
46
+
47
+ export interface HandlerError {
48
+ status: number
49
+ message?: string
50
+ }
51
+
52
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
53
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
54
+ auth: HA
55
+ params: QueryParams
56
+ input: HandlerInput
57
+ req: express.Request
58
+ res: express.Response
59
+ resetRouteRateLimits: () => Promise<void>
60
+ }
61
+ export type Handler<HA extends HandlerAuth = never> = (
62
+ ctx: HandlerReqCtx<HA>,
63
+ ) => Promise<HandlerOutput> | HandlerOutput
64
+
65
+ export interface Event {
66
+ $type?: 'tools.ozone.hosting.getAccountHistory#event'
67
+ details:
68
+ | $Typed<AccountCreated>
69
+ | $Typed<EmailUpdated>
70
+ | $Typed<EmailConfirmed>
71
+ | $Typed<PasswordUpdated>
72
+ | $Typed<HandleUpdated>
73
+ | { $type: string }
74
+ createdBy: string
75
+ createdAt: string
76
+ }
77
+
78
+ const hashEvent = 'event'
79
+
80
+ export function isEvent<V>(v: V) {
81
+ return is$typed(v, id, hashEvent)
82
+ }
83
+
84
+ export function validateEvent<V>(v: V) {
85
+ return validate<Event & V>(v, id, hashEvent)
86
+ }
87
+
88
+ export interface AccountCreated {
89
+ $type?: 'tools.ozone.hosting.getAccountHistory#accountCreated'
90
+ email?: string
91
+ handle?: string
92
+ }
93
+
94
+ const hashAccountCreated = 'accountCreated'
95
+
96
+ export function isAccountCreated<V>(v: V) {
97
+ return is$typed(v, id, hashAccountCreated)
98
+ }
99
+
100
+ export function validateAccountCreated<V>(v: V) {
101
+ return validate<AccountCreated & V>(v, id, hashAccountCreated)
102
+ }
103
+
104
+ export interface EmailUpdated {
105
+ $type?: 'tools.ozone.hosting.getAccountHistory#emailUpdated'
106
+ email: string
107
+ }
108
+
109
+ const hashEmailUpdated = 'emailUpdated'
110
+
111
+ export function isEmailUpdated<V>(v: V) {
112
+ return is$typed(v, id, hashEmailUpdated)
113
+ }
114
+
115
+ export function validateEmailUpdated<V>(v: V) {
116
+ return validate<EmailUpdated & V>(v, id, hashEmailUpdated)
117
+ }
118
+
119
+ export interface EmailConfirmed {
120
+ $type?: 'tools.ozone.hosting.getAccountHistory#emailConfirmed'
121
+ email: string
122
+ }
123
+
124
+ const hashEmailConfirmed = 'emailConfirmed'
125
+
126
+ export function isEmailConfirmed<V>(v: V) {
127
+ return is$typed(v, id, hashEmailConfirmed)
128
+ }
129
+
130
+ export function validateEmailConfirmed<V>(v: V) {
131
+ return validate<EmailConfirmed & V>(v, id, hashEmailConfirmed)
132
+ }
133
+
134
+ export interface PasswordUpdated {
135
+ $type?: 'tools.ozone.hosting.getAccountHistory#passwordUpdated'
136
+ }
137
+
138
+ const hashPasswordUpdated = 'passwordUpdated'
139
+
140
+ export function isPasswordUpdated<V>(v: V) {
141
+ return is$typed(v, id, hashPasswordUpdated)
142
+ }
143
+
144
+ export function validatePasswordUpdated<V>(v: V) {
145
+ return validate<PasswordUpdated & V>(v, id, hashPasswordUpdated)
146
+ }
147
+
148
+ export interface HandleUpdated {
149
+ $type?: 'tools.ozone.hosting.getAccountHistory#handleUpdated'
150
+ handle: string
151
+ }
152
+
153
+ const hashHandleUpdated = 'handleUpdated'
154
+
155
+ export function isHandleUpdated<V>(v: V) {
156
+ return is$typed(v, id, hashHandleUpdated)
157
+ }
158
+
159
+ export function validateHandleUpdated<V>(v: V) {
160
+ return validate<HandleUpdated & V>(v, id, hashHandleUpdated)
161
+ }