@atproto/api 0.13.8 → 0.13.10

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 (48) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/client/index.d.ts +21 -0
  3. package/dist/client/index.d.ts.map +1 -1
  4. package/dist/client/index.js +49 -4
  5. package/dist/client/index.js.map +1 -1
  6. package/dist/client/lexicons.d.ts +261 -0
  7. package/dist/client/lexicons.d.ts.map +1 -1
  8. package/dist/client/lexicons.js +269 -0
  9. package/dist/client/lexicons.js.map +1 -1
  10. package/dist/client/types/com/atproto/repo/getRecord.d.ts +4 -1
  11. package/dist/client/types/com/atproto/repo/getRecord.d.ts.map +1 -1
  12. package/dist/client/types/com/atproto/repo/getRecord.js +15 -1
  13. package/dist/client/types/com/atproto/repo/getRecord.js.map +1 -1
  14. package/dist/client/types/tools/ozone/moderation/getRecords.d.ts +27 -0
  15. package/dist/client/types/tools/ozone/moderation/getRecords.d.ts.map +1 -0
  16. package/dist/client/types/tools/ozone/moderation/getRecords.js +8 -0
  17. package/dist/client/types/tools/ozone/moderation/getRecords.js.map +1 -0
  18. package/dist/client/types/tools/ozone/moderation/getRepos.d.ts +27 -0
  19. package/dist/client/types/tools/ozone/moderation/getRepos.d.ts.map +1 -0
  20. package/dist/client/types/tools/ozone/moderation/getRepos.js +8 -0
  21. package/dist/client/types/tools/ozone/moderation/getRepos.js.map +1 -0
  22. package/dist/client/types/tools/ozone/signature/defs.d.ts +12 -0
  23. package/dist/client/types/tools/ozone/signature/defs.d.ts.map +1 -0
  24. package/dist/client/types/tools/ozone/signature/defs.js +16 -0
  25. package/dist/client/types/tools/ozone/signature/defs.js.map +1 -0
  26. package/dist/client/types/tools/ozone/signature/findCorrelation.d.ts +24 -0
  27. package/dist/client/types/tools/ozone/signature/findCorrelation.d.ts.map +1 -0
  28. package/dist/client/types/tools/ozone/signature/findCorrelation.js +8 -0
  29. package/dist/client/types/tools/ozone/signature/findCorrelation.js.map +1 -0
  30. package/dist/client/types/tools/ozone/signature/findRelatedAccounts.d.ts +36 -0
  31. package/dist/client/types/tools/ozone/signature/findRelatedAccounts.d.ts.map +1 -0
  32. package/dist/client/types/tools/ozone/signature/findRelatedAccounts.js +20 -0
  33. package/dist/client/types/tools/ozone/signature/findRelatedAccounts.js.map +1 -0
  34. package/dist/client/types/tools/ozone/signature/searchAccounts.d.ts +27 -0
  35. package/dist/client/types/tools/ozone/signature/searchAccounts.d.ts.map +1 -0
  36. package/dist/client/types/tools/ozone/signature/searchAccounts.js +8 -0
  37. package/dist/client/types/tools/ozone/signature/searchAccounts.js.map +1 -0
  38. package/package.json +1 -1
  39. package/src/client/index.ts +87 -6
  40. package/src/client/lexicons.ts +273 -0
  41. package/src/client/types/com/atproto/repo/getRecord.ts +10 -0
  42. package/src/client/types/tools/ozone/moderation/getRecords.ts +39 -0
  43. package/src/client/types/tools/ozone/moderation/getRepos.ts +39 -0
  44. package/src/client/types/tools/ozone/signature/defs.ts +25 -0
  45. package/src/client/types/tools/ozone/signature/findCorrelation.ts +35 -0
  46. package/src/client/types/tools/ozone/signature/findRelatedAccounts.ts +60 -0
  47. package/src/client/types/tools/ozone/signature/searchAccounts.ts +38 -0
  48. package/tests/{bsky-agent.test.ts → atp-agent.test.ts} +42 -42
@@ -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',
@@ -38,6 +38,16 @@ export interface Response {
38
38
  data: OutputSchema
39
39
  }
40
40
 
41
+ export class RecordNotFoundError extends XRPCError {
42
+ constructor(src: XRPCError) {
43
+ super(src.status, src.error, src.message, src.headers, { cause: src })
44
+ }
45
+ }
46
+
41
47
  export function toKnownErr(e: any) {
48
+ if (e instanceof XRPCError) {
49
+ if (e.error === 'RecordNotFound') return new RecordNotFoundError(e)
50
+ }
51
+
42
52
  return e
43
53
  }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as ToolsOzoneModerationDefs from './defs'
10
+
11
+ export interface QueryParams {
12
+ uris: string[]
13
+ }
14
+
15
+ export type InputSchema = undefined
16
+
17
+ export interface OutputSchema {
18
+ records: (
19
+ | ToolsOzoneModerationDefs.RecordViewDetail
20
+ | ToolsOzoneModerationDefs.RecordViewNotFound
21
+ | { $type: string; [k: string]: unknown }
22
+ )[]
23
+ [k: string]: unknown
24
+ }
25
+
26
+ export interface CallOptions {
27
+ signal?: AbortSignal
28
+ headers?: HeadersMap
29
+ }
30
+
31
+ export interface Response {
32
+ success: boolean
33
+ headers: HeadersMap
34
+ data: OutputSchema
35
+ }
36
+
37
+ export function toKnownErr(e: any) {
38
+ return e
39
+ }
@@ -0,0 +1,39 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as ToolsOzoneModerationDefs from './defs'
10
+
11
+ export interface QueryParams {
12
+ dids: string[]
13
+ }
14
+
15
+ export type InputSchema = undefined
16
+
17
+ export interface OutputSchema {
18
+ repos: (
19
+ | ToolsOzoneModerationDefs.RepoViewDetail
20
+ | ToolsOzoneModerationDefs.RepoViewNotFound
21
+ | { $type: string; [k: string]: unknown }
22
+ )[]
23
+ [k: string]: unknown
24
+ }
25
+
26
+ export interface CallOptions {
27
+ signal?: AbortSignal
28
+ headers?: HeadersMap
29
+ }
30
+
31
+ export interface Response {
32
+ success: boolean
33
+ headers: HeadersMap
34
+ data: OutputSchema
35
+ }
36
+
37
+ export function toKnownErr(e: any) {
38
+ return e
39
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { isObj, hasProp } from '../../../../util'
6
+ import { lexicons } from '../../../../lexicons'
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,35 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as ToolsOzoneSignatureDefs from './defs'
10
+
11
+ export interface QueryParams {
12
+ dids: string[]
13
+ }
14
+
15
+ export type InputSchema = undefined
16
+
17
+ export interface OutputSchema {
18
+ details: ToolsOzoneSignatureDefs.SigDetail[]
19
+ [k: string]: unknown
20
+ }
21
+
22
+ export interface CallOptions {
23
+ signal?: AbortSignal
24
+ headers?: HeadersMap
25
+ }
26
+
27
+ export interface Response {
28
+ success: boolean
29
+ headers: HeadersMap
30
+ data: OutputSchema
31
+ }
32
+
33
+ export function toKnownErr(e: any) {
34
+ return e
35
+ }
@@ -0,0 +1,60 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as ComAtprotoAdminDefs from '../../../com/atproto/admin/defs'
10
+ import * as ToolsOzoneSignatureDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ did: string
14
+ cursor?: string
15
+ limit?: number
16
+ }
17
+
18
+ export type InputSchema = undefined
19
+
20
+ export interface OutputSchema {
21
+ cursor?: string
22
+ accounts: RelatedAccount[]
23
+ [k: string]: unknown
24
+ }
25
+
26
+ export interface CallOptions {
27
+ signal?: AbortSignal
28
+ headers?: HeadersMap
29
+ }
30
+
31
+ export interface Response {
32
+ success: boolean
33
+ headers: HeadersMap
34
+ data: OutputSchema
35
+ }
36
+
37
+ export function toKnownErr(e: any) {
38
+ return e
39
+ }
40
+
41
+ export interface RelatedAccount {
42
+ account: ComAtprotoAdminDefs.AccountView
43
+ similarities?: ToolsOzoneSignatureDefs.SigDetail[]
44
+ [k: string]: unknown
45
+ }
46
+
47
+ export function isRelatedAccount(v: unknown): v is RelatedAccount {
48
+ return (
49
+ isObj(v) &&
50
+ hasProp(v, '$type') &&
51
+ v.$type === 'tools.ozone.signature.findRelatedAccounts#relatedAccount'
52
+ )
53
+ }
54
+
55
+ export function validateRelatedAccount(v: unknown): ValidationResult {
56
+ return lexicons.validate(
57
+ 'tools.ozone.signature.findRelatedAccounts#relatedAccount',
58
+ v,
59
+ )
60
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { HeadersMap, XRPCError } from '@atproto/xrpc'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { lexicons } from '../../../../lexicons'
8
+ import { CID } from 'multiformats/cid'
9
+ import * as ComAtprotoAdminDefs from '../../../com/atproto/admin/defs'
10
+
11
+ export interface QueryParams {
12
+ values: string[]
13
+ cursor?: string
14
+ limit?: number
15
+ }
16
+
17
+ export type InputSchema = undefined
18
+
19
+ export interface OutputSchema {
20
+ cursor?: string
21
+ accounts: ComAtprotoAdminDefs.AccountView[]
22
+ [k: string]: unknown
23
+ }
24
+
25
+ export interface CallOptions {
26
+ signal?: AbortSignal
27
+ headers?: HeadersMap
28
+ }
29
+
30
+ export interface Response {
31
+ success: boolean
32
+ headers: HeadersMap
33
+ data: OutputSchema
34
+ }
35
+
36
+ export function toKnownErr(e: any) {
37
+ return e
38
+ }