@atproto/api 0.3.3 → 0.3.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.
Files changed (28) hide show
  1. package/bench/agent.bench.ts +9 -0
  2. package/dist/client/lexicons.d.ts +38 -0
  3. package/dist/client/types/app/bsky/feed/describeFeedGenerator.d.ts +33 -0
  4. package/dist/client/types/app/bsky/feed/generator.d.ts +1 -1
  5. package/dist/client/types/app/bsky/feed/getFeed.d.ts +4 -1
  6. package/dist/client/types/app/bsky/feed/getFeedGenerator.d.ts +21 -0
  7. package/dist/client/types/app/bsky/feed/getFeedSkeleton.d.ts +4 -1
  8. package/dist/client/types/app/bsky/feed/getSavedFeeds.d.ts +21 -0
  9. package/dist/client/types/app/bsky/feed/saveFeed.d.ts +17 -0
  10. package/dist/client/types/app/bsky/feed/unsaveFeed.d.ts +17 -0
  11. package/dist/client/types/com/atproto/admin/defs.d.ts +14 -2
  12. package/dist/client/types/com/atproto/admin/getModerationReports.d.ts +1 -0
  13. package/dist/client/types/com/atproto/admin/getRecord.d.ts +4 -1
  14. package/dist/client/types/com/atproto/admin/getRepo.d.ts +4 -1
  15. package/dist/client/types/com/atproto/server/createAccount.d.ts +7 -0
  16. package/dist/index.js +8910 -9
  17. package/dist/index.js.map +4 -4
  18. package/jest.bench.config.js +8 -0
  19. package/package.json +4 -2
  20. package/src/client/lexicons.ts +56 -0
  21. package/src/client/types/com/atproto/admin/defs.ts +46 -2
  22. package/src/client/types/com/atproto/admin/getModerationReports.ts +6 -0
  23. package/src/client/types/com/atproto/admin/getRecord.ts +7 -0
  24. package/src/client/types/com/atproto/admin/getRepo.ts +7 -0
  25. package/src/client/types/com/atproto/server/createAccount.ts +15 -0
  26. package/tests/agent.test.ts +63 -0
  27. package/tests/bsky-agent.test.ts +63 -0
  28. package/tsconfig.build.tsbuildinfo +1 -1
@@ -0,0 +1,9 @@
1
+ import { BskyAgent } from "@atproto/api";
2
+
3
+ describe('Agent Benchmarks', () => {
4
+ it('Creates new Agent instance 10 times', () => {
5
+ for (let i = 0; i < 10; i++) {
6
+ new BskyAgent({ service: 'https://bsky.social' });
7
+ }
8
+ })
9
+ })
@@ -327,6 +327,16 @@ export declare const schemaDict: {
327
327
  };
328
328
  };
329
329
  };
330
+ repoViewNotFound: {
331
+ type: string;
332
+ required: string[];
333
+ properties: {
334
+ did: {
335
+ type: string;
336
+ format: string;
337
+ };
338
+ };
339
+ };
330
340
  repoRef: {
331
341
  type: string;
332
342
  required: string[];
@@ -416,6 +426,16 @@ export declare const schemaDict: {
416
426
  };
417
427
  };
418
428
  };
429
+ recordViewNotFound: {
430
+ type: string;
431
+ required: string[];
432
+ properties: {
433
+ uri: {
434
+ type: string;
435
+ format: string;
436
+ };
437
+ };
438
+ };
419
439
  moderation: {
420
440
  type: string;
421
441
  required: never[];
@@ -745,6 +765,10 @@ export declare const schemaDict: {
745
765
  resolved: {
746
766
  type: string;
747
767
  };
768
+ actionType: {
769
+ type: string;
770
+ knownValues: string[];
771
+ };
748
772
  limit: {
749
773
  type: string;
750
774
  minimum: number;
@@ -806,6 +830,9 @@ export declare const schemaDict: {
806
830
  ref: string;
807
831
  };
808
832
  };
833
+ errors: {
834
+ name: string;
835
+ }[];
809
836
  };
810
837
  };
811
838
  };
@@ -833,6 +860,9 @@ export declare const schemaDict: {
833
860
  ref: string;
834
861
  };
835
862
  };
863
+ errors: {
864
+ name: string;
865
+ }[];
836
866
  };
837
867
  };
838
868
  };
@@ -1439,6 +1469,7 @@ export declare const schemaDict: {
1439
1469
  };
1440
1470
  rkey: {
1441
1471
  type: string;
1472
+ maxLength: number;
1442
1473
  };
1443
1474
  value: {
1444
1475
  type: string;
@@ -1456,6 +1487,7 @@ export declare const schemaDict: {
1456
1487
  };
1457
1488
  rkey: {
1458
1489
  type: string;
1490
+ maxLength: number;
1459
1491
  };
1460
1492
  value: {
1461
1493
  type: string;
@@ -1504,6 +1536,7 @@ export declare const schemaDict: {
1504
1536
  rkey: {
1505
1537
  type: string;
1506
1538
  description: string;
1539
+ maxLength: number;
1507
1540
  };
1508
1541
  validate: {
1509
1542
  type: string;
@@ -1808,6 +1841,7 @@ export declare const schemaDict: {
1808
1841
  rkey: {
1809
1842
  type: string;
1810
1843
  description: string;
1844
+ maxLength: number;
1811
1845
  };
1812
1846
  validate: {
1813
1847
  type: string;
@@ -1952,6 +1986,10 @@ export declare const schemaDict: {
1952
1986
  type: string;
1953
1987
  format: string;
1954
1988
  };
1989
+ did: {
1990
+ type: string;
1991
+ format: string;
1992
+ };
1955
1993
  inviteCode: {
1956
1994
  type: string;
1957
1995
  };
@@ -0,0 +1,33 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ import { ValidationResult } from '@atproto/lexicon';
3
+ export interface QueryParams {
4
+ }
5
+ export declare type InputSchema = undefined;
6
+ export interface OutputSchema {
7
+ did: string;
8
+ feeds: Feed[];
9
+ links?: Links;
10
+ [k: string]: unknown;
11
+ }
12
+ export interface CallOptions {
13
+ headers?: Headers;
14
+ }
15
+ export interface Response {
16
+ success: boolean;
17
+ headers: Headers;
18
+ data: OutputSchema;
19
+ }
20
+ export declare function toKnownErr(e: any): any;
21
+ export interface Feed {
22
+ uri: string;
23
+ [k: string]: unknown;
24
+ }
25
+ export declare function isFeed(v: unknown): v is Feed;
26
+ export declare function validateFeed(v: unknown): ValidationResult;
27
+ export interface Links {
28
+ privacyPolicy?: string;
29
+ termsOfService?: string;
30
+ [k: string]: unknown;
31
+ }
32
+ export declare function isLinks(v: unknown): v is Links;
33
+ export declare function validateLinks(v: unknown): ValidationResult;
@@ -2,7 +2,7 @@ import { ValidationResult, BlobRef } from '@atproto/lexicon';
2
2
  import * as AppBskyRichtextFacet from '../richtext/facet';
3
3
  export interface Record {
4
4
  did: string;
5
- displayName?: string;
5
+ displayName: string;
6
6
  description?: string;
7
7
  descriptionFacets?: AppBskyRichtextFacet.Main[];
8
8
  avatar?: BlobRef;
@@ -1,4 +1,4 @@
1
- import { Headers } from '@atproto/xrpc';
1
+ import { Headers, XRPCError } from '@atproto/xrpc';
2
2
  import * as AppBskyFeedDefs from './defs';
3
3
  export interface QueryParams {
4
4
  feed: string;
@@ -19,4 +19,7 @@ export interface Response {
19
19
  headers: Headers;
20
20
  data: OutputSchema;
21
21
  }
22
+ export declare class UnknownFeedError extends XRPCError {
23
+ constructor(src: XRPCError);
24
+ }
22
25
  export declare function toKnownErr(e: any): any;
@@ -0,0 +1,21 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ import * as AppBskyFeedDefs from './defs';
3
+ export interface QueryParams {
4
+ feed: string;
5
+ }
6
+ export declare type InputSchema = undefined;
7
+ export interface OutputSchema {
8
+ view: AppBskyFeedDefs.GeneratorView;
9
+ isOnline: boolean;
10
+ isValid: boolean;
11
+ [k: string]: unknown;
12
+ }
13
+ export interface CallOptions {
14
+ headers?: Headers;
15
+ }
16
+ export interface Response {
17
+ success: boolean;
18
+ headers: Headers;
19
+ data: OutputSchema;
20
+ }
21
+ export declare function toKnownErr(e: any): any;
@@ -1,4 +1,4 @@
1
- import { Headers } from '@atproto/xrpc';
1
+ import { Headers, XRPCError } from '@atproto/xrpc';
2
2
  import * as AppBskyFeedDefs from './defs';
3
3
  export interface QueryParams {
4
4
  feed: string;
@@ -19,4 +19,7 @@ export interface Response {
19
19
  headers: Headers;
20
20
  data: OutputSchema;
21
21
  }
22
+ export declare class UnknownFeedError extends XRPCError {
23
+ constructor(src: XRPCError);
24
+ }
22
25
  export declare function toKnownErr(e: any): any;
@@ -0,0 +1,21 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ import * as AppBskyFeedDefs from './defs';
3
+ export interface QueryParams {
4
+ limit?: number;
5
+ cursor?: string;
6
+ }
7
+ export declare type InputSchema = undefined;
8
+ export interface OutputSchema {
9
+ cursor?: string;
10
+ feeds: AppBskyFeedDefs.GeneratorView[];
11
+ [k: string]: unknown;
12
+ }
13
+ export interface CallOptions {
14
+ headers?: Headers;
15
+ }
16
+ export interface Response {
17
+ success: boolean;
18
+ headers: Headers;
19
+ data: OutputSchema;
20
+ }
21
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,17 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ }
4
+ export interface InputSchema {
5
+ feed: string;
6
+ [k: string]: unknown;
7
+ }
8
+ export interface CallOptions {
9
+ headers?: Headers;
10
+ qp?: QueryParams;
11
+ encoding: 'application/json';
12
+ }
13
+ export interface Response {
14
+ success: boolean;
15
+ headers: Headers;
16
+ }
17
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,17 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ }
4
+ export interface InputSchema {
5
+ feed: string;
6
+ [k: string]: unknown;
7
+ }
8
+ export interface CallOptions {
9
+ headers?: Headers;
10
+ qp?: QueryParams;
11
+ encoding: 'application/json';
12
+ }
13
+ export interface Response {
14
+ success: boolean;
15
+ headers: Headers;
16
+ }
17
+ export declare function toKnownErr(e: any): any;
@@ -25,7 +25,7 @@ export declare function validateActionView(v: unknown): ValidationResult;
25
25
  export interface ActionViewDetail {
26
26
  id: number;
27
27
  action: ActionType;
28
- subject: RepoView | RecordView | {
28
+ subject: RepoView | RepoViewNotFound | RecordView | RecordViewNotFound | {
29
29
  $type: string;
30
30
  [k: string]: unknown;
31
31
  };
@@ -80,7 +80,7 @@ export interface ReportViewDetail {
80
80
  id: number;
81
81
  reasonType: ComAtprotoModerationDefs.ReasonType;
82
82
  reason?: string;
83
- subject: RepoView | RecordView | {
83
+ subject: RepoView | RepoViewNotFound | RecordView | RecordViewNotFound | {
84
84
  $type: string;
85
85
  [k: string]: unknown;
86
86
  };
@@ -119,6 +119,12 @@ export interface RepoViewDetail {
119
119
  }
120
120
  export declare function isRepoViewDetail(v: unknown): v is RepoViewDetail;
121
121
  export declare function validateRepoViewDetail(v: unknown): ValidationResult;
122
+ export interface RepoViewNotFound {
123
+ did: string;
124
+ [k: string]: unknown;
125
+ }
126
+ export declare function isRepoViewNotFound(v: unknown): v is RepoViewNotFound;
127
+ export declare function validateRepoViewNotFound(v: unknown): ValidationResult;
122
128
  export interface RepoRef {
123
129
  did: string;
124
130
  [k: string]: unknown;
@@ -150,6 +156,12 @@ export interface RecordViewDetail {
150
156
  }
151
157
  export declare function isRecordViewDetail(v: unknown): v is RecordViewDetail;
152
158
  export declare function validateRecordViewDetail(v: unknown): ValidationResult;
159
+ export interface RecordViewNotFound {
160
+ uri: string;
161
+ [k: string]: unknown;
162
+ }
163
+ export declare function isRecordViewNotFound(v: unknown): v is RecordViewNotFound;
164
+ export declare function validateRecordViewNotFound(v: unknown): ValidationResult;
153
165
  export interface Moderation {
154
166
  currentAction?: ActionViewCurrent;
155
167
  [k: string]: unknown;
@@ -3,6 +3,7 @@ import * as ComAtprotoAdminDefs from './defs';
3
3
  export interface QueryParams {
4
4
  subject?: string;
5
5
  resolved?: boolean;
6
+ actionType?: 'com.atproto.admin.defs#takedown' | 'com.atproto.admin.defs#flag' | 'com.atproto.admin.defs#acknowledge' | 'com.atproto.admin.defs#escalate' | (string & {});
6
7
  limit?: number;
7
8
  cursor?: string;
8
9
  }
@@ -1,4 +1,4 @@
1
- import { Headers } from '@atproto/xrpc';
1
+ import { Headers, XRPCError } from '@atproto/xrpc';
2
2
  import * as ComAtprotoAdminDefs from './defs';
3
3
  export interface QueryParams {
4
4
  uri: string;
@@ -14,4 +14,7 @@ export interface Response {
14
14
  headers: Headers;
15
15
  data: OutputSchema;
16
16
  }
17
+ export declare class RecordNotFoundError extends XRPCError {
18
+ constructor(src: XRPCError);
19
+ }
17
20
  export declare function toKnownErr(e: any): any;
@@ -1,4 +1,4 @@
1
- import { Headers } from '@atproto/xrpc';
1
+ import { Headers, XRPCError } from '@atproto/xrpc';
2
2
  import * as ComAtprotoAdminDefs from './defs';
3
3
  export interface QueryParams {
4
4
  did: string;
@@ -13,4 +13,7 @@ export interface Response {
13
13
  headers: Headers;
14
14
  data: OutputSchema;
15
15
  }
16
+ export declare class RepoNotFoundError extends XRPCError {
17
+ constructor(src: XRPCError);
18
+ }
16
19
  export declare function toKnownErr(e: any): any;
@@ -4,6 +4,7 @@ export interface QueryParams {
4
4
  export interface InputSchema {
5
5
  email: string;
6
6
  handle: string;
7
+ did?: string;
7
8
  inviteCode?: string;
8
9
  password: string;
9
10
  recoveryKey?: string;
@@ -41,4 +42,10 @@ export declare class HandleNotAvailableError extends XRPCError {
41
42
  export declare class UnsupportedDomainError extends XRPCError {
42
43
  constructor(src: XRPCError);
43
44
  }
45
+ export declare class UnresolvableDidError extends XRPCError {
46
+ constructor(src: XRPCError);
47
+ }
48
+ export declare class IncompatibleDidDocError extends XRPCError {
49
+ constructor(src: XRPCError);
50
+ }
44
51
  export declare function toKnownErr(e: any): any;