@atproto/api 0.3.11 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atproto/api",
3
- "version": "0.3.11",
3
+ "version": "0.3.13",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "codegen": "lex gen-api ./src/client ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/*",
@@ -982,22 +982,22 @@ export class SyncNS {
982
982
  }
983
983
 
984
984
  notifyOfUpdate(
985
- params?: ComAtprotoSyncNotifyOfUpdate.QueryParams,
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', params, undefined, opts)
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
- params?: ComAtprotoSyncRequestCrawl.QueryParams,
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', params, undefined, opts)
1000
+ .call('com.atproto.sync.requestCrawl', opts?.qp, data, opts)
1001
1001
  .catch((e) => {
1002
1002
  throw ComAtprotoSyncRequestCrawl.toKnownErr(e)
1003
1003
  })
@@ -865,6 +865,13 @@ export const schemaDict = {
865
865
  type: 'string',
866
866
  },
867
867
  },
868
+ reporters: {
869
+ type: 'array',
870
+ items: {
871
+ type: 'string',
872
+ },
873
+ description: 'Filter reports made by one or more DIDs',
874
+ },
868
875
  resolved: {
869
876
  type: 'boolean',
870
877
  },
@@ -3052,6 +3059,11 @@ export const schemaDict = {
3052
3059
  },
3053
3060
  },
3054
3061
  },
3062
+ errors: [
3063
+ {
3064
+ name: 'HeadNotFound',
3065
+ },
3066
+ ],
3055
3067
  },
3056
3068
  },
3057
3069
  },
@@ -3236,17 +3248,20 @@ export const schemaDict = {
3236
3248
  id: 'com.atproto.sync.notifyOfUpdate',
3237
3249
  defs: {
3238
3250
  main: {
3239
- type: 'query',
3251
+ type: 'procedure',
3240
3252
  description:
3241
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.',
3242
- parameters: {
3243
- type: 'params',
3244
- required: ['hostname'],
3245
- properties: {
3246
- hostname: {
3247
- type: 'string',
3248
- description:
3249
- 'Hostname of the service that is notifying of update.',
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
+ },
3250
3265
  },
3251
3266
  },
3252
3267
  },
@@ -3258,16 +3273,19 @@ export const schemaDict = {
3258
3273
  id: 'com.atproto.sync.requestCrawl',
3259
3274
  defs: {
3260
3275
  main: {
3261
- type: 'query',
3276
+ type: 'procedure',
3262
3277
  description: 'Request a service to persistently crawl hosted repos.',
3263
- parameters: {
3264
- type: 'params',
3265
- required: ['hostname'],
3266
- properties: {
3267
- hostname: {
3268
- type: 'string',
3269
- description:
3270
- 'Hostname of the service that is requesting to be crawled.',
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
+ },
3271
3289
  },
3272
3290
  },
3273
3291
  },
@@ -4118,6 +4136,7 @@ export const schemaDict = {
4118
4136
  'lex:app.bsky.embed.record#viewNotFound',
4119
4137
  'lex:app.bsky.embed.record#viewBlocked',
4120
4138
  'lex:app.bsky.feed.defs#generatorView',
4139
+ 'lex:app.bsky.graph.defs#listView',
4121
4140
  ],
4122
4141
  },
4123
4142
  },
@@ -4411,7 +4430,7 @@ export const schemaDict = {
4411
4430
  },
4412
4431
  generatorView: {
4413
4432
  type: 'object',
4414
- required: ['uri', 'cid', 'creator', 'displayName', 'indexedAt'],
4433
+ required: ['uri', 'cid', 'did', 'creator', 'displayName', 'indexedAt'],
4415
4434
  properties: {
4416
4435
  uri: {
4417
4436
  type: 'string',
@@ -5232,6 +5251,14 @@ export const schemaDict = {
5232
5251
  'lex:app.bsky.embed.recordWithMedia',
5233
5252
  ],
5234
5253
  },
5254
+ langs: {
5255
+ type: 'array',
5256
+ maxLength: 3,
5257
+ items: {
5258
+ type: 'string',
5259
+ format: 'language',
5260
+ },
5261
+ },
5235
5262
  createdAt: {
5236
5263
  type: 'string',
5237
5264
  format: 'datetime',
@@ -5344,12 +5371,16 @@ export const schemaDict = {
5344
5371
  defs: {
5345
5372
  listViewBasic: {
5346
5373
  type: 'object',
5347
- required: ['uri', 'name', 'purpose'],
5374
+ required: ['uri', 'cid', 'name', 'purpose'],
5348
5375
  properties: {
5349
5376
  uri: {
5350
5377
  type: 'string',
5351
5378
  format: 'at-uri',
5352
5379
  },
5380
+ cid: {
5381
+ type: 'string',
5382
+ format: 'cid',
5383
+ },
5353
5384
  name: {
5354
5385
  type: 'string',
5355
5386
  maxLength: 64,
@@ -5374,12 +5405,16 @@ export const schemaDict = {
5374
5405
  },
5375
5406
  listView: {
5376
5407
  type: 'object',
5377
- required: ['uri', 'creator', 'name', 'purpose', 'indexedAt'],
5408
+ required: ['uri', 'cid', 'creator', 'name', 'purpose', 'indexedAt'],
5378
5409
  properties: {
5379
5410
  uri: {
5380
5411
  type: 'string',
5381
5412
  format: 'at-uri',
5382
5413
  },
5414
+ cid: {
5415
+ type: 'string',
5416
+ format: 'cid',
5417
+ },
5383
5418
  creator: {
5384
5419
  type: 'ref',
5385
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?: string
192
+ did: string
193
193
  creator: AppBskyActorDefs.ProfileView
194
194
  displayName: string
195
195
  description?: string
@@ -24,6 +24,7 @@ export interface Record {
24
24
  | AppBskyEmbedRecord.Main
25
25
  | AppBskyEmbedRecordWithMedia.Main
26
26
  | { $type: string; [k: string]: unknown }
27
+ langs?: string[]
27
28
  createdAt: string
28
29
  [k: string]: unknown
29
30
  }
@@ -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
@@ -11,6 +11,8 @@ import * as ComAtprotoAdminDefs from './defs'
11
11
  export interface QueryParams {
12
12
  subject?: string
13
13
  ignoreSubjects?: string[]
14
+ /** Filter reports made by one or more DIDs */
15
+ reporters?: string[]
14
16
  resolved?: boolean
15
17
  actionType?:
16
18
  | 'com.atproto.admin.defs#takedown'
@@ -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 {
package/src/index.ts CHANGED
@@ -6,6 +6,7 @@ export {
6
6
  jsonToLex,
7
7
  jsonStringToLex,
8
8
  } from '@atproto/lexicon'
9
+ export { parseLanguage } from '@atproto/common-web'
9
10
  export * from './types'
10
11
  export * from './client'
11
12
  export * from './agent'