@atproto/api 0.6.7 → 0.6.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 (56) hide show
  1. package/build.js +8 -0
  2. package/dist/agent.d.ts +25 -44
  3. package/dist/bsky-agent.d.ts +24 -0
  4. package/dist/client/index.d.ts +14 -9
  5. package/dist/client/lexicons.d.ts +103 -100
  6. package/dist/client/types/app/bsky/actor/defs.d.ts +65 -74
  7. package/dist/client/types/app/bsky/actor/getFeedSuggestions.d.ts +21 -0
  8. package/dist/client/types/app/bsky/embed/external.d.ts +23 -23
  9. package/dist/client/types/app/bsky/embed/images.d.ts +20 -20
  10. package/dist/client/types/app/bsky/embed/recordWithMedia.d.ts +20 -26
  11. package/dist/client/types/{com/atproto/sync/getCommitPath.d.ts → app/bsky/feed/getFeedSuggestions.d.ts} +5 -4
  12. package/dist/client/types/app/bsky/feed/getSuggestedFeeds.d.ts +21 -0
  13. package/dist/client/types/app/bsky/feed/like.d.ts +7 -7
  14. package/dist/client/types/app/bsky/feed/repost.d.ts +7 -7
  15. package/dist/client/types/app/bsky/graph/block.d.ts +6 -6
  16. package/dist/client/types/app/bsky/graph/defs.d.ts +36 -36
  17. package/dist/client/types/app/bsky/graph/follow.d.ts +6 -6
  18. package/dist/client/types/app/bsky/graph/listitem.d.ts +7 -7
  19. package/dist/client/types/app/bsky/richtext/facet.d.ts +22 -26
  20. package/dist/client/types/com/atproto/label/subscribeLabels.d.ts +12 -12
  21. package/dist/client/types/com/atproto/moderation/defs.d.ts +7 -16
  22. package/dist/client/types/com/atproto/repo/strongRef.d.ts +6 -6
  23. package/dist/client/types/com/atproto/server/defs.d.ts +16 -16
  24. package/dist/client/types/com/atproto/sync/getCheckout.d.ts +0 -1
  25. package/dist/client/types/com/atproto/{admin/rebaseRepo.d.ts → sync/getLatestCommit.d.ts} +7 -9
  26. package/dist/client/types/com/atproto/sync/getRepo.d.ts +1 -2
  27. package/dist/client/types/com/atproto/sync/listBlobs.d.ts +4 -2
  28. package/dist/client/types/com/atproto/sync/subscribeRepos.d.ts +48 -46
  29. package/dist/client/types/{app/bsky/unspecced/registerPushNotification.d.ts → com/atproto/temp/upgradeRepoVersion.d.ts} +7 -5
  30. package/dist/client/util.d.ts +2 -5
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.js +1651 -1277
  33. package/dist/index.js.map +4 -4
  34. package/dist/rich-text/detection.d.ts +4 -4
  35. package/dist/rich-text/rich-text.d.ts +31 -31
  36. package/dist/rich-text/sanitization.d.ts +4 -7
  37. package/dist/rich-text/unicode.d.ts +9 -9
  38. package/dist/types.d.ts +32 -34
  39. package/package.json +24 -23
  40. package/src/bsky-agent.ts +181 -1
  41. package/src/client/index.ts +49 -39
  42. package/src/client/lexicons.ts +123 -129
  43. package/src/client/types/{com/atproto/sync/getCommitPath.ts → app/bsky/feed/getSuggestedFeeds.ts} +5 -7
  44. package/src/client/types/com/atproto/sync/getCheckout.ts +0 -2
  45. package/src/client/types/com/atproto/{admin/rebaseRepo.ts → sync/getLatestCommit.ts} +12 -17
  46. package/src/client/types/com/atproto/sync/getRepo.ts +2 -4
  47. package/src/client/types/com/atproto/sync/listBlobs.ts +5 -4
  48. package/src/client/types/com/atproto/sync/subscribeRepos.ts +5 -1
  49. package/src/client/types/com/atproto/{repo/rebaseRepo.ts → temp/upgradeRepoVersion.ts} +2 -18
  50. package/src/index.ts +1 -1
  51. package/src/types.ts +20 -0
  52. package/tests/bsky-agent.test.ts +149 -0
  53. package/update-pkg.js +14 -0
  54. package/LICENSE +0 -21
  55. package/dist/client/types/com/atproto/repo/rebaseRepo.d.ts +0 -24
  56. package/tsconfig.build.tsbuildinfo +0 -1
@@ -1,16 +1,7 @@
1
- export declare type ReasonType =
2
- | 'com.atproto.moderation.defs#reasonSpam'
3
- | 'com.atproto.moderation.defs#reasonViolation'
4
- | 'com.atproto.moderation.defs#reasonMisleading'
5
- | 'com.atproto.moderation.defs#reasonSexual'
6
- | 'com.atproto.moderation.defs#reasonRude'
7
- | 'com.atproto.moderation.defs#reasonOther'
8
- | (string & {})
9
- export declare const REASONSPAM = 'com.atproto.moderation.defs#reasonSpam'
10
- export declare const REASONVIOLATION =
11
- 'com.atproto.moderation.defs#reasonViolation'
12
- export declare const REASONMISLEADING =
13
- 'com.atproto.moderation.defs#reasonMisleading'
14
- export declare const REASONSEXUAL = 'com.atproto.moderation.defs#reasonSexual'
15
- export declare const REASONRUDE = 'com.atproto.moderation.defs#reasonRude'
16
- export declare const REASONOTHER = 'com.atproto.moderation.defs#reasonOther'
1
+ export declare type ReasonType = 'com.atproto.moderation.defs#reasonSpam' | 'com.atproto.moderation.defs#reasonViolation' | 'com.atproto.moderation.defs#reasonMisleading' | 'com.atproto.moderation.defs#reasonSexual' | 'com.atproto.moderation.defs#reasonRude' | 'com.atproto.moderation.defs#reasonOther' | (string & {});
2
+ export declare const REASONSPAM = "com.atproto.moderation.defs#reasonSpam";
3
+ export declare const REASONVIOLATION = "com.atproto.moderation.defs#reasonViolation";
4
+ export declare const REASONMISLEADING = "com.atproto.moderation.defs#reasonMisleading";
5
+ export declare const REASONSEXUAL = "com.atproto.moderation.defs#reasonSexual";
6
+ export declare const REASONRUDE = "com.atproto.moderation.defs#reasonRude";
7
+ export declare const REASONOTHER = "com.atproto.moderation.defs#reasonOther";
@@ -1,8 +1,8 @@
1
- import { ValidationResult } from '@atproto/lexicon'
1
+ import { ValidationResult } from '@atproto/lexicon';
2
2
  export interface Main {
3
- uri: string
4
- cid: string
5
- [k: string]: unknown
3
+ uri: string;
4
+ cid: string;
5
+ [k: string]: unknown;
6
6
  }
7
- export declare function isMain(v: unknown): v is Main
8
- export declare function validateMain(v: unknown): ValidationResult
7
+ export declare function isMain(v: unknown): v is Main;
8
+ export declare function validateMain(v: unknown): ValidationResult;
@@ -1,20 +1,20 @@
1
- import { ValidationResult } from '@atproto/lexicon'
1
+ import { ValidationResult } from '@atproto/lexicon';
2
2
  export interface InviteCode {
3
- code: string
4
- available: number
5
- disabled: boolean
6
- forAccount: string
7
- createdBy: string
8
- createdAt: string
9
- uses: InviteCodeUse[]
10
- [k: string]: unknown
3
+ code: string;
4
+ available: number;
5
+ disabled: boolean;
6
+ forAccount: string;
7
+ createdBy: string;
8
+ createdAt: string;
9
+ uses: InviteCodeUse[];
10
+ [k: string]: unknown;
11
11
  }
12
- export declare function isInviteCode(v: unknown): v is InviteCode
13
- export declare function validateInviteCode(v: unknown): ValidationResult
12
+ export declare function isInviteCode(v: unknown): v is InviteCode;
13
+ export declare function validateInviteCode(v: unknown): ValidationResult;
14
14
  export interface InviteCodeUse {
15
- usedBy: string
16
- usedAt: string
17
- [k: string]: unknown
15
+ usedBy: string;
16
+ usedAt: string;
17
+ [k: string]: unknown;
18
18
  }
19
- export declare function isInviteCodeUse(v: unknown): v is InviteCodeUse
20
- export declare function validateInviteCodeUse(v: unknown): ValidationResult
19
+ export declare function isInviteCodeUse(v: unknown): v is InviteCodeUse;
20
+ export declare function validateInviteCodeUse(v: unknown): ValidationResult;
@@ -1,7 +1,6 @@
1
1
  import { Headers } from '@atproto/xrpc';
2
2
  export interface QueryParams {
3
3
  did: string;
4
- commit?: string;
5
4
  }
6
5
  export declare type InputSchema = undefined;
7
6
  export interface CallOptions {
@@ -1,24 +1,22 @@
1
1
  import { Headers, XRPCError } from '@atproto/xrpc';
2
2
  export interface QueryParams {
3
+ did: string;
3
4
  }
4
- export interface InputSchema {
5
- repo: string;
6
- swapCommit?: string;
5
+ export declare type InputSchema = undefined;
6
+ export interface OutputSchema {
7
+ cid: string;
8
+ rev: string;
7
9
  [k: string]: unknown;
8
10
  }
9
11
  export interface CallOptions {
10
12
  headers?: Headers;
11
- qp?: QueryParams;
12
- encoding: 'application/json';
13
13
  }
14
14
  export interface Response {
15
15
  success: boolean;
16
16
  headers: Headers;
17
+ data: OutputSchema;
17
18
  }
18
- export declare class InvalidSwapError extends XRPCError {
19
- constructor(src: XRPCError);
20
- }
21
- export declare class ConcurrentWritesError extends XRPCError {
19
+ export declare class RepoNotFoundError extends XRPCError {
22
20
  constructor(src: XRPCError);
23
21
  }
24
22
  export declare function toKnownErr(e: any): any;
@@ -1,8 +1,7 @@
1
1
  import { Headers } from '@atproto/xrpc';
2
2
  export interface QueryParams {
3
3
  did: string;
4
- earliest?: string;
5
- latest?: string;
4
+ since?: string;
6
5
  }
7
6
  export declare type InputSchema = undefined;
8
7
  export interface CallOptions {
@@ -1,11 +1,13 @@
1
1
  import { Headers } from '@atproto/xrpc';
2
2
  export interface QueryParams {
3
3
  did: string;
4
- latest?: string;
5
- earliest?: string;
4
+ since?: string;
5
+ limit?: number;
6
+ cursor?: string;
6
7
  }
7
8
  export declare type InputSchema = undefined;
8
9
  export interface OutputSchema {
10
+ cursor?: string;
9
11
  cids: string[];
10
12
  [k: string]: unknown;
11
13
  }
@@ -1,58 +1,60 @@
1
- import { ValidationResult } from '@atproto/lexicon'
2
- import { CID } from 'multiformats/cid'
1
+ import { ValidationResult } from '@atproto/lexicon';
2
+ import { CID } from 'multiformats/cid';
3
3
  export interface Commit {
4
- seq: number
5
- rebase: boolean
6
- tooBig: boolean
7
- repo: string
8
- commit: CID
9
- prev: CID | null
10
- blocks: Uint8Array
11
- ops: RepoOp[]
12
- blobs: CID[]
13
- time: string
14
- [k: string]: unknown
4
+ seq: number;
5
+ rebase: boolean;
6
+ tooBig: boolean;
7
+ repo: string;
8
+ commit: CID;
9
+ prev?: CID | null;
10
+ rev: string;
11
+ since: string | null;
12
+ blocks: Uint8Array;
13
+ ops: RepoOp[];
14
+ blobs: CID[];
15
+ time: string;
16
+ [k: string]: unknown;
15
17
  }
16
- export declare function isCommit(v: unknown): v is Commit
17
- export declare function validateCommit(v: unknown): ValidationResult
18
+ export declare function isCommit(v: unknown): v is Commit;
19
+ export declare function validateCommit(v: unknown): ValidationResult;
18
20
  export interface Handle {
19
- seq: number
20
- did: string
21
- handle: string
22
- time: string
23
- [k: string]: unknown
21
+ seq: number;
22
+ did: string;
23
+ handle: string;
24
+ time: string;
25
+ [k: string]: unknown;
24
26
  }
25
- export declare function isHandle(v: unknown): v is Handle
26
- export declare function validateHandle(v: unknown): ValidationResult
27
+ export declare function isHandle(v: unknown): v is Handle;
28
+ export declare function validateHandle(v: unknown): ValidationResult;
27
29
  export interface Migrate {
28
- seq: number
29
- did: string
30
- migrateTo: string | null
31
- time: string
32
- [k: string]: unknown
30
+ seq: number;
31
+ did: string;
32
+ migrateTo: string | null;
33
+ time: string;
34
+ [k: string]: unknown;
33
35
  }
34
- export declare function isMigrate(v: unknown): v is Migrate
35
- export declare function validateMigrate(v: unknown): ValidationResult
36
+ export declare function isMigrate(v: unknown): v is Migrate;
37
+ export declare function validateMigrate(v: unknown): ValidationResult;
36
38
  export interface Tombstone {
37
- seq: number
38
- did: string
39
- time: string
40
- [k: string]: unknown
39
+ seq: number;
40
+ did: string;
41
+ time: string;
42
+ [k: string]: unknown;
41
43
  }
42
- export declare function isTombstone(v: unknown): v is Tombstone
43
- export declare function validateTombstone(v: unknown): ValidationResult
44
+ export declare function isTombstone(v: unknown): v is Tombstone;
45
+ export declare function validateTombstone(v: unknown): ValidationResult;
44
46
  export interface Info {
45
- name: 'OutdatedCursor' | (string & {})
46
- message?: string
47
- [k: string]: unknown
47
+ name: 'OutdatedCursor' | (string & {});
48
+ message?: string;
49
+ [k: string]: unknown;
48
50
  }
49
- export declare function isInfo(v: unknown): v is Info
50
- export declare function validateInfo(v: unknown): ValidationResult
51
+ export declare function isInfo(v: unknown): v is Info;
52
+ export declare function validateInfo(v: unknown): ValidationResult;
51
53
  export interface RepoOp {
52
- action: 'create' | 'update' | 'delete' | (string & {})
53
- path: string
54
- cid: CID | null
55
- [k: string]: unknown
54
+ action: 'create' | 'update' | 'delete' | (string & {});
55
+ path: string;
56
+ cid: CID | null;
57
+ [k: string]: unknown;
56
58
  }
57
- export declare function isRepoOp(v: unknown): v is RepoOp
58
- export declare function validateRepoOp(v: unknown): ValidationResult
59
+ export declare function isRepoOp(v: unknown): v is RepoOp;
60
+ export declare function validateRepoOp(v: unknown): ValidationResult;
@@ -1,13 +1,15 @@
1
1
  import { Headers } from '@atproto/xrpc';
2
2
  export interface QueryParams {
3
- token: string;
4
- platform: 'ios' | 'android' | 'web';
5
- endpoint: string;
6
- appId: string;
7
3
  }
8
- export declare type InputSchema = undefined;
4
+ export interface InputSchema {
5
+ did: string;
6
+ force?: boolean;
7
+ [k: string]: unknown;
8
+ }
9
9
  export interface CallOptions {
10
10
  headers?: Headers;
11
+ qp?: QueryParams;
12
+ encoding: 'application/json';
11
13
  }
12
14
  export interface Response {
13
15
  success: boolean;
@@ -1,5 +1,2 @@
1
- export declare function isObj(v: unknown): v is Record<string, unknown>
2
- export declare function hasProp<K extends PropertyKey>(
3
- data: object,
4
- prop: K,
5
- ): data is Record<K, unknown>
1
+ export declare function isObj(v: unknown): v is Record<string, unknown>;
2
+ export declare function hasProp<K extends PropertyKey>(data: object, prop: K): data is Record<K, unknown>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { AtUri } from '@atproto/uri';
1
+ export { AtUri } from '@atproto/syntax';
2
2
  export { BlobRef, lexToJson, stringifyLex, jsonToLex, jsonStringToLex, } from '@atproto/lexicon';
3
3
  export { parseLanguage } from '@atproto/common-web';
4
4
  export * from './types';