@atproto/api 0.9.4 → 0.9.6

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.9.4",
3
+ "version": "0.9.6",
4
4
  "license": "MIT",
5
5
  "description": "Client library for atproto and Bluesky",
6
6
  "keywords": [
@@ -28,7 +28,7 @@
28
28
  "devDependencies": {
29
29
  "common-tags": "^1.8.2",
30
30
  "@atproto/lex-cli": "^0.3.0",
31
- "@atproto/dev-env": "^0.2.27"
31
+ "@atproto/dev-env": "^0.2.29"
32
32
  },
33
33
  "scripts": {
34
34
  "codegen": "pnpm docgen && node ./scripts/generate-code.mjs && lex gen-api ./src/client ../../lexicons/com/atproto/*/* ../../lexicons/app/bsky/*/*",
package/src/agent.ts CHANGED
@@ -231,7 +231,7 @@ export class AtpAgent {
231
231
  // handle session-refreshes as needed
232
232
  if (isErrorResponse(res, ['ExpiredToken']) && this.session?.refreshJwt) {
233
233
  // attempt refresh
234
- await this._refreshSession()
234
+ await this.refreshSession()
235
235
 
236
236
  // resend the request with the new access token
237
237
  res = await AtpAgent.fetch(
@@ -250,7 +250,7 @@ export class AtpAgent {
250
250
  * - Wraps the actual implementation in a promise-guard to ensure only
251
251
  * one refresh is attempted at a time.
252
252
  */
253
- private async _refreshSession() {
253
+ async refreshSession() {
254
254
  if (this._refreshSessionPromise) {
255
255
  return this._refreshSessionPromise
256
256
  }
@@ -81,6 +81,7 @@ import * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos'
81
81
  import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate'
82
82
  import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl'
83
83
  import * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos'
84
+ import * as ComAtprotoTempCheckSignupQueue from './types/com/atproto/temp/checkSignupQueue'
84
85
  import * as ComAtprotoTempFetchLabels from './types/com/atproto/temp/fetchLabels'
85
86
  import * as ComAtprotoTempImportRepo from './types/com/atproto/temp/importRepo'
86
87
  import * as ComAtprotoTempPushBlob from './types/com/atproto/temp/pushBlob'
@@ -149,7 +150,6 @@ import * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet'
149
150
  import * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs'
150
151
  import * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators'
151
152
  import * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecced/getTaggedSuggestions'
152
- import * as AppBskyUnspeccedGetTimelineSkeleton from './types/app/bsky/unspecced/getTimelineSkeleton'
153
153
  import * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton'
154
154
  import * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton'
155
155
 
@@ -227,6 +227,7 @@ export * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos'
227
227
  export * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate'
228
228
  export * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl'
229
229
  export * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos'
230
+ export * as ComAtprotoTempCheckSignupQueue from './types/com/atproto/temp/checkSignupQueue'
230
231
  export * as ComAtprotoTempFetchLabels from './types/com/atproto/temp/fetchLabels'
231
232
  export * as ComAtprotoTempImportRepo from './types/com/atproto/temp/importRepo'
232
233
  export * as ComAtprotoTempPushBlob from './types/com/atproto/temp/pushBlob'
@@ -295,7 +296,6 @@ export * as AppBskyRichtextFacet from './types/app/bsky/richtext/facet'
295
296
  export * as AppBskyUnspeccedDefs from './types/app/bsky/unspecced/defs'
296
297
  export * as AppBskyUnspeccedGetPopularFeedGenerators from './types/app/bsky/unspecced/getPopularFeedGenerators'
297
298
  export * as AppBskyUnspeccedGetTaggedSuggestions from './types/app/bsky/unspecced/getTaggedSuggestions'
298
- export * as AppBskyUnspeccedGetTimelineSkeleton from './types/app/bsky/unspecced/getTimelineSkeleton'
299
299
  export * as AppBskyUnspeccedSearchActorsSkeleton from './types/app/bsky/unspecced/searchActorsSkeleton'
300
300
  export * as AppBskyUnspeccedSearchPostsSkeleton from './types/app/bsky/unspecced/searchPostsSkeleton'
301
301
 
@@ -1207,6 +1207,17 @@ export class ComAtprotoTempNS {
1207
1207
  this._service = service
1208
1208
  }
1209
1209
 
1210
+ checkSignupQueue(
1211
+ params?: ComAtprotoTempCheckSignupQueue.QueryParams,
1212
+ opts?: ComAtprotoTempCheckSignupQueue.CallOptions,
1213
+ ): Promise<ComAtprotoTempCheckSignupQueue.Response> {
1214
+ return this._service.xrpc
1215
+ .call('com.atproto.temp.checkSignupQueue', params, undefined, opts)
1216
+ .catch((e) => {
1217
+ throw ComAtprotoTempCheckSignupQueue.toKnownErr(e)
1218
+ })
1219
+ }
1220
+
1210
1221
  fetchLabels(
1211
1222
  params?: ComAtprotoTempFetchLabels.QueryParams,
1212
1223
  opts?: ComAtprotoTempFetchLabels.CallOptions,
@@ -2534,17 +2545,6 @@ export class AppBskyUnspeccedNS {
2534
2545
  })
2535
2546
  }
2536
2547
 
2537
- getTimelineSkeleton(
2538
- params?: AppBskyUnspeccedGetTimelineSkeleton.QueryParams,
2539
- opts?: AppBskyUnspeccedGetTimelineSkeleton.CallOptions,
2540
- ): Promise<AppBskyUnspeccedGetTimelineSkeleton.Response> {
2541
- return this._service.xrpc
2542
- .call('app.bsky.unspecced.getTimelineSkeleton', params, undefined, opts)
2543
- .catch((e) => {
2544
- throw AppBskyUnspeccedGetTimelineSkeleton.toKnownErr(e)
2545
- })
2546
- }
2547
-
2548
2548
  searchActorsSkeleton(
2549
2549
  params?: AppBskyUnspeccedSearchActorsSkeleton.QueryParams,
2550
2550
  opts?: AppBskyUnspeccedSearchActorsSkeleton.CallOptions,
@@ -91,6 +91,7 @@ export const schemaDict = {
91
91
  'lex:com.atproto.admin.defs#modEventEscalate',
92
92
  'lex:com.atproto.admin.defs#modEventMute',
93
93
  'lex:com.atproto.admin.defs#modEventEmail',
94
+ 'lex:com.atproto.admin.defs#modEventResolveAppeal',
94
95
  ],
95
96
  },
96
97
  subject: {
@@ -147,6 +148,7 @@ export const schemaDict = {
147
148
  'lex:com.atproto.admin.defs#modEventAcknowledge',
148
149
  'lex:com.atproto.admin.defs#modEventEscalate',
149
150
  'lex:com.atproto.admin.defs#modEventMute',
151
+ 'lex:com.atproto.admin.defs#modEventEmail',
150
152
  'lex:com.atproto.admin.defs#modEventResolveAppeal',
151
153
  ],
152
154
  },
@@ -1450,6 +1452,16 @@ export const schemaDict = {
1450
1452
  description:
1451
1453
  'Sort direction for the events. Defaults to descending order of created at timestamp.',
1452
1454
  },
1455
+ createdAfter: {
1456
+ type: 'string',
1457
+ format: 'datetime',
1458
+ description: 'Retrieve events created after a given timestamp',
1459
+ },
1460
+ createdBefore: {
1461
+ type: 'string',
1462
+ format: 'datetime',
1463
+ description: 'Retrieve events created before a given timestamp',
1464
+ },
1453
1465
  subject: {
1454
1466
  type: 'string',
1455
1467
  format: 'uri',
@@ -1466,6 +1478,37 @@ export const schemaDict = {
1466
1478
  maximum: 100,
1467
1479
  default: 50,
1468
1480
  },
1481
+ hasComment: {
1482
+ type: 'boolean',
1483
+ description: 'If true, only events with comments are returned',
1484
+ },
1485
+ comment: {
1486
+ type: 'string',
1487
+ description:
1488
+ 'If specified, only events with comments containing the keyword are returned',
1489
+ },
1490
+ addedLabels: {
1491
+ type: 'array',
1492
+ items: {
1493
+ type: 'string',
1494
+ },
1495
+ description:
1496
+ 'If specified, only events where all of these labels were added are returned',
1497
+ },
1498
+ removedLabels: {
1499
+ type: 'array',
1500
+ items: {
1501
+ type: 'string',
1502
+ },
1503
+ description:
1504
+ 'If specified, only events where all of these labels were removed are returned',
1505
+ },
1506
+ reportTypes: {
1507
+ type: 'array',
1508
+ items: {
1509
+ type: 'string',
1510
+ },
1511
+ },
1469
1512
  cursor: {
1470
1513
  type: 'string',
1471
1514
  },
@@ -4246,6 +4289,34 @@ export const schemaDict = {
4246
4289
  },
4247
4290
  },
4248
4291
  },
4292
+ ComAtprotoTempCheckSignupQueue: {
4293
+ lexicon: 1,
4294
+ id: 'com.atproto.temp.checkSignupQueue',
4295
+ defs: {
4296
+ main: {
4297
+ type: 'query',
4298
+ description: 'Check accounts location in signup queue.',
4299
+ output: {
4300
+ encoding: 'application/json',
4301
+ schema: {
4302
+ type: 'object',
4303
+ required: ['activated'],
4304
+ properties: {
4305
+ activated: {
4306
+ type: 'boolean',
4307
+ },
4308
+ placeInQueue: {
4309
+ type: 'integer',
4310
+ },
4311
+ estimatedTimeMs: {
4312
+ type: 'integer',
4313
+ },
4314
+ },
4315
+ },
4316
+ },
4317
+ },
4318
+ },
4319
+ },
4249
4320
  ComAtprotoTempFetchLabels: {
4250
4321
  lexicon: 1,
4251
4322
  id: 'com.atproto.temp.fetchLabels',
@@ -8072,55 +8143,6 @@ export const schemaDict = {
8072
8143
  },
8073
8144
  },
8074
8145
  },
8075
- AppBskyUnspeccedGetTimelineSkeleton: {
8076
- lexicon: 1,
8077
- id: 'app.bsky.unspecced.getTimelineSkeleton',
8078
- defs: {
8079
- main: {
8080
- type: 'query',
8081
- description:
8082
- 'DEPRECATED: a skeleton of a timeline. Unspecced and will be unavailable soon.',
8083
- parameters: {
8084
- type: 'params',
8085
- properties: {
8086
- limit: {
8087
- type: 'integer',
8088
- minimum: 1,
8089
- maximum: 100,
8090
- default: 50,
8091
- },
8092
- cursor: {
8093
- type: 'string',
8094
- },
8095
- },
8096
- },
8097
- output: {
8098
- encoding: 'application/json',
8099
- schema: {
8100
- type: 'object',
8101
- required: ['feed'],
8102
- properties: {
8103
- cursor: {
8104
- type: 'string',
8105
- },
8106
- feed: {
8107
- type: 'array',
8108
- items: {
8109
- type: 'ref',
8110
- ref: 'lex:app.bsky.feed.defs#skeletonFeedPost',
8111
- },
8112
- },
8113
- },
8114
- },
8115
- },
8116
- errors: [
8117
- {
8118
- name: 'UnknownFeed',
8119
- },
8120
- ],
8121
- },
8122
- },
8123
- },
8124
8146
  AppBskyUnspeccedSearchActorsSkeleton: {
8125
8147
  lexicon: 1,
8126
8148
  id: 'app.bsky.unspecced.searchActorsSkeleton',
@@ -8336,6 +8358,7 @@ export const ids = {
8336
8358
  ComAtprotoSyncNotifyOfUpdate: 'com.atproto.sync.notifyOfUpdate',
8337
8359
  ComAtprotoSyncRequestCrawl: 'com.atproto.sync.requestCrawl',
8338
8360
  ComAtprotoSyncSubscribeRepos: 'com.atproto.sync.subscribeRepos',
8361
+ ComAtprotoTempCheckSignupQueue: 'com.atproto.temp.checkSignupQueue',
8339
8362
  ComAtprotoTempFetchLabels: 'com.atproto.temp.fetchLabels',
8340
8363
  ComAtprotoTempImportRepo: 'com.atproto.temp.importRepo',
8341
8364
  ComAtprotoTempPushBlob: 'com.atproto.temp.pushBlob',
@@ -8409,7 +8432,6 @@ export const ids = {
8409
8432
  'app.bsky.unspecced.getPopularFeedGenerators',
8410
8433
  AppBskyUnspeccedGetTaggedSuggestions:
8411
8434
  'app.bsky.unspecced.getTaggedSuggestions',
8412
- AppBskyUnspeccedGetTimelineSkeleton: 'app.bsky.unspecced.getTimelineSkeleton',
8413
8435
  AppBskyUnspeccedSearchActorsSkeleton:
8414
8436
  'app.bsky.unspecced.searchActorsSkeleton',
8415
8437
  AppBskyUnspeccedSearchPostsSkeleton: 'app.bsky.unspecced.searchPostsSkeleton',
@@ -40,6 +40,7 @@ export interface ModEventView {
40
40
  | ModEventEscalate
41
41
  | ModEventMute
42
42
  | ModEventEmail
43
+ | ModEventResolveAppeal
43
44
  | { $type: string; [k: string]: unknown }
44
45
  subject:
45
46
  | RepoRef
@@ -76,6 +77,7 @@ export interface ModEventViewDetail {
76
77
  | ModEventAcknowledge
77
78
  | ModEventEscalate
78
79
  | ModEventMute
80
+ | ModEventEmail
79
81
  | ModEventResolveAppeal
80
82
  | { $type: string; [k: string]: unknown }
81
83
  subject:
@@ -14,10 +14,23 @@ export interface QueryParams {
14
14
  createdBy?: string
15
15
  /** Sort direction for the events. Defaults to descending order of created at timestamp. */
16
16
  sortDirection?: 'asc' | 'desc'
17
+ /** Retrieve events created after a given timestamp */
18
+ createdAfter?: string
19
+ /** Retrieve events created before a given timestamp */
20
+ createdBefore?: string
17
21
  subject?: string
18
22
  /** If true, events on all record types (posts, lists, profile etc.) owned by the did are returned */
19
23
  includeAllUserRecords?: boolean
20
24
  limit?: number
25
+ /** If true, only events with comments are returned */
26
+ hasComment?: boolean
27
+ /** If specified, only events with comments containing the keyword are returned */
28
+ comment?: string
29
+ /** If specified, only events where all of these labels were added are returned */
30
+ addedLabels?: string[]
31
+ /** If specified, only events where all of these labels were removed are returned */
32
+ removedLabels?: string[]
33
+ reportTypes?: string[]
21
34
  cursor?: string
22
35
  }
23
36
 
@@ -6,18 +6,15 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
6
  import { isObj, hasProp } from '../../../../util'
7
7
  import { lexicons } from '../../../../lexicons'
8
8
  import { CID } from 'multiformats/cid'
9
- import * as AppBskyFeedDefs from '../feed/defs'
10
9
 
11
- export interface QueryParams {
12
- limit?: number
13
- cursor?: string
14
- }
10
+ export interface QueryParams {}
15
11
 
16
12
  export type InputSchema = undefined
17
13
 
18
14
  export interface OutputSchema {
19
- cursor?: string
20
- feed: AppBskyFeedDefs.SkeletonFeedPost[]
15
+ activated: boolean
16
+ placeInQueue?: number
17
+ estimatedTimeMs?: number
21
18
  [k: string]: unknown
22
19
  }
23
20
 
@@ -31,15 +28,8 @@ export interface Response {
31
28
  data: OutputSchema
32
29
  }
33
30
 
34
- export class UnknownFeedError extends XRPCError {
35
- constructor(src: XRPCError) {
36
- super(src.status, src.error, src.message, src.headers)
37
- }
38
- }
39
-
40
31
  export function toKnownErr(e: any) {
41
32
  if (e instanceof XRPCError) {
42
- if (e.error === 'UnknownFeed') return new UnknownFeedError(e)
43
33
  }
44
34
  return e
45
35
  }