@atproto/ozone 0.1.46 → 0.1.48

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.
Files changed (95) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/api/index.d.ts.map +1 -1
  3. package/dist/api/index.js +4 -0
  4. package/dist/api/index.js.map +1 -1
  5. package/dist/api/moderation/getRecord.d.ts.map +1 -1
  6. package/dist/api/moderation/getRecord.js +5 -4
  7. package/dist/api/moderation/getRecord.js.map +1 -1
  8. package/dist/api/moderation/getRecords.d.ts +4 -0
  9. package/dist/api/moderation/getRecords.d.ts.map +1 -0
  10. package/dist/api/moderation/getRecords.js +37 -0
  11. package/dist/api/moderation/getRecords.js.map +1 -0
  12. package/dist/api/moderation/getRepo.d.ts.map +1 -1
  13. package/dist/api/moderation/getRepo.js +5 -4
  14. package/dist/api/moderation/getRepo.js.map +1 -1
  15. package/dist/api/moderation/getRepos.d.ts +4 -0
  16. package/dist/api/moderation/getRepos.d.ts.map +1 -0
  17. package/dist/api/moderation/getRepos.js +36 -0
  18. package/dist/api/moderation/getRepos.js.map +1 -0
  19. package/dist/api/proxied.d.ts.map +1 -1
  20. package/dist/api/proxied.js +39 -0
  21. package/dist/api/proxied.js.map +1 -1
  22. package/dist/api/util.d.ts +1 -1
  23. package/dist/api/util.d.ts.map +1 -1
  24. package/dist/api/util.js +13 -9
  25. package/dist/api/util.js.map +1 -1
  26. package/dist/db/migrations/20241001T205730722Z-subject-status-review-state-index.d.ts +4 -0
  27. package/dist/db/migrations/20241001T205730722Z-subject-status-review-state-index.d.ts.map +1 -0
  28. package/dist/db/migrations/20241001T205730722Z-subject-status-review-state-index.js +18 -0
  29. package/dist/db/migrations/20241001T205730722Z-subject-status-review-state-index.js.map +1 -0
  30. package/dist/db/migrations/index.d.ts +1 -0
  31. package/dist/db/migrations/index.d.ts.map +1 -1
  32. package/dist/db/migrations/index.js +2 -1
  33. package/dist/db/migrations/index.js.map +1 -1
  34. package/dist/lexicon/index.d.ts +15 -0
  35. package/dist/lexicon/index.d.ts.map +1 -1
  36. package/dist/lexicon/index.js +40 -1
  37. package/dist/lexicon/index.js.map +1 -1
  38. package/dist/lexicon/lexicons.d.ts +261 -0
  39. package/dist/lexicon/lexicons.d.ts.map +1 -1
  40. package/dist/lexicon/lexicons.js +269 -0
  41. package/dist/lexicon/lexicons.js.map +1 -1
  42. package/dist/lexicon/types/com/atproto/repo/getRecord.d.ts +1 -0
  43. package/dist/lexicon/types/com/atproto/repo/getRecord.d.ts.map +1 -1
  44. package/dist/lexicon/types/tools/ozone/moderation/getRecords.d.ts +39 -0
  45. package/dist/lexicon/types/tools/ozone/moderation/getRecords.d.ts.map +1 -0
  46. package/dist/lexicon/types/tools/ozone/moderation/getRecords.js +3 -0
  47. package/dist/lexicon/types/tools/ozone/moderation/getRecords.js.map +1 -0
  48. package/dist/lexicon/types/tools/ozone/moderation/getRepos.d.ts +39 -0
  49. package/dist/lexicon/types/tools/ozone/moderation/getRepos.d.ts.map +1 -0
  50. package/dist/lexicon/types/tools/ozone/moderation/getRepos.js +3 -0
  51. package/dist/lexicon/types/tools/ozone/moderation/getRepos.js.map +1 -0
  52. package/dist/lexicon/types/tools/ozone/signature/defs.d.ts +12 -0
  53. package/dist/lexicon/types/tools/ozone/signature/defs.d.ts.map +1 -0
  54. package/dist/lexicon/types/tools/ozone/signature/defs.js +16 -0
  55. package/dist/lexicon/types/tools/ozone/signature/defs.js.map +1 -0
  56. package/dist/lexicon/types/tools/ozone/signature/findCorrelation.d.ts +36 -0
  57. package/dist/lexicon/types/tools/ozone/signature/findCorrelation.d.ts.map +1 -0
  58. package/dist/lexicon/types/tools/ozone/signature/findCorrelation.js +3 -0
  59. package/dist/lexicon/types/tools/ozone/signature/findCorrelation.js.map +1 -0
  60. package/dist/lexicon/types/tools/ozone/signature/findRelatedAccounts.d.ts +48 -0
  61. package/dist/lexicon/types/tools/ozone/signature/findRelatedAccounts.d.ts.map +1 -0
  62. package/dist/lexicon/types/tools/ozone/signature/findRelatedAccounts.js +16 -0
  63. package/dist/lexicon/types/tools/ozone/signature/findRelatedAccounts.js.map +1 -0
  64. package/dist/lexicon/types/tools/ozone/signature/searchAccounts.d.ts +39 -0
  65. package/dist/lexicon/types/tools/ozone/signature/searchAccounts.d.ts.map +1 -0
  66. package/dist/lexicon/types/tools/ozone/signature/searchAccounts.js +3 -0
  67. package/dist/lexicon/types/tools/ozone/signature/searchAccounts.js.map +1 -0
  68. package/dist/mod-service/views.d.ts +5 -5
  69. package/dist/mod-service/views.d.ts.map +1 -1
  70. package/dist/mod-service/views.js +75 -48
  71. package/dist/mod-service/views.js.map +1 -1
  72. package/package.json +5 -5
  73. package/src/api/index.ts +4 -0
  74. package/src/api/moderation/getRecord.ts +7 -5
  75. package/src/api/moderation/getRecords.ts +50 -0
  76. package/src/api/moderation/getRepo.ts +7 -5
  77. package/src/api/moderation/getRepos.ts +41 -0
  78. package/src/api/proxied.ts +51 -0
  79. package/src/api/util.ts +16 -9
  80. package/src/db/migrations/20241001T205730722Z-subject-status-review-state-index.ts +15 -0
  81. package/src/db/migrations/index.ts +1 -0
  82. package/src/lexicon/index.ts +70 -0
  83. package/src/lexicon/lexicons.ts +273 -0
  84. package/src/lexicon/types/com/atproto/repo/getRecord.ts +1 -0
  85. package/src/lexicon/types/tools/ozone/moderation/getRecords.ts +50 -0
  86. package/src/lexicon/types/tools/ozone/moderation/getRepos.ts +50 -0
  87. package/src/lexicon/types/tools/ozone/signature/defs.ts +25 -0
  88. package/src/lexicon/types/tools/ozone/signature/findCorrelation.ts +46 -0
  89. package/src/lexicon/types/tools/ozone/signature/findRelatedAccounts.ts +71 -0
  90. package/src/lexicon/types/tools/ozone/signature/searchAccounts.ts +49 -0
  91. package/src/mod-service/views.ts +93 -52
  92. package/tests/__snapshots__/get-records.test.ts.snap +153 -0
  93. package/tests/__snapshots__/get-repos.test.ts.snap +108 -0
  94. package/tests/get-records.test.ts +87 -0
  95. package/tests/get-repos.test.ts +87 -0
@@ -1686,6 +1686,11 @@ export const schemaDict = {
1686
1686
  },
1687
1687
  },
1688
1688
  },
1689
+ errors: [
1690
+ {
1691
+ name: 'RecordNotFound',
1692
+ },
1693
+ ],
1689
1694
  },
1690
1695
  },
1691
1696
  },
@@ -11643,6 +11648,49 @@ export const schemaDict = {
11643
11648
  },
11644
11649
  },
11645
11650
  },
11651
+ ToolsOzoneModerationGetRecords: {
11652
+ lexicon: 1,
11653
+ id: 'tools.ozone.moderation.getRecords',
11654
+ defs: {
11655
+ main: {
11656
+ type: 'query',
11657
+ description: 'Get details about some records.',
11658
+ parameters: {
11659
+ type: 'params',
11660
+ required: ['uris'],
11661
+ properties: {
11662
+ uris: {
11663
+ type: 'array',
11664
+ maxLength: 100,
11665
+ items: {
11666
+ type: 'string',
11667
+ format: 'at-uri',
11668
+ },
11669
+ },
11670
+ },
11671
+ },
11672
+ output: {
11673
+ encoding: 'application/json',
11674
+ schema: {
11675
+ type: 'object',
11676
+ required: ['records'],
11677
+ properties: {
11678
+ records: {
11679
+ type: 'array',
11680
+ items: {
11681
+ type: 'union',
11682
+ refs: [
11683
+ 'lex:tools.ozone.moderation.defs#recordViewDetail',
11684
+ 'lex:tools.ozone.moderation.defs#recordViewNotFound',
11685
+ ],
11686
+ },
11687
+ },
11688
+ },
11689
+ },
11690
+ },
11691
+ },
11692
+ },
11693
+ },
11646
11694
  ToolsOzoneModerationGetRepo: {
11647
11695
  lexicon: 1,
11648
11696
  id: 'tools.ozone.moderation.getRepo',
@@ -11675,6 +11723,49 @@ export const schemaDict = {
11675
11723
  },
11676
11724
  },
11677
11725
  },
11726
+ ToolsOzoneModerationGetRepos: {
11727
+ lexicon: 1,
11728
+ id: 'tools.ozone.moderation.getRepos',
11729
+ defs: {
11730
+ main: {
11731
+ type: 'query',
11732
+ description: 'Get details about some repositories.',
11733
+ parameters: {
11734
+ type: 'params',
11735
+ required: ['dids'],
11736
+ properties: {
11737
+ dids: {
11738
+ type: 'array',
11739
+ maxLength: 100,
11740
+ items: {
11741
+ type: 'string',
11742
+ format: 'did',
11743
+ },
11744
+ },
11745
+ },
11746
+ },
11747
+ output: {
11748
+ encoding: 'application/json',
11749
+ schema: {
11750
+ type: 'object',
11751
+ required: ['repos'],
11752
+ properties: {
11753
+ repos: {
11754
+ type: 'array',
11755
+ items: {
11756
+ type: 'union',
11757
+ refs: [
11758
+ 'lex:tools.ozone.moderation.defs#repoViewDetail',
11759
+ 'lex:tools.ozone.moderation.defs#repoViewNotFound',
11760
+ ],
11761
+ },
11762
+ },
11763
+ },
11764
+ },
11765
+ },
11766
+ },
11767
+ },
11768
+ },
11678
11769
  ToolsOzoneModerationQueryEvents: {
11679
11770
  lexicon: 1,
11680
11771
  id: 'tools.ozone.moderation.queryEvents',
@@ -12048,6 +12139,181 @@ export const schemaDict = {
12048
12139
  },
12049
12140
  },
12050
12141
  },
12142
+ ToolsOzoneSignatureDefs: {
12143
+ lexicon: 1,
12144
+ id: 'tools.ozone.signature.defs',
12145
+ defs: {
12146
+ sigDetail: {
12147
+ type: 'object',
12148
+ required: ['property', 'value'],
12149
+ properties: {
12150
+ property: {
12151
+ type: 'string',
12152
+ },
12153
+ value: {
12154
+ type: 'string',
12155
+ },
12156
+ },
12157
+ },
12158
+ },
12159
+ },
12160
+ ToolsOzoneSignatureFindCorrelation: {
12161
+ lexicon: 1,
12162
+ id: 'tools.ozone.signature.findCorrelation',
12163
+ defs: {
12164
+ main: {
12165
+ type: 'query',
12166
+ description:
12167
+ 'Find all correlated threat signatures between 2 or more accounts.',
12168
+ parameters: {
12169
+ type: 'params',
12170
+ required: ['dids'],
12171
+ properties: {
12172
+ dids: {
12173
+ type: 'array',
12174
+ items: {
12175
+ type: 'string',
12176
+ format: 'did',
12177
+ },
12178
+ },
12179
+ },
12180
+ },
12181
+ output: {
12182
+ encoding: 'application/json',
12183
+ schema: {
12184
+ type: 'object',
12185
+ required: ['details'],
12186
+ properties: {
12187
+ details: {
12188
+ type: 'array',
12189
+ items: {
12190
+ type: 'ref',
12191
+ ref: 'lex:tools.ozone.signature.defs#sigDetail',
12192
+ },
12193
+ },
12194
+ },
12195
+ },
12196
+ },
12197
+ },
12198
+ },
12199
+ },
12200
+ ToolsOzoneSignatureFindRelatedAccounts: {
12201
+ lexicon: 1,
12202
+ id: 'tools.ozone.signature.findRelatedAccounts',
12203
+ defs: {
12204
+ main: {
12205
+ type: 'query',
12206
+ description:
12207
+ 'Get accounts that share some matching threat signatures with the root account.',
12208
+ parameters: {
12209
+ type: 'params',
12210
+ required: ['did'],
12211
+ properties: {
12212
+ did: {
12213
+ type: 'string',
12214
+ format: 'did',
12215
+ },
12216
+ cursor: {
12217
+ type: 'string',
12218
+ },
12219
+ limit: {
12220
+ type: 'integer',
12221
+ minimum: 1,
12222
+ maximum: 100,
12223
+ default: 50,
12224
+ },
12225
+ },
12226
+ },
12227
+ output: {
12228
+ encoding: 'application/json',
12229
+ schema: {
12230
+ type: 'object',
12231
+ required: ['accounts'],
12232
+ properties: {
12233
+ cursor: {
12234
+ type: 'string',
12235
+ },
12236
+ accounts: {
12237
+ type: 'array',
12238
+ items: {
12239
+ type: 'ref',
12240
+ ref: 'lex:tools.ozone.signature.findRelatedAccounts#relatedAccount',
12241
+ },
12242
+ },
12243
+ },
12244
+ },
12245
+ },
12246
+ },
12247
+ relatedAccount: {
12248
+ type: 'object',
12249
+ required: ['account'],
12250
+ properties: {
12251
+ account: {
12252
+ type: 'ref',
12253
+ ref: 'lex:com.atproto.admin.defs#accountView',
12254
+ },
12255
+ similarities: {
12256
+ type: 'array',
12257
+ items: {
12258
+ type: 'ref',
12259
+ ref: 'lex:tools.ozone.signature.defs#sigDetail',
12260
+ },
12261
+ },
12262
+ },
12263
+ },
12264
+ },
12265
+ },
12266
+ ToolsOzoneSignatureSearchAccounts: {
12267
+ lexicon: 1,
12268
+ id: 'tools.ozone.signature.searchAccounts',
12269
+ defs: {
12270
+ main: {
12271
+ type: 'query',
12272
+ description:
12273
+ 'Search for accounts that match one or more threat signature values.',
12274
+ parameters: {
12275
+ type: 'params',
12276
+ required: ['values'],
12277
+ properties: {
12278
+ values: {
12279
+ type: 'array',
12280
+ items: {
12281
+ type: 'string',
12282
+ },
12283
+ },
12284
+ cursor: {
12285
+ type: 'string',
12286
+ },
12287
+ limit: {
12288
+ type: 'integer',
12289
+ minimum: 1,
12290
+ maximum: 100,
12291
+ default: 50,
12292
+ },
12293
+ },
12294
+ },
12295
+ output: {
12296
+ encoding: 'application/json',
12297
+ schema: {
12298
+ type: 'object',
12299
+ required: ['accounts'],
12300
+ properties: {
12301
+ cursor: {
12302
+ type: 'string',
12303
+ },
12304
+ accounts: {
12305
+ type: 'array',
12306
+ items: {
12307
+ type: 'ref',
12308
+ ref: 'lex:com.atproto.admin.defs#accountView',
12309
+ },
12310
+ },
12311
+ },
12312
+ },
12313
+ },
12314
+ },
12315
+ },
12316
+ },
12051
12317
  ToolsOzoneTeamAddMember: {
12052
12318
  lexicon: 1,
12053
12319
  id: 'tools.ozone.team.addMember',
@@ -12491,11 +12757,18 @@ export const ids = {
12491
12757
  ToolsOzoneModerationEmitEvent: 'tools.ozone.moderation.emitEvent',
12492
12758
  ToolsOzoneModerationGetEvent: 'tools.ozone.moderation.getEvent',
12493
12759
  ToolsOzoneModerationGetRecord: 'tools.ozone.moderation.getRecord',
12760
+ ToolsOzoneModerationGetRecords: 'tools.ozone.moderation.getRecords',
12494
12761
  ToolsOzoneModerationGetRepo: 'tools.ozone.moderation.getRepo',
12762
+ ToolsOzoneModerationGetRepos: 'tools.ozone.moderation.getRepos',
12495
12763
  ToolsOzoneModerationQueryEvents: 'tools.ozone.moderation.queryEvents',
12496
12764
  ToolsOzoneModerationQueryStatuses: 'tools.ozone.moderation.queryStatuses',
12497
12765
  ToolsOzoneModerationSearchRepos: 'tools.ozone.moderation.searchRepos',
12498
12766
  ToolsOzoneServerGetConfig: 'tools.ozone.server.getConfig',
12767
+ ToolsOzoneSignatureDefs: 'tools.ozone.signature.defs',
12768
+ ToolsOzoneSignatureFindCorrelation: 'tools.ozone.signature.findCorrelation',
12769
+ ToolsOzoneSignatureFindRelatedAccounts:
12770
+ 'tools.ozone.signature.findRelatedAccounts',
12771
+ ToolsOzoneSignatureSearchAccounts: 'tools.ozone.signature.searchAccounts',
12499
12772
  ToolsOzoneTeamAddMember: 'tools.ozone.team.addMember',
12500
12773
  ToolsOzoneTeamDefs: 'tools.ozone.team.defs',
12501
12774
  ToolsOzoneTeamDeleteMember: 'tools.ozone.team.deleteMember',
@@ -39,6 +39,7 @@ export interface HandlerSuccess {
39
39
  export interface HandlerError {
40
40
  status: number
41
41
  message?: string
42
+ error?: 'RecordNotFound'
42
43
  }
43
44
 
44
45
  export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
@@ -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 ToolsOzoneModerationDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ uris: string[]
14
+ }
15
+
16
+ export type InputSchema = undefined
17
+
18
+ export interface OutputSchema {
19
+ records: (
20
+ | ToolsOzoneModerationDefs.RecordViewDetail
21
+ | ToolsOzoneModerationDefs.RecordViewNotFound
22
+ | { $type: string; [k: string]: unknown }
23
+ )[]
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,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 ToolsOzoneModerationDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ dids: string[]
14
+ }
15
+
16
+ export type InputSchema = undefined
17
+
18
+ export interface OutputSchema {
19
+ repos: (
20
+ | ToolsOzoneModerationDefs.RepoViewDetail
21
+ | ToolsOzoneModerationDefs.RepoViewNotFound
22
+ | { $type: string; [k: string]: unknown }
23
+ )[]
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,25 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { lexicons } from '../../../../lexicons'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { CID } from 'multiformats/cid'
8
+
9
+ export interface SigDetail {
10
+ property: string
11
+ value: string
12
+ [k: string]: unknown
13
+ }
14
+
15
+ export function isSigDetail(v: unknown): v is SigDetail {
16
+ return (
17
+ isObj(v) &&
18
+ hasProp(v, '$type') &&
19
+ v.$type === 'tools.ozone.signature.defs#sigDetail'
20
+ )
21
+ }
22
+
23
+ export function validateSigDetail(v: unknown): ValidationResult {
24
+ return lexicons.validate('tools.ozone.signature.defs#sigDetail', v)
25
+ }
@@ -0,0 +1,46 @@
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 ToolsOzoneSignatureDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ dids: string[]
14
+ }
15
+
16
+ export type InputSchema = undefined
17
+
18
+ export interface OutputSchema {
19
+ details: ToolsOzoneSignatureDefs.SigDetail[]
20
+ [k: string]: unknown
21
+ }
22
+
23
+ export type HandlerInput = undefined
24
+
25
+ export interface HandlerSuccess {
26
+ encoding: 'application/json'
27
+ body: OutputSchema
28
+ headers?: { [key: string]: string }
29
+ }
30
+
31
+ export interface HandlerError {
32
+ status: number
33
+ message?: string
34
+ }
35
+
36
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
37
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
38
+ auth: HA
39
+ params: QueryParams
40
+ input: HandlerInput
41
+ req: express.Request
42
+ res: express.Response
43
+ }
44
+ export type Handler<HA extends HandlerAuth = never> = (
45
+ ctx: HandlerReqCtx<HA>,
46
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,71 @@
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 '../../../com/atproto/admin/defs'
11
+ import * as ToolsOzoneSignatureDefs from './defs'
12
+
13
+ export interface QueryParams {
14
+ did: string
15
+ cursor?: string
16
+ limit: number
17
+ }
18
+
19
+ export type InputSchema = undefined
20
+
21
+ export interface OutputSchema {
22
+ cursor?: string
23
+ accounts: RelatedAccount[]
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
51
+
52
+ export interface RelatedAccount {
53
+ account: ComAtprotoAdminDefs.AccountView
54
+ similarities?: ToolsOzoneSignatureDefs.SigDetail[]
55
+ [k: string]: unknown
56
+ }
57
+
58
+ export function isRelatedAccount(v: unknown): v is RelatedAccount {
59
+ return (
60
+ isObj(v) &&
61
+ hasProp(v, '$type') &&
62
+ v.$type === 'tools.ozone.signature.findRelatedAccounts#relatedAccount'
63
+ )
64
+ }
65
+
66
+ export function validateRelatedAccount(v: unknown): ValidationResult {
67
+ return lexicons.validate(
68
+ 'tools.ozone.signature.findRelatedAccounts#relatedAccount',
69
+ v,
70
+ )
71
+ }
@@ -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 '../../../com/atproto/admin/defs'
11
+
12
+ export interface QueryParams {
13
+ values: 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