@atproto/api 0.2.7 → 0.2.9

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.
Files changed (30) hide show
  1. package/README.md +4 -4
  2. package/dist/client/index.d.ts +19 -0
  3. package/dist/client/lexicons.d.ts +248 -2
  4. package/dist/client/types/app/bsky/feed/getPosts.d.ts +19 -0
  5. package/dist/client/types/app/bsky/notification/getUnreadCount.d.ts +1 -0
  6. package/dist/client/types/app/bsky/notification/listNotifications.d.ts +1 -0
  7. package/dist/client/types/com/atproto/admin/defs.d.ts +3 -0
  8. package/dist/client/types/com/atproto/admin/updateAccountEmail.d.ts +18 -0
  9. package/dist/client/types/com/atproto/moderation/defs.d.ts +5 -1
  10. package/dist/client/types/com/atproto/server/createAppPassword.d.ts +31 -0
  11. package/dist/client/types/com/atproto/server/createInviteCodes.d.ts +10 -2
  12. package/dist/client/types/com/atproto/server/listAppPasswords.d.ts +28 -0
  13. package/dist/client/types/com/atproto/server/revokeAppPassword.d.ts +17 -0
  14. package/dist/index.js +626 -184
  15. package/dist/index.js.map +4 -4
  16. package/package.json +1 -1
  17. package/src/client/index.ts +69 -0
  18. package/src/client/lexicons.ts +263 -9
  19. package/src/client/types/app/bsky/feed/getPosts.ts +36 -0
  20. package/src/client/types/app/bsky/notification/getUnreadCount.ts +3 -1
  21. package/src/client/types/app/bsky/notification/listNotifications.ts +1 -0
  22. package/src/client/types/com/atproto/admin/defs.ts +3 -0
  23. package/src/client/types/com/atproto/admin/updateAccountEmail.ts +34 -0
  24. package/src/client/types/com/atproto/moderation/defs.ts +14 -2
  25. package/src/client/types/com/atproto/server/createAppPassword.ts +64 -0
  26. package/src/client/types/com/atproto/server/createInviteCodes.ts +23 -2
  27. package/src/client/types/com/atproto/server/listAppPasswords.ts +58 -0
  28. package/src/client/types/com/atproto/server/revokeAppPassword.ts +32 -0
  29. package/src/client/types/com/atproto/sync/getRepo.ts +1 -1
  30. package/tsconfig.build.tsbuildinfo +1 -1
@@ -0,0 +1,34 @@
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
+ account: string
15
+ email: string
16
+ [k: string]: unknown
17
+ }
18
+
19
+ export interface CallOptions {
20
+ headers?: Headers
21
+ qp?: QueryParams
22
+ encoding: 'application/json'
23
+ }
24
+
25
+ export interface Response {
26
+ success: boolean
27
+ headers: Headers
28
+ }
29
+
30
+ export function toKnownErr(e: any) {
31
+ if (e instanceof XRPCError) {
32
+ }
33
+ return e
34
+ }
@@ -8,10 +8,22 @@ import { CID } from 'multiformats/cid'
8
8
 
9
9
  export type ReasonType =
10
10
  | 'com.atproto.moderation.defs#reasonSpam'
11
+ | 'com.atproto.moderation.defs#reasonViolation'
12
+ | 'com.atproto.moderation.defs#reasonMisleading'
13
+ | 'com.atproto.moderation.defs#reasonSexual'
14
+ | 'com.atproto.moderation.defs#reasonRude'
11
15
  | 'com.atproto.moderation.defs#reasonOther'
12
16
  | (string & {})
13
17
 
14
- /** Moderation report reason: Spam. */
18
+ /** Spam: frequent unwanted promotion, replies, mentions */
15
19
  export const REASONSPAM = 'com.atproto.moderation.defs#reasonSpam'
16
- /** Moderation report reason: Other. */
20
+ /** Direct violation of server rules, laws, terms of service */
21
+ export const REASONVIOLATION = 'com.atproto.moderation.defs#reasonViolation'
22
+ /** Misleading identity, affiliation, or content */
23
+ export const REASONMISLEADING = 'com.atproto.moderation.defs#reasonMisleading'
24
+ /** Unwanted or mis-labeled sexual content */
25
+ export const REASONSEXUAL = 'com.atproto.moderation.defs#reasonSexual'
26
+ /** Rude, harassing, explicit, or otherwise unwelcoming behavior */
27
+ export const REASONRUDE = 'com.atproto.moderation.defs#reasonRude'
28
+ /** Other: reports not falling under another report category */
17
29
  export const REASONOTHER = 'com.atproto.moderation.defs#reasonOther'
@@ -0,0 +1,64 @@
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
+ name: string
14
+ [k: string]: unknown
15
+ }
16
+
17
+ export type OutputSchema = AppPassword
18
+
19
+ export interface CallOptions {
20
+ headers?: Headers
21
+ qp?: QueryParams
22
+ encoding: 'application/json'
23
+ }
24
+
25
+ export interface Response {
26
+ success: boolean
27
+ headers: Headers
28
+ data: OutputSchema
29
+ }
30
+
31
+ export class AccountTakedownError extends XRPCError {
32
+ constructor(src: XRPCError) {
33
+ super(src.status, src.error, src.message)
34
+ }
35
+ }
36
+
37
+ export function toKnownErr(e: any) {
38
+ if (e instanceof XRPCError) {
39
+ if (e.error === 'AccountTakedown') return new AccountTakedownError(e)
40
+ }
41
+ return e
42
+ }
43
+
44
+ export interface AppPassword {
45
+ name: string
46
+ password: string
47
+ createdAt: string
48
+ [k: string]: unknown
49
+ }
50
+
51
+ export function isAppPassword(v: unknown): v is AppPassword {
52
+ return (
53
+ isObj(v) &&
54
+ hasProp(v, '$type') &&
55
+ v.$type === 'com.atproto.server.createAppPassword#appPassword'
56
+ )
57
+ }
58
+
59
+ export function validateAppPassword(v: unknown): ValidationResult {
60
+ return lexicons.validate(
61
+ 'com.atproto.server.createAppPassword#appPassword',
62
+ v,
63
+ )
64
+ }
@@ -12,12 +12,12 @@ export interface QueryParams {}
12
12
  export interface InputSchema {
13
13
  codeCount: number
14
14
  useCount: number
15
- forAccount?: string
15
+ forAccounts?: string[]
16
16
  [k: string]: unknown
17
17
  }
18
18
 
19
19
  export interface OutputSchema {
20
- codes: string[]
20
+ codes: AccountCodes[]
21
21
  [k: string]: unknown
22
22
  }
23
23
 
@@ -38,3 +38,24 @@ export function toKnownErr(e: any) {
38
38
  }
39
39
  return e
40
40
  }
41
+
42
+ export interface AccountCodes {
43
+ account: string
44
+ codes: string[]
45
+ [k: string]: unknown
46
+ }
47
+
48
+ export function isAccountCodes(v: unknown): v is AccountCodes {
49
+ return (
50
+ isObj(v) &&
51
+ hasProp(v, '$type') &&
52
+ v.$type === 'com.atproto.server.createInviteCodes#accountCodes'
53
+ )
54
+ }
55
+
56
+ export function validateAccountCodes(v: unknown): ValidationResult {
57
+ return lexicons.validate(
58
+ 'com.atproto.server.createInviteCodes#accountCodes',
59
+ v,
60
+ )
61
+ }
@@ -0,0 +1,58 @@
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
+ passwords: AppPassword[]
16
+ [k: string]: unknown
17
+ }
18
+
19
+ export interface CallOptions {
20
+ headers?: Headers
21
+ }
22
+
23
+ export interface Response {
24
+ success: boolean
25
+ headers: Headers
26
+ data: OutputSchema
27
+ }
28
+
29
+ export class AccountTakedownError extends XRPCError {
30
+ constructor(src: XRPCError) {
31
+ super(src.status, src.error, src.message)
32
+ }
33
+ }
34
+
35
+ export function toKnownErr(e: any) {
36
+ if (e instanceof XRPCError) {
37
+ if (e.error === 'AccountTakedown') return new AccountTakedownError(e)
38
+ }
39
+ return e
40
+ }
41
+
42
+ export interface AppPassword {
43
+ name: string
44
+ createdAt: string
45
+ [k: string]: unknown
46
+ }
47
+
48
+ export function isAppPassword(v: unknown): v is AppPassword {
49
+ return (
50
+ isObj(v) &&
51
+ hasProp(v, '$type') &&
52
+ v.$type === 'com.atproto.server.listAppPasswords#appPassword'
53
+ )
54
+ }
55
+
56
+ export function validateAppPassword(v: unknown): ValidationResult {
57
+ return lexicons.validate('com.atproto.server.listAppPasswords#appPassword', v)
58
+ }
@@ -0,0 +1,32 @@
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
+ name: string
14
+ [k: string]: unknown
15
+ }
16
+
17
+ export interface CallOptions {
18
+ headers?: Headers
19
+ qp?: QueryParams
20
+ encoding: 'application/json'
21
+ }
22
+
23
+ export interface Response {
24
+ success: boolean
25
+ headers: Headers
26
+ }
27
+
28
+ export function toKnownErr(e: any) {
29
+ if (e instanceof XRPCError) {
30
+ }
31
+ return e
32
+ }
@@ -12,7 +12,7 @@ export interface QueryParams {
12
12
  did: string
13
13
  /** The earliest commit in the commit range (not inclusive) */
14
14
  earliest?: string
15
- /** The latest commit you in the commit range (inclusive */
15
+ /** The latest commit in the commit range (inclusive) */
16
16
  latest?: string
17
17
  }
18
18