@atcute/bluesky 1.0.7 → 1.0.9

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({ handler: 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
+ ```
@@ -239,7 +239,7 @@ declare module '@atcute/client/lexicons' {
239
239
  /** Show followed users at the top of all replies. */
240
240
  prioritizeFollowedUsers?: boolean;
241
241
  /** Sorting mode for threads. */
242
- sort?: 'most-likes' | 'newest' | 'oldest' | 'random' | (string & {});
242
+ sort?: 'hotness' | 'most-likes' | 'newest' | 'oldest' | 'random' | (string & {});
243
243
  }
244
244
  /** Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests. */
245
245
  interface ViewerState {
@@ -1652,6 +1652,25 @@ declare module '@atcute/client/lexicons' {
1652
1652
  }
1653
1653
  type Output = undefined;
1654
1654
  }
1655
+ /** Find starter packs matching search criteria. Does not require auth. */
1656
+ namespace AppBskyGraphSearchStarterPacks {
1657
+ interface Params {
1658
+ /** Search query string. Syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. */
1659
+ q: string;
1660
+ cursor?: string;
1661
+ /**
1662
+ * Minimum: 1 \
1663
+ * Maximum: 100
1664
+ * @default 25
1665
+ */
1666
+ limit?: number;
1667
+ }
1668
+ type Input = undefined;
1669
+ interface Output {
1670
+ starterPacks: AppBskyGraphDefs.StarterPackViewBasic[];
1671
+ cursor?: string;
1672
+ }
1673
+ }
1655
1674
  namespace AppBskyGraphStarterpack {
1656
1675
  /** Record defining a starter pack of actors and feeds for new users. */
1657
1676
  interface Record {
@@ -1883,6 +1902,19 @@ declare module '@atcute/client/lexicons' {
1883
1902
  [Brand.Type]?: 'app.bsky.unspecced.defs#skeletonSearchPost';
1884
1903
  uri: At.Uri;
1885
1904
  }
1905
+ interface SkeletonSearchStarterPack {
1906
+ [Brand.Type]?: 'app.bsky.unspecced.defs#skeletonSearchStarterPack';
1907
+ uri: At.Uri;
1908
+ }
1909
+ }
1910
+ /** Get miscellaneous runtime configuration. */
1911
+ namespace AppBskyUnspeccedGetConfig {
1912
+ interface Params {
1913
+ }
1914
+ type Input = undefined;
1915
+ interface Output {
1916
+ checkEmailConfirmed?: boolean;
1917
+ }
1886
1918
  }
1887
1919
  /** An unspecced view of globally popular feed generators. */
1888
1920
  namespace AppBskyUnspeccedGetPopularFeedGenerators {
@@ -2019,6 +2051,33 @@ declare module '@atcute/client/lexicons' {
2019
2051
  BadQueryString: {};
2020
2052
  }
2021
2053
  }
2054
+ /** Backend Starter Pack search, returns only skeleton. */
2055
+ namespace AppBskyUnspeccedSearchStarterPacksSkeleton {
2056
+ interface Params {
2057
+ /** Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. */
2058
+ q: string;
2059
+ /** Optional pagination mechanism; may not necessarily allow scrolling through entire result set. */
2060
+ cursor?: string;
2061
+ /**
2062
+ * Minimum: 1 \
2063
+ * Maximum: 100
2064
+ * @default 25
2065
+ */
2066
+ limit?: number;
2067
+ /** DID of the account making the request (not included for public/unauthenticated queries). */
2068
+ viewer?: At.DID;
2069
+ }
2070
+ type Input = undefined;
2071
+ interface Output {
2072
+ starterPacks: AppBskyUnspeccedDefs.SkeletonSearchStarterPack[];
2073
+ cursor?: string;
2074
+ /** Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. */
2075
+ hitsTotal?: number;
2076
+ }
2077
+ interface Errors {
2078
+ BadQueryString: {};
2079
+ }
2080
+ }
2022
2081
  namespace AppBskyVideoDefs {
2023
2082
  interface JobStatus {
2024
2083
  [Brand.Type]?: 'app.bsky.video.defs#jobStatus';
@@ -2116,6 +2175,7 @@ declare module '@atcute/client/lexicons' {
2116
2175
  rev: string;
2117
2176
  unreadCount: number;
2118
2177
  lastMessage?: Brand.Union<DeletedMessageView | MessageView>;
2178
+ opened?: boolean;
2119
2179
  }
2120
2180
  interface DeletedMessageView {
2121
2181
  [Brand.Type]?: 'chat.bsky.convo.defs#deletedMessageView';
@@ -2531,6 +2591,10 @@ declare module '@atcute/client/lexicons' {
2531
2591
  params: AppBskyGraphGetSuggestedFollowsByActor.Params;
2532
2592
  output: AppBskyGraphGetSuggestedFollowsByActor.Output;
2533
2593
  };
2594
+ 'app.bsky.graph.searchStarterPacks': {
2595
+ params: AppBskyGraphSearchStarterPacks.Params;
2596
+ output: AppBskyGraphSearchStarterPacks.Output;
2597
+ };
2534
2598
  'app.bsky.labeler.getServices': {
2535
2599
  params: AppBskyLabelerGetServices.Params;
2536
2600
  output: AppBskyLabelerGetServices.Output;
@@ -2543,6 +2607,9 @@ declare module '@atcute/client/lexicons' {
2543
2607
  params: AppBskyNotificationListNotifications.Params;
2544
2608
  output: AppBskyNotificationListNotifications.Output;
2545
2609
  };
2610
+ 'app.bsky.unspecced.getConfig': {
2611
+ output: AppBskyUnspeccedGetConfig.Output;
2612
+ };
2546
2613
  'app.bsky.unspecced.getPopularFeedGenerators': {
2547
2614
  params: AppBskyUnspeccedGetPopularFeedGenerators.Params;
2548
2615
  output: AppBskyUnspeccedGetPopularFeedGenerators.Output;
@@ -2562,6 +2629,10 @@ declare module '@atcute/client/lexicons' {
2562
2629
  params: AppBskyUnspeccedSearchPostsSkeleton.Params;
2563
2630
  output: AppBskyUnspeccedSearchPostsSkeleton.Output;
2564
2631
  };
2632
+ 'app.bsky.unspecced.searchStarterPacksSkeleton': {
2633
+ params: AppBskyUnspeccedSearchStarterPacksSkeleton.Params;
2634
+ output: AppBskyUnspeccedSearchStarterPacksSkeleton.Output;
2635
+ };
2565
2636
  'app.bsky.video.getJobStatus': {
2566
2637
  params: AppBskyVideoGetJobStatus.Params;
2567
2638
  output: AppBskyVideoGetJobStatus.Output;