@atproto/api 0.9.3 → 0.9.4
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 +7 -0
- package/dist/bsky-agent.d.ts +2 -1
- package/dist/client/index.d.ts +3 -0
- package/dist/client/lexicons.d.ts +105 -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/index.js +219 -45
- package/dist/index.js.map +3 -3
- package/dist/types.d.ts +5 -0
- package/package.json +2 -2
- package/src/bsky-agent.ts +27 -0
- package/src/client/index.ts +13 -0
- package/src/client/lexicons.ts +117 -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/types.ts +9 -0
- package/tests/bsky-agent.test.ts +109 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atproto/api
|
|
2
2
|
|
|
3
|
+
## 0.9.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#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
|
|
8
|
+
`getPreferences` response.
|
|
9
|
+
|
|
3
10
|
## 0.9.3
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
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
|
@@ -110,6 +110,7 @@ import * as AppBskyGraphGetListBlocks from './types/app/bsky/graph/getListBlocks
|
|
|
110
110
|
import * as AppBskyGraphGetListMutes from './types/app/bsky/graph/getListMutes';
|
|
111
111
|
import * as AppBskyGraphGetLists from './types/app/bsky/graph/getLists';
|
|
112
112
|
import * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes';
|
|
113
|
+
import * as AppBskyGraphGetRelationships from './types/app/bsky/graph/getRelationships';
|
|
113
114
|
import * as AppBskyGraphGetSuggestedFollowsByActor from './types/app/bsky/graph/getSuggestedFollowsByActor';
|
|
114
115
|
import * as AppBskyGraphList from './types/app/bsky/graph/list';
|
|
115
116
|
import * as AppBskyGraphListblock from './types/app/bsky/graph/listblock';
|
|
@@ -252,6 +253,7 @@ export * as AppBskyGraphGetListBlocks from './types/app/bsky/graph/getListBlocks
|
|
|
252
253
|
export * as AppBskyGraphGetListMutes from './types/app/bsky/graph/getListMutes';
|
|
253
254
|
export * as AppBskyGraphGetLists from './types/app/bsky/graph/getLists';
|
|
254
255
|
export * as AppBskyGraphGetMutes from './types/app/bsky/graph/getMutes';
|
|
256
|
+
export * as AppBskyGraphGetRelationships from './types/app/bsky/graph/getRelationships';
|
|
255
257
|
export * as AppBskyGraphGetSuggestedFollowsByActor from './types/app/bsky/graph/getSuggestedFollowsByActor';
|
|
256
258
|
export * as AppBskyGraphList from './types/app/bsky/graph/list';
|
|
257
259
|
export * as AppBskyGraphListblock from './types/app/bsky/graph/listblock';
|
|
@@ -622,6 +624,7 @@ export declare class AppBskyGraphNS {
|
|
|
622
624
|
getListMutes(params?: AppBskyGraphGetListMutes.QueryParams, opts?: AppBskyGraphGetListMutes.CallOptions): Promise<AppBskyGraphGetListMutes.Response>;
|
|
623
625
|
getLists(params?: AppBskyGraphGetLists.QueryParams, opts?: AppBskyGraphGetLists.CallOptions): Promise<AppBskyGraphGetLists.Response>;
|
|
624
626
|
getMutes(params?: AppBskyGraphGetMutes.QueryParams, opts?: AppBskyGraphGetMutes.CallOptions): Promise<AppBskyGraphGetMutes.Response>;
|
|
627
|
+
getRelationships(params?: AppBskyGraphGetRelationships.QueryParams, opts?: AppBskyGraphGetRelationships.CallOptions): Promise<AppBskyGraphGetRelationships.Response>;
|
|
625
628
|
getSuggestedFollowsByActor(params?: AppBskyGraphGetSuggestedFollowsByActor.QueryParams, opts?: AppBskyGraphGetSuggestedFollowsByActor.CallOptions): Promise<AppBskyGraphGetSuggestedFollowsByActor.Response>;
|
|
626
629
|
muteActor(data?: AppBskyGraphMuteActor.InputSchema, opts?: AppBskyGraphMuteActor.CallOptions): Promise<AppBskyGraphMuteActor.Response>;
|
|
627
630
|
muteActorList(data?: AppBskyGraphMuteActorList.InputSchema, opts?: AppBskyGraphMuteActorList.CallOptions): Promise<AppBskyGraphMuteActorList.Response>;
|
|
@@ -4344,6 +4344,22 @@ export declare const schemaDict: {
|
|
|
4344
4344
|
};
|
|
4345
4345
|
};
|
|
4346
4346
|
};
|
|
4347
|
+
interestsPref: {
|
|
4348
|
+
type: string;
|
|
4349
|
+
required: string[];
|
|
4350
|
+
properties: {
|
|
4351
|
+
tags: {
|
|
4352
|
+
type: string;
|
|
4353
|
+
maxLength: number;
|
|
4354
|
+
items: {
|
|
4355
|
+
type: string;
|
|
4356
|
+
maxLength: number;
|
|
4357
|
+
maxGraphemes: number;
|
|
4358
|
+
};
|
|
4359
|
+
description: string;
|
|
4360
|
+
};
|
|
4361
|
+
};
|
|
4362
|
+
};
|
|
4347
4363
|
};
|
|
4348
4364
|
};
|
|
4349
4365
|
AppBskyActorGetPreferences: {
|
|
@@ -6461,6 +6477,42 @@ export declare const schemaDict: {
|
|
|
6461
6477
|
};
|
|
6462
6478
|
};
|
|
6463
6479
|
};
|
|
6480
|
+
notFoundActor: {
|
|
6481
|
+
type: string;
|
|
6482
|
+
description: string;
|
|
6483
|
+
required: string[];
|
|
6484
|
+
properties: {
|
|
6485
|
+
actor: {
|
|
6486
|
+
type: string;
|
|
6487
|
+
format: string;
|
|
6488
|
+
};
|
|
6489
|
+
notFound: {
|
|
6490
|
+
type: string;
|
|
6491
|
+
const: boolean;
|
|
6492
|
+
};
|
|
6493
|
+
};
|
|
6494
|
+
};
|
|
6495
|
+
relationship: {
|
|
6496
|
+
type: string;
|
|
6497
|
+
description: string;
|
|
6498
|
+
required: string[];
|
|
6499
|
+
properties: {
|
|
6500
|
+
did: {
|
|
6501
|
+
type: string;
|
|
6502
|
+
format: string;
|
|
6503
|
+
};
|
|
6504
|
+
following: {
|
|
6505
|
+
type: string;
|
|
6506
|
+
format: string;
|
|
6507
|
+
description: string;
|
|
6508
|
+
};
|
|
6509
|
+
followedBy: {
|
|
6510
|
+
type: string;
|
|
6511
|
+
format: string;
|
|
6512
|
+
description: string;
|
|
6513
|
+
};
|
|
6514
|
+
};
|
|
6515
|
+
};
|
|
6464
6516
|
};
|
|
6465
6517
|
};
|
|
6466
6518
|
AppBskyGraphFollow: {
|
|
@@ -6864,6 +6916,58 @@ export declare const schemaDict: {
|
|
|
6864
6916
|
};
|
|
6865
6917
|
};
|
|
6866
6918
|
};
|
|
6919
|
+
AppBskyGraphGetRelationships: {
|
|
6920
|
+
lexicon: number;
|
|
6921
|
+
id: string;
|
|
6922
|
+
defs: {
|
|
6923
|
+
main: {
|
|
6924
|
+
type: string;
|
|
6925
|
+
description: string;
|
|
6926
|
+
parameters: {
|
|
6927
|
+
type: string;
|
|
6928
|
+
required: string[];
|
|
6929
|
+
properties: {
|
|
6930
|
+
actor: {
|
|
6931
|
+
type: string;
|
|
6932
|
+
format: string;
|
|
6933
|
+
};
|
|
6934
|
+
others: {
|
|
6935
|
+
type: string;
|
|
6936
|
+
maxLength: number;
|
|
6937
|
+
items: {
|
|
6938
|
+
type: string;
|
|
6939
|
+
format: string;
|
|
6940
|
+
};
|
|
6941
|
+
};
|
|
6942
|
+
};
|
|
6943
|
+
};
|
|
6944
|
+
output: {
|
|
6945
|
+
encoding: string;
|
|
6946
|
+
schema: {
|
|
6947
|
+
type: string;
|
|
6948
|
+
required: string[];
|
|
6949
|
+
properties: {
|
|
6950
|
+
actor: {
|
|
6951
|
+
type: string;
|
|
6952
|
+
format: string;
|
|
6953
|
+
};
|
|
6954
|
+
relationships: {
|
|
6955
|
+
type: string;
|
|
6956
|
+
items: {
|
|
6957
|
+
type: string;
|
|
6958
|
+
refs: string[];
|
|
6959
|
+
};
|
|
6960
|
+
};
|
|
6961
|
+
};
|
|
6962
|
+
};
|
|
6963
|
+
};
|
|
6964
|
+
errors: {
|
|
6965
|
+
name: string;
|
|
6966
|
+
description: string;
|
|
6967
|
+
}[];
|
|
6968
|
+
};
|
|
6969
|
+
};
|
|
6970
|
+
};
|
|
6867
6971
|
AppBskyGraphGetSuggestedFollowsByActor: {
|
|
6868
6972
|
lexicon: number;
|
|
6869
6973
|
id: string;
|
|
@@ -7761,6 +7865,7 @@ export declare const ids: {
|
|
|
7761
7865
|
AppBskyGraphGetListMutes: string;
|
|
7762
7866
|
AppBskyGraphGetLists: string;
|
|
7763
7867
|
AppBskyGraphGetMutes: string;
|
|
7868
|
+
AppBskyGraphGetRelationships: string;
|
|
7764
7869
|
AppBskyGraphGetSuggestedFollowsByActor: string;
|
|
7765
7870
|
AppBskyGraphList: string;
|
|
7766
7871
|
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;
|