@atproto/api 0.12.21 → 0.12.22

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 +6 -0
  2. package/dist/client/index.d.ts +34 -0
  3. package/dist/client/index.d.ts.map +1 -1
  4. package/dist/client/index.js +73 -3
  5. package/dist/client/index.js.map +1 -1
  6. package/dist/client/lexicons.d.ts +332 -0
  7. package/dist/client/lexicons.d.ts.map +1 -1
  8. package/dist/client/lexicons.js +339 -1
  9. package/dist/client/lexicons.js.map +1 -1
  10. package/dist/client/types/app/bsky/actor/defs.d.ts +5 -0
  11. package/dist/client/types/app/bsky/actor/defs.d.ts.map +1 -1
  12. package/dist/client/types/app/bsky/actor/defs.js.map +1 -1
  13. package/dist/client/types/app/bsky/actor/profile.d.ts +3 -0
  14. package/dist/client/types/app/bsky/actor/profile.d.ts.map +1 -1
  15. package/dist/client/types/app/bsky/actor/profile.js.map +1 -1
  16. package/dist/client/types/app/bsky/graph/defs.d.ts +36 -1
  17. package/dist/client/types/app/bsky/graph/defs.d.ts.map +1 -1
  18. package/dist/client/types/app/bsky/graph/defs.js +23 -1
  19. package/dist/client/types/app/bsky/graph/defs.js.map +1 -1
  20. package/dist/client/types/app/bsky/graph/getActorStarterPacks.d.ts +26 -0
  21. package/dist/client/types/app/bsky/graph/getActorStarterPacks.d.ts.map +1 -0
  22. package/dist/client/types/app/bsky/graph/getActorStarterPacks.js +14 -0
  23. package/dist/client/types/app/bsky/graph/getActorStarterPacks.js.map +1 -0
  24. package/dist/client/types/app/bsky/graph/getStarterPack.d.ts +24 -0
  25. package/dist/client/types/app/bsky/graph/getStarterPack.d.ts.map +1 -0
  26. package/dist/client/types/app/bsky/graph/getStarterPack.js +14 -0
  27. package/dist/client/types/app/bsky/graph/getStarterPack.js.map +1 -0
  28. package/dist/client/types/app/bsky/graph/getStarterPacks.d.ts +23 -0
  29. package/dist/client/types/app/bsky/graph/getStarterPacks.d.ts.map +1 -0
  30. package/dist/client/types/app/bsky/graph/getStarterPacks.js +14 -0
  31. package/dist/client/types/app/bsky/graph/getStarterPacks.js.map +1 -0
  32. package/dist/client/types/app/bsky/graph/starterpack.d.ts +25 -0
  33. package/dist/client/types/app/bsky/graph/starterpack.d.ts.map +1 -0
  34. package/dist/client/types/app/bsky/graph/starterpack.js +27 -0
  35. package/dist/client/types/app/bsky/graph/starterpack.js.map +1 -0
  36. package/dist/client/types/app/bsky/notification/listNotifications.d.ts +2 -2
  37. package/dist/client/types/app/bsky/notification/listNotifications.d.ts.map +1 -1
  38. package/dist/client/types/app/bsky/notification/listNotifications.js.map +1 -1
  39. package/dist/client/types/tools/ozone/team/deleteMember.d.ts +3 -0
  40. package/dist/client/types/tools/ozone/team/deleteMember.d.ts.map +1 -1
  41. package/dist/client/types/tools/ozone/team/deleteMember.js +9 -1
  42. package/dist/client/types/tools/ozone/team/deleteMember.js.map +1 -1
  43. package/package.json +1 -1
  44. package/src/client/index.ts +109 -0
  45. package/src/client/lexicons.ts +341 -1
  46. package/src/client/types/app/bsky/actor/defs.ts +5 -0
  47. package/src/client/types/app/bsky/actor/profile.ts +3 -0
  48. package/src/client/types/app/bsky/graph/defs.ts +58 -0
  49. package/src/client/types/app/bsky/graph/getActorStarterPacks.ts +39 -0
  50. package/src/client/types/app/bsky/graph/getStarterPack.ts +37 -0
  51. package/src/client/types/app/bsky/graph/getStarterPacks.ts +36 -0
  52. package/src/client/types/app/bsky/graph/starterpack.ts +50 -0
  53. package/src/client/types/app/bsky/notification/listNotifications.ts +2 -1
  54. package/src/client/types/tools/ozone/team/deleteMember.ts +7 -0
@@ -8,6 +8,7 @@ import { CID } from 'multiformats/cid'
8
8
  import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
9
9
  import * as AppBskyActorDefs from '../actor/defs'
10
10
  import * as AppBskyRichtextFacet from '../richtext/facet'
11
+ import * as AppBskyFeedDefs from '../feed/defs'
11
12
 
12
13
  export interface ListViewBasic {
13
14
  uri: string
@@ -15,6 +16,7 @@ export interface ListViewBasic {
15
16
  name: string
16
17
  purpose: ListPurpose
17
18
  avatar?: string
19
+ listItemCount?: number
18
20
  labels?: ComAtprotoLabelDefs.Label[]
19
21
  viewer?: ListViewerState
20
22
  indexedAt?: string
@@ -42,6 +44,7 @@ export interface ListView {
42
44
  description?: string
43
45
  descriptionFacets?: AppBskyRichtextFacet.Main[]
44
46
  avatar?: string
47
+ listItemCount?: number
45
48
  labels?: ComAtprotoLabelDefs.Label[]
46
49
  viewer?: ListViewerState
47
50
  indexedAt: string
@@ -78,15 +81,70 @@ export function validateListItemView(v: unknown): ValidationResult {
78
81
  return lexicons.validate('app.bsky.graph.defs#listItemView', v)
79
82
  }
80
83
 
84
+ export interface StarterPackView {
85
+ uri: string
86
+ cid: string
87
+ record: {}
88
+ creator: AppBskyActorDefs.ProfileViewBasic
89
+ list?: ListViewBasic
90
+ listItemsSample?: ListItemView[]
91
+ feeds?: AppBskyFeedDefs.GeneratorView[]
92
+ joinedWeekCount?: number
93
+ joinedAllTimeCount?: number
94
+ labels?: ComAtprotoLabelDefs.Label[]
95
+ indexedAt: string
96
+ [k: string]: unknown
97
+ }
98
+
99
+ export function isStarterPackView(v: unknown): v is StarterPackView {
100
+ return (
101
+ isObj(v) &&
102
+ hasProp(v, '$type') &&
103
+ v.$type === 'app.bsky.graph.defs#starterPackView'
104
+ )
105
+ }
106
+
107
+ export function validateStarterPackView(v: unknown): ValidationResult {
108
+ return lexicons.validate('app.bsky.graph.defs#starterPackView', v)
109
+ }
110
+
111
+ export interface StarterPackViewBasic {
112
+ uri: string
113
+ cid: string
114
+ record: {}
115
+ creator: AppBskyActorDefs.ProfileViewBasic
116
+ listItemCount?: number
117
+ joinedWeekCount?: number
118
+ joinedAllTimeCount?: number
119
+ labels?: ComAtprotoLabelDefs.Label[]
120
+ indexedAt: string
121
+ [k: string]: unknown
122
+ }
123
+
124
+ export function isStarterPackViewBasic(v: unknown): v is StarterPackViewBasic {
125
+ return (
126
+ isObj(v) &&
127
+ hasProp(v, '$type') &&
128
+ v.$type === 'app.bsky.graph.defs#starterPackViewBasic'
129
+ )
130
+ }
131
+
132
+ export function validateStarterPackViewBasic(v: unknown): ValidationResult {
133
+ return lexicons.validate('app.bsky.graph.defs#starterPackViewBasic', v)
134
+ }
135
+
81
136
  export type ListPurpose =
82
137
  | 'app.bsky.graph.defs#modlist'
83
138
  | 'app.bsky.graph.defs#curatelist'
139
+ | 'app.bsky.graph.defs#referencelist'
84
140
  | (string & {})
85
141
 
86
142
  /** A list of actors to apply an aggregate moderation action (mute/block) on. */
87
143
  export const MODLIST = 'app.bsky.graph.defs#modlist'
88
144
  /** A list of actors used for curation purposes such as list feeds or interaction gating. */
89
145
  export const CURATELIST = 'app.bsky.graph.defs#curatelist'
146
+ /** A list of actors used for only for reference purposes such as within a starter pack. */
147
+ export const REFERENCELIST = 'app.bsky.graph.defs#referencelist'
90
148
 
91
149
  export interface ListViewerState {
92
150
  muted?: boolean
@@ -0,0 +1,39 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { Headers, 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 AppBskyGraphDefs from './defs'
10
+
11
+ export interface QueryParams {
12
+ actor: string
13
+ limit?: number
14
+ cursor?: string
15
+ }
16
+
17
+ export type InputSchema = undefined
18
+
19
+ export interface OutputSchema {
20
+ cursor?: string
21
+ starterPacks: AppBskyGraphDefs.StarterPackViewBasic[]
22
+ [k: string]: unknown
23
+ }
24
+
25
+ export interface CallOptions {
26
+ headers?: Headers
27
+ }
28
+
29
+ export interface Response {
30
+ success: boolean
31
+ headers: Headers
32
+ data: OutputSchema
33
+ }
34
+
35
+ export function toKnownErr(e: any) {
36
+ if (e instanceof XRPCError) {
37
+ }
38
+ return e
39
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { Headers, 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 AppBskyGraphDefs from './defs'
10
+
11
+ export interface QueryParams {
12
+ /** Reference (AT-URI) of the starter pack record. */
13
+ starterPack: string
14
+ }
15
+
16
+ export type InputSchema = undefined
17
+
18
+ export interface OutputSchema {
19
+ starterPack: AppBskyGraphDefs.StarterPackView
20
+ [k: string]: unknown
21
+ }
22
+
23
+ export interface CallOptions {
24
+ headers?: Headers
25
+ }
26
+
27
+ export interface Response {
28
+ success: boolean
29
+ headers: Headers
30
+ data: OutputSchema
31
+ }
32
+
33
+ export function toKnownErr(e: any) {
34
+ if (e instanceof XRPCError) {
35
+ }
36
+ return e
37
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { Headers, 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 AppBskyGraphDefs from './defs'
10
+
11
+ export interface QueryParams {
12
+ uris: string[]
13
+ }
14
+
15
+ export type InputSchema = undefined
16
+
17
+ export interface OutputSchema {
18
+ starterPacks: AppBskyGraphDefs.StarterPackViewBasic[]
19
+ [k: string]: unknown
20
+ }
21
+
22
+ export interface CallOptions {
23
+ headers?: Headers
24
+ }
25
+
26
+ export interface Response {
27
+ success: boolean
28
+ headers: Headers
29
+ data: OutputSchema
30
+ }
31
+
32
+ export function toKnownErr(e: any) {
33
+ if (e instanceof XRPCError) {
34
+ }
35
+ return e
36
+ }
@@ -0,0 +1,50 @@
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
+ import * as AppBskyRichtextFacet from '../richtext/facet'
9
+
10
+ export interface Record {
11
+ /** Display name for starter pack; can not be empty. */
12
+ name: string
13
+ description?: string
14
+ descriptionFacets?: AppBskyRichtextFacet.Main[]
15
+ /** Reference (AT-URI) to the list record. */
16
+ list: string
17
+ feeds?: FeedItem[]
18
+ createdAt: string
19
+ [k: string]: unknown
20
+ }
21
+
22
+ export function isRecord(v: unknown): v is Record {
23
+ return (
24
+ isObj(v) &&
25
+ hasProp(v, '$type') &&
26
+ (v.$type === 'app.bsky.graph.starterpack#main' ||
27
+ v.$type === 'app.bsky.graph.starterpack')
28
+ )
29
+ }
30
+
31
+ export function validateRecord(v: unknown): ValidationResult {
32
+ return lexicons.validate('app.bsky.graph.starterpack#main', v)
33
+ }
34
+
35
+ export interface FeedItem {
36
+ uri: string
37
+ [k: string]: unknown
38
+ }
39
+
40
+ export function isFeedItem(v: unknown): v is FeedItem {
41
+ return (
42
+ isObj(v) &&
43
+ hasProp(v, '$type') &&
44
+ v.$type === 'app.bsky.graph.starterpack#feedItem'
45
+ )
46
+ }
47
+
48
+ export function validateFeedItem(v: unknown): ValidationResult {
49
+ return lexicons.validate('app.bsky.graph.starterpack#feedItem', v)
50
+ }
@@ -44,7 +44,7 @@ export interface Notification {
44
44
  uri: string
45
45
  cid: string
46
46
  author: AppBskyActorDefs.ProfileView
47
- /** Expected values are 'like', 'repost', 'follow', 'mention', 'reply', and 'quote'. */
47
+ /** Expected values are 'like', 'repost', 'follow', 'mention', 'reply', 'quote', and 'starterpack-joined'. */
48
48
  reason:
49
49
  | 'like'
50
50
  | 'repost'
@@ -52,6 +52,7 @@ export interface Notification {
52
52
  | 'mention'
53
53
  | 'reply'
54
54
  | 'quote'
55
+ | 'starterpack-joined'
55
56
  | (string & {})
56
57
  reasonSubject?: string
57
58
  record: {}
@@ -31,9 +31,16 @@ export class MemberNotFoundError extends XRPCError {
31
31
  }
32
32
  }
33
33
 
34
+ export class CannotDeleteSelfError extends XRPCError {
35
+ constructor(src: XRPCError) {
36
+ super(src.status, src.error, src.message, src.headers)
37
+ }
38
+ }
39
+
34
40
  export function toKnownErr(e: any) {
35
41
  if (e instanceof XRPCError) {
36
42
  if (e.error === 'MemberNotFound') return new MemberNotFoundError(e)
43
+ if (e.error === 'CannotDeleteSelf') return new CannotDeleteSelfError(e)
37
44
  }
38
45
  return e
39
46
  }