@keystrokehq/spotify 0.0.1

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 (72) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +113 -0
  3. package/dist/_official/index.d.mts +32 -0
  4. package/dist/_official/index.mjs +3 -0
  5. package/dist/_runtime/index.d.mts +1 -0
  6. package/dist/_runtime/index.mjs +1 -0
  7. package/dist/albums.d.mts +265 -0
  8. package/dist/albums.mjs +72 -0
  9. package/dist/artists.d.mts +237 -0
  10. package/dist/artists.mjs +84 -0
  11. package/dist/audio-analysis.d.mts +91 -0
  12. package/dist/audio-analysis.mjs +19 -0
  13. package/dist/audio-features.d.mts +61 -0
  14. package/dist/audio-features.mjs +31 -0
  15. package/dist/audiobooks.d.mts +176 -0
  16. package/dist/audiobooks.mjs +59 -0
  17. package/dist/browse.d.mts +74 -0
  18. package/dist/browse.mjs +31 -0
  19. package/dist/categories.d.mts +118 -0
  20. package/dist/categories.mjs +66 -0
  21. package/dist/chapters.d.mts +163 -0
  22. package/dist/chapters.mjs +39 -0
  23. package/dist/client.d.mts +3486 -0
  24. package/dist/client.mjs +758 -0
  25. package/dist/connection.d.mts +2 -0
  26. package/dist/connection.mjs +3 -0
  27. package/dist/episodes.d.mts +149 -0
  28. package/dist/episodes.mjs +39 -0
  29. package/dist/errors.d.mts +34 -0
  30. package/dist/errors.mjs +89 -0
  31. package/dist/events.d.mts +613 -0
  32. package/dist/events.mjs +55 -0
  33. package/dist/factory-tZba6Hij.mjs +8 -0
  34. package/dist/follow.d.mts +83 -0
  35. package/dist/follow.mjs +65 -0
  36. package/dist/genres.d.mts +14 -0
  37. package/dist/genres.mjs +19 -0
  38. package/dist/index.d.mts +1 -0
  39. package/dist/index.mjs +1 -0
  40. package/dist/integration-DQ5Egd4f.d.mts +41 -0
  41. package/dist/integration-ykoImsCq.mjs +78 -0
  42. package/dist/library.d.mts +472 -0
  43. package/dist/library.mjs +225 -0
  44. package/dist/markets.d.mts +14 -0
  45. package/dist/markets.mjs +20 -0
  46. package/dist/me.d.mts +169 -0
  47. package/dist/me.mjs +58 -0
  48. package/dist/messaging.d.mts +1 -0
  49. package/dist/messaging.mjs +1 -0
  50. package/dist/operations.d.mts +6 -0
  51. package/dist/operations.mjs +237 -0
  52. package/dist/player.d.mts +877 -0
  53. package/dist/player.mjs +220 -0
  54. package/dist/playlists.d.mts +546 -0
  55. package/dist/playlists.mjs +243 -0
  56. package/dist/recommendations.d.mts +144 -0
  57. package/dist/recommendations.mjs +137 -0
  58. package/dist/schemas.d.mts +3312 -0
  59. package/dist/schemas.mjs +460 -0
  60. package/dist/search.d.mts +389 -0
  61. package/dist/search.mjs +42 -0
  62. package/dist/shows.d.mts +159 -0
  63. package/dist/shows.mjs +59 -0
  64. package/dist/tracks.d.mts +173 -0
  65. package/dist/tracks.mjs +37 -0
  66. package/dist/triggers.d.mts +45 -0
  67. package/dist/triggers.mjs +201 -0
  68. package/dist/users.d.mts +35 -0
  69. package/dist/users.mjs +20 -0
  70. package/dist/verification.d.mts +1 -0
  71. package/dist/verification.mjs +1 -0
  72. package/package.json +187 -0
@@ -0,0 +1,39 @@
1
+ import { spotifyChapterSchema, spotifyIdSchema, spotifyMarketSchema } from "./schemas.mjs";
2
+ import { createSpotifyClient } from "./client.mjs";
3
+ import { t as spotifyOperation } from "./factory-tZba6Hij.mjs";
4
+ import { z } from "zod";
5
+
6
+ //#region src/chapters.ts
7
+ const chapterIdsSchema = z.array(spotifyIdSchema).min(1).max(50);
8
+ const chapterLookupInputSchema = z.object({
9
+ id: spotifyIdSchema,
10
+ market: spotifyMarketSchema.optional()
11
+ });
12
+ const severalChaptersInputSchema = z.object({
13
+ ids: chapterIdsSchema,
14
+ market: spotifyMarketSchema.optional()
15
+ });
16
+ const severalChaptersOutputSchema = z.object({ chapters: z.array(spotifyChapterSchema) });
17
+ const getChapter = spotifyOperation({
18
+ id: "get_spotify_chapter",
19
+ name: "Get Spotify Chapter",
20
+ description: "Fetch a single Spotify chapter by ID.",
21
+ input: chapterLookupInputSchema,
22
+ output: spotifyChapterSchema,
23
+ run: async (input, credentials) => {
24
+ return createSpotifyClient(credentials).chapters.getChapter(input.id, input.market);
25
+ }
26
+ });
27
+ const getSeveralChapters = spotifyOperation({
28
+ id: "get_spotify_several_chapters",
29
+ name: "Get Several Spotify Chapters",
30
+ description: "Fetch multiple Spotify chapters in a single request.",
31
+ input: severalChaptersInputSchema,
32
+ output: severalChaptersOutputSchema,
33
+ run: async (input, credentials) => {
34
+ return createSpotifyClient(credentials).chapters.getSeveralChapters(input.ids, input.market);
35
+ }
36
+ });
37
+
38
+ //#endregion
39
+ export { getChapter, getSeveralChapters };