@rocksky/sdk 0.4.0 → 0.6.0

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
@@ -32,12 +32,53 @@ const uri = await agent.scrobble({
32
32
 
33
33
  ## API
34
34
 
35
- **Reads — `RockskyClient`**: `profile`, `scrobbles`, `songs`, `albums`,
36
- `artists`, `topTracks`, `topArtists`, `search`, `globalStats`.
35
+ **Reads — `RockskyClient`**: the client now covers the whole `app.rocksky.*`
36
+ read surface. Typed methods include `profile`, `scrobbles`, `songs`, `albums`,
37
+ `artists`, `topTracks`, `topArtists`, `search`, `globalStats`, `lovedSongs`,
38
+ `catalogAlbums`, `catalogArtists`, `catalogSongs`, `albumTracks`, `artistAlbums`,
39
+ `artistTracks`, `scrobbleFeed`, `scrobble` (single by uri), `follows`,
40
+ `followers`, `knownFollowers`. Raw (`unknown`-returning) detail/long-tail
41
+ methods cover the rest: `album`, `artist`, `song`, `feed`, `playlists`,
42
+ `playlist`, `stats`, `wrapped`, `scrobblesChart`, `recommendations`,
43
+ `neighbours`, shouts, and more.
44
+
45
+ Every named method is sugar over the universal escape hatch **`rk.get(nsid,
46
+ params)`**, which calls ANY read query by nsid and returns `unknown`.
47
+
48
+ **Typed date-window charts**: `topTracksInterval(limit, offset, interval)` and
49
+ `topArtistsInterval(...)` take a `DateInterval` built with the `Interval`
50
+ factories — `Interval.allTime()`, `Interval.lastDays(n)`, `Interval.lastWeeks(n)`,
51
+ `Interval.lastMonths(n)`, `Interval.lastYears(n)`, `Interval.range(start, end)`.
52
+ `topTracks` / `topArtists` remain all-time shorthands.
37
53
 
38
- **Writes — `Agent`**: `scrobble`, `createSong`/`createAlbum`/`createArtist`,
39
- `like`, `follow`, `shout`/`replyShout`, `setNowPlaying`/`clearNowPlaying`,
40
- `delete`. Records are the generated types from `./generated/types`.
54
+ ```ts
55
+ import { RockskyClient, Interval } from "@rocksky/sdk";
56
+
57
+ const rk = new RockskyClient();
58
+ const monthly = await rk.topTracksInterval(10, 0, Interval.lastMonths(1));
59
+
60
+ // Resolve a bare title + artist into full canonical metadata.
61
+ const song = await rk.matchSong("Chaser", "Calibro 35");
62
+ ```
63
+
64
+ **`matchSong(title, artist, mbId?, isrc?)`**: resolves a bare title + artist into
65
+ full canonical metadata (album, artwork, duration, MBID, ISRC, links).
66
+
67
+ **Auth-gated reads**: pass an optional bearer access token —
68
+ `new RockskyClient(appview, token)` — and it is sent as
69
+ `Authorization: Bearer <token>`.
70
+
71
+ **Writes — `Agent`**: two scrobble paths. `scrobble(rec)` writes full metadata
72
+ you already have; `scrobbleMatch(input, appview?)` takes a `ScrobbleMatchInput`
73
+ object (`{ title, artist, album?, mbId?, isrc?, timestamp? }` — title/artist
74
+ required; `album` overrides the resolved album, `mbId`/`isrc` are match anchors,
75
+ `timestamp` is a scrobbled-at Unix-seconds time; the optional `appview` overrides
76
+ the AppView used for matching) and resolves full metadata via `matchSong` first,
77
+ then writes — e.g. `agent.scrobbleMatch({ title: "Chaser", artist: "Calibro 35" })`.
78
+ Plus
79
+ `createSong`/`createAlbum`/`createArtist`, `like`, `follow`,
80
+ `shout`/`replyShout`, `setNowPlaying`/`clearNowPlaying`, `delete`. Records are the
81
+ generated types from `./generated/types`.
41
82
 
42
83
  **Identity hashes**: `songHash`, `albumHash`, `artistHash` — lowercase-hex
43
84
  SHA-256, identical to the server and every other Rocksky SDK.
package/dist/agent.d.ts CHANGED
@@ -6,6 +6,19 @@ import { type JetstreamOptions } from "./jetstream.js";
6
6
  export type ScrobbleInput = Omit<ScrobbleRecord, "createdAt"> & {
7
7
  createdAt?: string;
8
8
  };
9
+ /** Input for {@link Agent.scrobbleMatch} — `title`/`artist` required, rest optional. */
10
+ export interface ScrobbleMatchInput {
11
+ title: string;
12
+ artist: string;
13
+ /** Overrides the matched album. */
14
+ album?: string;
15
+ /** MusicBrainz recording id — anchors the match. */
16
+ mbId?: string;
17
+ /** ISRC — anchors the match. */
18
+ isrc?: string;
19
+ /** Scrobbled-at Unix seconds; omitted = now. */
20
+ timestamp?: number;
21
+ }
9
22
  /** Input for {@link Agent.createSong}. */
10
23
  export type SongInput = Omit<SongRecord, "createdAt"> & {
11
24
  createdAt?: string;
@@ -55,6 +68,11 @@ export declare class Agent {
55
68
  delete(collection: string, rkey: string): Promise<void>;
56
69
  /** Scrobble a play (app.rocksky.scrobble). createdAt defaults to now. */
57
70
  scrobble(rec: ScrobbleInput): Promise<string>;
71
+ /** Scrobble from just a title + artist (album optional, plus optional
72
+ * `mbId`/`isrc` anchors): resolve full metadata via `matchSong`, then write.
73
+ * Matching uses the public AppView unless `appview` is given; an empty match
74
+ * falls back to a minimal record. */
75
+ scrobbleMatch(input: ScrobbleMatchInput, appview?: string): Promise<string>;
58
76
  /** Create a canonical track record (app.rocksky.song). */
59
77
  createSong(rec: SongInput): Promise<string>;
60
78
  /** Create an album record (app.rocksky.album). `artist` is the album artist. */
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,cAAc,EACd,cAAc,EACd,UAAU,EACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAgB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA+BrE,oEAAoE;AACpE,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AACvF,0CAA0C;AAC1C,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC/E,0EAA0E;AAC1E,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, StatsGlobalStatsView } from "./generated/types.js";
1
+ import type { ActorProfileViewBasic, ActorProfileViewDetailed, AlbumViewBasic, ArtistViewBasic, FeedSearchResultsView, ScrobbleViewBasic, SongViewBasic, StatsGlobalStatsView } from "./generated/types.js";
2
+ /**
3
+ * A typed date window for the `top*` charts. Build one with the {@link Interval}
4
+ * factories; `range` bounds are RFC-3339 datetimes.
5
+ */
6
+ export interface DateInterval {
7
+ startDate?: string;
8
+ endDate?: string;
9
+ }
10
+ /** Factories for {@link DateInterval} windows used by the `top*Interval` charts. */
11
+ export declare const Interval: {
12
+ /** No bounds — the all-time chart. */
13
+ allTime: () => DateInterval;
14
+ /** The last `n` days ending now. */
15
+ lastDays: (n: number) => DateInterval;
16
+ /** The last `n` weeks ending now. */
17
+ lastWeeks: (n: number) => DateInterval;
18
+ /** The last `n` months ending now. */
19
+ lastMonths: (n: number) => DateInterval;
20
+ /** The last `n` years ending now. */
21
+ lastYears: (n: number) => DateInterval;
22
+ /** An explicit closed `[start, end]` window. */
23
+ range: (start: Date, end: Date) => DateInterval;
24
+ };
2
25
  /** The default public Rocksky AppView base URL. */
3
26
  export declare const DEFAULT_APPVIEW = "https://api.rocksky.app";
4
27
  /** Unauthenticated read client over the public Rocksky AppView XRPC. */
5
28
  export declare class RockskyClient {
6
29
  private rpc;
7
- /** Build a read client against an AppView base URL (defaults to {@link DEFAULT_APPVIEW}). */
8
- constructor(appview?: string);
30
+ /**
31
+ * Build a read client against an AppView base URL (defaults to
32
+ * {@link DEFAULT_APPVIEW}). Pass `token` to send it as
33
+ * `Authorization: Bearer <token>` on every read — needed only for auth-gated
34
+ * queries.
35
+ */
36
+ constructor(appview?: string, token?: string);
9
37
  private query;
10
38
  /** An actor's detailed profile. `actor` is a handle or DID. */
11
39
  profile(actor: string): Promise<ActorProfileViewDetailed>;
12
40
  /** An actor's scrobbles, newest first. */
13
41
  scrobbles(actor: string, limit?: number, offset?: number): Promise<ScrobbleViewBasic[]>;
42
+ /** Call any AppView read query by nsid; returns the raw JSON response. Every
43
+ * method here is sugar over this — use it for queries without a wrapper. */
44
+ get(nsid: string, params?: Record<string, unknown>): Promise<unknown>;
14
45
  /** An actor's most-played songs. */
15
46
  songs(actor: string, limit?: number, offset?: number): Promise<SongViewBasic[]>;
47
+ /** An actor's loved (liked) songs. */
48
+ lovedSongs(actor: string, limit?: number, offset?: number): Promise<SongViewBasic[]>;
16
49
  /** An actor's most-played albums. */
17
50
  albums(actor: string, limit?: number, offset?: number): Promise<AlbumViewBasic[]>;
18
51
  /** An actor's most-played artists. */
19
52
  artists(actor: string, limit?: number, offset?: number): Promise<ArtistViewBasic[]>;
20
- /** The platform-wide top tracks chart. */
53
+ /** The platform-wide top tracks chart (all-time). */
21
54
  topTracks(limit?: number, offset?: number): Promise<SongViewBasic[]>;
22
- /** The platform-wide top artists chart. */
55
+ /** The platform-wide top artists chart (all-time). */
23
56
  topArtists(limit?: number, offset?: number): Promise<ArtistViewBasic[]>;
57
+ /** The top tracks chart over a typed {@link DateInterval}. */
58
+ topTracksInterval(limit: number, offset: number, interval: DateInterval): Promise<SongViewBasic[]>;
59
+ /** The top artists chart over a typed {@link DateInterval}. */
60
+ topArtistsInterval(limit: number, offset: number, interval: DateInterval): Promise<ArtistViewBasic[]>;
61
+ /** The album catalog, optionally filtered by `genre`. */
62
+ catalogAlbums(limit?: number, offset?: number, genre?: string): Promise<AlbumViewBasic[]>;
63
+ /** The artist catalog, optionally filtered by `genre`. */
64
+ catalogArtists(limit?: number, offset?: number, genre?: string): Promise<ArtistViewBasic[]>;
65
+ /** The song catalog, optionally filtered by `genre`. */
66
+ catalogSongs(limit?: number, offset?: number, genre?: string): Promise<SongViewBasic[]>;
67
+ /** An album's tracklist by album at:// URI. */
68
+ albumTracks(uri: string): Promise<SongViewBasic[]>;
69
+ /** An artist's albums by artist at:// URI. */
70
+ artistAlbums(uri: string): Promise<AlbumViewBasic[]>;
71
+ /** An artist's top tracks by artist at:// URI. */
72
+ artistTracks(uri: string, limit?: number, offset?: number): Promise<SongViewBasic[]>;
73
+ /** A social/global scrobbles feed. Pass `did` to scope to an actor and
74
+ * `following = true` for their follow graph. */
75
+ scrobbleFeed(did?: string, following?: boolean, limit?: number, offset?: number): Promise<ScrobbleViewBasic[]>;
76
+ /** A single scrobble by its at:// URI. */
77
+ scrobble(uri: string): Promise<ScrobbleViewBasic>;
78
+ /** The accounts `actor` follows. */
79
+ follows(actor: string, limit?: number, cursor?: string): Promise<ActorProfileViewBasic[]>;
80
+ /** The accounts that follow `actor`. */
81
+ followers(actor: string, limit?: number, cursor?: string): Promise<ActorProfileViewBasic[]>;
82
+ /** Followers of `actor` that the viewer also follows. */
83
+ knownFollowers(actor: string, limit?: number, cursor?: string): Promise<ActorProfileViewBasic[]>;
24
84
  /** Full-text search across songs, albums, artists, playlists, actors. */
25
85
  search(query: string): Promise<FeedSearchResultsView>;
26
86
  /** Platform-wide totals. */
27
87
  globalStats(): Promise<StatsGlobalStatsView>;
88
+ /** A feed by its at:// URI (paginate via `cursor`). */
89
+ feed(feed: string, limit?: number, cursor?: string): Promise<unknown>;
90
+ /** A single album with its tracklist. */
91
+ album(uri: string): Promise<unknown>;
92
+ /** A single artist with detail. */
93
+ artist(uri: string): Promise<unknown>;
94
+ /** Resolve full canonical metadata for a bare title + artist
95
+ * (`app.rocksky.song.matchSong`); optionally anchor with `mbId` / `isrc`. */
96
+ matchSong(title: string, artist: string, mbId?: string, isrc?: string): Promise<unknown>;
97
+ /** A single song by at:// `uri` (or by `mbid` / `isrc` / `spotifyId`). */
98
+ song(opts: {
99
+ uri?: string;
100
+ mbid?: string;
101
+ isrc?: string;
102
+ spotifyId?: string;
103
+ }): Promise<unknown>;
104
+ /** An actor's playlists. */
105
+ actorPlaylists(actor: string, limit?: number, offset?: number): Promise<unknown>;
106
+ /** Actors with similar taste to `actor`. */
107
+ neighbours(actor: string): Promise<unknown>;
108
+ /** Music compatibility between the viewer and `actor` (auth). */
109
+ compatibility(actor: string): Promise<unknown>;
110
+ /** An artist's all-time listeners. */
111
+ artistListeners(uri: string, limit?: number, offset?: number): Promise<unknown>;
112
+ /** An artist's recent listeners. */
113
+ artistRecentListeners(uri: string, limit?: number, offset?: number): Promise<unknown>;
114
+ /** A song's recent listeners. */
115
+ songRecentListeners(uri: string, limit?: number, offset?: number): Promise<unknown>;
116
+ /** A scrobble time-series chart. Scope with any of `did` / `artisturi` /
117
+ * `albumuri` / `songuri` / `genre` and bound with `from` / `to`. */
118
+ scrobblesChart(opts: {
119
+ did?: string;
120
+ artisturi?: string;
121
+ albumuri?: string;
122
+ songuri?: string;
123
+ genre?: string;
124
+ from?: string;
125
+ to?: string;
126
+ }): Promise<unknown>;
127
+ /** List the available feed generators. */
128
+ feedGenerators(size?: number): Promise<unknown>;
129
+ /** A single feed generator's record. */
130
+ feedGenerator(feed: string): Promise<unknown>;
131
+ /** The stories row. */
132
+ stories(size?: number, feed?: string, following?: boolean): Promise<unknown>;
133
+ /** Track recommendations for `actor`. */
134
+ recommendations(actor: string, limit?: number): Promise<unknown>;
135
+ /** Artist recommendations for `actor`. */
136
+ artistRecommendations(actor: string, limit?: number): Promise<unknown>;
137
+ /** Album recommendations for `actor`. */
138
+ albumRecommendations(actor: string, limit?: number): Promise<unknown>;
139
+ /** An actor's aggregate stats. */
140
+ stats(actor: string): Promise<unknown>;
141
+ /** An actor's year-in-review. */
142
+ wrapped(actor: string, year?: number): Promise<unknown>;
143
+ /** The viewer's configured scrobble mirror sources (auth). */
144
+ mirrorSources(): Promise<unknown>;
145
+ /** What `actor` is playing now. */
146
+ currentlyPlaying(playerId?: string, actor?: string): Promise<unknown>;
147
+ /** A player's playback queue. */
148
+ playbackQueue(playerId: string): Promise<unknown>;
149
+ /** What `actor` is playing now on Spotify. */
150
+ spotifyCurrentlyPlaying(actor: string): Promise<unknown>;
151
+ /** The playlist catalog. */
152
+ playlists(limit?: number, offset?: number): Promise<unknown>;
153
+ /** A single playlist with its items. */
154
+ playlist(uri: string): Promise<unknown>;
155
+ /** Shouts on an album. */
156
+ albumShouts(uri: string, limit?: number, offset?: number): Promise<unknown>;
157
+ /** Shouts on an artist. */
158
+ artistShouts(uri: string, limit?: number, offset?: number): Promise<unknown>;
159
+ /** Shouts on a profile. */
160
+ profileShouts(actor: string, limit?: number, offset?: number): Promise<unknown>;
161
+ /** Shouts on a track. */
162
+ trackShouts(uri: string): Promise<unknown>;
163
+ /** Replies to a shout. */
164
+ shoutReplies(uri: string, limit?: number, offset?: number): Promise<unknown>;
165
+ /** An actor's Rockbox EQ / audio settings. */
166
+ audioSettings(actor: string): Promise<unknown>;
167
+ /** The viewer's API keys (auth). */
168
+ apikeys(limit?: number, offset?: number): Promise<unknown>;
28
169
  }
29
170
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,wBAAwB,EACxB,cAAc,EACd,eAAe,EACf,qBAAqB,EAOrB,iBAAiB,EACjB,aAAa,EACb,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAE9B,mDAAmD;AACnD,eAAO,MAAM,eAAe,4BAA4B,CAAC;AAEzD,wEAAwE;AACxE,qBAAa,aAAa;IACxB,OAAO,CAAC,GAAG,CAAS;IAEpB,6FAA6F;gBACjF,OAAO,GAAE,MAAwB;YAI/B,KAAK;IAUnB,+DAA+D;IAC/D,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAIzD,0CAA0C;IACpC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAK,EAAE,MAAM,SAAI,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IASpF,oCAAoC;IAC9B,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAK,EAAE,MAAM,SAAI,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAS5E,qCAAqC;IAC/B,MAAM,CAAC,KAAK,EAAE,MAAM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E,MAAM,EAAE,KAAK,SAAK,EAAE,MAAM,SAAI,GAAG,OAAO,CAAC,OAAO,CAAC;IAGnE,2BAA2B;IAC3B,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,SAAK,EAAE,MAAM,SAAI,GAAG,OAAO,CAAC,OAAO,CAAC;IAGtE,yBAAyB;IACzB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAG1C,0BAA0B;IAC1B,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,SAAK,EAAE,MAAM,SAAI,GAAG,OAAO,CAAC,OAAO,CAAC;IAGnE,8CAA8C;IAC9C,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAG9C,oCAAoC;IACpC,OAAO,CAAC,KAAK,SAAK,EAAE,MAAM,SAAI,GAAG,OAAO,CAAC,OAAO,CAAC;CAGlD"}
package/dist/index.d.ts CHANGED
@@ -8,8 +8,9 @@
8
8
  * ({@link Agent.syncRepo}) and kept live off the Jetstream firehose
9
9
  * ({@link Agent.hydrateFromJetstream}).
10
10
  */
11
- export { RockskyClient, DEFAULT_APPVIEW } from "./client.js";
12
- export { Agent, type ScrobbleInput, type SongInput, type AlbumInput, type ArtistInput } from "./agent.js";
11
+ export { RockskyClient, DEFAULT_APPVIEW, Interval } from "./client.js";
12
+ export type { DateInterval } from "./client.js";
13
+ export { Agent, type ScrobbleInput, type ScrobbleMatchInput, type SongInput, type AlbumInput, type ArtistInput, } from "./agent.js";
13
14
  export { RockskyIndex, totalIndexed, type IndexStats } from "./dedup.js";
14
15
  export { runJetstream, DEFAULT_JETSTREAM_SERVERS, type JetstreamOptions } from "./jetstream.js";
15
16
  export { songHash, albumHash, artistHash } from "./hash.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC7D,OAAO,EAAE,KAAK,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AAC1G,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,yBAAyB,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,mBAAmB,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,KAAK,EACL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,SAAS,EACd,KAAK,UAAU,EACf,KAAK,WAAW,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,yBAAyB,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,mBAAmB,sBAAsB,CAAC"}