@atproto/api 0.9.3 → 0.9.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.
- package/CHANGELOG.md +13 -0
- package/dist/agent.d.ts +1 -1
- package/dist/bsky-agent.d.ts +2 -1
- package/dist/client/index.d.ts +6 -0
- package/dist/client/lexicons.d.ts +134 -0
- package/dist/client/types/app/bsky/actor/defs.d.ts +7 -1
- package/dist/client/types/app/bsky/graph/defs.d.ts +15 -0
- package/dist/client/types/app/bsky/graph/getRelationships.d.ts +27 -0
- package/dist/client/types/com/atproto/temp/checkSignupQueue.d.ts +19 -0
- package/dist/index.js +374 -155
- package/dist/index.js.map +3 -3
- package/dist/types.d.ts +5 -0
- package/package.json +2 -2
- package/src/agent.ts +2 -2
- package/src/bsky-agent.ts +27 -0
- package/src/client/index.ts +26 -0
- package/src/client/lexicons.ts +146 -0
- package/src/client/types/app/bsky/actor/defs.ts +19 -0
- package/src/client/types/app/bsky/graph/defs.ts +41 -0
- package/src/client/types/app/bsky/graph/getRelationships.ts +49 -0
- package/src/client/types/com/atproto/temp/checkSignupQueue.ts +35 -0
- package/src/types.ts +9 -0
- package/tests/bsky-agent.test.ts +109 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atproto/api
|
|
2
2
|
|
|
3
|
+
## 0.9.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#2090](https://github.com/bluesky-social/atproto/pull/2090) [`8994d363`](https://github.com/bluesky-social/atproto/commit/8994d3633adad1c02569d6d44ae896e18195e8e2) Thanks [@dholms](https://github.com/dholms)! - add checkSignupQueue method and expose refreshSession on agent
|
|
8
|
+
|
|
9
|
+
## 0.9.4
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#2086](https://github.com/bluesky-social/atproto/pull/2086) [`4171c04a`](https://github.com/bluesky-social/atproto/commit/4171c04ad81c5734a4558bc41fa1c4f3a1aba18c) Thanks [@estrattonbailey](https://github.com/estrattonbailey)! - Add `setInterestsPref` method to BskyAgent, and `interests` prop to
|
|
14
|
+
`getPreferences` response.
|
|
15
|
+
|
|
3
16
|
## 0.9.3
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/agent.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare class AtpAgent {
|
|
|
19
19
|
resumeSession(session: AtpSessionData): Promise<ComAtprotoServerGetSession.Response>;
|
|
20
20
|
private _addAuthHeader;
|
|
21
21
|
private _fetch;
|
|
22
|
-
|
|
22
|
+
refreshSession(): Promise<void>;
|
|
23
23
|
private _refreshSessionInner;
|
|
24
24
|
uploadBlob: typeof this.api.com.atproto.repo.uploadBlob;
|
|
25
25
|
resolveHandle: typeof this.api.com.atproto.identity.resolveHandle;
|
package/dist/bsky-agent.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AtpAgent } from './agent';
|
|
2
2
|
import { AppBskyFeedPost, AppBskyActorProfile } from './client';
|
|
3
|
-
import { BskyPreferences, BskyLabelPreference, BskyFeedViewPreference, BskyThreadViewPreference } from './types';
|
|
3
|
+
import { BskyPreferences, BskyLabelPreference, BskyFeedViewPreference, BskyThreadViewPreference, BskyInterestsPreference } from './types';
|
|
4
4
|
declare global {
|
|
5
5
|
interface Array<T> {
|
|
6
6
|
findLast(predicate: (value: T, index: number, obj: T[]) => unknown, thisArg?: any): T;
|
|
@@ -84,4 +84,5 @@ export declare class BskyAgent extends AtpAgent {
|
|
|
84
84
|
}): Promise<void>;
|
|
85
85
|
setFeedViewPrefs(feed: string, pref: Partial<BskyFeedViewPreference>): Promise<void>;
|
|
86
86
|
setThreadViewPrefs(pref: Partial<BskyThreadViewPreference>): Promise<void>;
|
|
87
|
+
setInterestsPref(pref: Partial<BskyInterestsPreference>): Promise<void>;
|
|
87
88
|
}
|
package/dist/client/index.d.ts
CHANGED
|
@@ -66,6 +66,7 @@ import * as ComAtprotoSyncListBlobs from './types/com/atproto/sync/listBlobs';
|
|
|
66
66
|
import * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos';
|
|
67
67
|
import * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate';
|
|
68
68
|
import * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl';
|
|
69
|
+
import * as ComAtprotoTempCheckSignupQueue from './types/com/atproto/temp/checkSignupQueue';
|
|
69
70
|
import * as ComAtprotoTempFetchLabels from './types/com/atproto/temp/fetchLabels';
|
|
70
71
|
import * as ComAtprotoTempImportRepo from './types/com/atproto/temp/importRepo';
|
|
71
72
|
import * as ComAtprotoTempPushBlob from './types/com/atproto/temp/pushBlob';
|
|
@@ -110,6 +111,7 @@ import * as AppBskyGraphGetListBlocks from './types/app/bsky/graph/getListBlocks
|
|
|
110
111
|
import * as AppBskyGraphGetListMutes from './types/app/bsky/graph/getListMutes';
|
|
111
112
|
import * as AppBskyGraphGetLists from './types/app/bsky/graph/getLists';
|
|
112
113
|
import * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes';
|
|
114
|
+
import * as AppBskyGraphGetRelationships from './types/app/bsky/graph/getRelationships';
|
|
113
115
|
import * as AppBskyGraphGetSuggestedFollowsByActor from './types/app/bsky/graph/getSuggestedFollowsByActor';
|
|
114
116
|
import * as AppBskyGraphList from './types/app/bsky/graph/list';
|
|
115
117
|
import * as AppBskyGraphListblock from './types/app/bsky/graph/listblock';
|
|
@@ -201,6 +203,7 @@ export * as ComAtprotoSyncListRepos from './types/com/atproto/sync/listRepos';
|
|
|
201
203
|
export * as ComAtprotoSyncNotifyOfUpdate from './types/com/atproto/sync/notifyOfUpdate';
|
|
202
204
|
export * as ComAtprotoSyncRequestCrawl from './types/com/atproto/sync/requestCrawl';
|
|
203
205
|
export * as ComAtprotoSyncSubscribeRepos from './types/com/atproto/sync/subscribeRepos';
|
|
206
|
+
export * as ComAtprotoTempCheckSignupQueue from './types/com/atproto/temp/checkSignupQueue';
|
|
204
207
|
export * as ComAtprotoTempFetchLabels from './types/com/atproto/temp/fetchLabels';
|
|
205
208
|
export * as ComAtprotoTempImportRepo from './types/com/atproto/temp/importRepo';
|
|
206
209
|
export * as ComAtprotoTempPushBlob from './types/com/atproto/temp/pushBlob';
|
|
@@ -252,6 +255,7 @@ export * as AppBskyGraphGetListBlocks from './types/app/bsky/graph/getListBlocks
|
|
|
252
255
|
export * as AppBskyGraphGetListMutes from './types/app/bsky/graph/getListMutes';
|
|
253
256
|
export * as AppBskyGraphGetLists from './types/app/bsky/graph/getLists';
|
|
254
257
|
export * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes';
|
|
258
|
+
export * as AppBskyGraphGetRelationships from './types/app/bsky/graph/getRelationships';
|
|
255
259
|
export * as AppBskyGraphGetSuggestedFollowsByActor from './types/app/bsky/graph/getSuggestedFollowsByActor';
|
|
256
260
|
export * as AppBskyGraphList from './types/app/bsky/graph/list';
|
|
257
261
|
export * as AppBskyGraphListblock from './types/app/bsky/graph/listblock';
|
|
@@ -417,6 +421,7 @@ export declare class ComAtprotoSyncNS {
|
|
|
417
421
|
export declare class ComAtprotoTempNS {
|
|
418
422
|
_service: AtpServiceClient;
|
|
419
423
|
constructor(service: AtpServiceClient);
|
|
424
|
+
checkSignupQueue(params?: ComAtprotoTempCheckSignupQueue.QueryParams, opts?: ComAtprotoTempCheckSignupQueue.CallOptions): Promise<ComAtprotoTempCheckSignupQueue.Response>;
|
|
420
425
|
fetchLabels(params?: ComAtprotoTempFetchLabels.QueryParams, opts?: ComAtprotoTempFetchLabels.CallOptions): Promise<ComAtprotoTempFetchLabels.Response>;
|
|
421
426
|
importRepo(data?: ComAtprotoTempImportRepo.InputSchema, opts?: ComAtprotoTempImportRepo.CallOptions): Promise<ComAtprotoTempImportRepo.Response>;
|
|
422
427
|
pushBlob(data?: ComAtprotoTempPushBlob.InputSchema, opts?: ComAtprotoTempPushBlob.CallOptions): Promise<ComAtprotoTempPushBlob.Response>;
|
|
@@ -622,6 +627,7 @@ export declare class AppBskyGraphNS {
|
|
|
622
627
|
getListMutes(params?: AppBskyGraphGetListMutes.QueryParams, opts?: AppBskyGraphGetListMutes.CallOptions): Promise<AppBskyGraphGetListMutes.Response>;
|
|
623
628
|
getLists(params?: AppBskyGraphGetLists.QueryParams, opts?: AppBskyGraphGetLists.CallOptions): Promise<AppBskyGraphGetLists.Response>;
|
|
624
629
|
getMutes(params?: AppBskyGraphGetMutes.QueryParams, opts?: AppBskyGraphGetMutes.CallOptions): Promise<AppBskyGraphGetMutes.Response>;
|
|
630
|
+
getRelationships(params?: AppBskyGraphGetRelationships.QueryParams, opts?: AppBskyGraphGetRelationships.CallOptions): Promise<AppBskyGraphGetRelationships.Response>;
|
|
625
631
|
getSuggestedFollowsByActor(params?: AppBskyGraphGetSuggestedFollowsByActor.QueryParams, opts?: AppBskyGraphGetSuggestedFollowsByActor.CallOptions): Promise<AppBskyGraphGetSuggestedFollowsByActor.Response>;
|
|
626
632
|
muteActor(data?: AppBskyGraphMuteActor.InputSchema, opts?: AppBskyGraphMuteActor.CallOptions): Promise<AppBskyGraphMuteActor.Response>;
|
|
627
633
|
muteActorList(data?: AppBskyGraphMuteActorList.InputSchema, opts?: AppBskyGraphMuteActorList.CallOptions): Promise<AppBskyGraphMuteActorList.Response>;
|
|
@@ -3906,6 +3906,34 @@ export declare const schemaDict: {
|
|
|
3906
3906
|
};
|
|
3907
3907
|
};
|
|
3908
3908
|
};
|
|
3909
|
+
ComAtprotoTempCheckSignupQueue: {
|
|
3910
|
+
lexicon: number;
|
|
3911
|
+
id: string;
|
|
3912
|
+
defs: {
|
|
3913
|
+
main: {
|
|
3914
|
+
type: string;
|
|
3915
|
+
description: string;
|
|
3916
|
+
output: {
|
|
3917
|
+
encoding: string;
|
|
3918
|
+
schema: {
|
|
3919
|
+
type: string;
|
|
3920
|
+
required: string[];
|
|
3921
|
+
properties: {
|
|
3922
|
+
activated: {
|
|
3923
|
+
type: string;
|
|
3924
|
+
};
|
|
3925
|
+
placeInQueue: {
|
|
3926
|
+
type: string;
|
|
3927
|
+
};
|
|
3928
|
+
estimatedTimeMs: {
|
|
3929
|
+
type: string;
|
|
3930
|
+
};
|
|
3931
|
+
};
|
|
3932
|
+
};
|
|
3933
|
+
};
|
|
3934
|
+
};
|
|
3935
|
+
};
|
|
3936
|
+
};
|
|
3909
3937
|
ComAtprotoTempFetchLabels: {
|
|
3910
3938
|
lexicon: number;
|
|
3911
3939
|
id: string;
|
|
@@ -4344,6 +4372,22 @@ export declare const schemaDict: {
|
|
|
4344
4372
|
};
|
|
4345
4373
|
};
|
|
4346
4374
|
};
|
|
4375
|
+
interestsPref: {
|
|
4376
|
+
type: string;
|
|
4377
|
+
required: string[];
|
|
4378
|
+
properties: {
|
|
4379
|
+
tags: {
|
|
4380
|
+
type: string;
|
|
4381
|
+
maxLength: number;
|
|
4382
|
+
items: {
|
|
4383
|
+
type: string;
|
|
4384
|
+
maxLength: number;
|
|
4385
|
+
maxGraphemes: number;
|
|
4386
|
+
};
|
|
4387
|
+
description: string;
|
|
4388
|
+
};
|
|
4389
|
+
};
|
|
4390
|
+
};
|
|
4347
4391
|
};
|
|
4348
4392
|
};
|
|
4349
4393
|
AppBskyActorGetPreferences: {
|
|
@@ -6461,6 +6505,42 @@ export declare const schemaDict: {
|
|
|
6461
6505
|
};
|
|
6462
6506
|
};
|
|
6463
6507
|
};
|
|
6508
|
+
notFoundActor: {
|
|
6509
|
+
type: string;
|
|
6510
|
+
description: string;
|
|
6511
|
+
required: string[];
|
|
6512
|
+
properties: {
|
|
6513
|
+
actor: {
|
|
6514
|
+
type: string;
|
|
6515
|
+
format: string;
|
|
6516
|
+
};
|
|
6517
|
+
notFound: {
|
|
6518
|
+
type: string;
|
|
6519
|
+
const: boolean;
|
|
6520
|
+
};
|
|
6521
|
+
};
|
|
6522
|
+
};
|
|
6523
|
+
relationship: {
|
|
6524
|
+
type: string;
|
|
6525
|
+
description: string;
|
|
6526
|
+
required: string[];
|
|
6527
|
+
properties: {
|
|
6528
|
+
did: {
|
|
6529
|
+
type: string;
|
|
6530
|
+
format: string;
|
|
6531
|
+
};
|
|
6532
|
+
following: {
|
|
6533
|
+
type: string;
|
|
6534
|
+
format: string;
|
|
6535
|
+
description: string;
|
|
6536
|
+
};
|
|
6537
|
+
followedBy: {
|
|
6538
|
+
type: string;
|
|
6539
|
+
format: string;
|
|
6540
|
+
description: string;
|
|
6541
|
+
};
|
|
6542
|
+
};
|
|
6543
|
+
};
|
|
6464
6544
|
};
|
|
6465
6545
|
};
|
|
6466
6546
|
AppBskyGraphFollow: {
|
|
@@ -6864,6 +6944,58 @@ export declare const schemaDict: {
|
|
|
6864
6944
|
};
|
|
6865
6945
|
};
|
|
6866
6946
|
};
|
|
6947
|
+
AppBskyGraphGetRelationships: {
|
|
6948
|
+
lexicon: number;
|
|
6949
|
+
id: string;
|
|
6950
|
+
defs: {
|
|
6951
|
+
main: {
|
|
6952
|
+
type: string;
|
|
6953
|
+
description: string;
|
|
6954
|
+
parameters: {
|
|
6955
|
+
type: string;
|
|
6956
|
+
required: string[];
|
|
6957
|
+
properties: {
|
|
6958
|
+
actor: {
|
|
6959
|
+
type: string;
|
|
6960
|
+
format: string;
|
|
6961
|
+
};
|
|
6962
|
+
others: {
|
|
6963
|
+
type: string;
|
|
6964
|
+
maxLength: number;
|
|
6965
|
+
items: {
|
|
6966
|
+
type: string;
|
|
6967
|
+
format: string;
|
|
6968
|
+
};
|
|
6969
|
+
};
|
|
6970
|
+
};
|
|
6971
|
+
};
|
|
6972
|
+
output: {
|
|
6973
|
+
encoding: string;
|
|
6974
|
+
schema: {
|
|
6975
|
+
type: string;
|
|
6976
|
+
required: string[];
|
|
6977
|
+
properties: {
|
|
6978
|
+
actor: {
|
|
6979
|
+
type: string;
|
|
6980
|
+
format: string;
|
|
6981
|
+
};
|
|
6982
|
+
relationships: {
|
|
6983
|
+
type: string;
|
|
6984
|
+
items: {
|
|
6985
|
+
type: string;
|
|
6986
|
+
refs: string[];
|
|
6987
|
+
};
|
|
6988
|
+
};
|
|
6989
|
+
};
|
|
6990
|
+
};
|
|
6991
|
+
};
|
|
6992
|
+
errors: {
|
|
6993
|
+
name: string;
|
|
6994
|
+
description: string;
|
|
6995
|
+
}[];
|
|
6996
|
+
};
|
|
6997
|
+
};
|
|
6998
|
+
};
|
|
6867
6999
|
AppBskyGraphGetSuggestedFollowsByActor: {
|
|
6868
7000
|
lexicon: number;
|
|
6869
7001
|
id: string;
|
|
@@ -7710,6 +7842,7 @@ export declare const ids: {
|
|
|
7710
7842
|
ComAtprotoSyncNotifyOfUpdate: string;
|
|
7711
7843
|
ComAtprotoSyncRequestCrawl: string;
|
|
7712
7844
|
ComAtprotoSyncSubscribeRepos: string;
|
|
7845
|
+
ComAtprotoTempCheckSignupQueue: string;
|
|
7713
7846
|
ComAtprotoTempFetchLabels: string;
|
|
7714
7847
|
ComAtprotoTempImportRepo: string;
|
|
7715
7848
|
ComAtprotoTempPushBlob: string;
|
|
@@ -7761,6 +7894,7 @@ export declare const ids: {
|
|
|
7761
7894
|
AppBskyGraphGetListMutes: string;
|
|
7762
7895
|
AppBskyGraphGetLists: string;
|
|
7763
7896
|
AppBskyGraphGetMutes: string;
|
|
7897
|
+
AppBskyGraphGetRelationships: string;
|
|
7764
7898
|
AppBskyGraphGetSuggestedFollowsByActor: string;
|
|
7765
7899
|
AppBskyGraphList: string;
|
|
7766
7900
|
AppBskyGraphListblock: string;
|
|
@@ -54,7 +54,7 @@ export interface ViewerState {
|
|
|
54
54
|
}
|
|
55
55
|
export declare function isViewerState(v: unknown): v is ViewerState;
|
|
56
56
|
export declare function validateViewerState(v: unknown): ValidationResult;
|
|
57
|
-
export type Preferences = (AdultContentPref | ContentLabelPref | SavedFeedsPref | PersonalDetailsPref | FeedViewPref | ThreadViewPref | {
|
|
57
|
+
export type Preferences = (AdultContentPref | ContentLabelPref | SavedFeedsPref | PersonalDetailsPref | FeedViewPref | ThreadViewPref | InterestsPref | {
|
|
58
58
|
$type: string;
|
|
59
59
|
[k: string]: unknown;
|
|
60
60
|
})[];
|
|
@@ -102,3 +102,9 @@ export interface ThreadViewPref {
|
|
|
102
102
|
}
|
|
103
103
|
export declare function isThreadViewPref(v: unknown): v is ThreadViewPref;
|
|
104
104
|
export declare function validateThreadViewPref(v: unknown): ValidationResult;
|
|
105
|
+
export interface InterestsPref {
|
|
106
|
+
tags: string[];
|
|
107
|
+
[k: string]: unknown;
|
|
108
|
+
}
|
|
109
|
+
export declare function isInterestsPref(v: unknown): v is InterestsPref;
|
|
110
|
+
export declare function validateInterestsPref(v: unknown): ValidationResult;
|
|
@@ -45,3 +45,18 @@ export interface ListViewerState {
|
|
|
45
45
|
}
|
|
46
46
|
export declare function isListViewerState(v: unknown): v is ListViewerState;
|
|
47
47
|
export declare function validateListViewerState(v: unknown): ValidationResult;
|
|
48
|
+
export interface NotFoundActor {
|
|
49
|
+
actor: string;
|
|
50
|
+
notFound: true;
|
|
51
|
+
[k: string]: unknown;
|
|
52
|
+
}
|
|
53
|
+
export declare function isNotFoundActor(v: unknown): v is NotFoundActor;
|
|
54
|
+
export declare function validateNotFoundActor(v: unknown): ValidationResult;
|
|
55
|
+
export interface Relationship {
|
|
56
|
+
did: string;
|
|
57
|
+
following?: string;
|
|
58
|
+
followedBy?: string;
|
|
59
|
+
[k: string]: unknown;
|
|
60
|
+
}
|
|
61
|
+
export declare function isRelationship(v: unknown): v is Relationship;
|
|
62
|
+
export declare function validateRelationship(v: unknown): ValidationResult;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Headers, XRPCError } from '@atproto/xrpc';
|
|
2
|
+
import * as AppBskyGraphDefs from './defs';
|
|
3
|
+
export interface QueryParams {
|
|
4
|
+
actor: string;
|
|
5
|
+
others?: string[];
|
|
6
|
+
}
|
|
7
|
+
export type InputSchema = undefined;
|
|
8
|
+
export interface OutputSchema {
|
|
9
|
+
actor?: string;
|
|
10
|
+
relationships: (AppBskyGraphDefs.Relationship | AppBskyGraphDefs.NotFoundActor | {
|
|
11
|
+
$type: string;
|
|
12
|
+
[k: string]: unknown;
|
|
13
|
+
})[];
|
|
14
|
+
[k: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface CallOptions {
|
|
17
|
+
headers?: Headers;
|
|
18
|
+
}
|
|
19
|
+
export interface Response {
|
|
20
|
+
success: boolean;
|
|
21
|
+
headers: Headers;
|
|
22
|
+
data: OutputSchema;
|
|
23
|
+
}
|
|
24
|
+
export declare class ActorNotFoundError extends XRPCError {
|
|
25
|
+
constructor(src: XRPCError);
|
|
26
|
+
}
|
|
27
|
+
export declare function toKnownErr(e: any): any;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Headers } from '@atproto/xrpc';
|
|
2
|
+
export interface QueryParams {
|
|
3
|
+
}
|
|
4
|
+
export type InputSchema = undefined;
|
|
5
|
+
export interface OutputSchema {
|
|
6
|
+
activated: boolean;
|
|
7
|
+
placeInQueue?: number;
|
|
8
|
+
estimatedTimeMs?: number;
|
|
9
|
+
[k: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
export interface CallOptions {
|
|
12
|
+
headers?: Headers;
|
|
13
|
+
}
|
|
14
|
+
export interface Response {
|
|
15
|
+
success: boolean;
|
|
16
|
+
headers: Headers;
|
|
17
|
+
data: OutputSchema;
|
|
18
|
+
}
|
|
19
|
+
export declare function toKnownErr(e: any): any;
|