@atproto/api 0.13.7 → 0.13.9

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 (54) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +1 -1
  3. package/dist/client/index.d.ts +6 -0
  4. package/dist/client/index.d.ts.map +1 -1
  5. package/dist/client/index.js +17 -4
  6. package/dist/client/index.js.map +1 -1
  7. package/dist/client/lexicons.d.ts +118 -0
  8. package/dist/client/lexicons.d.ts.map +1 -1
  9. package/dist/client/lexicons.js +135 -3
  10. package/dist/client/lexicons.js.map +1 -1
  11. package/dist/client/types/app/bsky/actor/defs.d.ts +2 -0
  12. package/dist/client/types/app/bsky/actor/defs.d.ts.map +1 -1
  13. package/dist/client/types/app/bsky/actor/defs.js.map +1 -1
  14. package/dist/client/types/app/bsky/actor/profile.d.ts +1 -0
  15. package/dist/client/types/app/bsky/actor/profile.d.ts.map +1 -1
  16. package/dist/client/types/app/bsky/actor/profile.js.map +1 -1
  17. package/dist/client/types/app/bsky/feed/defs.d.ts +13 -2
  18. package/dist/client/types/app/bsky/feed/defs.d.ts.map +1 -1
  19. package/dist/client/types/app/bsky/feed/defs.js +21 -1
  20. package/dist/client/types/app/bsky/feed/defs.js.map +1 -1
  21. package/dist/client/types/app/bsky/feed/getAuthorFeed.d.ts +1 -0
  22. package/dist/client/types/app/bsky/feed/getAuthorFeed.d.ts.map +1 -1
  23. package/dist/client/types/app/bsky/feed/getAuthorFeed.js.map +1 -1
  24. package/dist/client/types/app/bsky/graph/getSuggestedFollowsByActor.d.ts +2 -0
  25. package/dist/client/types/app/bsky/graph/getSuggestedFollowsByActor.d.ts.map +1 -1
  26. package/dist/client/types/app/bsky/graph/getSuggestedFollowsByActor.js.map +1 -1
  27. package/dist/client/types/app/bsky/unspecced/getSuggestionsSkeleton.d.ts +2 -0
  28. package/dist/client/types/app/bsky/unspecced/getSuggestionsSkeleton.d.ts.map +1 -1
  29. package/dist/client/types/app/bsky/unspecced/getSuggestionsSkeleton.js.map +1 -1
  30. package/dist/client/types/com/atproto/repo/getRecord.d.ts +4 -1
  31. package/dist/client/types/com/atproto/repo/getRecord.d.ts.map +1 -1
  32. package/dist/client/types/com/atproto/repo/getRecord.js +15 -1
  33. package/dist/client/types/com/atproto/repo/getRecord.js.map +1 -1
  34. package/dist/client/types/tools/ozone/moderation/getRecords.d.ts +27 -0
  35. package/dist/client/types/tools/ozone/moderation/getRecords.d.ts.map +1 -0
  36. package/dist/client/types/tools/ozone/moderation/getRecords.js +8 -0
  37. package/dist/client/types/tools/ozone/moderation/getRecords.js.map +1 -0
  38. package/dist/client/types/tools/ozone/moderation/getRepos.d.ts +27 -0
  39. package/dist/client/types/tools/ozone/moderation/getRepos.d.ts.map +1 -0
  40. package/dist/client/types/tools/ozone/moderation/getRepos.js +8 -0
  41. package/dist/client/types/tools/ozone/moderation/getRepos.js.map +1 -0
  42. package/package.json +5 -5
  43. package/src/client/index.ts +33 -6
  44. package/src/client/lexicons.ts +137 -3
  45. package/src/client/types/app/bsky/actor/defs.ts +2 -0
  46. package/src/client/types/app/bsky/actor/profile.ts +1 -0
  47. package/src/client/types/app/bsky/feed/defs.ts +38 -2
  48. package/src/client/types/app/bsky/feed/getAuthorFeed.ts +1 -0
  49. package/src/client/types/app/bsky/graph/getSuggestedFollowsByActor.ts +2 -0
  50. package/src/client/types/app/bsky/unspecced/getSuggestionsSkeleton.ts +2 -0
  51. package/src/client/types/com/atproto/repo/getRecord.ts +10 -0
  52. package/src/client/types/tools/ozone/moderation/getRecords.ts +39 -0
  53. package/src/client/types/tools/ozone/moderation/getRepos.ts +39 -0
  54. 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
  },
@@ -4190,6 +4195,10 @@ export const schemaDict = {
4190
4195
  ref: 'lex:com.atproto.label.defs#label',
4191
4196
  },
4192
4197
  },
4198
+ pinnedPost: {
4199
+ type: 'ref',
4200
+ ref: 'lex:com.atproto.repo.strongRef',
4201
+ },
4193
4202
  },
4194
4203
  },
4195
4204
  profileAssociated: {
@@ -4812,6 +4821,10 @@ export const schemaDict = {
4812
4821
  type: 'ref',
4813
4822
  ref: 'lex:com.atproto.repo.strongRef',
4814
4823
  },
4824
+ pinnedPost: {
4825
+ type: 'ref',
4826
+ ref: 'lex:com.atproto.repo.strongRef',
4827
+ },
4815
4828
  createdAt: {
4816
4829
  type: 'string',
4817
4830
  format: 'datetime',
@@ -5468,6 +5481,9 @@ export const schemaDict = {
5468
5481
  embeddingDisabled: {
5469
5482
  type: 'boolean',
5470
5483
  },
5484
+ pinned: {
5485
+ type: 'boolean',
5486
+ },
5471
5487
  },
5472
5488
  },
5473
5489
  feedViewPost: {
@@ -5484,7 +5500,10 @@ export const schemaDict = {
5484
5500
  },
5485
5501
  reason: {
5486
5502
  type: 'union',
5487
- refs: ['lex:app.bsky.feed.defs#reasonRepost'],
5503
+ refs: [
5504
+ 'lex:app.bsky.feed.defs#reasonRepost',
5505
+ 'lex:app.bsky.feed.defs#reasonPin',
5506
+ ],
5488
5507
  },
5489
5508
  feedContext: {
5490
5509
  type: 'string',
@@ -5536,6 +5555,10 @@ export const schemaDict = {
5536
5555
  },
5537
5556
  },
5538
5557
  },
5558
+ reasonPin: {
5559
+ type: 'object',
5560
+ properties: {},
5561
+ },
5539
5562
  threadViewPost: {
5540
5563
  type: 'object',
5541
5564
  required: ['post'],
@@ -5693,7 +5716,10 @@ export const schemaDict = {
5693
5716
  },
5694
5717
  reason: {
5695
5718
  type: 'union',
5696
- refs: ['lex:app.bsky.feed.defs#skeletonReasonRepost'],
5719
+ refs: [
5720
+ 'lex:app.bsky.feed.defs#skeletonReasonRepost',
5721
+ 'lex:app.bsky.feed.defs#skeletonReasonPin',
5722
+ ],
5697
5723
  },
5698
5724
  feedContext: {
5699
5725
  type: 'string',
@@ -5713,6 +5739,10 @@ export const schemaDict = {
5713
5739
  },
5714
5740
  },
5715
5741
  },
5742
+ skeletonReasonPin: {
5743
+ type: 'object',
5744
+ properties: {},
5745
+ },
5716
5746
  threadgateView: {
5717
5747
  type: 'object',
5718
5748
  properties: {
@@ -6078,6 +6108,10 @@ export const schemaDict = {
6078
6108
  ],
6079
6109
  default: 'posts_with_replies',
6080
6110
  },
6111
+ includePins: {
6112
+ type: 'boolean',
6113
+ default: false,
6114
+ },
6081
6115
  },
6082
6116
  },
6083
6117
  output: {
@@ -7162,7 +7196,7 @@ export const schemaDict = {
7162
7196
  type: 'record',
7163
7197
  key: 'tid',
7164
7198
  description:
7165
- "Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository..",
7199
+ "Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository.",
7166
7200
  record: {
7167
7201
  type: 'object',
7168
7202
  required: ['post', 'createdAt'],
@@ -8236,6 +8270,12 @@ export const schemaDict = {
8236
8270
  ref: 'lex:app.bsky.actor.defs#profileView',
8237
8271
  },
8238
8272
  },
8273
+ isFallback: {
8274
+ type: 'boolean',
8275
+ description:
8276
+ 'If true, response has fallen-back to generic results, and is not scoped using relativeToDid',
8277
+ default: false,
8278
+ },
8239
8279
  },
8240
8280
  },
8241
8281
  },
@@ -9192,6 +9232,12 @@ export const schemaDict = {
9192
9232
  ref: 'lex:app.bsky.unspecced.defs#skeletonSearchActor',
9193
9233
  },
9194
9234
  },
9235
+ relativeToDid: {
9236
+ type: 'string',
9237
+ format: 'did',
9238
+ description:
9239
+ 'DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer.',
9240
+ },
9195
9241
  },
9196
9242
  },
9197
9243
  },
@@ -11602,6 +11648,49 @@ export const schemaDict = {
11602
11648
  },
11603
11649
  },
11604
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
+ },
11605
11694
  ToolsOzoneModerationGetRepo: {
11606
11695
  lexicon: 1,
11607
11696
  id: 'tools.ozone.moderation.getRepo',
@@ -11634,6 +11723,49 @@ export const schemaDict = {
11634
11723
  },
11635
11724
  },
11636
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
+ },
11637
11769
  ToolsOzoneModerationQueryEvents: {
11638
11770
  lexicon: 1,
11639
11771
  id: 'tools.ozone.moderation.queryEvents',
@@ -12450,7 +12582,9 @@ export const ids = {
12450
12582
  ToolsOzoneModerationEmitEvent: 'tools.ozone.moderation.emitEvent',
12451
12583
  ToolsOzoneModerationGetEvent: 'tools.ozone.moderation.getEvent',
12452
12584
  ToolsOzoneModerationGetRecord: 'tools.ozone.moderation.getRecord',
12585
+ ToolsOzoneModerationGetRecords: 'tools.ozone.moderation.getRecords',
12453
12586
  ToolsOzoneModerationGetRepo: 'tools.ozone.moderation.getRepo',
12587
+ ToolsOzoneModerationGetRepos: 'tools.ozone.moderation.getRepos',
12454
12588
  ToolsOzoneModerationQueryEvents: 'tools.ozone.moderation.queryEvents',
12455
12589
  ToolsOzoneModerationQueryStatuses: 'tools.ozone.moderation.queryStatuses',
12456
12590
  ToolsOzoneModerationSearchRepos: 'tools.ozone.moderation.searchRepos',
@@ -7,6 +7,7 @@ import { lexicons } from '../../../../lexicons'
7
7
  import { CID } from 'multiformats/cid'
8
8
  import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
9
9
  import * as AppBskyGraphDefs from '../graph/defs'
10
+ import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
10
11
 
11
12
  export interface ProfileViewBasic {
12
13
  did: string
@@ -74,6 +75,7 @@ export interface ProfileViewDetailed {
74
75
  createdAt?: string
75
76
  viewer?: ViewerState
76
77
  labels?: ComAtprotoLabelDefs.Label[]
78
+ pinnedPost?: ComAtprotoRepoStrongRef.Main
77
79
  [k: string]: unknown
78
80
  }
79
81
 
@@ -20,6 +20,7 @@ export interface Record {
20
20
  | ComAtprotoLabelDefs.SelfLabels
21
21
  | { $type: string; [k: string]: unknown }
22
22
  joinedViaStarterPack?: ComAtprotoRepoStrongRef.Main
23
+ pinnedPost?: ComAtprotoRepoStrongRef.Main
23
24
  createdAt?: string
24
25
  [k: string]: unknown
25
26
  }
@@ -55,6 +55,7 @@ export interface ViewerState {
55
55
  threadMuted?: boolean
56
56
  replyDisabled?: boolean
57
57
  embeddingDisabled?: boolean
58
+ pinned?: boolean
58
59
  [k: string]: unknown
59
60
  }
60
61
 
@@ -73,7 +74,7 @@ export function validateViewerState(v: unknown): ValidationResult {
73
74
  export interface FeedViewPost {
74
75
  post: PostView
75
76
  reply?: ReplyRef
76
- reason?: ReasonRepost | { $type: string; [k: string]: unknown }
77
+ reason?: ReasonRepost | ReasonPin | { $type: string; [k: string]: unknown }
77
78
  /** Context provided by feed generator that may be passed back alongside interactions. */
78
79
  feedContext?: string
79
80
  [k: string]: unknown
@@ -134,6 +135,22 @@ export function validateReasonRepost(v: unknown): ValidationResult {
134
135
  return lexicons.validate('app.bsky.feed.defs#reasonRepost', v)
135
136
  }
136
137
 
138
+ export interface ReasonPin {
139
+ [k: string]: unknown
140
+ }
141
+
142
+ export function isReasonPin(v: unknown): v is ReasonPin {
143
+ return (
144
+ isObj(v) &&
145
+ hasProp(v, '$type') &&
146
+ v.$type === 'app.bsky.feed.defs#reasonPin'
147
+ )
148
+ }
149
+
150
+ export function validateReasonPin(v: unknown): ValidationResult {
151
+ return lexicons.validate('app.bsky.feed.defs#reasonPin', v)
152
+ }
153
+
137
154
  export interface ThreadViewPost {
138
155
  post: PostView
139
156
  parent?:
@@ -265,7 +282,10 @@ export function validateGeneratorViewerState(v: unknown): ValidationResult {
265
282
 
266
283
  export interface SkeletonFeedPost {
267
284
  post: string
268
- reason?: SkeletonReasonRepost | { $type: string; [k: string]: unknown }
285
+ reason?:
286
+ | SkeletonReasonRepost
287
+ | SkeletonReasonPin
288
+ | { $type: string; [k: string]: unknown }
269
289
  /** Context that will be passed through to client and may be passed to feed generator back alongside interactions. */
270
290
  feedContext?: string
271
291
  [k: string]: unknown
@@ -300,6 +320,22 @@ export function validateSkeletonReasonRepost(v: unknown): ValidationResult {
300
320
  return lexicons.validate('app.bsky.feed.defs#skeletonReasonRepost', v)
301
321
  }
302
322
 
323
+ export interface SkeletonReasonPin {
324
+ [k: string]: unknown
325
+ }
326
+
327
+ export function isSkeletonReasonPin(v: unknown): v is SkeletonReasonPin {
328
+ return (
329
+ isObj(v) &&
330
+ hasProp(v, '$type') &&
331
+ v.$type === 'app.bsky.feed.defs#skeletonReasonPin'
332
+ )
333
+ }
334
+
335
+ export function validateSkeletonReasonPin(v: unknown): ValidationResult {
336
+ return lexicons.validate('app.bsky.feed.defs#skeletonReasonPin', v)
337
+ }
338
+
303
339
  export interface ThreadgateView {
304
340
  uri?: string
305
341
  cid?: string
@@ -19,6 +19,7 @@ export interface QueryParams {
19
19
  | 'posts_with_media'
20
20
  | 'posts_and_author_threads'
21
21
  | (string & {})
22
+ includePins?: boolean
22
23
  }
23
24
 
24
25
  export type InputSchema = undefined
@@ -16,6 +16,8 @@ export type InputSchema = undefined
16
16
 
17
17
  export interface OutputSchema {
18
18
  suggestions: AppBskyActorDefs.ProfileView[]
19
+ /** If true, response has fallen-back to generic results, and is not scoped using relativeToDid */
20
+ isFallback: boolean
19
21
  [k: string]: unknown
20
22
  }
21
23
 
@@ -22,6 +22,8 @@ export type InputSchema = undefined
22
22
  export interface OutputSchema {
23
23
  cursor?: string
24
24
  actors: AppBskyUnspeccedDefs.SkeletonSearchActor[]
25
+ /** DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer. */
26
+ relativeToDid?: string
25
27
  [k: string]: unknown
26
28
  }
27
29
 
@@ -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
+ }