@atproto/api 0.13.1 → 0.13.2
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/CHANGELOG.md +8 -0
- package/dist/client/index.d.ts +27 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +54 -3
- package/dist/client/index.js.map +1 -1
- package/dist/client/lexicons.d.ts +141 -0
- package/dist/client/lexicons.d.ts.map +1 -1
- package/dist/client/lexicons.js +142 -0
- package/dist/client/lexicons.js.map +1 -1
- package/dist/client/types/app/bsky/embed/record.d.ts +8 -1
- package/dist/client/types/app/bsky/embed/record.d.ts.map +1 -1
- package/dist/client/types/app/bsky/embed/record.js +11 -1
- package/dist/client/types/app/bsky/embed/record.js.map +1 -1
- package/dist/client/types/app/bsky/feed/defs.d.ts +2 -0
- package/dist/client/types/app/bsky/feed/defs.d.ts.map +1 -1
- package/dist/client/types/app/bsky/feed/defs.js.map +1 -1
- package/dist/client/types/app/bsky/feed/getQuotes.d.ts +31 -0
- package/dist/client/types/app/bsky/feed/getQuotes.d.ts.map +1 -0
- package/dist/client/types/app/bsky/feed/getQuotes.js +14 -0
- package/dist/client/types/app/bsky/feed/getQuotes.js.map +1 -0
- package/dist/client/types/app/bsky/feed/postgate.d.ts +25 -0
- package/dist/client/types/app/bsky/feed/postgate.d.ts.map +1 -0
- package/dist/client/types/app/bsky/feed/postgate.js +27 -0
- package/dist/client/types/app/bsky/feed/postgate.js.map +1 -0
- package/dist/client/types/app/bsky/feed/threadgate.d.ts +2 -0
- package/dist/client/types/app/bsky/feed/threadgate.d.ts.map +1 -1
- package/dist/client/types/app/bsky/feed/threadgate.js.map +1 -1
- package/package.json +1 -1
- package/src/client/index.ts +78 -0
- package/src/client/lexicons.ts +145 -0
- package/src/client/types/app/bsky/embed/record.ts +19 -0
- package/src/client/types/app/bsky/feed/defs.ts +2 -0
- package/src/client/types/app/bsky/feed/getQuotes.ts +44 -0
- package/src/client/types/app/bsky/feed/postgate.ts +47 -0
- package/src/client/types/app/bsky/feed/threadgate.ts +2 -0
|
@@ -38,6 +38,7 @@ export interface View {
|
|
|
38
38
|
| ViewRecord
|
|
39
39
|
| ViewNotFound
|
|
40
40
|
| ViewBlocked
|
|
41
|
+
| ViewDetached
|
|
41
42
|
| AppBskyFeedDefs.GeneratorView
|
|
42
43
|
| AppBskyGraphDefs.ListView
|
|
43
44
|
| AppBskyLabelerDefs.LabelerView
|
|
@@ -125,3 +126,21 @@ export function isViewBlocked(v: unknown): v is ViewBlocked {
|
|
|
125
126
|
export function validateViewBlocked(v: unknown): ValidationResult {
|
|
126
127
|
return lexicons.validate('app.bsky.embed.record#viewBlocked', v)
|
|
127
128
|
}
|
|
129
|
+
|
|
130
|
+
export interface ViewDetached {
|
|
131
|
+
uri: string
|
|
132
|
+
detached: true
|
|
133
|
+
[k: string]: unknown
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function isViewDetached(v: unknown): v is ViewDetached {
|
|
137
|
+
return (
|
|
138
|
+
isObj(v) &&
|
|
139
|
+
hasProp(v, '$type') &&
|
|
140
|
+
v.$type === 'app.bsky.embed.record#viewDetached'
|
|
141
|
+
)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export function validateViewDetached(v: unknown): ValidationResult {
|
|
145
|
+
return lexicons.validate('app.bsky.embed.record#viewDetached', v)
|
|
146
|
+
}
|
|
@@ -28,6 +28,7 @@ export interface PostView {
|
|
|
28
28
|
replyCount?: number
|
|
29
29
|
repostCount?: number
|
|
30
30
|
likeCount?: number
|
|
31
|
+
quoteCount?: number
|
|
31
32
|
indexedAt: string
|
|
32
33
|
viewer?: ViewerState
|
|
33
34
|
labels?: ComAtprotoLabelDefs.Label[]
|
|
@@ -51,6 +52,7 @@ export interface ViewerState {
|
|
|
51
52
|
like?: string
|
|
52
53
|
threadMuted?: boolean
|
|
53
54
|
replyDisabled?: boolean
|
|
55
|
+
embeddingDisabled?: boolean
|
|
54
56
|
[k: string]: unknown
|
|
55
57
|
}
|
|
56
58
|
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
/** Reference (AT-URI) of post record */
|
|
13
|
+
uri: string
|
|
14
|
+
/** If supplied, filters to quotes of specific version (by CID) of the post record. */
|
|
15
|
+
cid?: string
|
|
16
|
+
limit?: number
|
|
17
|
+
cursor?: string
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type InputSchema = undefined
|
|
21
|
+
|
|
22
|
+
export interface OutputSchema {
|
|
23
|
+
uri: string
|
|
24
|
+
cid?: string
|
|
25
|
+
cursor?: string
|
|
26
|
+
posts: AppBskyFeedDefs.PostView[]
|
|
27
|
+
[k: string]: unknown
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface CallOptions {
|
|
31
|
+
headers?: Headers
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Response {
|
|
35
|
+
success: boolean
|
|
36
|
+
headers: Headers
|
|
37
|
+
data: OutputSchema
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function toKnownErr(e: any) {
|
|
41
|
+
if (e instanceof XRPCError) {
|
|
42
|
+
}
|
|
43
|
+
return e
|
|
44
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
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 Record {
|
|
10
|
+
createdAt: string
|
|
11
|
+
/** Reference (AT-URI) to the post record. */
|
|
12
|
+
post: string
|
|
13
|
+
/** List of AT-URIs embedding this post that the author has detached from. */
|
|
14
|
+
detachedEmbeddingUris?: string[]
|
|
15
|
+
embeddingRules?: (DisableRule | { $type: string; [k: string]: unknown })[]
|
|
16
|
+
[k: string]: unknown
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function isRecord(v: unknown): v is Record {
|
|
20
|
+
return (
|
|
21
|
+
isObj(v) &&
|
|
22
|
+
hasProp(v, '$type') &&
|
|
23
|
+
(v.$type === 'app.bsky.feed.postgate#main' ||
|
|
24
|
+
v.$type === 'app.bsky.feed.postgate')
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function validateRecord(v: unknown): ValidationResult {
|
|
29
|
+
return lexicons.validate('app.bsky.feed.postgate#main', v)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Disables embedding of this post. */
|
|
33
|
+
export interface DisableRule {
|
|
34
|
+
[k: string]: unknown
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function isDisableRule(v: unknown): v is DisableRule {
|
|
38
|
+
return (
|
|
39
|
+
isObj(v) &&
|
|
40
|
+
hasProp(v, '$type') &&
|
|
41
|
+
v.$type === 'app.bsky.feed.postgate#disableRule'
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function validateDisableRule(v: unknown): ValidationResult {
|
|
46
|
+
return lexicons.validate('app.bsky.feed.postgate#disableRule', v)
|
|
47
|
+
}
|