@atproto/api 0.6.3 → 0.6.5
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.
- package/dist/bsky-agent.d.ts +1 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/lexicons.d.ts +68 -0
- package/dist/client/types/app/bsky/feed/getActorLikes.d.ts +28 -0
- package/dist/client/types/app/bsky/unspecced/registerPushNotification.d.ts +16 -0
- package/dist/client/types/com/atproto/admin/defs.d.ts +3 -0
- package/dist/client/types/com/atproto/admin/takeModerationAction.d.ts +1 -0
- package/dist/index.js +225 -119
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
- package/src/bsky-agent.ts +3 -0
- package/src/client/index.ts +13 -0
- package/src/client/lexicons.ts +77 -0
- package/src/client/types/app/bsky/feed/getActorLikes.ts +53 -0
- package/src/client/types/com/atproto/admin/defs.ts +6 -0
- package/src/client/types/com/atproto/admin/takeModerationAction.ts +2 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
package/src/bsky-agent.ts
CHANGED
|
@@ -17,6 +17,9 @@ export class BskyAgent extends AtpAgent {
|
|
|
17
17
|
getAuthorFeed: typeof this.api.app.bsky.feed.getAuthorFeed = (params, opts) =>
|
|
18
18
|
this.api.app.bsky.feed.getAuthorFeed(params, opts)
|
|
19
19
|
|
|
20
|
+
getActorLikes: typeof this.api.app.bsky.feed.getActorLikes = (params, opts) =>
|
|
21
|
+
this.api.app.bsky.feed.getActorLikes(params, opts)
|
|
22
|
+
|
|
20
23
|
getPostThread: typeof this.api.app.bsky.feed.getPostThread = (params, opts) =>
|
|
21
24
|
this.api.app.bsky.feed.getPostThread(params, opts)
|
|
22
25
|
|
package/src/client/index.ts
CHANGED
|
@@ -89,6 +89,7 @@ import * as AppBskyFeedDefs from './types/app/bsky/feed/defs'
|
|
|
89
89
|
import * as AppBskyFeedDescribeFeedGenerator from './types/app/bsky/feed/describeFeedGenerator'
|
|
90
90
|
import * as AppBskyFeedGenerator from './types/app/bsky/feed/generator'
|
|
91
91
|
import * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds'
|
|
92
|
+
import * as AppBskyFeedGetActorLikes from './types/app/bsky/feed/getActorLikes'
|
|
92
93
|
import * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed'
|
|
93
94
|
import * as AppBskyFeedGetFeed from './types/app/bsky/feed/getFeed'
|
|
94
95
|
import * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGenerator'
|
|
@@ -209,6 +210,7 @@ export * as AppBskyFeedDefs from './types/app/bsky/feed/defs'
|
|
|
209
210
|
export * as AppBskyFeedDescribeFeedGenerator from './types/app/bsky/feed/describeFeedGenerator'
|
|
210
211
|
export * as AppBskyFeedGenerator from './types/app/bsky/feed/generator'
|
|
211
212
|
export * as AppBskyFeedGetActorFeeds from './types/app/bsky/feed/getActorFeeds'
|
|
213
|
+
export * as AppBskyFeedGetActorLikes from './types/app/bsky/feed/getActorLikes'
|
|
212
214
|
export * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed'
|
|
213
215
|
export * as AppBskyFeedGetFeed from './types/app/bsky/feed/getFeed'
|
|
214
216
|
export * as AppBskyFeedGetFeedGenerator from './types/app/bsky/feed/getFeedGenerator'
|
|
@@ -1246,6 +1248,17 @@ export class FeedNS {
|
|
|
1246
1248
|
})
|
|
1247
1249
|
}
|
|
1248
1250
|
|
|
1251
|
+
getActorLikes(
|
|
1252
|
+
params?: AppBskyFeedGetActorLikes.QueryParams,
|
|
1253
|
+
opts?: AppBskyFeedGetActorLikes.CallOptions,
|
|
1254
|
+
): Promise<AppBskyFeedGetActorLikes.Response> {
|
|
1255
|
+
return this._service.xrpc
|
|
1256
|
+
.call('app.bsky.feed.getActorLikes', params, undefined, opts)
|
|
1257
|
+
.catch((e) => {
|
|
1258
|
+
throw AppBskyFeedGetActorLikes.toKnownErr(e)
|
|
1259
|
+
})
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1249
1262
|
getAuthorFeed(
|
|
1250
1263
|
params?: AppBskyFeedGetAuthorFeed.QueryParams,
|
|
1251
1264
|
opts?: AppBskyFeedGetAuthorFeed.CallOptions,
|
package/src/client/lexicons.ts
CHANGED
|
@@ -28,6 +28,11 @@ export const schemaDict = {
|
|
|
28
28
|
type: 'ref',
|
|
29
29
|
ref: 'lex:com.atproto.admin.defs#actionType',
|
|
30
30
|
},
|
|
31
|
+
durationInHours: {
|
|
32
|
+
type: 'integer',
|
|
33
|
+
description:
|
|
34
|
+
'Indicates how long this action was meant to be in effect before automatically expiring.',
|
|
35
|
+
},
|
|
31
36
|
subject: {
|
|
32
37
|
type: 'union',
|
|
33
38
|
refs: [
|
|
@@ -96,6 +101,11 @@ export const schemaDict = {
|
|
|
96
101
|
type: 'ref',
|
|
97
102
|
ref: 'lex:com.atproto.admin.defs#actionType',
|
|
98
103
|
},
|
|
104
|
+
durationInHours: {
|
|
105
|
+
type: 'integer',
|
|
106
|
+
description:
|
|
107
|
+
'Indicates how long this action was meant to be in effect before automatically expiring.',
|
|
108
|
+
},
|
|
99
109
|
subject: {
|
|
100
110
|
type: 'union',
|
|
101
111
|
refs: [
|
|
@@ -159,6 +169,11 @@ export const schemaDict = {
|
|
|
159
169
|
type: 'ref',
|
|
160
170
|
ref: 'lex:com.atproto.admin.defs#actionType',
|
|
161
171
|
},
|
|
172
|
+
durationInHours: {
|
|
173
|
+
type: 'integer',
|
|
174
|
+
description:
|
|
175
|
+
'Indicates how long this action was meant to be in effect before automatically expiring.',
|
|
176
|
+
},
|
|
162
177
|
},
|
|
163
178
|
},
|
|
164
179
|
actionReversal: {
|
|
@@ -1264,6 +1279,11 @@ export const schemaDict = {
|
|
|
1264
1279
|
reason: {
|
|
1265
1280
|
type: 'string',
|
|
1266
1281
|
},
|
|
1282
|
+
durationInHours: {
|
|
1283
|
+
type: 'integer',
|
|
1284
|
+
description:
|
|
1285
|
+
'Indicates how long this action was meant to be in effect before automatically expiring.',
|
|
1286
|
+
},
|
|
1267
1287
|
createdBy: {
|
|
1268
1288
|
type: 'string',
|
|
1269
1289
|
format: 'did',
|
|
@@ -4796,6 +4816,62 @@ export const schemaDict = {
|
|
|
4796
4816
|
},
|
|
4797
4817
|
},
|
|
4798
4818
|
},
|
|
4819
|
+
AppBskyFeedGetActorLikes: {
|
|
4820
|
+
lexicon: 1,
|
|
4821
|
+
id: 'app.bsky.feed.getActorLikes',
|
|
4822
|
+
defs: {
|
|
4823
|
+
main: {
|
|
4824
|
+
type: 'query',
|
|
4825
|
+
description: 'A view of the posts liked by an actor.',
|
|
4826
|
+
parameters: {
|
|
4827
|
+
type: 'params',
|
|
4828
|
+
required: ['actor'],
|
|
4829
|
+
properties: {
|
|
4830
|
+
actor: {
|
|
4831
|
+
type: 'string',
|
|
4832
|
+
format: 'at-identifier',
|
|
4833
|
+
},
|
|
4834
|
+
limit: {
|
|
4835
|
+
type: 'integer',
|
|
4836
|
+
minimum: 1,
|
|
4837
|
+
maximum: 100,
|
|
4838
|
+
default: 50,
|
|
4839
|
+
},
|
|
4840
|
+
cursor: {
|
|
4841
|
+
type: 'string',
|
|
4842
|
+
},
|
|
4843
|
+
},
|
|
4844
|
+
},
|
|
4845
|
+
output: {
|
|
4846
|
+
encoding: 'application/json',
|
|
4847
|
+
schema: {
|
|
4848
|
+
type: 'object',
|
|
4849
|
+
required: ['feed'],
|
|
4850
|
+
properties: {
|
|
4851
|
+
cursor: {
|
|
4852
|
+
type: 'string',
|
|
4853
|
+
},
|
|
4854
|
+
feed: {
|
|
4855
|
+
type: 'array',
|
|
4856
|
+
items: {
|
|
4857
|
+
type: 'ref',
|
|
4858
|
+
ref: 'lex:app.bsky.feed.defs#feedViewPost',
|
|
4859
|
+
},
|
|
4860
|
+
},
|
|
4861
|
+
},
|
|
4862
|
+
},
|
|
4863
|
+
},
|
|
4864
|
+
errors: [
|
|
4865
|
+
{
|
|
4866
|
+
name: 'BlockedActor',
|
|
4867
|
+
},
|
|
4868
|
+
{
|
|
4869
|
+
name: 'BlockedByActor',
|
|
4870
|
+
},
|
|
4871
|
+
],
|
|
4872
|
+
},
|
|
4873
|
+
},
|
|
4874
|
+
},
|
|
4799
4875
|
AppBskyFeedGetAuthorFeed: {
|
|
4800
4876
|
lexicon: 1,
|
|
4801
4877
|
id: 'app.bsky.feed.getAuthorFeed',
|
|
@@ -6637,6 +6713,7 @@ export const ids = {
|
|
|
6637
6713
|
AppBskyFeedDescribeFeedGenerator: 'app.bsky.feed.describeFeedGenerator',
|
|
6638
6714
|
AppBskyFeedGenerator: 'app.bsky.feed.generator',
|
|
6639
6715
|
AppBskyFeedGetActorFeeds: 'app.bsky.feed.getActorFeeds',
|
|
6716
|
+
AppBskyFeedGetActorLikes: 'app.bsky.feed.getActorLikes',
|
|
6640
6717
|
AppBskyFeedGetAuthorFeed: 'app.bsky.feed.getAuthorFeed',
|
|
6641
6718
|
AppBskyFeedGetFeed: 'app.bsky.feed.getFeed',
|
|
6642
6719
|
AppBskyFeedGetFeedGenerator: 'app.bsky.feed.getFeedGenerator',
|
|
@@ -0,0 +1,53 @@
|
|
|
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 AppBskyFeedDefs 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
|
+
feed: AppBskyFeedDefs.FeedViewPost[]
|
|
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 class BlockedActorError extends XRPCError {
|
|
36
|
+
constructor(src: XRPCError) {
|
|
37
|
+
super(src.status, src.error, src.message, src.headers)
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export class BlockedByActorError extends XRPCError {
|
|
42
|
+
constructor(src: XRPCError) {
|
|
43
|
+
super(src.status, src.error, src.message, src.headers)
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function toKnownErr(e: any) {
|
|
48
|
+
if (e instanceof XRPCError) {
|
|
49
|
+
if (e.error === 'BlockedActor') return new BlockedActorError(e)
|
|
50
|
+
if (e.error === 'BlockedByActor') return new BlockedByActorError(e)
|
|
51
|
+
}
|
|
52
|
+
return e
|
|
53
|
+
}
|
|
@@ -13,6 +13,8 @@ import * as ComAtprotoLabelDefs from '../label/defs'
|
|
|
13
13
|
export interface ActionView {
|
|
14
14
|
id: number
|
|
15
15
|
action: ActionType
|
|
16
|
+
/** Indicates how long this action was meant to be in effect before automatically expiring. */
|
|
17
|
+
durationInHours?: number
|
|
16
18
|
subject:
|
|
17
19
|
| RepoRef
|
|
18
20
|
| ComAtprotoRepoStrongRef.Main
|
|
@@ -43,6 +45,8 @@ export function validateActionView(v: unknown): ValidationResult {
|
|
|
43
45
|
export interface ActionViewDetail {
|
|
44
46
|
id: number
|
|
45
47
|
action: ActionType
|
|
48
|
+
/** Indicates how long this action was meant to be in effect before automatically expiring. */
|
|
49
|
+
durationInHours?: number
|
|
46
50
|
subject:
|
|
47
51
|
| RepoView
|
|
48
52
|
| RepoViewNotFound
|
|
@@ -75,6 +79,8 @@ export function validateActionViewDetail(v: unknown): ValidationResult {
|
|
|
75
79
|
export interface ActionViewCurrent {
|
|
76
80
|
id: number
|
|
77
81
|
action: ActionType
|
|
82
|
+
/** Indicates how long this action was meant to be in effect before automatically expiring. */
|
|
83
|
+
durationInHours?: number
|
|
78
84
|
[k: string]: unknown
|
|
79
85
|
}
|
|
80
86
|
|
|
@@ -25,6 +25,8 @@ export interface InputSchema {
|
|
|
25
25
|
createLabelVals?: string[]
|
|
26
26
|
negateLabelVals?: string[]
|
|
27
27
|
reason: string
|
|
28
|
+
/** Indicates how long this action was meant to be in effect before automatically expiring. */
|
|
29
|
+
durationInHours?: number
|
|
28
30
|
createdBy: string
|
|
29
31
|
[k: string]: unknown
|
|
30
32
|
}
|