@atproto/api 0.12.13 → 0.12.14
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 +6 -0
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +13 -4
- package/dist/client/index.js.map +1 -1
- package/dist/client/lexicons.d.ts +105 -0
- package/dist/client/lexicons.d.ts.map +1 -1
- package/dist/client/lexicons.js +185 -4
- package/dist/client/lexicons.js.map +1 -1
- package/dist/client/types/chat/bsky/convo/defs.d.ts +1 -1
- package/dist/client/types/com/atproto/sync/getBlob.d.ts +16 -1
- package/dist/client/types/com/atproto/sync/getBlob.d.ts.map +1 -1
- package/dist/client/types/com/atproto/sync/getBlob.js +41 -1
- package/dist/client/types/com/atproto/sync/getBlob.js.map +1 -1
- package/dist/client/types/com/atproto/sync/getBlocks.d.ts +16 -1
- package/dist/client/types/com/atproto/sync/getBlocks.d.ts.map +1 -1
- package/dist/client/types/com/atproto/sync/getBlocks.js +41 -1
- package/dist/client/types/com/atproto/sync/getBlocks.js.map +1 -1
- package/dist/client/types/com/atproto/sync/getLatestCommit.d.ts +9 -0
- package/dist/client/types/com/atproto/sync/getLatestCommit.d.ts.map +1 -1
- package/dist/client/types/com/atproto/sync/getLatestCommit.js +25 -1
- package/dist/client/types/com/atproto/sync/getLatestCommit.js.map +1 -1
- package/dist/client/types/com/atproto/sync/getRecord.d.ts +16 -1
- package/dist/client/types/com/atproto/sync/getRecord.d.ts.map +1 -1
- package/dist/client/types/com/atproto/sync/getRecord.js +41 -1
- package/dist/client/types/com/atproto/sync/getRecord.js.map +1 -1
- package/dist/client/types/com/atproto/sync/getRepo.d.ts +13 -1
- package/dist/client/types/com/atproto/sync/getRepo.d.ts.map +1 -1
- package/dist/client/types/com/atproto/sync/getRepo.js +33 -1
- package/dist/client/types/com/atproto/sync/getRepo.js.map +1 -1
- package/dist/client/types/com/atproto/sync/getRepoStatus.d.ts +31 -0
- package/dist/client/types/com/atproto/sync/getRepoStatus.d.ts.map +1 -0
- package/dist/client/types/com/atproto/sync/getRepoStatus.js +22 -0
- package/dist/client/types/com/atproto/sync/getRepoStatus.js.map +1 -0
- package/dist/client/types/com/atproto/sync/listBlobs.d.ts +13 -1
- package/dist/client/types/com/atproto/sync/listBlobs.d.ts.map +1 -1
- package/dist/client/types/com/atproto/sync/listBlobs.js +33 -1
- package/dist/client/types/com/atproto/sync/listBlobs.js.map +1 -1
- package/dist/client/types/com/atproto/sync/listRepos.d.ts +3 -0
- package/dist/client/types/com/atproto/sync/listRepos.d.ts.map +1 -1
- package/dist/client/types/com/atproto/sync/listRepos.js.map +1 -1
- package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts +18 -3
- package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts.map +1 -1
- package/dist/client/types/com/atproto/sync/subscribeRepos.js +11 -1
- package/dist/client/types/com/atproto/sync/subscribeRepos.js.map +1 -1
- package/package.json +1 -1
- package/src/client/index.ts +13 -0
- package/src/client/lexicons.ts +193 -7
- package/src/client/types/chat/bsky/convo/defs.ts +1 -1
- package/src/client/types/com/atproto/sync/getBlob.ts +35 -0
- package/src/client/types/com/atproto/sync/getBlocks.ts +35 -0
- package/src/client/types/com/atproto/sync/getLatestCommit.ts +21 -0
- package/src/client/types/com/atproto/sync/getRecord.ts +35 -0
- package/src/client/types/com/atproto/sync/getRepo.ts +28 -0
- package/src/client/types/com/atproto/sync/getRepoStatus.ts +48 -0
- package/src/client/types/com/atproto/sync/listBlobs.ts +28 -0
- package/src/client/types/com/atproto/sync/listRepos.ts +3 -0
- package/src/client/types/com/atproto/sync/subscribeRepos.ts +29 -3
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
|
|
10
|
+
export interface QueryParams {
|
|
11
|
+
/** The DID of the repo. */
|
|
12
|
+
did: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type InputSchema = undefined
|
|
16
|
+
|
|
17
|
+
export interface OutputSchema {
|
|
18
|
+
did: string
|
|
19
|
+
active: boolean
|
|
20
|
+
/** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */
|
|
21
|
+
status?: 'takendown' | 'suspended' | 'deactivated' | (string & {})
|
|
22
|
+
/** Optional field, the current rev of the repo, if active=true */
|
|
23
|
+
rev?: string
|
|
24
|
+
[k: string]: unknown
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface CallOptions {
|
|
28
|
+
headers?: Headers
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface Response {
|
|
32
|
+
success: boolean
|
|
33
|
+
headers: Headers
|
|
34
|
+
data: OutputSchema
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export class RepoNotFoundError extends XRPCError {
|
|
38
|
+
constructor(src: XRPCError) {
|
|
39
|
+
super(src.status, src.error, src.message, src.headers)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function toKnownErr(e: any) {
|
|
44
|
+
if (e instanceof XRPCError) {
|
|
45
|
+
if (e.error === 'RepoNotFound') return new RepoNotFoundError(e)
|
|
46
|
+
}
|
|
47
|
+
return e
|
|
48
|
+
}
|
|
@@ -34,8 +34,36 @@ export interface Response {
|
|
|
34
34
|
data: OutputSchema
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
export class RepoNotFoundError extends XRPCError {
|
|
38
|
+
constructor(src: XRPCError) {
|
|
39
|
+
super(src.status, src.error, src.message, src.headers)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export class RepoTakendownError extends XRPCError {
|
|
44
|
+
constructor(src: XRPCError) {
|
|
45
|
+
super(src.status, src.error, src.message, src.headers)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class RepoSuspendedError extends XRPCError {
|
|
50
|
+
constructor(src: XRPCError) {
|
|
51
|
+
super(src.status, src.error, src.message, src.headers)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export class RepoDeactivatedError extends XRPCError {
|
|
56
|
+
constructor(src: XRPCError) {
|
|
57
|
+
super(src.status, src.error, src.message, src.headers)
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
37
61
|
export function toKnownErr(e: any) {
|
|
38
62
|
if (e instanceof XRPCError) {
|
|
63
|
+
if (e.error === 'RepoNotFound') return new RepoNotFoundError(e)
|
|
64
|
+
if (e.error === 'RepoTakendown') return new RepoTakendownError(e)
|
|
65
|
+
if (e.error === 'RepoSuspended') return new RepoSuspendedError(e)
|
|
66
|
+
if (e.error === 'RepoDeactivated') return new RepoDeactivatedError(e)
|
|
39
67
|
}
|
|
40
68
|
return e
|
|
41
69
|
}
|
|
@@ -41,6 +41,9 @@ export interface Repo {
|
|
|
41
41
|
/** Current repo commit CID */
|
|
42
42
|
head: string
|
|
43
43
|
rev: string
|
|
44
|
+
active?: boolean
|
|
45
|
+
/** If active=false, this optional field indicates a possible reason for why the account is not active. If active=false and no status is supplied, then the host makes no claim for why the repository is no longer being hosted. */
|
|
46
|
+
status?: 'takendown' | 'suspended' | 'deactivated' | (string & {})
|
|
44
47
|
[k: string]: unknown
|
|
45
48
|
}
|
|
46
49
|
|
|
@@ -51,6 +51,8 @@ export interface Identity {
|
|
|
51
51
|
seq: number
|
|
52
52
|
did: string
|
|
53
53
|
time: string
|
|
54
|
+
/** The current handle for the account, or 'handle.invalid' if validation fails. This field is optional, might have been validated or passed-through from an upstream source. Semantics and behaviors for PDS vs Relay may evolve in the future; see atproto specs for more details. */
|
|
55
|
+
handle?: string
|
|
54
56
|
[k: string]: unknown
|
|
55
57
|
}
|
|
56
58
|
|
|
@@ -66,7 +68,31 @@ export function validateIdentity(v: unknown): ValidationResult {
|
|
|
66
68
|
return lexicons.validate('com.atproto.sync.subscribeRepos#identity', v)
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
/** Represents
|
|
71
|
+
/** Represents a change to an account's status on a host (eg, PDS or Relay). The semantics of this event are that the status is at the host which emitted the event, not necessarily that at the currently active PDS. Eg, a Relay takedown would emit a takedown with active=false, even if the PDS is still active. */
|
|
72
|
+
export interface Account {
|
|
73
|
+
seq: number
|
|
74
|
+
did: string
|
|
75
|
+
time: string
|
|
76
|
+
/** Indicates that the account has a repository which can be fetched from the host that emitted this event. */
|
|
77
|
+
active: boolean
|
|
78
|
+
/** If active=false, this optional field indicates a reason for why the account is not active. */
|
|
79
|
+
status?: 'takendown' | 'suspended' | 'deleted' | 'deactivated' | (string & {})
|
|
80
|
+
[k: string]: unknown
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function isAccount(v: unknown): v is Account {
|
|
84
|
+
return (
|
|
85
|
+
isObj(v) &&
|
|
86
|
+
hasProp(v, '$type') &&
|
|
87
|
+
v.$type === 'com.atproto.sync.subscribeRepos#account'
|
|
88
|
+
)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function validateAccount(v: unknown): ValidationResult {
|
|
92
|
+
return lexicons.validate('com.atproto.sync.subscribeRepos#account', v)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** DEPRECATED -- Use #identity event instead */
|
|
70
96
|
export interface Handle {
|
|
71
97
|
seq: number
|
|
72
98
|
did: string
|
|
@@ -87,7 +113,7 @@ export function validateHandle(v: unknown): ValidationResult {
|
|
|
87
113
|
return lexicons.validate('com.atproto.sync.subscribeRepos#handle', v)
|
|
88
114
|
}
|
|
89
115
|
|
|
90
|
-
/**
|
|
116
|
+
/** DEPRECATED -- Use #account event instead */
|
|
91
117
|
export interface Migrate {
|
|
92
118
|
seq: number
|
|
93
119
|
did: string
|
|
@@ -108,7 +134,7 @@ export function validateMigrate(v: unknown): ValidationResult {
|
|
|
108
134
|
return lexicons.validate('com.atproto.sync.subscribeRepos#migrate', v)
|
|
109
135
|
}
|
|
110
136
|
|
|
111
|
-
/**
|
|
137
|
+
/** DEPRECATED -- Use #account event instead */
|
|
112
138
|
export interface Tombstone {
|
|
113
139
|
seq: number
|
|
114
140
|
did: string
|