@atproto/api 0.3.9 → 0.3.10
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 +37 -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 +346 -261
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
- package/src/client/index.ts +13 -0
- package/src/client/lexicons.ts +47 -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
|
@@ -883,6 +883,11 @@ export const schemaDict = {
|
|
|
883
883
|
cursor: {
|
|
884
884
|
type: 'string',
|
|
885
885
|
},
|
|
886
|
+
reverse: {
|
|
887
|
+
type: 'boolean',
|
|
888
|
+
description:
|
|
889
|
+
'Reverse the order of the returned records? when true, returns reports in chronological order',
|
|
890
|
+
},
|
|
886
891
|
},
|
|
887
892
|
},
|
|
888
893
|
output: {
|
|
@@ -975,6 +980,44 @@ export const schemaDict = {
|
|
|
975
980
|
},
|
|
976
981
|
},
|
|
977
982
|
},
|
|
983
|
+
ComAtprotoAdminRebaseRepo: {
|
|
984
|
+
lexicon: 1,
|
|
985
|
+
id: 'com.atproto.admin.rebaseRepo',
|
|
986
|
+
defs: {
|
|
987
|
+
main: {
|
|
988
|
+
type: 'procedure',
|
|
989
|
+
description: "Administrative action to rebase an account's repo",
|
|
990
|
+
input: {
|
|
991
|
+
encoding: 'application/json',
|
|
992
|
+
schema: {
|
|
993
|
+
type: 'object',
|
|
994
|
+
required: ['repo'],
|
|
995
|
+
properties: {
|
|
996
|
+
repo: {
|
|
997
|
+
type: 'string',
|
|
998
|
+
format: 'at-identifier',
|
|
999
|
+
description: 'The handle or DID of the repo.',
|
|
1000
|
+
},
|
|
1001
|
+
swapCommit: {
|
|
1002
|
+
type: 'string',
|
|
1003
|
+
format: 'cid',
|
|
1004
|
+
description:
|
|
1005
|
+
'Compare and swap with the previous commit by cid.',
|
|
1006
|
+
},
|
|
1007
|
+
},
|
|
1008
|
+
},
|
|
1009
|
+
},
|
|
1010
|
+
errors: [
|
|
1011
|
+
{
|
|
1012
|
+
name: 'InvalidSwap',
|
|
1013
|
+
},
|
|
1014
|
+
{
|
|
1015
|
+
name: 'ConcurrentWrites',
|
|
1016
|
+
},
|
|
1017
|
+
],
|
|
1018
|
+
},
|
|
1019
|
+
},
|
|
1020
|
+
},
|
|
978
1021
|
ComAtprotoAdminResolveModerationReports: {
|
|
979
1022
|
lexicon: 1,
|
|
980
1023
|
id: 'com.atproto.admin.resolveModerationReports',
|
|
@@ -2095,6 +2138,9 @@ export const schemaDict = {
|
|
|
2095
2138
|
{
|
|
2096
2139
|
name: 'InvalidSwap',
|
|
2097
2140
|
},
|
|
2141
|
+
{
|
|
2142
|
+
name: 'ConcurrentWrites',
|
|
2143
|
+
},
|
|
2098
2144
|
],
|
|
2099
2145
|
},
|
|
2100
2146
|
},
|
|
@@ -6233,6 +6279,7 @@ export const ids = {
|
|
|
6233
6279
|
ComAtprotoAdminGetModerationReports: 'com.atproto.admin.getModerationReports',
|
|
6234
6280
|
ComAtprotoAdminGetRecord: 'com.atproto.admin.getRecord',
|
|
6235
6281
|
ComAtprotoAdminGetRepo: 'com.atproto.admin.getRepo',
|
|
6282
|
+
ComAtprotoAdminRebaseRepo: 'com.atproto.admin.rebaseRepo',
|
|
6236
6283
|
ComAtprotoAdminResolveModerationReports:
|
|
6237
6284
|
'com.atproto.admin.resolveModerationReports',
|
|
6238
6285
|
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
|
}
|