@atproto/api 0.1.2 → 0.2.0
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/README.md +179 -25
- package/build.js +10 -1
- package/dist/agent.d.ts +11 -6
- package/dist/bsky-agent.d.ts +43 -0
- package/dist/client/index.d.ts +127 -215
- package/dist/client/lexicons.d.ts +1496 -1347
- package/dist/client/types/app/bsky/actor/defs.d.ts +47 -0
- package/dist/client/types/app/bsky/actor/getProfile.d.ts +2 -2
- package/dist/client/types/app/bsky/actor/getProfiles.d.ts +2 -2
- package/dist/client/types/app/bsky/actor/getSuggestions.d.ts +2 -2
- package/dist/client/types/app/bsky/actor/profile.d.ts +4 -60
- package/dist/client/types/app/bsky/actor/searchActors.d.ts +22 -0
- package/dist/client/types/app/bsky/actor/searchActorsTypeahead.d.ts +20 -0
- package/dist/client/types/app/bsky/actor/updateProfile.d.ts +4 -11
- package/dist/client/types/app/bsky/embed/external.d.ts +9 -13
- package/dist/client/types/app/bsky/embed/images.d.ts +9 -13
- package/dist/client/types/app/bsky/embed/record.d.ts +41 -0
- package/dist/client/types/app/bsky/embed/recordWithMedia.d.ts +24 -0
- package/dist/client/types/app/bsky/feed/defs.d.ts +77 -0
- package/dist/client/types/app/bsky/feed/getAuthorFeed.d.ts +4 -4
- package/dist/client/types/app/bsky/feed/getLikes.d.ts +34 -0
- package/dist/client/types/app/bsky/feed/getPostThread.d.ts +2 -24
- package/dist/client/types/app/bsky/feed/getRepostedBy.d.ts +3 -3
- package/dist/client/types/app/bsky/feed/getTimeline.d.ts +3 -3
- package/dist/client/types/app/bsky/feed/like.d.ts +9 -0
- package/dist/client/types/app/bsky/feed/post.d.ts +5 -29
- package/dist/client/types/app/bsky/graph/follow.d.ts +1 -2
- package/dist/client/types/app/bsky/graph/getFollowers.d.ts +5 -5
- package/dist/client/types/app/bsky/graph/getFollows.d.ts +5 -5
- package/dist/client/types/app/bsky/graph/getMutes.d.ts +3 -3
- package/dist/client/types/app/bsky/graph/muteActor.d.ts +17 -0
- package/dist/client/types/app/bsky/graph/unmuteActor.d.ts +17 -0
- package/dist/client/types/app/bsky/notification/getUnreadCount.d.ts +17 -0
- package/dist/client/types/app/bsky/notification/listNotifications.d.ts +35 -0
- package/dist/client/types/app/bsky/richtext/facet.d.ts +30 -0
- package/dist/client/types/app/bsky/unspecced/getPopular.d.ts +21 -0
- package/dist/client/types/com/atproto/admin/defs.d.ts +181 -0
- package/dist/client/types/com/atproto/admin/getModerationAction.d.ts +2 -2
- package/dist/client/types/com/atproto/admin/getModerationActions.d.ts +3 -3
- package/dist/client/types/com/atproto/admin/getModerationReport.d.ts +2 -2
- package/dist/client/types/com/atproto/admin/getModerationReports.d.ts +3 -3
- package/dist/client/types/com/atproto/admin/getRecord.d.ts +2 -2
- package/dist/client/types/com/atproto/admin/getRepo.d.ts +2 -2
- package/dist/client/types/com/atproto/admin/resolveModerationReports.d.ts +2 -2
- package/dist/client/types/com/atproto/admin/reverseModerationAction.d.ts +2 -2
- package/dist/client/types/com/atproto/admin/searchRepos.d.ts +3 -3
- package/dist/client/types/com/atproto/admin/takeModerationAction.d.ts +5 -6
- package/dist/client/types/com/atproto/identity/resolveHandle.d.ts +18 -0
- package/dist/client/types/com/atproto/identity/updateHandle.d.ts +17 -0
- package/dist/client/types/com/atproto/moderation/createReport.d.ts +38 -0
- package/dist/client/types/com/atproto/moderation/defs.d.ts +3 -0
- package/dist/client/types/com/atproto/repo/applyWrites.d.ts +47 -0
- package/dist/client/types/com/atproto/repo/createRecord.d.ts +7 -2
- package/dist/client/types/com/atproto/repo/deleteRecord.d.ts +7 -2
- package/dist/client/types/com/atproto/repo/describeRepo.d.ts +22 -0
- package/dist/client/types/com/atproto/repo/getRecord.d.ts +1 -1
- package/dist/client/types/com/atproto/repo/listRecords.d.ts +3 -3
- package/dist/client/types/com/atproto/repo/putRecord.d.ts +7 -2
- package/dist/client/types/com/atproto/repo/uploadBlob.d.ts +20 -0
- package/dist/client/types/com/atproto/server/createAccount.d.ts +44 -0
- package/dist/client/types/com/atproto/server/createInviteCode.d.ts +22 -0
- package/dist/client/types/com/atproto/server/createSession.d.ts +29 -0
- package/dist/client/types/com/atproto/server/deleteAccount.d.ts +25 -0
- package/dist/client/types/com/atproto/server/deleteSession.d.ts +13 -0
- package/dist/client/types/com/atproto/server/describeServer.d.ts +27 -0
- package/dist/client/types/com/atproto/server/getSession.d.ts +18 -0
- package/dist/client/types/com/atproto/server/refreshSession.d.ts +24 -0
- package/dist/client/types/com/atproto/server/requestAccountDelete.d.ts +13 -0
- package/dist/client/types/com/atproto/server/requestPasswordReset.d.ts +17 -0
- package/dist/client/types/com/atproto/server/resetPassword.d.ts +24 -0
- package/dist/client/types/com/atproto/sync/getBlob.d.ts +15 -0
- package/dist/client/types/com/atproto/sync/getBlocks.d.ts +15 -0
- package/dist/client/types/com/atproto/sync/listBlobs.d.ts +20 -0
- package/dist/client/types/com/atproto/sync/notifyOfUpdate.d.ts +13 -0
- package/dist/client/types/com/atproto/sync/requestCrawl.d.ts +13 -0
- package/dist/client/types/com/atproto/sync/subscribeAllRepos.d.ts +6 -17
- package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts +58 -0
- package/dist/helpers/bsky.d.ts +20 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +8222 -3608
- package/dist/index.js.map +4 -4
- package/dist/mixins/bsky.d.ts +23 -0
- package/dist/rich-text/detection.d.ts +4 -0
- package/dist/rich-text/rich-text.d.ts +39 -0
- package/dist/rich-text/sanitization.d.ts +4 -0
- package/dist/rich-text/sanitize.d.ts +4 -0
- package/dist/rich-text/unicode.d.ts +11 -0
- package/dist/types.d.ts +2 -2
- package/docs/rn-fetch-handler.ts +88 -0
- package/package.json +4 -1
- package/src/agent.ts +51 -15
- package/src/bsky-agent.ts +228 -0
- package/src/client/index.ts +371 -581
- package/src/client/lexicons.ts +1920 -1746
- package/src/client/types/app/bsky/actor/defs.ts +97 -0
- package/src/client/types/app/bsky/actor/getProfile.ts +4 -3
- package/src/client/types/app/bsky/actor/getProfiles.ts +4 -3
- package/src/client/types/app/bsky/actor/getSuggestions.ts +4 -3
- package/src/client/types/app/bsky/actor/profile.ts +5 -95
- package/src/client/types/app/bsky/actor/{searchTypeahead.ts → searchActors.ts} +6 -3
- package/src/client/types/app/bsky/actor/{search.ts → searchActorsTypeahead.ts} +4 -5
- package/src/client/types/app/bsky/embed/external.ts +14 -13
- package/src/client/types/app/bsky/embed/images.ts +14 -15
- package/src/client/types/app/bsky/embed/record.ts +90 -0
- package/src/client/types/app/bsky/embed/recordWithMedia.ts +53 -0
- package/src/client/types/app/bsky/feed/defs.ts +156 -0
- package/src/client/types/app/bsky/feed/getAuthorFeed.ts +6 -5
- package/src/client/types/app/bsky/feed/{getVotes.ts → getLikes.ts} +11 -12
- package/src/client/types/app/bsky/feed/getPostThread.ts +5 -48
- package/src/client/types/app/bsky/feed/getRepostedBy.ts +5 -4
- package/src/client/types/app/bsky/feed/getTimeline.ts +5 -4
- package/src/client/types/app/bsky/feed/{vote.ts → like.ts} +4 -4
- package/src/client/types/app/bsky/feed/post.ts +12 -51
- package/src/client/types/app/bsky/feed/repost.ts +2 -1
- package/src/client/types/app/bsky/graph/follow.ts +3 -3
- package/src/client/types/app/bsky/graph/getFollowers.ts +7 -6
- package/src/client/types/app/bsky/graph/getFollows.ts +7 -6
- package/src/client/types/app/bsky/graph/getMutes.ts +5 -4
- package/src/client/types/app/bsky/graph/{mute.ts → muteActor.ts} +3 -2
- package/src/client/types/app/bsky/graph/{unmute.ts → unmuteActor.ts} +3 -2
- package/src/client/types/app/bsky/notification/{getCount.ts → getUnreadCount.ts} +2 -1
- package/src/client/types/app/bsky/notification/{list.ts → listNotifications.ts} +13 -9
- package/src/client/types/app/bsky/notification/updateSeen.ts +2 -1
- package/src/client/types/app/bsky/richtext/facet.ts +81 -0
- package/src/client/types/app/bsky/unspecced/getPopular.ts +38 -0
- package/src/client/types/com/atproto/admin/defs.ts +366 -0
- package/src/client/types/com/atproto/admin/getModerationAction.ts +4 -3
- package/src/client/types/com/atproto/admin/getModerationActions.ts +5 -4
- package/src/client/types/com/atproto/admin/getModerationReport.ts +4 -3
- package/src/client/types/com/atproto/admin/getModerationReports.ts +5 -4
- package/src/client/types/com/atproto/admin/getRecord.ts +4 -3
- package/src/client/types/com/atproto/admin/getRepo.ts +4 -3
- package/src/client/types/com/atproto/admin/resolveModerationReports.ts +4 -3
- package/src/client/types/com/atproto/admin/reverseModerationAction.ts +4 -3
- package/src/client/types/com/atproto/admin/searchRepos.ts +5 -4
- package/src/client/types/com/atproto/admin/takeModerationAction.ts +10 -10
- package/src/client/types/com/atproto/{handle/resolve.ts → identity/resolveHandle.ts} +2 -1
- package/src/client/types/com/atproto/{handle/update.ts → identity/updateHandle.ts} +2 -1
- package/src/client/types/com/atproto/{report/create.ts → moderation/createReport.ts} +10 -10
- package/src/client/types/com/atproto/moderation/defs.ts +17 -0
- package/src/client/types/com/atproto/repo/{batchWrite.ts → applyWrites.ts} +21 -12
- package/src/client/types/com/atproto/repo/createRecord.ts +15 -3
- package/src/client/types/com/atproto/repo/deleteRecord.ts +15 -3
- package/src/client/types/com/atproto/repo/{describe.ts → describeRepo.ts} +3 -2
- package/src/client/types/com/atproto/repo/getRecord.ts +4 -3
- package/src/client/types/com/atproto/repo/listRecords.ts +7 -6
- package/src/client/types/com/atproto/repo/putRecord.ts +18 -6
- package/src/client/types/com/atproto/repo/strongRef.ts +2 -1
- package/src/client/types/com/atproto/{blob/upload.ts → repo/uploadBlob.ts} +3 -2
- package/src/client/types/com/atproto/{account/create.ts → server/createAccount.ts} +9 -1
- package/src/client/types/com/atproto/{account → server}/createInviteCode.ts +2 -1
- package/src/client/types/com/atproto/{session/create.ts → server/createSession.ts} +2 -1
- package/src/client/types/com/atproto/{account/delete.ts → server/deleteAccount.ts} +2 -1
- package/src/client/types/com/atproto/{account/requestDelete.ts → server/deleteSession.ts} +2 -1
- package/src/client/types/com/atproto/server/{getAccountsConfig.ts → describeServer.ts} +4 -3
- package/src/client/types/com/atproto/{session/get.ts → server/getSession.ts} +2 -1
- package/src/client/types/com/atproto/{session/refresh.ts → server/refreshSession.ts} +2 -1
- package/src/client/types/com/atproto/{session/delete.ts → server/requestAccountDelete.ts} +2 -1
- package/src/client/types/com/atproto/{account → server}/requestPasswordReset.ts +2 -1
- package/src/client/types/com/atproto/{account → server}/resetPassword.ts +2 -1
- package/src/client/types/com/atproto/sync/getBlob.ts +33 -0
- package/src/client/types/com/atproto/sync/getBlocks.ts +32 -0
- package/src/client/types/com/atproto/sync/getCheckout.ts +2 -1
- package/src/client/types/com/atproto/sync/getCommitPath.ts +2 -1
- package/src/client/types/com/atproto/sync/getHead.ts +2 -1
- package/src/client/types/com/atproto/sync/getRecord.ts +2 -1
- package/src/client/types/com/atproto/sync/getRepo.ts +2 -1
- package/src/client/types/com/atproto/sync/listBlobs.ts +40 -0
- package/src/client/types/com/atproto/sync/notifyOfUpdate.ts +30 -0
- package/src/client/types/com/atproto/{account/get.ts → sync/requestCrawl.ts} +6 -2
- package/src/client/types/com/atproto/sync/subscribeRepos.ts +131 -0
- package/src/index.ts +12 -0
- package/src/rich-text/detection.ts +83 -0
- package/src/rich-text/rich-text.ts +401 -0
- package/src/rich-text/sanitization.ts +40 -0
- package/src/rich-text/unicode.ts +47 -0
- package/src/types.ts +2 -2
- package/tests/agent.test.ts +10 -6
- package/tests/bsky-agent.test.ts +140 -0
- package/tests/errors.test.ts +4 -4
- package/tests/rich-text-detection.test.ts +229 -0
- package/tests/rich-text-sanitization.test.ts +211 -0
- package/tests/rich-text.test.ts +661 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/src/client/types/app/bsky/actor/ref.ts +0 -64
- package/src/client/types/app/bsky/actor/updateProfile.ts +0 -71
- package/src/client/types/app/bsky/feed/feedViewPost.ts +0 -64
- package/src/client/types/app/bsky/feed/setVote.ts +0 -40
- package/src/client/types/app/bsky/graph/assertCreator.ts +0 -9
- package/src/client/types/app/bsky/graph/assertMember.ts +0 -9
- package/src/client/types/app/bsky/graph/assertion.ts +0 -27
- package/src/client/types/app/bsky/graph/confirmation.ts +0 -28
- package/src/client/types/app/bsky/system/actorUser.ts +0 -9
- package/src/client/types/app/bsky/system/declRef.ts +0 -26
- package/src/client/types/app/bsky/system/declaration.ts +0 -24
- package/src/client/types/com/atproto/admin/blob.ts +0 -84
- package/src/client/types/com/atproto/admin/moderationAction.ts +0 -118
- package/src/client/types/com/atproto/admin/moderationReport.ts +0 -64
- package/src/client/types/com/atproto/admin/record.ts +0 -92
- package/src/client/types/com/atproto/admin/repo.ts +0 -103
- package/src/client/types/com/atproto/repo/recordRef.ts +0 -25
- package/src/client/types/com/atproto/repo/repoRef.ts +0 -24
- package/src/client/types/com/atproto/report/reasonType.ts +0 -16
- package/src/client/types/com/atproto/report/subject.ts +0 -66
- package/src/client/types/com/atproto/sync/subscribeAllRepos.ts +0 -48
|
@@ -0,0 +1,97 @@
|
|
|
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 ProfileViewBasic {
|
|
10
|
+
did: string
|
|
11
|
+
handle: string
|
|
12
|
+
displayName?: string
|
|
13
|
+
avatar?: string
|
|
14
|
+
viewer?: ViewerState
|
|
15
|
+
[k: string]: unknown
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function isProfileViewBasic(v: unknown): v is ProfileViewBasic {
|
|
19
|
+
return (
|
|
20
|
+
isObj(v) &&
|
|
21
|
+
hasProp(v, '$type') &&
|
|
22
|
+
v.$type === 'app.bsky.actor.defs#profileViewBasic'
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function validateProfileViewBasic(v: unknown): ValidationResult {
|
|
27
|
+
return lexicons.validate('app.bsky.actor.defs#profileViewBasic', v)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface ProfileView {
|
|
31
|
+
did: string
|
|
32
|
+
handle: string
|
|
33
|
+
displayName?: string
|
|
34
|
+
description?: string
|
|
35
|
+
avatar?: string
|
|
36
|
+
indexedAt?: string
|
|
37
|
+
viewer?: ViewerState
|
|
38
|
+
[k: string]: unknown
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function isProfileView(v: unknown): v is ProfileView {
|
|
42
|
+
return (
|
|
43
|
+
isObj(v) &&
|
|
44
|
+
hasProp(v, '$type') &&
|
|
45
|
+
v.$type === 'app.bsky.actor.defs#profileView'
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function validateProfileView(v: unknown): ValidationResult {
|
|
50
|
+
return lexicons.validate('app.bsky.actor.defs#profileView', v)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ProfileViewDetailed {
|
|
54
|
+
did: string
|
|
55
|
+
handle: string
|
|
56
|
+
displayName?: string
|
|
57
|
+
description?: string
|
|
58
|
+
avatar?: string
|
|
59
|
+
banner?: string
|
|
60
|
+
followersCount?: number
|
|
61
|
+
followsCount?: number
|
|
62
|
+
postsCount?: number
|
|
63
|
+
indexedAt?: string
|
|
64
|
+
viewer?: ViewerState
|
|
65
|
+
[k: string]: unknown
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function isProfileViewDetailed(v: unknown): v is ProfileViewDetailed {
|
|
69
|
+
return (
|
|
70
|
+
isObj(v) &&
|
|
71
|
+
hasProp(v, '$type') &&
|
|
72
|
+
v.$type === 'app.bsky.actor.defs#profileViewDetailed'
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export function validateProfileViewDetailed(v: unknown): ValidationResult {
|
|
77
|
+
return lexicons.validate('app.bsky.actor.defs#profileViewDetailed', v)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface ViewerState {
|
|
81
|
+
muted?: boolean
|
|
82
|
+
following?: string
|
|
83
|
+
followedBy?: string
|
|
84
|
+
[k: string]: unknown
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function isViewerState(v: unknown): v is ViewerState {
|
|
88
|
+
return (
|
|
89
|
+
isObj(v) &&
|
|
90
|
+
hasProp(v, '$type') &&
|
|
91
|
+
v.$type === 'app.bsky.actor.defs#viewerState'
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function validateViewerState(v: unknown): ValidationResult {
|
|
96
|
+
return lexicons.validate('app.bsky.actor.defs#viewerState', v)
|
|
97
|
+
}
|
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
* GENERATED CODE - DO NOT MODIFY
|
|
3
3
|
*/
|
|
4
4
|
import { Headers, XRPCError } from '@atproto/xrpc'
|
|
5
|
-
import { ValidationResult } from '@atproto/lexicon'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
6
|
import { isObj, hasProp } from '../../../../util'
|
|
7
7
|
import { lexicons } from '../../../../lexicons'
|
|
8
|
-
import
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import * as AppBskyActorDefs from './defs'
|
|
9
10
|
|
|
10
11
|
export interface QueryParams {
|
|
11
12
|
actor: string
|
|
12
13
|
}
|
|
13
14
|
|
|
14
15
|
export type InputSchema = undefined
|
|
15
|
-
export type OutputSchema =
|
|
16
|
+
export type OutputSchema = AppBskyActorDefs.ProfileViewDetailed
|
|
16
17
|
|
|
17
18
|
export interface CallOptions {
|
|
18
19
|
headers?: Headers
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* GENERATED CODE - DO NOT MODIFY
|
|
3
3
|
*/
|
|
4
4
|
import { Headers, XRPCError } from '@atproto/xrpc'
|
|
5
|
-
import { ValidationResult } from '@atproto/lexicon'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
6
|
import { isObj, hasProp } from '../../../../util'
|
|
7
7
|
import { lexicons } from '../../../../lexicons'
|
|
8
|
-
import
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import * as AppBskyActorDefs from './defs'
|
|
9
10
|
|
|
10
11
|
export interface QueryParams {
|
|
11
12
|
actors: string[]
|
|
@@ -14,7 +15,7 @@ export interface QueryParams {
|
|
|
14
15
|
export type InputSchema = undefined
|
|
15
16
|
|
|
16
17
|
export interface OutputSchema {
|
|
17
|
-
profiles:
|
|
18
|
+
profiles: AppBskyActorDefs.ProfileViewDetailed[]
|
|
18
19
|
[k: string]: unknown
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
* GENERATED CODE - DO NOT MODIFY
|
|
3
3
|
*/
|
|
4
4
|
import { Headers, XRPCError } from '@atproto/xrpc'
|
|
5
|
-
import { ValidationResult } from '@atproto/lexicon'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
6
|
import { isObj, hasProp } from '../../../../util'
|
|
7
7
|
import { lexicons } from '../../../../lexicons'
|
|
8
|
-
import
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import * as AppBskyActorDefs from './defs'
|
|
9
10
|
|
|
10
11
|
export interface QueryParams {
|
|
11
12
|
limit?: number
|
|
@@ -16,7 +17,7 @@ export type InputSchema = undefined
|
|
|
16
17
|
|
|
17
18
|
export interface OutputSchema {
|
|
18
19
|
cursor?: string
|
|
19
|
-
actors:
|
|
20
|
+
actors: AppBskyActorDefs.ProfileView[]
|
|
20
21
|
[k: string]: unknown
|
|
21
22
|
}
|
|
22
23
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED CODE - DO NOT MODIFY
|
|
3
3
|
*/
|
|
4
|
-
import { ValidationResult } from '@atproto/lexicon'
|
|
4
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
5
|
import { isObj, hasProp } from '../../../../util'
|
|
6
6
|
import { lexicons } from '../../../../lexicons'
|
|
7
|
-
import
|
|
7
|
+
import { CID } from 'multiformats/cid'
|
|
8
8
|
|
|
9
9
|
export interface Record {
|
|
10
|
-
displayName
|
|
10
|
+
displayName?: string
|
|
11
11
|
description?: string
|
|
12
|
-
avatar?:
|
|
13
|
-
banner?:
|
|
12
|
+
avatar?: BlobRef
|
|
13
|
+
banner?: BlobRef
|
|
14
14
|
[k: string]: unknown
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -26,93 +26,3 @@ export function isRecord(v: unknown): v is Record {
|
|
|
26
26
|
export function validateRecord(v: unknown): ValidationResult {
|
|
27
27
|
return lexicons.validate('app.bsky.actor.profile#main', v)
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
export interface View {
|
|
31
|
-
did: string
|
|
32
|
-
declaration: AppBskySystemDeclRef.Main
|
|
33
|
-
handle: string
|
|
34
|
-
displayName?: string
|
|
35
|
-
description?: string
|
|
36
|
-
avatar?: string
|
|
37
|
-
banner?: string
|
|
38
|
-
followersCount: number
|
|
39
|
-
followsCount: number
|
|
40
|
-
postsCount: number
|
|
41
|
-
creator: string
|
|
42
|
-
indexedAt?: string
|
|
43
|
-
viewer?: ViewerState
|
|
44
|
-
myState?: MyState
|
|
45
|
-
[k: string]: unknown
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export function isView(v: unknown): v is View {
|
|
49
|
-
return (
|
|
50
|
-
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.actor.profile#view'
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export function validateView(v: unknown): ValidationResult {
|
|
55
|
-
return lexicons.validate('app.bsky.actor.profile#view', v)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface ViewBasic {
|
|
59
|
-
did: string
|
|
60
|
-
declaration: AppBskySystemDeclRef.Main
|
|
61
|
-
handle: string
|
|
62
|
-
displayName?: string
|
|
63
|
-
description?: string
|
|
64
|
-
avatar?: string
|
|
65
|
-
indexedAt?: string
|
|
66
|
-
viewer?: ViewerState
|
|
67
|
-
[k: string]: unknown
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function isViewBasic(v: unknown): v is ViewBasic {
|
|
71
|
-
return (
|
|
72
|
-
isObj(v) &&
|
|
73
|
-
hasProp(v, '$type') &&
|
|
74
|
-
v.$type === 'app.bsky.actor.profile#viewBasic'
|
|
75
|
-
)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function validateViewBasic(v: unknown): ValidationResult {
|
|
79
|
-
return lexicons.validate('app.bsky.actor.profile#viewBasic', v)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface ViewerState {
|
|
83
|
-
muted?: boolean
|
|
84
|
-
following?: string
|
|
85
|
-
followedBy?: string
|
|
86
|
-
[k: string]: unknown
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export function isViewerState(v: unknown): v is ViewerState {
|
|
90
|
-
return (
|
|
91
|
-
isObj(v) &&
|
|
92
|
-
hasProp(v, '$type') &&
|
|
93
|
-
v.$type === 'app.bsky.actor.profile#viewerState'
|
|
94
|
-
)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export function validateViewerState(v: unknown): ValidationResult {
|
|
98
|
-
return lexicons.validate('app.bsky.actor.profile#viewerState', v)
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/** Deprecated in favor of #viewerState */
|
|
102
|
-
export interface MyState {
|
|
103
|
-
follow?: string
|
|
104
|
-
muted?: boolean
|
|
105
|
-
[k: string]: unknown
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export function isMyState(v: unknown): v is MyState {
|
|
109
|
-
return (
|
|
110
|
-
isObj(v) &&
|
|
111
|
-
hasProp(v, '$type') &&
|
|
112
|
-
v.$type === 'app.bsky.actor.profile#myState'
|
|
113
|
-
)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export function validateMyState(v: unknown): ValidationResult {
|
|
117
|
-
return lexicons.validate('app.bsky.actor.profile#myState', v)
|
|
118
|
-
}
|
|
@@ -2,20 +2,23 @@
|
|
|
2
2
|
* GENERATED CODE - DO NOT MODIFY
|
|
3
3
|
*/
|
|
4
4
|
import { Headers, XRPCError } from '@atproto/xrpc'
|
|
5
|
-
import { ValidationResult } from '@atproto/lexicon'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
6
|
import { isObj, hasProp } from '../../../../util'
|
|
7
7
|
import { lexicons } from '../../../../lexicons'
|
|
8
|
-
import
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import * as AppBskyActorDefs from './defs'
|
|
9
10
|
|
|
10
11
|
export interface QueryParams {
|
|
11
12
|
term?: string
|
|
12
13
|
limit?: number
|
|
14
|
+
cursor?: string
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export type InputSchema = undefined
|
|
16
18
|
|
|
17
19
|
export interface OutputSchema {
|
|
18
|
-
|
|
20
|
+
cursor?: string
|
|
21
|
+
actors: AppBskyActorDefs.ProfileView[]
|
|
19
22
|
[k: string]: unknown
|
|
20
23
|
}
|
|
21
24
|
|
|
@@ -2,22 +2,21 @@
|
|
|
2
2
|
* GENERATED CODE - DO NOT MODIFY
|
|
3
3
|
*/
|
|
4
4
|
import { Headers, XRPCError } from '@atproto/xrpc'
|
|
5
|
-
import { ValidationResult } from '@atproto/lexicon'
|
|
5
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
6
6
|
import { isObj, hasProp } from '../../../../util'
|
|
7
7
|
import { lexicons } from '../../../../lexicons'
|
|
8
|
-
import
|
|
8
|
+
import { CID } from 'multiformats/cid'
|
|
9
|
+
import * as AppBskyActorDefs from './defs'
|
|
9
10
|
|
|
10
11
|
export interface QueryParams {
|
|
11
12
|
term?: string
|
|
12
13
|
limit?: number
|
|
13
|
-
before?: string
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export type InputSchema = undefined
|
|
17
17
|
|
|
18
18
|
export interface OutputSchema {
|
|
19
|
-
|
|
20
|
-
users: AppBskyActorProfile.ViewBasic[]
|
|
19
|
+
actors: AppBskyActorDefs.ProfileViewBasic[]
|
|
21
20
|
[k: string]: unknown
|
|
22
21
|
}
|
|
23
22
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED CODE - DO NOT MODIFY
|
|
3
3
|
*/
|
|
4
|
-
import { ValidationResult } from '@atproto/lexicon'
|
|
4
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
5
|
import { isObj, hasProp } from '../../../../util'
|
|
6
6
|
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { CID } from 'multiformats/cid'
|
|
7
8
|
|
|
8
9
|
export interface Main {
|
|
9
10
|
external: External
|
|
@@ -27,7 +28,7 @@ export interface External {
|
|
|
27
28
|
uri: string
|
|
28
29
|
title: string
|
|
29
30
|
description: string
|
|
30
|
-
thumb?:
|
|
31
|
+
thumb?: BlobRef
|
|
31
32
|
[k: string]: unknown
|
|
32
33
|
}
|
|
33
34
|
|
|
@@ -43,24 +44,24 @@ export function validateExternal(v: unknown): ValidationResult {
|
|
|
43
44
|
return lexicons.validate('app.bsky.embed.external#external', v)
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
export interface
|
|
47
|
-
external:
|
|
47
|
+
export interface View {
|
|
48
|
+
external: ViewExternal
|
|
48
49
|
[k: string]: unknown
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
export function
|
|
52
|
+
export function isView(v: unknown): v is View {
|
|
52
53
|
return (
|
|
53
54
|
isObj(v) &&
|
|
54
55
|
hasProp(v, '$type') &&
|
|
55
|
-
v.$type === 'app.bsky.embed.external#
|
|
56
|
+
v.$type === 'app.bsky.embed.external#view'
|
|
56
57
|
)
|
|
57
58
|
}
|
|
58
59
|
|
|
59
|
-
export function
|
|
60
|
-
return lexicons.validate('app.bsky.embed.external#
|
|
60
|
+
export function validateView(v: unknown): ValidationResult {
|
|
61
|
+
return lexicons.validate('app.bsky.embed.external#view', v)
|
|
61
62
|
}
|
|
62
63
|
|
|
63
|
-
export interface
|
|
64
|
+
export interface ViewExternal {
|
|
64
65
|
uri: string
|
|
65
66
|
title: string
|
|
66
67
|
description: string
|
|
@@ -68,14 +69,14 @@ export interface PresentedExternal {
|
|
|
68
69
|
[k: string]: unknown
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
export function
|
|
72
|
+
export function isViewExternal(v: unknown): v is ViewExternal {
|
|
72
73
|
return (
|
|
73
74
|
isObj(v) &&
|
|
74
75
|
hasProp(v, '$type') &&
|
|
75
|
-
v.$type === 'app.bsky.embed.external#
|
|
76
|
+
v.$type === 'app.bsky.embed.external#viewExternal'
|
|
76
77
|
)
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
export function
|
|
80
|
-
return lexicons.validate('app.bsky.embed.external#
|
|
80
|
+
export function validateViewExternal(v: unknown): ValidationResult {
|
|
81
|
+
return lexicons.validate('app.bsky.embed.external#viewExternal', v)
|
|
81
82
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* GENERATED CODE - DO NOT MODIFY
|
|
3
3
|
*/
|
|
4
|
-
import { ValidationResult } from '@atproto/lexicon'
|
|
4
|
+
import { ValidationResult, BlobRef } from '@atproto/lexicon'
|
|
5
5
|
import { isObj, hasProp } from '../../../../util'
|
|
6
6
|
import { lexicons } from '../../../../lexicons'
|
|
7
|
+
import { CID } from 'multiformats/cid'
|
|
7
8
|
|
|
8
9
|
export interface Main {
|
|
9
10
|
images: Image[]
|
|
@@ -24,7 +25,7 @@ export function validateMain(v: unknown): ValidationResult {
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export interface Image {
|
|
27
|
-
image:
|
|
28
|
+
image: BlobRef
|
|
28
29
|
alt: string
|
|
29
30
|
[k: string]: unknown
|
|
30
31
|
}
|
|
@@ -39,38 +40,36 @@ export function validateImage(v: unknown): ValidationResult {
|
|
|
39
40
|
return lexicons.validate('app.bsky.embed.images#image', v)
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
export interface
|
|
43
|
-
images:
|
|
43
|
+
export interface View {
|
|
44
|
+
images: ViewImage[]
|
|
44
45
|
[k: string]: unknown
|
|
45
46
|
}
|
|
46
47
|
|
|
47
|
-
export function
|
|
48
|
+
export function isView(v: unknown): v is View {
|
|
48
49
|
return (
|
|
49
|
-
isObj(v) &&
|
|
50
|
-
hasProp(v, '$type') &&
|
|
51
|
-
v.$type === 'app.bsky.embed.images#presented'
|
|
50
|
+
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.images#view'
|
|
52
51
|
)
|
|
53
52
|
}
|
|
54
53
|
|
|
55
|
-
export function
|
|
56
|
-
return lexicons.validate('app.bsky.embed.images#
|
|
54
|
+
export function validateView(v: unknown): ValidationResult {
|
|
55
|
+
return lexicons.validate('app.bsky.embed.images#view', v)
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
export interface
|
|
58
|
+
export interface ViewImage {
|
|
60
59
|
thumb: string
|
|
61
60
|
fullsize: string
|
|
62
61
|
alt: string
|
|
63
62
|
[k: string]: unknown
|
|
64
63
|
}
|
|
65
64
|
|
|
66
|
-
export function
|
|
65
|
+
export function isViewImage(v: unknown): v is ViewImage {
|
|
67
66
|
return (
|
|
68
67
|
isObj(v) &&
|
|
69
68
|
hasProp(v, '$type') &&
|
|
70
|
-
v.$type === 'app.bsky.embed.images#
|
|
69
|
+
v.$type === 'app.bsky.embed.images#viewImage'
|
|
71
70
|
)
|
|
72
71
|
}
|
|
73
72
|
|
|
74
|
-
export function
|
|
75
|
-
return lexicons.validate('app.bsky.embed.images#
|
|
73
|
+
export function validateViewImage(v: unknown): ValidationResult {
|
|
74
|
+
return lexicons.validate('app.bsky.embed.images#viewImage', v)
|
|
76
75
|
}
|
|
@@ -0,0 +1,90 @@
|
|
|
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 ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
|
|
9
|
+
import * as AppBskyActorDefs from '../actor/defs'
|
|
10
|
+
import * as AppBskyEmbedImages from './images'
|
|
11
|
+
import * as AppBskyEmbedExternal from './external'
|
|
12
|
+
import * as AppBskyEmbedRecordWithMedia from './recordWithMedia'
|
|
13
|
+
|
|
14
|
+
export interface Main {
|
|
15
|
+
record: ComAtprotoRepoStrongRef.Main
|
|
16
|
+
[k: string]: unknown
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function isMain(v: unknown): v is Main {
|
|
20
|
+
return (
|
|
21
|
+
isObj(v) &&
|
|
22
|
+
hasProp(v, '$type') &&
|
|
23
|
+
(v.$type === 'app.bsky.embed.record#main' ||
|
|
24
|
+
v.$type === 'app.bsky.embed.record')
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function validateMain(v: unknown): ValidationResult {
|
|
29
|
+
return lexicons.validate('app.bsky.embed.record#main', v)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface View {
|
|
33
|
+
record: ViewRecord | ViewNotFound | { $type: string; [k: string]: unknown }
|
|
34
|
+
[k: string]: unknown
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function isView(v: unknown): v is View {
|
|
38
|
+
return (
|
|
39
|
+
isObj(v) && hasProp(v, '$type') && v.$type === 'app.bsky.embed.record#view'
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function validateView(v: unknown): ValidationResult {
|
|
44
|
+
return lexicons.validate('app.bsky.embed.record#view', v)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface ViewRecord {
|
|
48
|
+
uri: string
|
|
49
|
+
cid: string
|
|
50
|
+
author: AppBskyActorDefs.ProfileViewBasic
|
|
51
|
+
value: {}
|
|
52
|
+
embeds?: (
|
|
53
|
+
| AppBskyEmbedImages.View
|
|
54
|
+
| AppBskyEmbedExternal.View
|
|
55
|
+
| View
|
|
56
|
+
| AppBskyEmbedRecordWithMedia.View
|
|
57
|
+
| { $type: string; [k: string]: unknown }
|
|
58
|
+
)[]
|
|
59
|
+
indexedAt: string
|
|
60
|
+
[k: string]: unknown
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function isViewRecord(v: unknown): v is ViewRecord {
|
|
64
|
+
return (
|
|
65
|
+
isObj(v) &&
|
|
66
|
+
hasProp(v, '$type') &&
|
|
67
|
+
v.$type === 'app.bsky.embed.record#viewRecord'
|
|
68
|
+
)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function validateViewRecord(v: unknown): ValidationResult {
|
|
72
|
+
return lexicons.validate('app.bsky.embed.record#viewRecord', v)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface ViewNotFound {
|
|
76
|
+
uri: string
|
|
77
|
+
[k: string]: unknown
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function isViewNotFound(v: unknown): v is ViewNotFound {
|
|
81
|
+
return (
|
|
82
|
+
isObj(v) &&
|
|
83
|
+
hasProp(v, '$type') &&
|
|
84
|
+
v.$type === 'app.bsky.embed.record#viewNotFound'
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export function validateViewNotFound(v: unknown): ValidationResult {
|
|
89
|
+
return lexicons.validate('app.bsky.embed.record#viewNotFound', v)
|
|
90
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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 AppBskyEmbedRecord from './record'
|
|
9
|
+
import * as AppBskyEmbedImages from './images'
|
|
10
|
+
import * as AppBskyEmbedExternal from './external'
|
|
11
|
+
|
|
12
|
+
export interface Main {
|
|
13
|
+
record: AppBskyEmbedRecord.Main
|
|
14
|
+
media:
|
|
15
|
+
| AppBskyEmbedImages.Main
|
|
16
|
+
| AppBskyEmbedExternal.Main
|
|
17
|
+
| { $type: string; [k: string]: unknown }
|
|
18
|
+
[k: string]: unknown
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function isMain(v: unknown): v is Main {
|
|
22
|
+
return (
|
|
23
|
+
isObj(v) &&
|
|
24
|
+
hasProp(v, '$type') &&
|
|
25
|
+
(v.$type === 'app.bsky.embed.recordWithMedia#main' ||
|
|
26
|
+
v.$type === 'app.bsky.embed.recordWithMedia')
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function validateMain(v: unknown): ValidationResult {
|
|
31
|
+
return lexicons.validate('app.bsky.embed.recordWithMedia#main', v)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface View {
|
|
35
|
+
record: AppBskyEmbedRecord.View
|
|
36
|
+
media:
|
|
37
|
+
| AppBskyEmbedImages.View
|
|
38
|
+
| AppBskyEmbedExternal.View
|
|
39
|
+
| { $type: string; [k: string]: unknown }
|
|
40
|
+
[k: string]: unknown
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function isView(v: unknown): v is View {
|
|
44
|
+
return (
|
|
45
|
+
isObj(v) &&
|
|
46
|
+
hasProp(v, '$type') &&
|
|
47
|
+
v.$type === 'app.bsky.embed.recordWithMedia#view'
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function validateView(v: unknown): ValidationResult {
|
|
52
|
+
return lexicons.validate('app.bsky.embed.recordWithMedia#view', v)
|
|
53
|
+
}
|