@atproto/api 0.3.9 → 0.3.11
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 +3 -0
- package/dist/client/lexicons.d.ts +40 -0
- package/dist/client/types/com/atproto/admin/defs.d.ts +1 -0
- package/dist/client/types/com/atproto/admin/getModerationReports.d.ts +1 -0
- package/dist/client/types/com/atproto/admin/rebaseRepo.d.ts +24 -0
- package/dist/client/types/com/atproto/repo/rebaseRepo.d.ts +3 -0
- package/dist/index.js +366 -276
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
- package/src/client/index.ts +13 -0
- package/src/client/lexicons.ts +53 -0
- package/src/client/types/com/atproto/admin/defs.ts +1 -0
- package/src/client/types/com/atproto/admin/getModerationReports.ts +2 -0
- package/src/client/types/com/atproto/admin/rebaseRepo.ts +49 -0
- package/src/client/types/com/atproto/repo/rebaseRepo.ts +7 -0
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
package/src/client/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ import * as ComAtprotoAdminGetModerationReport from './types/com/atproto/admin/g
|
|
|
18
18
|
import * as ComAtprotoAdminGetModerationReports from './types/com/atproto/admin/getModerationReports'
|
|
19
19
|
import * as ComAtprotoAdminGetRecord from './types/com/atproto/admin/getRecord'
|
|
20
20
|
import * as ComAtprotoAdminGetRepo from './types/com/atproto/admin/getRepo'
|
|
21
|
+
import * as ComAtprotoAdminRebaseRepo from './types/com/atproto/admin/rebaseRepo'
|
|
21
22
|
import * as ComAtprotoAdminResolveModerationReports from './types/com/atproto/admin/resolveModerationReports'
|
|
22
23
|
import * as ComAtprotoAdminReverseModerationAction from './types/com/atproto/admin/reverseModerationAction'
|
|
23
24
|
import * as ComAtprotoAdminSearchRepos from './types/com/atproto/admin/searchRepos'
|
|
@@ -134,6 +135,7 @@ export * as ComAtprotoAdminGetModerationReport from './types/com/atproto/admin/g
|
|
|
134
135
|
export * as ComAtprotoAdminGetModerationReports from './types/com/atproto/admin/getModerationReports'
|
|
135
136
|
export * as ComAtprotoAdminGetRecord from './types/com/atproto/admin/getRecord'
|
|
136
137
|
export * as ComAtprotoAdminGetRepo from './types/com/atproto/admin/getRepo'
|
|
138
|
+
export * as ComAtprotoAdminRebaseRepo from './types/com/atproto/admin/rebaseRepo'
|
|
137
139
|
export * as ComAtprotoAdminResolveModerationReports from './types/com/atproto/admin/resolveModerationReports'
|
|
138
140
|
export * as ComAtprotoAdminReverseModerationAction from './types/com/atproto/admin/reverseModerationAction'
|
|
139
141
|
export * as ComAtprotoAdminSearchRepos from './types/com/atproto/admin/searchRepos'
|
|
@@ -436,6 +438,17 @@ export class AdminNS {
|
|
|
436
438
|
})
|
|
437
439
|
}
|
|
438
440
|
|
|
441
|
+
rebaseRepo(
|
|
442
|
+
data?: ComAtprotoAdminRebaseRepo.InputSchema,
|
|
443
|
+
opts?: ComAtprotoAdminRebaseRepo.CallOptions,
|
|
444
|
+
): Promise<ComAtprotoAdminRebaseRepo.Response> {
|
|
445
|
+
return this._service.xrpc
|
|
446
|
+
.call('com.atproto.admin.rebaseRepo', opts?.qp, data, opts)
|
|
447
|
+
.catch((e) => {
|
|
448
|
+
throw ComAtprotoAdminRebaseRepo.toKnownErr(e)
|
|
449
|
+
})
|
|
450
|
+
}
|
|
451
|
+
|
|
439
452
|
resolveModerationReports(
|
|
440
453
|
data?: ComAtprotoAdminResolveModerationReports.InputSchema,
|
|
441
454
|
opts?: ComAtprotoAdminResolveModerationReports.CallOptions,
|
package/src/client/lexicons.ts
CHANGED
|
@@ -228,6 +228,9 @@ export const schemaDict = {
|
|
|
228
228
|
reason: {
|
|
229
229
|
type: 'string',
|
|
230
230
|
},
|
|
231
|
+
subjectRepoHandle: {
|
|
232
|
+
type: 'string',
|
|
233
|
+
},
|
|
231
234
|
subject: {
|
|
232
235
|
type: 'union',
|
|
233
236
|
refs: [
|
|
@@ -883,6 +886,11 @@ export const schemaDict = {
|
|
|
883
886
|
cursor: {
|
|
884
887
|
type: 'string',
|
|
885
888
|
},
|
|
889
|
+
reverse: {
|
|
890
|
+
type: 'boolean',
|
|
891
|
+
description:
|
|
892
|
+
'Reverse the order of the returned records? when true, returns reports in chronological order',
|
|
893
|
+
},
|
|
886
894
|
},
|
|
887
895
|
},
|
|
888
896
|
output: {
|
|
@@ -975,6 +983,44 @@ export const schemaDict = {
|
|
|
975
983
|
},
|
|
976
984
|
},
|
|
977
985
|
},
|
|
986
|
+
ComAtprotoAdminRebaseRepo: {
|
|
987
|
+
lexicon: 1,
|
|
988
|
+
id: 'com.atproto.admin.rebaseRepo',
|
|
989
|
+
defs: {
|
|
990
|
+
main: {
|
|
991
|
+
type: 'procedure',
|
|
992
|
+
description: "Administrative action to rebase an account's repo",
|
|
993
|
+
input: {
|
|
994
|
+
encoding: 'application/json',
|
|
995
|
+
schema: {
|
|
996
|
+
type: 'object',
|
|
997
|
+
required: ['repo'],
|
|
998
|
+
properties: {
|
|
999
|
+
repo: {
|
|
1000
|
+
type: 'string',
|
|
1001
|
+
format: 'at-identifier',
|
|
1002
|
+
description: 'The handle or DID of the repo.',
|
|
1003
|
+
},
|
|
1004
|
+
swapCommit: {
|
|
1005
|
+
type: 'string',
|
|
1006
|
+
format: 'cid',
|
|
1007
|
+
description:
|
|
1008
|
+
'Compare and swap with the previous commit by cid.',
|
|
1009
|
+
},
|
|
1010
|
+
},
|
|
1011
|
+
},
|
|
1012
|
+
},
|
|
1013
|
+
errors: [
|
|
1014
|
+
{
|
|
1015
|
+
name: 'InvalidSwap',
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
name: 'ConcurrentWrites',
|
|
1019
|
+
},
|
|
1020
|
+
],
|
|
1021
|
+
},
|
|
1022
|
+
},
|
|
1023
|
+
},
|
|
978
1024
|
ComAtprotoAdminResolveModerationReports: {
|
|
979
1025
|
lexicon: 1,
|
|
980
1026
|
id: 'com.atproto.admin.resolveModerationReports',
|
|
@@ -2095,6 +2141,9 @@ export const schemaDict = {
|
|
|
2095
2141
|
{
|
|
2096
2142
|
name: 'InvalidSwap',
|
|
2097
2143
|
},
|
|
2144
|
+
{
|
|
2145
|
+
name: 'ConcurrentWrites',
|
|
2146
|
+
},
|
|
2098
2147
|
],
|
|
2099
2148
|
},
|
|
2100
2149
|
},
|
|
@@ -3257,6 +3306,9 @@ export const schemaDict = {
|
|
|
3257
3306
|
{
|
|
3258
3307
|
name: 'FutureCursor',
|
|
3259
3308
|
},
|
|
3309
|
+
{
|
|
3310
|
+
name: 'ConsumerTooSlow',
|
|
3311
|
+
},
|
|
3260
3312
|
],
|
|
3261
3313
|
},
|
|
3262
3314
|
commit: {
|
|
@@ -6233,6 +6285,7 @@ export const ids = {
|
|
|
6233
6285
|
ComAtprotoAdminGetModerationReports: 'com.atproto.admin.getModerationReports',
|
|
6234
6286
|
ComAtprotoAdminGetRecord: 'com.atproto.admin.getRecord',
|
|
6235
6287
|
ComAtprotoAdminGetRepo: 'com.atproto.admin.getRepo',
|
|
6288
|
+
ComAtprotoAdminRebaseRepo: 'com.atproto.admin.rebaseRepo',
|
|
6236
6289
|
ComAtprotoAdminResolveModerationReports:
|
|
6237
6290
|
'com.atproto.admin.resolveModerationReports',
|
|
6238
6291
|
ComAtprotoAdminReverseModerationAction:
|
|
@@ -0,0 +1,49 @@
|
|
|
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 interface InputSchema {
|
|
13
|
+
/** The handle or DID of the repo. */
|
|
14
|
+
repo: string
|
|
15
|
+
/** Compare and swap with the previous commit by cid. */
|
|
16
|
+
swapCommit?: string
|
|
17
|
+
[k: string]: unknown
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface CallOptions {
|
|
21
|
+
headers?: Headers
|
|
22
|
+
qp?: QueryParams
|
|
23
|
+
encoding: 'application/json'
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface Response {
|
|
27
|
+
success: boolean
|
|
28
|
+
headers: Headers
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export class InvalidSwapError extends XRPCError {
|
|
32
|
+
constructor(src: XRPCError) {
|
|
33
|
+
super(src.status, src.error, src.message)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export class ConcurrentWritesError extends XRPCError {
|
|
38
|
+
constructor(src: XRPCError) {
|
|
39
|
+
super(src.status, src.error, src.message)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function toKnownErr(e: any) {
|
|
44
|
+
if (e instanceof XRPCError) {
|
|
45
|
+
if (e.error === 'InvalidSwap') return new InvalidSwapError(e)
|
|
46
|
+
if (e.error === 'ConcurrentWrites') return new ConcurrentWritesError(e)
|
|
47
|
+
}
|
|
48
|
+
return e
|
|
49
|
+
}
|
|
@@ -34,9 +34,16 @@ export class InvalidSwapError extends XRPCError {
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
export class ConcurrentWritesError extends XRPCError {
|
|
38
|
+
constructor(src: XRPCError) {
|
|
39
|
+
super(src.status, src.error, src.message)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
37
43
|
export function toKnownErr(e: any) {
|
|
38
44
|
if (e instanceof XRPCError) {
|
|
39
45
|
if (e.error === 'InvalidSwap') return new InvalidSwapError(e)
|
|
46
|
+
if (e.error === 'ConcurrentWrites') return new ConcurrentWritesError(e)
|
|
40
47
|
}
|
|
41
48
|
return e
|
|
42
49
|
}
|