@atproto/api 0.3.12 → 0.3.13
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/client/index.d.ts +2 -2
- package/dist/client/lexicons.d.ts +39 -14
- package/dist/client/types/app/bsky/embed/record.d.ts +2 -1
- package/dist/client/types/app/bsky/feed/defs.d.ts +1 -1
- package/dist/client/types/app/bsky/feed/post.d.ts +1 -0
- package/dist/client/types/app/bsky/graph/defs.d.ts +2 -0
- package/dist/client/types/com/atproto/sync/getHead.d.ts +4 -1
- package/dist/client/types/com/atproto/sync/notifyOfUpdate.d.ts +5 -1
- package/dist/client/types/com/atproto/sync/requestCrawl.d.ts +5 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +97 -27
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
- package/src/client/index.ts +4 -4
- package/src/client/lexicons.ts +49 -21
- package/src/client/types/app/bsky/embed/record.ts +2 -0
- package/src/client/types/app/bsky/feed/defs.ts +1 -1
- package/src/client/types/app/bsky/feed/post.ts +1 -0
- package/src/client/types/app/bsky/graph/defs.ts +2 -0
- package/src/client/types/com/atproto/sync/getHead.ts +7 -0
- package/src/client/types/com/atproto/sync/notifyOfUpdate.ts +6 -3
- package/src/client/types/com/atproto/sync/requestCrawl.ts +6 -3
- package/src/index.ts +1 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
package/src/client/index.ts
CHANGED
|
@@ -982,22 +982,22 @@ export class SyncNS {
|
|
|
982
982
|
}
|
|
983
983
|
|
|
984
984
|
notifyOfUpdate(
|
|
985
|
-
|
|
985
|
+
data?: ComAtprotoSyncNotifyOfUpdate.InputSchema,
|
|
986
986
|
opts?: ComAtprotoSyncNotifyOfUpdate.CallOptions,
|
|
987
987
|
): Promise<ComAtprotoSyncNotifyOfUpdate.Response> {
|
|
988
988
|
return this._service.xrpc
|
|
989
|
-
.call('com.atproto.sync.notifyOfUpdate',
|
|
989
|
+
.call('com.atproto.sync.notifyOfUpdate', opts?.qp, data, opts)
|
|
990
990
|
.catch((e) => {
|
|
991
991
|
throw ComAtprotoSyncNotifyOfUpdate.toKnownErr(e)
|
|
992
992
|
})
|
|
993
993
|
}
|
|
994
994
|
|
|
995
995
|
requestCrawl(
|
|
996
|
-
|
|
996
|
+
data?: ComAtprotoSyncRequestCrawl.InputSchema,
|
|
997
997
|
opts?: ComAtprotoSyncRequestCrawl.CallOptions,
|
|
998
998
|
): Promise<ComAtprotoSyncRequestCrawl.Response> {
|
|
999
999
|
return this._service.xrpc
|
|
1000
|
-
.call('com.atproto.sync.requestCrawl',
|
|
1000
|
+
.call('com.atproto.sync.requestCrawl', opts?.qp, data, opts)
|
|
1001
1001
|
.catch((e) => {
|
|
1002
1002
|
throw ComAtprotoSyncRequestCrawl.toKnownErr(e)
|
|
1003
1003
|
})
|
package/src/client/lexicons.ts
CHANGED
|
@@ -3059,6 +3059,11 @@ export const schemaDict = {
|
|
|
3059
3059
|
},
|
|
3060
3060
|
},
|
|
3061
3061
|
},
|
|
3062
|
+
errors: [
|
|
3063
|
+
{
|
|
3064
|
+
name: 'HeadNotFound',
|
|
3065
|
+
},
|
|
3066
|
+
],
|
|
3062
3067
|
},
|
|
3063
3068
|
},
|
|
3064
3069
|
},
|
|
@@ -3243,17 +3248,20 @@ export const schemaDict = {
|
|
|
3243
3248
|
id: 'com.atproto.sync.notifyOfUpdate',
|
|
3244
3249
|
defs: {
|
|
3245
3250
|
main: {
|
|
3246
|
-
type: '
|
|
3251
|
+
type: 'procedure',
|
|
3247
3252
|
description:
|
|
3248
3253
|
'Notify a crawling service of a recent update. Often when a long break between updates causes the connection with the crawling service to break.',
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3254
|
+
input: {
|
|
3255
|
+
encoding: 'application/json',
|
|
3256
|
+
schema: {
|
|
3257
|
+
type: 'object',
|
|
3258
|
+
required: ['hostname'],
|
|
3259
|
+
properties: {
|
|
3260
|
+
hostname: {
|
|
3261
|
+
type: 'string',
|
|
3262
|
+
description:
|
|
3263
|
+
'Hostname of the service that is notifying of update.',
|
|
3264
|
+
},
|
|
3257
3265
|
},
|
|
3258
3266
|
},
|
|
3259
3267
|
},
|
|
@@ -3265,16 +3273,19 @@ export const schemaDict = {
|
|
|
3265
3273
|
id: 'com.atproto.sync.requestCrawl',
|
|
3266
3274
|
defs: {
|
|
3267
3275
|
main: {
|
|
3268
|
-
type: '
|
|
3276
|
+
type: 'procedure',
|
|
3269
3277
|
description: 'Request a service to persistently crawl hosted repos.',
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
+
input: {
|
|
3279
|
+
encoding: 'application/json',
|
|
3280
|
+
schema: {
|
|
3281
|
+
type: 'object',
|
|
3282
|
+
required: ['hostname'],
|
|
3283
|
+
properties: {
|
|
3284
|
+
hostname: {
|
|
3285
|
+
type: 'string',
|
|
3286
|
+
description:
|
|
3287
|
+
'Hostname of the service that is requesting to be crawled.',
|
|
3288
|
+
},
|
|
3278
3289
|
},
|
|
3279
3290
|
},
|
|
3280
3291
|
},
|
|
@@ -4125,6 +4136,7 @@ export const schemaDict = {
|
|
|
4125
4136
|
'lex:app.bsky.embed.record#viewNotFound',
|
|
4126
4137
|
'lex:app.bsky.embed.record#viewBlocked',
|
|
4127
4138
|
'lex:app.bsky.feed.defs#generatorView',
|
|
4139
|
+
'lex:app.bsky.graph.defs#listView',
|
|
4128
4140
|
],
|
|
4129
4141
|
},
|
|
4130
4142
|
},
|
|
@@ -4418,7 +4430,7 @@ export const schemaDict = {
|
|
|
4418
4430
|
},
|
|
4419
4431
|
generatorView: {
|
|
4420
4432
|
type: 'object',
|
|
4421
|
-
required: ['uri', 'cid', 'creator', 'displayName', 'indexedAt'],
|
|
4433
|
+
required: ['uri', 'cid', 'did', 'creator', 'displayName', 'indexedAt'],
|
|
4422
4434
|
properties: {
|
|
4423
4435
|
uri: {
|
|
4424
4436
|
type: 'string',
|
|
@@ -5239,6 +5251,14 @@ export const schemaDict = {
|
|
|
5239
5251
|
'lex:app.bsky.embed.recordWithMedia',
|
|
5240
5252
|
],
|
|
5241
5253
|
},
|
|
5254
|
+
langs: {
|
|
5255
|
+
type: 'array',
|
|
5256
|
+
maxLength: 3,
|
|
5257
|
+
items: {
|
|
5258
|
+
type: 'string',
|
|
5259
|
+
format: 'language',
|
|
5260
|
+
},
|
|
5261
|
+
},
|
|
5242
5262
|
createdAt: {
|
|
5243
5263
|
type: 'string',
|
|
5244
5264
|
format: 'datetime',
|
|
@@ -5351,12 +5371,16 @@ export const schemaDict = {
|
|
|
5351
5371
|
defs: {
|
|
5352
5372
|
listViewBasic: {
|
|
5353
5373
|
type: 'object',
|
|
5354
|
-
required: ['uri', 'name', 'purpose'],
|
|
5374
|
+
required: ['uri', 'cid', 'name', 'purpose'],
|
|
5355
5375
|
properties: {
|
|
5356
5376
|
uri: {
|
|
5357
5377
|
type: 'string',
|
|
5358
5378
|
format: 'at-uri',
|
|
5359
5379
|
},
|
|
5380
|
+
cid: {
|
|
5381
|
+
type: 'string',
|
|
5382
|
+
format: 'cid',
|
|
5383
|
+
},
|
|
5360
5384
|
name: {
|
|
5361
5385
|
type: 'string',
|
|
5362
5386
|
maxLength: 64,
|
|
@@ -5381,12 +5405,16 @@ export const schemaDict = {
|
|
|
5381
5405
|
},
|
|
5382
5406
|
listView: {
|
|
5383
5407
|
type: 'object',
|
|
5384
|
-
required: ['uri', 'creator', 'name', 'purpose', 'indexedAt'],
|
|
5408
|
+
required: ['uri', 'cid', 'creator', 'name', 'purpose', 'indexedAt'],
|
|
5385
5409
|
properties: {
|
|
5386
5410
|
uri: {
|
|
5387
5411
|
type: 'string',
|
|
5388
5412
|
format: 'at-uri',
|
|
5389
5413
|
},
|
|
5414
|
+
cid: {
|
|
5415
|
+
type: 'string',
|
|
5416
|
+
format: 'cid',
|
|
5417
|
+
},
|
|
5390
5418
|
creator: {
|
|
5391
5419
|
type: 'ref',
|
|
5392
5420
|
ref: 'lex:app.bsky.actor.defs#profileView',
|
|
@@ -7,6 +7,7 @@ import { lexicons } from '../../../../lexicons'
|
|
|
7
7
|
import { CID } from 'multiformats/cid'
|
|
8
8
|
import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef'
|
|
9
9
|
import * as AppBskyFeedDefs from '../feed/defs'
|
|
10
|
+
import * as AppBskyGraphDefs from '../graph/defs'
|
|
10
11
|
import * as AppBskyActorDefs from '../actor/defs'
|
|
11
12
|
import * as ComAtprotoLabelDefs from '../../../com/atproto/label/defs'
|
|
12
13
|
import * as AppBskyEmbedImages from './images'
|
|
@@ -37,6 +38,7 @@ export interface View {
|
|
|
37
38
|
| ViewNotFound
|
|
38
39
|
| ViewBlocked
|
|
39
40
|
| AppBskyFeedDefs.GeneratorView
|
|
41
|
+
| AppBskyGraphDefs.ListView
|
|
40
42
|
| { $type: string; [k: string]: unknown }
|
|
41
43
|
[k: string]: unknown
|
|
42
44
|
}
|
|
@@ -189,7 +189,7 @@ export function validateBlockedPost(v: unknown): ValidationResult {
|
|
|
189
189
|
export interface GeneratorView {
|
|
190
190
|
uri: string
|
|
191
191
|
cid: string
|
|
192
|
-
did
|
|
192
|
+
did: string
|
|
193
193
|
creator: AppBskyActorDefs.ProfileView
|
|
194
194
|
displayName: string
|
|
195
195
|
description?: string
|
|
@@ -10,6 +10,7 @@ import * as AppBskyRichtextFacet from '../richtext/facet'
|
|
|
10
10
|
|
|
11
11
|
export interface ListViewBasic {
|
|
12
12
|
uri: string
|
|
13
|
+
cid: string
|
|
13
14
|
name: string
|
|
14
15
|
purpose: ListPurpose
|
|
15
16
|
avatar?: string
|
|
@@ -32,6 +33,7 @@ export function validateListViewBasic(v: unknown): ValidationResult {
|
|
|
32
33
|
|
|
33
34
|
export interface ListView {
|
|
34
35
|
uri: string
|
|
36
|
+
cid: string
|
|
35
37
|
creator: AppBskyActorDefs.ProfileView
|
|
36
38
|
name: string
|
|
37
39
|
purpose: ListPurpose
|
|
@@ -29,8 +29,15 @@ export interface Response {
|
|
|
29
29
|
data: OutputSchema
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
export class HeadNotFoundError extends XRPCError {
|
|
33
|
+
constructor(src: XRPCError) {
|
|
34
|
+
super(src.status, src.error, src.message)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
32
38
|
export function toKnownErr(e: any) {
|
|
33
39
|
if (e instanceof XRPCError) {
|
|
40
|
+
if (e.error === 'HeadNotFound') return new HeadNotFoundError(e)
|
|
34
41
|
}
|
|
35
42
|
return e
|
|
36
43
|
}
|
|
@@ -7,15 +7,18 @@ import { isObj, hasProp } from '../../../../util'
|
|
|
7
7
|
import { lexicons } from '../../../../lexicons'
|
|
8
8
|
import { CID } from 'multiformats/cid'
|
|
9
9
|
|
|
10
|
-
export interface QueryParams {
|
|
10
|
+
export interface QueryParams {}
|
|
11
|
+
|
|
12
|
+
export interface InputSchema {
|
|
11
13
|
/** Hostname of the service that is notifying of update. */
|
|
12
14
|
hostname: string
|
|
15
|
+
[k: string]: unknown
|
|
13
16
|
}
|
|
14
17
|
|
|
15
|
-
export type InputSchema = undefined
|
|
16
|
-
|
|
17
18
|
export interface CallOptions {
|
|
18
19
|
headers?: Headers
|
|
20
|
+
qp?: QueryParams
|
|
21
|
+
encoding: 'application/json'
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
export interface Response {
|
|
@@ -7,15 +7,18 @@ import { isObj, hasProp } from '../../../../util'
|
|
|
7
7
|
import { lexicons } from '../../../../lexicons'
|
|
8
8
|
import { CID } from 'multiformats/cid'
|
|
9
9
|
|
|
10
|
-
export interface QueryParams {
|
|
10
|
+
export interface QueryParams {}
|
|
11
|
+
|
|
12
|
+
export interface InputSchema {
|
|
11
13
|
/** Hostname of the service that is requesting to be crawled. */
|
|
12
14
|
hostname: string
|
|
15
|
+
[k: string]: unknown
|
|
13
16
|
}
|
|
14
17
|
|
|
15
|
-
export type InputSchema = undefined
|
|
16
|
-
|
|
17
18
|
export interface CallOptions {
|
|
18
19
|
headers?: Headers
|
|
20
|
+
qp?: QueryParams
|
|
21
|
+
encoding: 'application/json'
|
|
19
22
|
}
|
|
20
23
|
|
|
21
24
|
export interface Response {
|