@rocksky/cli 0.2.0 → 0.3.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.
Files changed (170) hide show
  1. package/README.md +21 -9
  2. package/dist/drizzle/0000_parallel_paper_doll.sql +220 -0
  3. package/dist/drizzle/meta/0000_snapshot.json +1559 -0
  4. package/dist/drizzle/meta/_journal.json +13 -0
  5. package/dist/index.js +8280 -254
  6. package/drizzle/0000_parallel_paper_doll.sql +220 -0
  7. package/drizzle/meta/0000_snapshot.json +1559 -0
  8. package/drizzle/meta/_journal.json +13 -0
  9. package/drizzle.config.ts +18 -0
  10. package/package.json +31 -3
  11. package/src/client.ts +32 -14
  12. package/src/cmd/scrobble-api.ts +457 -0
  13. package/src/cmd/scrobble.ts +14 -61
  14. package/src/cmd/search.ts +27 -25
  15. package/src/cmd/sync.ts +812 -0
  16. package/src/cmd/whoami.ts +36 -7
  17. package/src/context.ts +24 -0
  18. package/src/drizzle.ts +53 -0
  19. package/src/index.ts +66 -26
  20. package/src/jetstream.ts +285 -0
  21. package/src/lexicon/index.ts +1321 -0
  22. package/src/lexicon/lexicons.ts +5453 -0
  23. package/src/lexicon/types/app/bsky/actor/profile.ts +38 -0
  24. package/src/lexicon/types/app/rocksky/actor/defs.ts +146 -0
  25. package/src/lexicon/types/app/rocksky/actor/getActorAlbums.ts +56 -0
  26. package/src/lexicon/types/app/rocksky/actor/getActorArtists.ts +56 -0
  27. package/src/lexicon/types/app/rocksky/actor/getActorCompatibility.ts +48 -0
  28. package/src/lexicon/types/app/rocksky/actor/getActorLovedSongs.ts +52 -0
  29. package/src/lexicon/types/app/rocksky/actor/getActorNeighbours.ts +48 -0
  30. package/src/lexicon/types/app/rocksky/actor/getActorPlaylists.ts +52 -0
  31. package/src/lexicon/types/app/rocksky/actor/getActorScrobbles.ts +52 -0
  32. package/src/lexicon/types/app/rocksky/actor/getActorSongs.ts +56 -0
  33. package/src/lexicon/types/app/rocksky/actor/getProfile.ts +43 -0
  34. package/src/lexicon/types/app/rocksky/album/defs.ts +85 -0
  35. package/src/lexicon/types/app/rocksky/album/getAlbum.ts +43 -0
  36. package/src/lexicon/types/app/rocksky/album/getAlbumTracks.ts +48 -0
  37. package/src/lexicon/types/app/rocksky/album/getAlbums.ts +50 -0
  38. package/src/lexicon/types/app/rocksky/album.ts +51 -0
  39. package/src/lexicon/types/app/rocksky/apikey/createApikey.ts +51 -0
  40. package/src/lexicon/types/app/rocksky/apikey/defs.ts +31 -0
  41. package/src/lexicon/types/app/rocksky/apikey/getApikeys.ts +50 -0
  42. package/src/lexicon/types/app/rocksky/apikey/removeApikey.ts +43 -0
  43. package/src/lexicon/types/app/rocksky/apikey/updateApikey.ts +53 -0
  44. package/src/lexicon/types/app/rocksky/apikeys/defs.ts +7 -0
  45. package/src/lexicon/types/app/rocksky/artist/defs.ts +140 -0
  46. package/src/lexicon/types/app/rocksky/artist/getArtist.ts +43 -0
  47. package/src/lexicon/types/app/rocksky/artist/getArtistAlbums.ts +48 -0
  48. package/src/lexicon/types/app/rocksky/artist/getArtistListeners.ts +52 -0
  49. package/src/lexicon/types/app/rocksky/artist/getArtistTracks.ts +52 -0
  50. package/src/lexicon/types/app/rocksky/artist/getArtists.ts +52 -0
  51. package/src/lexicon/types/app/rocksky/artist.ts +41 -0
  52. package/src/lexicon/types/app/rocksky/charts/defs.ts +44 -0
  53. package/src/lexicon/types/app/rocksky/charts/getScrobblesChart.ts +49 -0
  54. package/src/lexicon/types/app/rocksky/dropbox/defs.ts +71 -0
  55. package/src/lexicon/types/app/rocksky/dropbox/downloadFile.ts +42 -0
  56. package/src/lexicon/types/app/rocksky/dropbox/getFiles.ts +43 -0
  57. package/src/lexicon/types/app/rocksky/dropbox/getMetadata.ts +43 -0
  58. package/src/lexicon/types/app/rocksky/dropbox/getTemporaryLink.ts +43 -0
  59. package/src/lexicon/types/app/rocksky/feed/defs.ts +182 -0
  60. package/src/lexicon/types/app/rocksky/feed/describeFeedGenerator.ts +48 -0
  61. package/src/lexicon/types/app/rocksky/feed/generator.ts +29 -0
  62. package/src/lexicon/types/app/rocksky/feed/getFeed.ts +47 -0
  63. package/src/lexicon/types/app/rocksky/feed/getFeedGenerator.ts +48 -0
  64. package/src/lexicon/types/app/rocksky/feed/getFeedGenerators.ts +43 -0
  65. package/src/lexicon/types/app/rocksky/feed/getFeedSkeleton.ts +56 -0
  66. package/src/lexicon/types/app/rocksky/feed/getNowPlayings.ts +43 -0
  67. package/src/lexicon/types/app/rocksky/feed/search.ts +43 -0
  68. package/src/lexicon/types/app/rocksky/googledrive/defs.ts +42 -0
  69. package/src/lexicon/types/app/rocksky/googledrive/downloadFile.ts +42 -0
  70. package/src/lexicon/types/app/rocksky/googledrive/getFile.ts +43 -0
  71. package/src/lexicon/types/app/rocksky/googledrive/getFiles.ts +43 -0
  72. package/src/lexicon/types/app/rocksky/graph/defs.ts +47 -0
  73. package/src/lexicon/types/app/rocksky/graph/follow.ts +28 -0
  74. package/src/lexicon/types/app/rocksky/graph/followAccount.ts +50 -0
  75. package/src/lexicon/types/app/rocksky/graph/getFollowers.ts +56 -0
  76. package/src/lexicon/types/app/rocksky/graph/getFollows.ts +56 -0
  77. package/src/lexicon/types/app/rocksky/graph/getKnownFollowers.ts +52 -0
  78. package/src/lexicon/types/app/rocksky/graph/unfollowAccount.ts +50 -0
  79. package/src/lexicon/types/app/rocksky/like/dislikeShout.ts +49 -0
  80. package/src/lexicon/types/app/rocksky/like/dislikeSong.ts +49 -0
  81. package/src/lexicon/types/app/rocksky/like/likeShout.ts +49 -0
  82. package/src/lexicon/types/app/rocksky/like/likeSong.ts +49 -0
  83. package/src/lexicon/types/app/rocksky/like.ts +27 -0
  84. package/src/lexicon/types/app/rocksky/player/addDirectoryToQueue.ts +40 -0
  85. package/src/lexicon/types/app/rocksky/player/addItemsToQueue.ts +39 -0
  86. package/src/lexicon/types/app/rocksky/player/defs.ts +57 -0
  87. package/src/lexicon/types/app/rocksky/player/getCurrentlyPlaying.ts +44 -0
  88. package/src/lexicon/types/app/rocksky/player/getPlaybackQueue.ts +42 -0
  89. package/src/lexicon/types/app/rocksky/player/next.ts +34 -0
  90. package/src/lexicon/types/app/rocksky/player/pause.ts +34 -0
  91. package/src/lexicon/types/app/rocksky/player/play.ts +34 -0
  92. package/src/lexicon/types/app/rocksky/player/playDirectory.ts +38 -0
  93. package/src/lexicon/types/app/rocksky/player/playFile.ts +35 -0
  94. package/src/lexicon/types/app/rocksky/player/previous.ts +34 -0
  95. package/src/lexicon/types/app/rocksky/player/seek.ts +36 -0
  96. package/src/lexicon/types/app/rocksky/playlist/createPlaylist.ts +37 -0
  97. package/src/lexicon/types/app/rocksky/playlist/defs.ts +86 -0
  98. package/src/lexicon/types/app/rocksky/playlist/getPlaylist.ts +43 -0
  99. package/src/lexicon/types/app/rocksky/playlist/getPlaylists.ts +50 -0
  100. package/src/lexicon/types/app/rocksky/playlist/insertDirectory.ts +39 -0
  101. package/src/lexicon/types/app/rocksky/playlist/insertFiles.ts +38 -0
  102. package/src/lexicon/types/app/rocksky/playlist/removePlaylist.ts +35 -0
  103. package/src/lexicon/types/app/rocksky/playlist/removeTrack.ts +37 -0
  104. package/src/lexicon/types/app/rocksky/playlist/startPlaylist.ts +39 -0
  105. package/src/lexicon/types/app/rocksky/playlist.ts +43 -0
  106. package/src/lexicon/types/app/rocksky/radio/defs.ts +63 -0
  107. package/src/lexicon/types/app/rocksky/radio.ts +37 -0
  108. package/src/lexicon/types/app/rocksky/scrobble/createScrobble.ts +91 -0
  109. package/src/lexicon/types/app/rocksky/scrobble/defs.ts +93 -0
  110. package/src/lexicon/types/app/rocksky/scrobble/getScrobble.ts +43 -0
  111. package/src/lexicon/types/app/rocksky/scrobble/getScrobbles.ts +54 -0
  112. package/src/lexicon/types/app/rocksky/scrobble.ts +75 -0
  113. package/src/lexicon/types/app/rocksky/shout/createShout.ts +49 -0
  114. package/src/lexicon/types/app/rocksky/shout/defs.ts +58 -0
  115. package/src/lexicon/types/app/rocksky/shout/getAlbumShouts.ts +52 -0
  116. package/src/lexicon/types/app/rocksky/shout/getArtistShouts.ts +52 -0
  117. package/src/lexicon/types/app/rocksky/shout/getProfileShouts.ts +52 -0
  118. package/src/lexicon/types/app/rocksky/shout/getShoutReplies.ts +52 -0
  119. package/src/lexicon/types/app/rocksky/shout/getTrackShouts.ts +48 -0
  120. package/src/lexicon/types/app/rocksky/shout/removeShout.ts +43 -0
  121. package/src/lexicon/types/app/rocksky/shout/replyShout.ts +51 -0
  122. package/src/lexicon/types/app/rocksky/shout/reportShout.ts +51 -0
  123. package/src/lexicon/types/app/rocksky/shout.ts +30 -0
  124. package/src/lexicon/types/app/rocksky/song/createSong.ts +71 -0
  125. package/src/lexicon/types/app/rocksky/song/defs.ts +103 -0
  126. package/src/lexicon/types/app/rocksky/song/getSong.ts +43 -0
  127. package/src/lexicon/types/app/rocksky/song/getSongs.ts +50 -0
  128. package/src/lexicon/types/app/rocksky/song.ts +74 -0
  129. package/src/lexicon/types/app/rocksky/spotify/defs.ts +35 -0
  130. package/src/lexicon/types/app/rocksky/spotify/getCurrentlyPlaying.ts +43 -0
  131. package/src/lexicon/types/app/rocksky/spotify/next.ts +32 -0
  132. package/src/lexicon/types/app/rocksky/spotify/pause.ts +32 -0
  133. package/src/lexicon/types/app/rocksky/spotify/play.ts +32 -0
  134. package/src/lexicon/types/app/rocksky/spotify/previous.ts +32 -0
  135. package/src/lexicon/types/app/rocksky/spotify/seek.ts +35 -0
  136. package/src/lexicon/types/app/rocksky/stats/defs.ts +33 -0
  137. package/src/lexicon/types/app/rocksky/stats/getStats.ts +43 -0
  138. package/src/lexicon/types/com/atproto/repo/strongRef.ts +26 -0
  139. package/src/lexicon/util.ts +13 -0
  140. package/src/lib/agent.ts +56 -0
  141. package/src/lib/cleanUpJetstreamLock.ts +66 -0
  142. package/src/lib/cleanUpSyncLock.ts +56 -0
  143. package/src/lib/didUnstorageCache.ts +72 -0
  144. package/src/lib/env.ts +25 -0
  145. package/src/lib/extractPdsFromDid.ts +33 -0
  146. package/src/lib/getDidAndHandle.ts +39 -0
  147. package/src/lib/idResolver.ts +52 -0
  148. package/src/lib/lastfm.ts +26 -0
  149. package/src/lib/matchTrack.ts +47 -0
  150. package/src/logger.ts +18 -0
  151. package/src/schema/album-tracks.ts +30 -0
  152. package/src/schema/albums.ts +29 -0
  153. package/src/schema/artist-albums.ts +29 -0
  154. package/src/schema/artist-genres.ts +17 -0
  155. package/src/schema/artist-tracks.ts +29 -0
  156. package/src/schema/artists.ts +30 -0
  157. package/src/schema/auth-session.ts +18 -0
  158. package/src/schema/genres.ts +18 -0
  159. package/src/schema/index.ts +33 -0
  160. package/src/schema/loved-tracks.ts +27 -0
  161. package/src/schema/scrobbles.ts +30 -0
  162. package/src/schema/tracks.ts +39 -0
  163. package/src/schema/user-albums.ts +31 -0
  164. package/src/schema/user-artists.ts +32 -0
  165. package/src/schema/user-tracks.ts +31 -0
  166. package/src/schema/users.ts +21 -0
  167. package/src/scrobble.ts +410 -0
  168. package/src/sqliteKv.ts +173 -0
  169. package/src/types.ts +308 -0
  170. package/tsconfig.json +26 -29
@@ -0,0 +1,85 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { lexicons } from '../../../../lexicons'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { CID } from 'multiformats/cid'
8
+ import * as AppRockskySongDefsSongViewBasic from '../song/defs/songViewBasic'
9
+
10
+ export interface AlbumViewBasic {
11
+ /** The unique identifier of the album. */
12
+ id?: string
13
+ /** The URI of the album. */
14
+ uri?: string
15
+ /** The title of the album. */
16
+ title?: string
17
+ /** The artist of the album. */
18
+ artist?: string
19
+ /** The URI of the album's artist. */
20
+ artistUri?: string
21
+ /** The year the album was released. */
22
+ year?: number
23
+ /** The URL of the album art image. */
24
+ albumArt?: string
25
+ /** The release date of the album. */
26
+ releaseDate?: string
27
+ /** The SHA256 hash of the album. */
28
+ sha256?: string
29
+ /** The number of times the album has been played. */
30
+ playCount?: number
31
+ /** The number of unique listeners who have played the album. */
32
+ uniqueListeners?: number
33
+ [k: string]: unknown
34
+ }
35
+
36
+ export function isAlbumViewBasic(v: unknown): v is AlbumViewBasic {
37
+ return (
38
+ isObj(v) &&
39
+ hasProp(v, '$type') &&
40
+ v.$type === 'app.rocksky.album.defs#albumViewBasic'
41
+ )
42
+ }
43
+
44
+ export function validateAlbumViewBasic(v: unknown): ValidationResult {
45
+ return lexicons.validate('app.rocksky.album.defs#albumViewBasic', v)
46
+ }
47
+
48
+ export interface AlbumViewDetailed {
49
+ /** The unique identifier of the album. */
50
+ id?: string
51
+ /** The URI of the album. */
52
+ uri?: string
53
+ /** The title of the album. */
54
+ title?: string
55
+ /** The artist of the album. */
56
+ artist?: string
57
+ /** The URI of the album's artist. */
58
+ artistUri?: string
59
+ /** The year the album was released. */
60
+ year?: number
61
+ /** The URL of the album art image. */
62
+ albumArt?: string
63
+ /** The release date of the album. */
64
+ releaseDate?: string
65
+ /** The SHA256 hash of the album. */
66
+ sha256?: string
67
+ /** The number of times the album has been played. */
68
+ playCount?: number
69
+ /** The number of unique listeners who have played the album. */
70
+ uniqueListeners?: number
71
+ tracks?: AppRockskySongDefsSongViewBasic.Main[]
72
+ [k: string]: unknown
73
+ }
74
+
75
+ export function isAlbumViewDetailed(v: unknown): v is AlbumViewDetailed {
76
+ return (
77
+ isObj(v) &&
78
+ hasProp(v, '$type') &&
79
+ v.$type === 'app.rocksky.album.defs#albumViewDetailed'
80
+ )
81
+ }
82
+
83
+ export function validateAlbumViewDetailed(v: unknown): ValidationResult {
84
+ return lexicons.validate('app.rocksky.album.defs#albumViewDetailed', v)
85
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { isObj, hasProp } from '../../../../util'
8
+ import { CID } from 'multiformats/cid'
9
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
10
+ import * as AppRockskyAlbumDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ /** The URI of the album to retrieve. */
14
+ uri: string
15
+ }
16
+
17
+ export type InputSchema = undefined
18
+ export type OutputSchema = AppRockskyAlbumDefs.AlbumViewDetailed
19
+ export type HandlerInput = undefined
20
+
21
+ export interface HandlerSuccess {
22
+ encoding: 'application/json'
23
+ body: OutputSchema
24
+ headers?: { [key: string]: string }
25
+ }
26
+
27
+ export interface HandlerError {
28
+ status: number
29
+ message?: string
30
+ }
31
+
32
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
33
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
34
+ auth: HA
35
+ params: QueryParams
36
+ input: HandlerInput
37
+ req: express.Request
38
+ res: express.Response
39
+ resetRouteRateLimits: () => Promise<void>
40
+ }
41
+ export type Handler<HA extends HandlerAuth = never> = (
42
+ ctx: HandlerReqCtx<HA>,
43
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,48 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { isObj, hasProp } from '../../../../util'
8
+ import { CID } from 'multiformats/cid'
9
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
10
+ import * as AppRockskySongDefs from '../song/defs'
11
+
12
+ export interface QueryParams {
13
+ /** The URI of the album to retrieve tracks from */
14
+ uri: string
15
+ }
16
+
17
+ export type InputSchema = undefined
18
+
19
+ export interface OutputSchema {
20
+ tracks?: AppRockskySongDefs.SongViewBasic[]
21
+ [k: string]: unknown
22
+ }
23
+
24
+ export type HandlerInput = undefined
25
+
26
+ export interface HandlerSuccess {
27
+ encoding: 'application/json'
28
+ body: OutputSchema
29
+ headers?: { [key: string]: string }
30
+ }
31
+
32
+ export interface HandlerError {
33
+ status: number
34
+ message?: string
35
+ }
36
+
37
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
38
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
39
+ auth: HA
40
+ params: QueryParams
41
+ input: HandlerInput
42
+ req: express.Request
43
+ res: express.Response
44
+ resetRouteRateLimits: () => Promise<void>
45
+ }
46
+ export type Handler<HA extends HandlerAuth = never> = (
47
+ ctx: HandlerReqCtx<HA>,
48
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,50 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { isObj, hasProp } from '../../../../util'
8
+ import { CID } from 'multiformats/cid'
9
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
10
+ import * as AppRockskyAlbumDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ /** The maximum number of albums to return */
14
+ limit?: number
15
+ /** The offset for pagination */
16
+ offset?: number
17
+ }
18
+
19
+ export type InputSchema = undefined
20
+
21
+ export interface OutputSchema {
22
+ albums?: AppRockskyAlbumDefs.AlbumViewBasic[]
23
+ [k: string]: unknown
24
+ }
25
+
26
+ export type HandlerInput = undefined
27
+
28
+ export interface HandlerSuccess {
29
+ encoding: 'application/json'
30
+ body: OutputSchema
31
+ headers?: { [key: string]: string }
32
+ }
33
+
34
+ export interface HandlerError {
35
+ status: number
36
+ message?: string
37
+ }
38
+
39
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
40
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
41
+ auth: HA
42
+ params: QueryParams
43
+ input: HandlerInput
44
+ req: express.Request
45
+ res: express.Response
46
+ resetRouteRateLimits: () => Promise<void>
47
+ }
48
+ export type Handler<HA extends HandlerAuth = never> = (
49
+ ctx: HandlerReqCtx<HA>,
50
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,51 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { lexicons } from '../../../lexicons'
6
+ import { isObj, hasProp } from '../../../util'
7
+ import { CID } from 'multiformats/cid'
8
+
9
+ export interface Record {
10
+ /** The title of the album. */
11
+ title: string
12
+ /** The artist of the album. */
13
+ artist: string
14
+ /** The duration of the album in seconds. */
15
+ duration?: number
16
+ /** The release date of the album. */
17
+ releaseDate?: string
18
+ /** The year the album was released. */
19
+ year?: number
20
+ /** The genre of the album. */
21
+ genre?: string
22
+ /** The album art of the album. */
23
+ albumArt?: BlobRef
24
+ /** The URL of the album art of the album. */
25
+ albumArtUrl?: string
26
+ /** The tags of the album. */
27
+ tags?: string[]
28
+ /** The YouTube link of the album. */
29
+ youtubeLink?: string
30
+ /** The Spotify link of the album. */
31
+ spotifyLink?: string
32
+ /** The tidal link of the album. */
33
+ tidalLink?: string
34
+ /** The Apple Music link of the album. */
35
+ appleMusicLink?: string
36
+ /** The date and time when the album was created. */
37
+ createdAt: string
38
+ [k: string]: unknown
39
+ }
40
+
41
+ export function isRecord(v: unknown): v is Record {
42
+ return (
43
+ isObj(v) &&
44
+ hasProp(v, '$type') &&
45
+ (v.$type === 'app.rocksky.album#main' || v.$type === 'app.rocksky.album')
46
+ )
47
+ }
48
+
49
+ export function validateRecord(v: unknown): ValidationResult {
50
+ return lexicons.validate('app.rocksky.album#main', v)
51
+ }
@@ -0,0 +1,51 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { isObj, hasProp } from '../../../../util'
8
+ import { CID } from 'multiformats/cid'
9
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
10
+ import * as AppRockskyApikeyDefs from './defs'
11
+
12
+ export interface QueryParams {}
13
+
14
+ export interface InputSchema {
15
+ /** The name of the API key. */
16
+ name: string
17
+ /** A description for the API key. */
18
+ description?: string
19
+ [k: string]: unknown
20
+ }
21
+
22
+ export type OutputSchema = AppRockskyApikeyDefs.ApiKey
23
+
24
+ export interface HandlerInput {
25
+ encoding: 'application/json'
26
+ body: InputSchema
27
+ }
28
+
29
+ export interface HandlerSuccess {
30
+ encoding: 'application/json'
31
+ body: OutputSchema
32
+ headers?: { [key: string]: string }
33
+ }
34
+
35
+ export interface HandlerError {
36
+ status: number
37
+ message?: string
38
+ }
39
+
40
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
41
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
42
+ auth: HA
43
+ params: QueryParams
44
+ input: HandlerInput
45
+ req: express.Request
46
+ res: express.Response
47
+ resetRouteRateLimits: () => Promise<void>
48
+ }
49
+ export type Handler<HA extends HandlerAuth = never> = (
50
+ ctx: HandlerReqCtx<HA>,
51
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,31 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { lexicons } from '../../../../lexicons'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { CID } from 'multiformats/cid'
8
+
9
+ export interface ApiKeyView {
10
+ /** The unique identifier of the API key. */
11
+ id?: string
12
+ /** The name of the API key. */
13
+ name?: string
14
+ /** A description for the API key. */
15
+ description?: string
16
+ /** The date and time when the API key was created. */
17
+ createdAt?: string
18
+ [k: string]: unknown
19
+ }
20
+
21
+ export function isApiKeyView(v: unknown): v is ApiKeyView {
22
+ return (
23
+ isObj(v) &&
24
+ hasProp(v, '$type') &&
25
+ v.$type === 'app.rocksky.apikey.defs#apiKeyView'
26
+ )
27
+ }
28
+
29
+ export function validateApiKeyView(v: unknown): ValidationResult {
30
+ return lexicons.validate('app.rocksky.apikey.defs#apiKeyView', v)
31
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { isObj, hasProp } from '../../../../util'
8
+ import { CID } from 'multiformats/cid'
9
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
10
+ import * as AppRockskyApikeyDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ /** The number of API keys to skip before starting to collect the result set. */
14
+ offset?: number
15
+ /** The number of API keys to return per page. */
16
+ limit?: number
17
+ }
18
+
19
+ export type InputSchema = undefined
20
+
21
+ export interface OutputSchema {
22
+ apiKeys?: AppRockskyApikeyDefs.ApikeyView[]
23
+ [k: string]: unknown
24
+ }
25
+
26
+ export type HandlerInput = undefined
27
+
28
+ export interface HandlerSuccess {
29
+ encoding: 'application/json'
30
+ body: OutputSchema
31
+ headers?: { [key: string]: string }
32
+ }
33
+
34
+ export interface HandlerError {
35
+ status: number
36
+ message?: string
37
+ }
38
+
39
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
40
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
41
+ auth: HA
42
+ params: QueryParams
43
+ input: HandlerInput
44
+ req: express.Request
45
+ res: express.Response
46
+ resetRouteRateLimits: () => Promise<void>
47
+ }
48
+ export type Handler<HA extends HandlerAuth = never> = (
49
+ ctx: HandlerReqCtx<HA>,
50
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,43 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { isObj, hasProp } from '../../../../util'
8
+ import { CID } from 'multiformats/cid'
9
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
10
+ import * as AppRockskyApikeyDefs from './defs'
11
+
12
+ export interface QueryParams {
13
+ /** The ID of the API key to remove. */
14
+ id: string
15
+ }
16
+
17
+ export type InputSchema = undefined
18
+ export type OutputSchema = AppRockskyApikeyDefs.ApiKey
19
+ export type HandlerInput = undefined
20
+
21
+ export interface HandlerSuccess {
22
+ encoding: 'application/json'
23
+ body: OutputSchema
24
+ headers?: { [key: string]: string }
25
+ }
26
+
27
+ export interface HandlerError {
28
+ status: number
29
+ message?: string
30
+ }
31
+
32
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
33
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
34
+ auth: HA
35
+ params: QueryParams
36
+ input: HandlerInput
37
+ req: express.Request
38
+ res: express.Response
39
+ resetRouteRateLimits: () => Promise<void>
40
+ }
41
+ export type Handler<HA extends HandlerAuth = never> = (
42
+ ctx: HandlerReqCtx<HA>,
43
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,53 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import express from 'express'
5
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
6
+ import { lexicons } from '../../../../lexicons'
7
+ import { isObj, hasProp } from '../../../../util'
8
+ import { CID } from 'multiformats/cid'
9
+ import { HandlerAuth, HandlerPipeThrough } from '@atproto/xrpc-server'
10
+ import * as AppRockskyApikeyDefs from './defs'
11
+
12
+ export interface QueryParams {}
13
+
14
+ export interface InputSchema {
15
+ /** The ID of the API key to update. */
16
+ id: string
17
+ /** The new name of the API key. */
18
+ name: string
19
+ /** A new description for the API key. */
20
+ description?: string
21
+ [k: string]: unknown
22
+ }
23
+
24
+ export type OutputSchema = AppRockskyApikeyDefs.ApiKey
25
+
26
+ export interface HandlerInput {
27
+ encoding: 'application/json'
28
+ body: InputSchema
29
+ }
30
+
31
+ export interface HandlerSuccess {
32
+ encoding: 'application/json'
33
+ body: OutputSchema
34
+ headers?: { [key: string]: string }
35
+ }
36
+
37
+ export interface HandlerError {
38
+ status: number
39
+ message?: string
40
+ }
41
+
42
+ export type HandlerOutput = HandlerError | HandlerSuccess | HandlerPipeThrough
43
+ export type HandlerReqCtx<HA extends HandlerAuth = never> = {
44
+ auth: HA
45
+ params: QueryParams
46
+ input: HandlerInput
47
+ req: express.Request
48
+ res: express.Response
49
+ resetRouteRateLimits: () => Promise<void>
50
+ }
51
+ export type Handler<HA extends HandlerAuth = never> = (
52
+ ctx: HandlerReqCtx<HA>,
53
+ ) => Promise<HandlerOutput> | HandlerOutput
@@ -0,0 +1,7 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { lexicons } from '../../../../lexicons'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { CID } from 'multiformats/cid'
@@ -0,0 +1,140 @@
1
+ /**
2
+ * GENERATED CODE - DO NOT MODIFY
3
+ */
4
+ import { ValidationResult, BlobRef } from '@atproto/lexicon'
5
+ import { lexicons } from '../../../../lexicons'
6
+ import { isObj, hasProp } from '../../../../util'
7
+ import { CID } from 'multiformats/cid'
8
+
9
+ export interface ArtistViewBasic {
10
+ /** The unique identifier of the artist. */
11
+ id?: string
12
+ /** The URI of the artist. */
13
+ uri?: string
14
+ /** The name of the artist. */
15
+ name?: string
16
+ /** The picture of the artist. */
17
+ picture?: string
18
+ /** The SHA256 hash of the artist. */
19
+ sha256?: string
20
+ /** The number of times the artist has been played. */
21
+ playCount?: number
22
+ /** The number of unique listeners who have played the artist. */
23
+ uniqueListeners?: number
24
+ [k: string]: unknown
25
+ }
26
+
27
+ export function isArtistViewBasic(v: unknown): v is ArtistViewBasic {
28
+ return (
29
+ isObj(v) &&
30
+ hasProp(v, '$type') &&
31
+ v.$type === 'app.rocksky.artist.defs#artistViewBasic'
32
+ )
33
+ }
34
+
35
+ export function validateArtistViewBasic(v: unknown): ValidationResult {
36
+ return lexicons.validate('app.rocksky.artist.defs#artistViewBasic', v)
37
+ }
38
+
39
+ export interface ArtistViewDetailed {
40
+ /** The unique identifier of the artist. */
41
+ id?: string
42
+ /** The URI of the artist. */
43
+ uri?: string
44
+ /** The name of the artist. */
45
+ name?: string
46
+ /** The picture of the artist. */
47
+ picture?: string
48
+ /** The SHA256 hash of the artist. */
49
+ sha256?: string
50
+ /** The number of times the artist has been played. */
51
+ playCount?: number
52
+ /** The number of unique listeners who have played the artist. */
53
+ uniqueListeners?: number
54
+ [k: string]: unknown
55
+ }
56
+
57
+ export function isArtistViewDetailed(v: unknown): v is ArtistViewDetailed {
58
+ return (
59
+ isObj(v) &&
60
+ hasProp(v, '$type') &&
61
+ v.$type === 'app.rocksky.artist.defs#artistViewDetailed'
62
+ )
63
+ }
64
+
65
+ export function validateArtistViewDetailed(v: unknown): ValidationResult {
66
+ return lexicons.validate('app.rocksky.artist.defs#artistViewDetailed', v)
67
+ }
68
+
69
+ export interface SongViewBasic {
70
+ /** The URI of the song. */
71
+ uri?: string
72
+ /** The title of the song. */
73
+ title?: string
74
+ /** The number of times the song has been played. */
75
+ playCount?: number
76
+ [k: string]: unknown
77
+ }
78
+
79
+ export function isSongViewBasic(v: unknown): v is SongViewBasic {
80
+ return (
81
+ isObj(v) &&
82
+ hasProp(v, '$type') &&
83
+ v.$type === 'app.rocksky.artist.defs#songViewBasic'
84
+ )
85
+ }
86
+
87
+ export function validateSongViewBasic(v: unknown): ValidationResult {
88
+ return lexicons.validate('app.rocksky.artist.defs#songViewBasic', v)
89
+ }
90
+
91
+ export interface ListenerViewBasic {
92
+ /** The unique identifier of the actor. */
93
+ id?: string
94
+ /** The DID of the listener. */
95
+ did?: string
96
+ /** The handle of the listener. */
97
+ handle?: string
98
+ /** The display name of the listener. */
99
+ displayName?: string
100
+ /** The URL of the listener's avatar image. */
101
+ avatar?: string
102
+ mostListenedSong?: SongViewBasic
103
+ /** The total number of plays by the listener. */
104
+ totalPlays?: number
105
+ /** The rank of the listener among all listeners of the artist. */
106
+ rank?: number
107
+ [k: string]: unknown
108
+ }
109
+
110
+ export function isListenerViewBasic(v: unknown): v is ListenerViewBasic {
111
+ return (
112
+ isObj(v) &&
113
+ hasProp(v, '$type') &&
114
+ v.$type === 'app.rocksky.artist.defs#listenerViewBasic'
115
+ )
116
+ }
117
+
118
+ export function validateListenerViewBasic(v: unknown): ValidationResult {
119
+ return lexicons.validate('app.rocksky.artist.defs#listenerViewBasic', v)
120
+ }
121
+
122
+ export interface ArtistMbid {
123
+ /** The MusicBrainz Identifier (MBID) of the artist. */
124
+ mbid?: string
125
+ /** The name of the artist. */
126
+ name?: string
127
+ [k: string]: unknown
128
+ }
129
+
130
+ export function isArtistMbid(v: unknown): v is ArtistMbid {
131
+ return (
132
+ isObj(v) &&
133
+ hasProp(v, '$type') &&
134
+ v.$type === 'app.rocksky.artist.defs#artistMbid'
135
+ )
136
+ }
137
+
138
+ export function validateArtistMbid(v: unknown): ValidationResult {
139
+ return lexicons.validate('app.rocksky.artist.defs#artistMbid', v)
140
+ }