@atproto/api 0.9.4 → 0.9.5
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/agent.d.ts +1 -1
- package/dist/client/index.d.ts +3 -0
- package/dist/client/lexicons.d.ts +29 -0
- package/dist/client/types/com/atproto/temp/checkSignupQueue.d.ts +19 -0
- package/dist/index.js +200 -155
- package/dist/index.js.map +3 -3
- package/package.json +2 -2
- package/src/agent.ts +2 -2
- package/src/client/index.ts +13 -0
- package/src/client/lexicons.ts +29 -0
- package/src/client/types/com/atproto/temp/checkSignupQueue.ts +35 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atproto/api",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
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.
|
|
31
|
+
"@atproto/dev-env": "^0.2.28"
|
|
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.
|
|
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
|
-
|
|
253
|
+
async refreshSession() {
|
|
254
254
|
if (this._refreshSessionPromise) {
|
|
255
255
|
return this._refreshSessionPromise
|
|
256
256
|
}
|
package/src/client/index.ts
CHANGED
|
@@ -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'
|
|
@@ -227,6 +228,7 @@ export * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos'
|
|
|
227
228
|
export * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate'
|
|
228
229
|
export * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl'
|
|
229
230
|
export * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos'
|
|
231
|
+
export * as ComAtprotoTempCheckSignupQueue from './types/com/atproto/temp/checkSignupQueue'
|
|
230
232
|
export * as ComAtprotoTempFetchLabels from './types/com/atproto/temp/fetchLabels'
|
|
231
233
|
export * as ComAtprotoTempImportRepo from './types/com/atproto/temp/importRepo'
|
|
232
234
|
export * as ComAtprotoTempPushBlob from './types/com/atproto/temp/pushBlob'
|
|
@@ -1207,6 +1209,17 @@ export class ComAtprotoTempNS {
|
|
|
1207
1209
|
this._service = service
|
|
1208
1210
|
}
|
|
1209
1211
|
|
|
1212
|
+
checkSignupQueue(
|
|
1213
|
+
params?: ComAtprotoTempCheckSignupQueue.QueryParams,
|
|
1214
|
+
opts?: ComAtprotoTempCheckSignupQueue.CallOptions,
|
|
1215
|
+
): Promise<ComAtprotoTempCheckSignupQueue.Response> {
|
|
1216
|
+
return this._service.xrpc
|
|
1217
|
+
.call('com.atproto.temp.checkSignupQueue', params, undefined, opts)
|
|
1218
|
+
.catch((e) => {
|
|
1219
|
+
throw ComAtprotoTempCheckSignupQueue.toKnownErr(e)
|
|
1220
|
+
})
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1210
1223
|
fetchLabels(
|
|
1211
1224
|
params?: ComAtprotoTempFetchLabels.QueryParams,
|
|
1212
1225
|
opts?: ComAtprotoTempFetchLabels.CallOptions,
|
package/src/client/lexicons.ts
CHANGED
|
@@ -4246,6 +4246,34 @@ export const schemaDict = {
|
|
|
4246
4246
|
},
|
|
4247
4247
|
},
|
|
4248
4248
|
},
|
|
4249
|
+
ComAtprotoTempCheckSignupQueue: {
|
|
4250
|
+
lexicon: 1,
|
|
4251
|
+
id: 'com.atproto.temp.checkSignupQueue',
|
|
4252
|
+
defs: {
|
|
4253
|
+
main: {
|
|
4254
|
+
type: 'query',
|
|
4255
|
+
description: 'Check accounts location in signup queue.',
|
|
4256
|
+
output: {
|
|
4257
|
+
encoding: 'application/json',
|
|
4258
|
+
schema: {
|
|
4259
|
+
type: 'object',
|
|
4260
|
+
required: ['activated'],
|
|
4261
|
+
properties: {
|
|
4262
|
+
activated: {
|
|
4263
|
+
type: 'boolean',
|
|
4264
|
+
},
|
|
4265
|
+
placeInQueue: {
|
|
4266
|
+
type: 'integer',
|
|
4267
|
+
},
|
|
4268
|
+
estimatedTimeMs: {
|
|
4269
|
+
type: 'integer',
|
|
4270
|
+
},
|
|
4271
|
+
},
|
|
4272
|
+
},
|
|
4273
|
+
},
|
|
4274
|
+
},
|
|
4275
|
+
},
|
|
4276
|
+
},
|
|
4249
4277
|
ComAtprotoTempFetchLabels: {
|
|
4250
4278
|
lexicon: 1,
|
|
4251
4279
|
id: 'com.atproto.temp.fetchLabels',
|
|
@@ -8336,6 +8364,7 @@ export const ids = {
|
|
|
8336
8364
|
ComAtprotoSyncNotifyOfUpdate: 'com.atproto.sync.notifyOfUpdate',
|
|
8337
8365
|
ComAtprotoSyncRequestCrawl: 'com.atproto.sync.requestCrawl',
|
|
8338
8366
|
ComAtprotoSyncSubscribeRepos: 'com.atproto.sync.subscribeRepos',
|
|
8367
|
+
ComAtprotoTempCheckSignupQueue: 'com.atproto.temp.checkSignupQueue',
|
|
8339
8368
|
ComAtprotoTempFetchLabels: 'com.atproto.temp.fetchLabels',
|
|
8340
8369
|
ComAtprotoTempImportRepo: 'com.atproto.temp.importRepo',
|
|
8341
8370
|
ComAtprotoTempPushBlob: 'com.atproto.temp.pushBlob',
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
|
|
12
|
+
export type InputSchema = undefined
|
|
13
|
+
|
|
14
|
+
export interface OutputSchema {
|
|
15
|
+
activated: boolean
|
|
16
|
+
placeInQueue?: number
|
|
17
|
+
estimatedTimeMs?: number
|
|
18
|
+
[k: string]: unknown
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface CallOptions {
|
|
22
|
+
headers?: Headers
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface Response {
|
|
26
|
+
success: boolean
|
|
27
|
+
headers: Headers
|
|
28
|
+
data: OutputSchema
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function toKnownErr(e: any) {
|
|
32
|
+
if (e instanceof XRPCError) {
|
|
33
|
+
}
|
|
34
|
+
return e
|
|
35
|
+
}
|