@atproto/api 0.1.2 → 0.1.3

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/build.js CHANGED
@@ -1,8 +1,16 @@
1
+ const pkgJson = require('@npmcli/package-json')
1
2
  const { nodeExternalsPlugin } = require('esbuild-node-externals')
2
3
 
3
4
  const buildShallow =
4
5
  process.argv.includes('--shallow') || process.env.ATP_BUILD_SHALLOW === 'true'
5
6
 
7
+ if (process.argv.includes('--update-main-to-dist')) {
8
+ return pkgJson
9
+ .load(__dirname)
10
+ .then((pkg) => pkg.update({ main: 'dist/index.js' }))
11
+ .then((pkg) => pkg.save())
12
+ }
13
+
6
14
  require('esbuild').build({
7
15
  logLevel: 'info',
8
16
  entryPoints: ['src/index.ts'],
@@ -32,11 +32,14 @@ import * as ComAtprotoSessionCreate from './types/com/atproto/session/create';
32
32
  import * as ComAtprotoSessionDelete from './types/com/atproto/session/delete';
33
33
  import * as ComAtprotoSessionGet from './types/com/atproto/session/get';
34
34
  import * as ComAtprotoSessionRefresh from './types/com/atproto/session/refresh';
35
+ import * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks';
35
36
  import * as ComAtprotoSyncGetCheckout from './types/com/atproto/sync/getCheckout';
36
37
  import * as ComAtprotoSyncGetCommitPath from './types/com/atproto/sync/getCommitPath';
37
38
  import * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead';
38
39
  import * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord';
39
40
  import * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo';
41
+ import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate';
42
+ import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl';
40
43
  import * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile';
41
44
  import * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles';
42
45
  import * as AppBskyActorGetSuggestions from './types/app/bsky/actor/getSuggestions';
@@ -108,11 +111,14 @@ export * as ComAtprotoSessionCreate from './types/com/atproto/session/create';
108
111
  export * as ComAtprotoSessionDelete from './types/com/atproto/session/delete';
109
112
  export * as ComAtprotoSessionGet from './types/com/atproto/session/get';
110
113
  export * as ComAtprotoSessionRefresh from './types/com/atproto/session/refresh';
114
+ export * as ComAtprotoSyncGetBlocks from './types/com/atproto/sync/getBlocks';
111
115
  export * as ComAtprotoSyncGetCheckout from './types/com/atproto/sync/getCheckout';
112
116
  export * as ComAtprotoSyncGetCommitPath from './types/com/atproto/sync/getCommitPath';
113
117
  export * as ComAtprotoSyncGetHead from './types/com/atproto/sync/getHead';
114
118
  export * as ComAtprotoSyncGetRecord from './types/com/atproto/sync/getRecord';
115
119
  export * as ComAtprotoSyncGetRepo from './types/com/atproto/sync/getRepo';
120
+ export * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate';
121
+ export * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl';
116
122
  export * as ComAtprotoSyncSubscribeAllRepos from './types/com/atproto/sync/subscribeAllRepos';
117
123
  export * as AppBskyActorGetProfile from './types/app/bsky/actor/getProfile';
118
124
  export * as AppBskyActorGetProfiles from './types/app/bsky/actor/getProfiles';
@@ -124,6 +130,7 @@ export * as AppBskyActorSearchTypeahead from './types/app/bsky/actor/searchTypea
124
130
  export * as AppBskyActorUpdateProfile from './types/app/bsky/actor/updateProfile';
125
131
  export * as AppBskyEmbedExternal from './types/app/bsky/embed/external';
126
132
  export * as AppBskyEmbedImages from './types/app/bsky/embed/images';
133
+ export * as AppBskyEmbedRecord from './types/app/bsky/embed/record';
127
134
  export * as AppBskyFeedFeedViewPost from './types/app/bsky/feed/feedViewPost';
128
135
  export * as AppBskyFeedGetAuthorFeed from './types/app/bsky/feed/getAuthorFeed';
129
136
  export * as AppBskyFeedGetPostThread from './types/app/bsky/feed/getPostThread';
@@ -265,11 +272,14 @@ export declare class SessionNS {
265
272
  export declare class SyncNS {
266
273
  _service: AtpServiceClient;
267
274
  constructor(service: AtpServiceClient);
275
+ getBlocks(params?: ComAtprotoSyncGetBlocks.QueryParams, opts?: ComAtprotoSyncGetBlocks.CallOptions): Promise<ComAtprotoSyncGetBlocks.Response>;
268
276
  getCheckout(params?: ComAtprotoSyncGetCheckout.QueryParams, opts?: ComAtprotoSyncGetCheckout.CallOptions): Promise<ComAtprotoSyncGetCheckout.Response>;
269
277
  getCommitPath(params?: ComAtprotoSyncGetCommitPath.QueryParams, opts?: ComAtprotoSyncGetCommitPath.CallOptions): Promise<ComAtprotoSyncGetCommitPath.Response>;
270
278
  getHead(params?: ComAtprotoSyncGetHead.QueryParams, opts?: ComAtprotoSyncGetHead.CallOptions): Promise<ComAtprotoSyncGetHead.Response>;
271
279
  getRecord(params?: ComAtprotoSyncGetRecord.QueryParams, opts?: ComAtprotoSyncGetRecord.CallOptions): Promise<ComAtprotoSyncGetRecord.Response>;
272
280
  getRepo(params?: ComAtprotoSyncGetRepo.QueryParams, opts?: ComAtprotoSyncGetRepo.CallOptions): Promise<ComAtprotoSyncGetRepo.Response>;
281
+ notifyOfUpdate(params?: ComAtprotoSyncNotifyOfUpdate.QueryParams, opts?: ComAtprotoSyncNotifyOfUpdate.CallOptions): Promise<ComAtprotoSyncNotifyOfUpdate.Response>;
282
+ requestCrawl(params?: ComAtprotoSyncRequestCrawl.QueryParams, opts?: ComAtprotoSyncRequestCrawl.CallOptions): Promise<ComAtprotoSyncRequestCrawl.Response>;
273
283
  }
274
284
  export declare class AppNS {
275
285
  _service: AtpServiceClient;
@@ -1873,6 +1873,35 @@ export declare const schemaDict: {
1873
1873
  };
1874
1874
  };
1875
1875
  };
1876
+ ComAtprotoSyncGetBlocks: {
1877
+ lexicon: number;
1878
+ id: string;
1879
+ defs: {
1880
+ main: {
1881
+ type: string;
1882
+ description: string;
1883
+ parameters: {
1884
+ type: string;
1885
+ required: string[];
1886
+ properties: {
1887
+ did: {
1888
+ type: string;
1889
+ description: string;
1890
+ };
1891
+ cids: {
1892
+ type: string;
1893
+ items: {
1894
+ type: string;
1895
+ };
1896
+ };
1897
+ };
1898
+ };
1899
+ output: {
1900
+ encoding: string;
1901
+ };
1902
+ };
1903
+ };
1904
+ };
1876
1905
  ComAtprotoSyncGetCheckout: {
1877
1906
  lexicon: number;
1878
1907
  id: string;
@@ -2039,7 +2068,17 @@ export declare const schemaDict: {
2039
2068
  };
2040
2069
  };
2041
2070
  };
2042
- ComAtprotoSyncSubscribeAllRepos: {
2071
+ ComAtprotoSyncNotifyOfUpdate: {
2072
+ lexicon: number;
2073
+ id: string;
2074
+ defs: {
2075
+ main: {
2076
+ type: string;
2077
+ description: string;
2078
+ };
2079
+ };
2080
+ };
2081
+ ComAtprotoSyncRequestCrawl: {
2043
2082
  lexicon: number;
2044
2083
  id: string;
2045
2084
  defs: {
@@ -2048,65 +2087,76 @@ export declare const schemaDict: {
2048
2087
  description: string;
2049
2088
  parameters: {
2050
2089
  type: string;
2090
+ required: string[];
2051
2091
  properties: {
2052
- backfillFrom: {
2092
+ host: {
2053
2093
  type: string;
2054
2094
  description: string;
2055
2095
  };
2056
2096
  };
2057
2097
  };
2058
- message: {
2059
- schema: {
2060
- type: string;
2061
- refs: string[];
2062
- };
2063
- codes: {
2064
- 'lex:com.atproto.sync.subscribeAllRepos#repoAppend': number;
2065
- 'lex:com.atproto.sync.subscribeAllRepos#repoRebase': number;
2066
- };
2067
- };
2068
2098
  };
2069
- repoAppend: {
2099
+ };
2100
+ };
2101
+ ComAtprotoSyncSubscribeAllRepos: {
2102
+ lexicon: number;
2103
+ id: string;
2104
+ defs: {
2105
+ main: {
2070
2106
  type: string;
2071
- required: string[];
2072
- properties: {
2073
- time: {
2074
- type: string;
2075
- };
2076
- repo: {
2077
- type: string;
2078
- };
2079
- commit: {
2080
- type: string;
2081
- };
2082
- prev: {
2083
- type: string;
2084
- };
2085
- blocks: {
2086
- type: string;
2087
- };
2088
- blobs: {
2089
- type: string;
2090
- items: {
2107
+ description: string;
2108
+ parameters: {
2109
+ type: string;
2110
+ properties: {
2111
+ cursor: {
2091
2112
  type: string;
2113
+ description: string;
2092
2114
  };
2093
2115
  };
2094
2116
  };
2095
- };
2096
- repoRebase: {
2097
- type: string;
2098
- required: string[];
2099
- properties: {
2100
- time: {
2101
- type: string;
2102
- };
2103
- repo: {
2104
- type: string;
2105
- };
2106
- commit: {
2117
+ message: {
2118
+ schema: {
2107
2119
  type: string;
2120
+ required: string[];
2121
+ nullable: string[];
2122
+ properties: {
2123
+ seq: {
2124
+ type: string;
2125
+ };
2126
+ event: {
2127
+ type: string;
2128
+ knownValues: string[];
2129
+ };
2130
+ repo: {
2131
+ type: string;
2132
+ };
2133
+ commit: {
2134
+ type: string;
2135
+ };
2136
+ prev: {
2137
+ type: string;
2138
+ };
2139
+ blocks: {
2140
+ type: string;
2141
+ };
2142
+ blobs: {
2143
+ type: string;
2144
+ items: {
2145
+ type: string;
2146
+ };
2147
+ };
2148
+ time: {
2149
+ type: string;
2150
+ };
2151
+ };
2108
2152
  };
2109
2153
  };
2154
+ infos: {
2155
+ name: string;
2156
+ }[];
2157
+ errors: {
2158
+ name: string;
2159
+ }[];
2110
2160
  };
2111
2161
  };
2112
2162
  };
@@ -2525,6 +2575,7 @@ export declare const schemaDict: {
2525
2575
  encoding: string;
2526
2576
  schema: {
2527
2577
  type: string;
2578
+ nullable: string[];
2528
2579
  properties: {
2529
2580
  displayName: {
2530
2581
  type: string;
@@ -2708,6 +2759,61 @@ export declare const schemaDict: {
2708
2759
  };
2709
2760
  };
2710
2761
  };
2762
+ AppBskyEmbedRecord: {
2763
+ lexicon: number;
2764
+ id: string;
2765
+ description: string;
2766
+ defs: {
2767
+ main: {
2768
+ type: string;
2769
+ required: string[];
2770
+ properties: {
2771
+ record: {
2772
+ type: string;
2773
+ ref: string;
2774
+ };
2775
+ };
2776
+ };
2777
+ presented: {
2778
+ type: string;
2779
+ required: string[];
2780
+ properties: {
2781
+ record: {
2782
+ type: string;
2783
+ refs: string[];
2784
+ };
2785
+ };
2786
+ };
2787
+ presentedRecord: {
2788
+ type: string;
2789
+ required: string[];
2790
+ properties: {
2791
+ uri: {
2792
+ type: string;
2793
+ };
2794
+ cid: {
2795
+ type: string;
2796
+ };
2797
+ author: {
2798
+ type: string;
2799
+ ref: string;
2800
+ };
2801
+ record: {
2802
+ type: string;
2803
+ };
2804
+ };
2805
+ };
2806
+ presentedNotFound: {
2807
+ type: string;
2808
+ required: string[];
2809
+ properties: {
2810
+ uri: {
2811
+ type: string;
2812
+ };
2813
+ };
2814
+ };
2815
+ };
2816
+ };
2711
2817
  AppBskyFeedFeedViewPost: {
2712
2818
  lexicon: number;
2713
2819
  id: string;
@@ -3790,11 +3896,14 @@ export declare const ids: {
3790
3896
  ComAtprotoSessionDelete: string;
3791
3897
  ComAtprotoSessionGet: string;
3792
3898
  ComAtprotoSessionRefresh: string;
3899
+ ComAtprotoSyncGetBlocks: string;
3793
3900
  ComAtprotoSyncGetCheckout: string;
3794
3901
  ComAtprotoSyncGetCommitPath: string;
3795
3902
  ComAtprotoSyncGetHead: string;
3796
3903
  ComAtprotoSyncGetRecord: string;
3797
3904
  ComAtprotoSyncGetRepo: string;
3905
+ ComAtprotoSyncNotifyOfUpdate: string;
3906
+ ComAtprotoSyncRequestCrawl: string;
3798
3907
  ComAtprotoSyncSubscribeAllRepos: string;
3799
3908
  AppBskyActorGetProfile: string;
3800
3909
  AppBskyActorGetProfiles: string;
@@ -3806,6 +3915,7 @@ export declare const ids: {
3806
3915
  AppBskyActorUpdateProfile: string;
3807
3916
  AppBskyEmbedExternal: string;
3808
3917
  AppBskyEmbedImages: string;
3918
+ AppBskyEmbedRecord: string;
3809
3919
  AppBskyFeedFeedViewPost: string;
3810
3920
  AppBskyFeedGetAuthorFeed: string;
3811
3921
  AppBskyFeedGetPostThread: string;
@@ -3,17 +3,17 @@ export interface QueryParams {
3
3
  }
4
4
  export interface InputSchema {
5
5
  displayName?: string;
6
- description?: string;
6
+ description?: string | null;
7
7
  avatar?: {
8
8
  cid: string;
9
9
  mimeType: string;
10
10
  [k: string]: unknown;
11
- };
11
+ } | null;
12
12
  banner?: {
13
13
  cid: string;
14
14
  mimeType: string;
15
15
  [k: string]: unknown;
16
- };
16
+ } | null;
17
17
  [k: string]: unknown;
18
18
  }
19
19
  export interface OutputSchema {
@@ -0,0 +1,33 @@
1
+ import { ValidationResult } from '@atproto/lexicon';
2
+ import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef';
3
+ import * as AppBskyActorRef from '../actor/ref';
4
+ export interface Main {
5
+ record: ComAtprotoRepoStrongRef.Main;
6
+ [k: string]: unknown;
7
+ }
8
+ export declare function isMain(v: unknown): v is Main;
9
+ export declare function validateMain(v: unknown): ValidationResult;
10
+ export interface Presented {
11
+ record: PresentedRecord | PresentedNotFound | {
12
+ $type: string;
13
+ [k: string]: unknown;
14
+ };
15
+ [k: string]: unknown;
16
+ }
17
+ export declare function isPresented(v: unknown): v is Presented;
18
+ export declare function validatePresented(v: unknown): ValidationResult;
19
+ export interface PresentedRecord {
20
+ uri: string;
21
+ cid: string;
22
+ author: AppBskyActorRef.WithInfo;
23
+ record: {};
24
+ [k: string]: unknown;
25
+ }
26
+ export declare function isPresentedRecord(v: unknown): v is PresentedRecord;
27
+ export declare function validatePresentedRecord(v: unknown): ValidationResult;
28
+ export interface PresentedNotFound {
29
+ uri: string;
30
+ [k: string]: unknown;
31
+ }
32
+ export declare function isPresentedNotFound(v: unknown): v is PresentedNotFound;
33
+ export declare function validatePresentedNotFound(v: unknown): ValidationResult;
@@ -1,13 +1,14 @@
1
1
  import { ValidationResult } from '@atproto/lexicon';
2
2
  import * as AppBskyEmbedImages from '../embed/images';
3
3
  import * as AppBskyEmbedExternal from '../embed/external';
4
+ import * as AppBskyEmbedRecord from '../embed/record';
4
5
  import * as ComAtprotoRepoStrongRef from '../../../com/atproto/repo/strongRef';
5
6
  import * as AppBskyActorRef from '../actor/ref';
6
7
  export interface Record {
7
8
  text: string;
8
9
  entities?: Entity[];
9
10
  reply?: ReplyRef;
10
- embed?: AppBskyEmbedImages.Main | AppBskyEmbedExternal.Main | {
11
+ embed?: AppBskyEmbedImages.Main | AppBskyEmbedExternal.Main | AppBskyEmbedRecord.Main | {
11
12
  $type: string;
12
13
  [k: string]: unknown;
13
14
  };
@@ -43,7 +44,7 @@ export interface View {
43
44
  cid: string;
44
45
  author: AppBskyActorRef.WithInfo;
45
46
  record: {};
46
- embed?: AppBskyEmbedImages.Presented | AppBskyEmbedExternal.Presented | {
47
+ embed?: AppBskyEmbedImages.Presented | AppBskyEmbedExternal.Presented | AppBskyEmbedRecord.Presented | {
47
48
  $type: string;
48
49
  [k: string]: unknown;
49
50
  };
@@ -0,0 +1,15 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ did: string;
4
+ cids: string[];
5
+ }
6
+ export declare type InputSchema = undefined;
7
+ export interface CallOptions {
8
+ headers?: Headers;
9
+ }
10
+ export interface Response {
11
+ success: boolean;
12
+ headers: Headers;
13
+ data: Uint8Array;
14
+ }
15
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,12 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ }
4
+ export declare type InputSchema = undefined;
5
+ export interface CallOptions {
6
+ headers?: Headers;
7
+ }
8
+ export interface Response {
9
+ success: boolean;
10
+ headers: Headers;
11
+ }
12
+ export declare function toKnownErr(e: any): any;
@@ -0,0 +1,13 @@
1
+ import { Headers } from '@atproto/xrpc';
2
+ export interface QueryParams {
3
+ host?: string;
4
+ }
5
+ export declare type InputSchema = undefined;
6
+ export interface CallOptions {
7
+ headers?: Headers;
8
+ }
9
+ export interface Response {
10
+ success: boolean;
11
+ headers: Headers;
12
+ }
13
+ export declare function toKnownErr(e: any): any;
@@ -1,20 +1 @@
1
- import { ValidationResult } from '@atproto/lexicon';
2
- export interface RepoAppend {
3
- time: string;
4
- repo: string;
5
- commit: string;
6
- prev?: string;
7
- blocks: {};
8
- blobs: string[];
9
- [k: string]: unknown;
10
- }
11
- export declare function isRepoAppend(v: unknown): v is RepoAppend;
12
- export declare function validateRepoAppend(v: unknown): ValidationResult;
13
- export interface RepoRebase {
14
- time: string;
15
- repo: string;
16
- commit: string;
17
- [k: string]: unknown;
18
- }
19
- export declare function isRepoRebase(v: unknown): v is RepoRebase;
20
- export declare function validateRepoRebase(v: unknown): ValidationResult;
1
+ export {};