@atcute/bluesky 1.0.6 → 1.0.8

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/README.md CHANGED
@@ -1,9 +1,70 @@
1
1
  # @atcute/bluesky
2
2
 
3
- [Bluesky](https://bsky.app) type definitions for `@atcute/client`, a lightweight and cute API client for AT Protocol.
3
+ [Bluesky](https://bsky.app) type definitions for `@atcute/client`, a lightweight and cute API client
4
+ for AT Protocol.
4
5
 
5
- import the lexicons module to start using it.
6
+ ## usage
7
+
8
+ you'd need to import `@atcute/bluesky/lexicons` into your project, either by adding it into the
9
+ `types` field in `tsconfig.json` or by importing it on your source code.
10
+
11
+ ```jsonc
12
+ // tsconfig.json
13
+ {
14
+ "compilerOptions": {
15
+ "types": ["@atcute/bluesky/lexicons"],
16
+ },
17
+ }
18
+ ```
19
+
20
+ ```ts
21
+ // env.d.ts
22
+ /// <reference types="@atcute/bluesky/lexicons" />
23
+ ```
6
24
 
7
25
  ```ts
26
+ // index.ts
8
27
  import '@atcute/bluesky/lexicons';
9
28
  ```
29
+
30
+ newly added lexicons are augmented to `@atcute/client/lexicons` module
31
+
32
+ ```ts
33
+ import type { AppBskyFeedPost, AppBskyRichtextFacet, Brand } from '@atcute/client/lexicons';
34
+
35
+ type Facet = AppBskyRichtextFacet.Main;
36
+ type MentionFeature = Brand.Union<AppBskyRichtextFacet.Mention>;
37
+
38
+ const mention: MentionFeature = {
39
+ $type: 'app.bsky.richtext.facet#mention',
40
+ did: 'did:plc:z72i7hdynmk6r22z27h6tvur',
41
+ };
42
+
43
+ const facet: Facet = {
44
+ index: {
45
+ byteStart: 6,
46
+ byteEnd: 15,
47
+ },
48
+ features: [mention],
49
+ };
50
+
51
+ const record: AppBskyFeedPost.Record = {
52
+ $type: 'app.bsky.feed.post',
53
+ text: `hello @bsky.app!`,
54
+ facets: [facet],
55
+ createdAt: new Date().toISOString(),
56
+ };
57
+ ```
58
+
59
+ ```ts
60
+ const rpc = new XRPC({ handle: simpleFetchHandler({ service: 'https://api.bsky.app' }) });
61
+
62
+ const { data } = await rpc.get('app.bsky.actor.getProfile', {
63
+ params: {
64
+ actor: 'did:plc:z72i7hdynmk6r22z27h6tvur',
65
+ },
66
+ });
67
+
68
+ data;
69
+ // -> { handle: 'bsky.app', displayName: 'Bluesky', ... }
70
+ ```
@@ -20,6 +20,11 @@ declare module '@atcute/client/lexicons' {
20
20
  interface BskyAppStatePref {
21
21
  [Brand.Type]?: 'app.bsky.actor.defs#bskyAppStatePref';
22
22
  activeProgressGuide?: BskyAppProgressGuide;
23
+ /**
24
+ * Storage for NUXs the user has encountered. \
25
+ * Maximum array length: 100
26
+ */
27
+ nuxs?: AppBskyActorDefs.Nux[];
23
28
  /**
24
29
  * An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user. \
25
30
  * Maximum array length: 1000 \
@@ -115,6 +120,22 @@ declare module '@atcute/client/lexicons' {
115
120
  * Maximum grapheme length: 64
116
121
  */
117
122
  type MutedWordTarget = 'content' | 'tag' | (string & {});
123
+ /** A new user experiences (NUX) storage object */
124
+ interface Nux {
125
+ [Brand.Type]?: 'app.bsky.actor.defs#nux';
126
+ /** @default false */
127
+ completed: boolean;
128
+ /** Maximum string length: 100 */
129
+ id: string;
130
+ /**
131
+ * Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters. \
132
+ * Maximum string length: 3000 \
133
+ * Maximum grapheme length: 300
134
+ */
135
+ data?: string;
136
+ /** The date and time at which the NUX will expire and should be considered completed. */
137
+ expiresAt?: string;
138
+ }
118
139
  interface PersonalDetailsPref {
119
140
  [Brand.Type]?: 'app.bsky.actor.defs#personalDetailsPref';
120
141
  /** The birth date of account owner. */
@@ -192,6 +213,7 @@ declare module '@atcute/client/lexicons' {
192
213
  indexedAt?: string;
193
214
  joinedViaStarterPack?: AppBskyGraphDefs.StarterPackViewBasic;
194
215
  labels?: ComAtprotoLabelDefs.Label[];
216
+ pinnedPost?: ComAtprotoRepoStrongRef.Main;
195
217
  postsCount?: number;
196
218
  viewer?: ViewerState;
197
219
  }
@@ -299,6 +321,7 @@ declare module '@atcute/client/lexicons' {
299
321
  joinedViaStarterPack?: ComAtprotoRepoStrongRef.Main;
300
322
  /** Self-label values, specific to the Bluesky application, on the overall account. */
301
323
  labels?: Brand.Union<ComAtprotoLabelDefs.SelfLabels>;
324
+ pinnedPost?: ComAtprotoRepoStrongRef.Main;
302
325
  }
303
326
  }
304
327
  /** Set the private preferences attached to the account. */
@@ -529,7 +552,7 @@ declare module '@atcute/client/lexicons' {
529
552
  * Maximum string length: 2000
530
553
  */
531
554
  feedContext?: string;
532
- reason?: Brand.Union<ReasonRepost>;
555
+ reason?: Brand.Union<ReasonPin | ReasonRepost>;
533
556
  reply?: ReplyRef;
534
557
  }
535
558
  interface GeneratorView {
@@ -594,6 +617,9 @@ declare module '@atcute/client/lexicons' {
594
617
  threadgate?: ThreadgateView;
595
618
  viewer?: ViewerState;
596
619
  }
620
+ interface ReasonPin {
621
+ [Brand.Type]?: 'app.bsky.feed.defs#reasonPin';
622
+ }
597
623
  interface ReasonRepost {
598
624
  [Brand.Type]?: 'app.bsky.feed.defs#reasonRepost';
599
625
  by: AppBskyActorDefs.ProfileViewBasic;
@@ -616,7 +642,10 @@ declare module '@atcute/client/lexicons' {
616
642
  * Maximum string length: 2000
617
643
  */
618
644
  feedContext?: string;
619
- reason?: Brand.Union<SkeletonReasonRepost>;
645
+ reason?: Brand.Union<SkeletonReasonPin | SkeletonReasonRepost>;
646
+ }
647
+ interface SkeletonReasonPin {
648
+ [Brand.Type]?: 'app.bsky.feed.defs#skeletonReasonPin';
620
649
  }
621
650
  interface SkeletonReasonRepost {
622
651
  [Brand.Type]?: 'app.bsky.feed.defs#skeletonReasonRepost';
@@ -640,6 +669,7 @@ declare module '@atcute/client/lexicons' {
640
669
  [Brand.Type]?: 'app.bsky.feed.defs#viewerState';
641
670
  embeddingDisabled?: boolean;
642
671
  like?: At.Uri;
672
+ pinned?: boolean;
643
673
  replyDisabled?: boolean;
644
674
  repost?: At.Uri;
645
675
  threadMuted?: boolean;
@@ -739,6 +769,8 @@ declare module '@atcute/client/lexicons' {
739
769
  * @default "posts_with_replies"
740
770
  */
741
771
  filter?: 'posts_and_author_threads' | 'posts_no_replies' | 'posts_with_media' | 'posts_with_replies' | (string & {});
772
+ /** @default false */
773
+ includePins?: boolean;
742
774
  /**
743
775
  * Minimum: 1 \
744
776
  * Maximum: 100
@@ -1161,7 +1193,7 @@ declare module '@atcute/client/lexicons' {
1161
1193
  }
1162
1194
  }
1163
1195
  namespace AppBskyFeedThreadgate {
1164
- /** Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository.. */
1196
+ /** Record defining interaction gating rules for a thread (aka, reply controls). The record key (rkey) of the threadgate record must match the record key of the thread's root post, and that record must be in the same repository. */
1165
1197
  interface Record {
1166
1198
  $type: 'app.bsky.feed.threadgate';
1167
1199
  createdAt: string;
@@ -1543,6 +1575,11 @@ declare module '@atcute/client/lexicons' {
1543
1575
  type Input = undefined;
1544
1576
  interface Output {
1545
1577
  suggestions: AppBskyActorDefs.ProfileView[];
1578
+ /**
1579
+ * If true, response has fallen-back to generic results, and is not scoped using relativeToDid
1580
+ * @default false
1581
+ */
1582
+ isFallback?: boolean;
1546
1583
  }
1547
1584
  }
1548
1585
  namespace AppBskyGraphList {
@@ -1884,6 +1921,8 @@ declare module '@atcute/client/lexicons' {
1884
1921
  interface Output {
1885
1922
  actors: AppBskyUnspeccedDefs.SkeletonSearchActor[];
1886
1923
  cursor?: string;
1924
+ /** DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer. */
1925
+ relativeToDid?: At.DID;
1887
1926
  }
1888
1927
  }
1889
1928
  /** Get a list of suggestions (feeds and users) tagged with categories */