@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,237 @@
1
+ import { z } from "zod";
2
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
3
+ import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
+
5
+ //#region src/artists.d.ts
6
+ declare const getArtist: _keystrokehq_core0.Operation<z.ZodObject<{
7
+ id: z.ZodString;
8
+ }, z.core.$strip>, z.ZodObject<{
9
+ externalUrls: z.ZodOptional<z.ZodObject<{
10
+ spotify: z.ZodOptional<z.ZodURL>;
11
+ }, z.core.$strip>>;
12
+ href: z.ZodOptional<z.ZodURL>;
13
+ id: z.ZodString;
14
+ name: z.ZodString;
15
+ type: z.ZodLiteral<"artist">;
16
+ uri: z.ZodOptional<z.ZodString>;
17
+ followers: z.ZodOptional<z.ZodObject<{
18
+ href: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
19
+ total: z.ZodNumber;
20
+ }, z.core.$strip>>;
21
+ genres: z.ZodOptional<z.ZodArray<z.ZodString>>;
22
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
23
+ url: z.ZodURL;
24
+ height: z.ZodNullable<z.ZodNumber>;
25
+ width: z.ZodNullable<z.ZodNumber>;
26
+ }, z.core.$strip>>>;
27
+ popularity: z.ZodOptional<z.ZodNumber>;
28
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
29
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
30
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
31
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
32
+ }, z.core.$strip>>[] | undefined>], undefined>;
33
+ declare const getArtistAlbums: _keystrokehq_core0.Operation<z.ZodObject<{
34
+ limit: z.ZodOptional<z.ZodNumber>;
35
+ offset: z.ZodOptional<z.ZodNumber>;
36
+ id: z.ZodString;
37
+ includeGroups: z.ZodOptional<z.ZodArray<z.ZodEnum<{
38
+ album: "album";
39
+ single: "single";
40
+ compilation: "compilation";
41
+ appears_on: "appears_on";
42
+ }>>>;
43
+ market: z.ZodOptional<z.ZodString>;
44
+ }, z.core.$strip>, z.ZodObject<{
45
+ href: z.ZodOptional<z.ZodURL>;
46
+ items: z.ZodArray<z.ZodObject<{
47
+ albumType: z.ZodOptional<z.ZodEnum<{
48
+ album: "album";
49
+ single: "single";
50
+ compilation: "compilation";
51
+ }>>;
52
+ artists: z.ZodArray<z.ZodObject<{
53
+ externalUrls: z.ZodOptional<z.ZodObject<{
54
+ spotify: z.ZodOptional<z.ZodURL>;
55
+ }, z.core.$strip>>;
56
+ href: z.ZodOptional<z.ZodURL>;
57
+ id: z.ZodString;
58
+ name: z.ZodString;
59
+ type: z.ZodLiteral<"artist">;
60
+ uri: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$strip>>;
62
+ availableMarkets: z.ZodOptional<z.ZodArray<z.ZodString>>;
63
+ externalUrls: z.ZodOptional<z.ZodObject<{
64
+ spotify: z.ZodOptional<z.ZodURL>;
65
+ }, z.core.$strip>>;
66
+ href: z.ZodOptional<z.ZodURL>;
67
+ id: z.ZodString;
68
+ images: z.ZodArray<z.ZodObject<{
69
+ url: z.ZodURL;
70
+ height: z.ZodNullable<z.ZodNumber>;
71
+ width: z.ZodNullable<z.ZodNumber>;
72
+ }, z.core.$strip>>;
73
+ name: z.ZodString;
74
+ releaseDate: z.ZodOptional<z.ZodString>;
75
+ releaseDatePrecision: z.ZodOptional<z.ZodEnum<{
76
+ year: "year";
77
+ month: "month";
78
+ day: "day";
79
+ }>>;
80
+ totalTracks: z.ZodOptional<z.ZodNumber>;
81
+ type: z.ZodLiteral<"album">;
82
+ uri: z.ZodOptional<z.ZodString>;
83
+ }, z.core.$strip>>;
84
+ limit: z.ZodNumber;
85
+ nextPageToken: z.ZodOptional<z.ZodString>;
86
+ offset: z.ZodNumber;
87
+ previousPageToken: z.ZodOptional<z.ZodString>;
88
+ total: z.ZodOptional<z.ZodNumber>;
89
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
90
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
91
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
92
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
93
+ }, z.core.$strip>>[] | undefined>], undefined>;
94
+ declare const getArtistTopTracks: _keystrokehq_core0.Operation<z.ZodObject<{
95
+ id: z.ZodString;
96
+ market: z.ZodString;
97
+ }, z.core.$strip>, z.ZodObject<{
98
+ tracks: z.ZodArray<z.ZodObject<{
99
+ album: z.ZodOptional<z.ZodObject<{
100
+ albumType: z.ZodOptional<z.ZodEnum<{
101
+ album: "album";
102
+ single: "single";
103
+ compilation: "compilation";
104
+ }>>;
105
+ artists: z.ZodArray<z.ZodObject<{
106
+ externalUrls: z.ZodOptional<z.ZodObject<{
107
+ spotify: z.ZodOptional<z.ZodURL>;
108
+ }, z.core.$strip>>;
109
+ href: z.ZodOptional<z.ZodURL>;
110
+ id: z.ZodString;
111
+ name: z.ZodString;
112
+ type: z.ZodLiteral<"artist">;
113
+ uri: z.ZodOptional<z.ZodString>;
114
+ }, z.core.$strip>>;
115
+ availableMarkets: z.ZodOptional<z.ZodArray<z.ZodString>>;
116
+ externalUrls: z.ZodOptional<z.ZodObject<{
117
+ spotify: z.ZodOptional<z.ZodURL>;
118
+ }, z.core.$strip>>;
119
+ href: z.ZodOptional<z.ZodURL>;
120
+ id: z.ZodString;
121
+ images: z.ZodArray<z.ZodObject<{
122
+ url: z.ZodURL;
123
+ height: z.ZodNullable<z.ZodNumber>;
124
+ width: z.ZodNullable<z.ZodNumber>;
125
+ }, z.core.$strip>>;
126
+ name: z.ZodString;
127
+ releaseDate: z.ZodOptional<z.ZodString>;
128
+ releaseDatePrecision: z.ZodOptional<z.ZodEnum<{
129
+ year: "year";
130
+ month: "month";
131
+ day: "day";
132
+ }>>;
133
+ totalTracks: z.ZodOptional<z.ZodNumber>;
134
+ type: z.ZodLiteral<"album">;
135
+ uri: z.ZodOptional<z.ZodString>;
136
+ }, z.core.$strip>>;
137
+ artists: z.ZodArray<z.ZodObject<{
138
+ externalUrls: z.ZodOptional<z.ZodObject<{
139
+ spotify: z.ZodOptional<z.ZodURL>;
140
+ }, z.core.$strip>>;
141
+ href: z.ZodOptional<z.ZodURL>;
142
+ id: z.ZodString;
143
+ name: z.ZodString;
144
+ type: z.ZodLiteral<"artist">;
145
+ uri: z.ZodOptional<z.ZodString>;
146
+ }, z.core.$strip>>;
147
+ availableMarkets: z.ZodOptional<z.ZodArray<z.ZodString>>;
148
+ discNumber: z.ZodOptional<z.ZodNumber>;
149
+ durationMs: z.ZodNumber;
150
+ explicit: z.ZodBoolean;
151
+ externalIds: z.ZodOptional<z.ZodObject<{
152
+ isrc: z.ZodOptional<z.ZodString>;
153
+ ean: z.ZodOptional<z.ZodString>;
154
+ upc: z.ZodOptional<z.ZodString>;
155
+ }, z.core.$strip>>;
156
+ externalUrls: z.ZodOptional<z.ZodObject<{
157
+ spotify: z.ZodOptional<z.ZodURL>;
158
+ }, z.core.$strip>>;
159
+ href: z.ZodOptional<z.ZodURL>;
160
+ id: z.ZodString;
161
+ isLocal: z.ZodOptional<z.ZodBoolean>;
162
+ isPlayable: z.ZodOptional<z.ZodBoolean>;
163
+ name: z.ZodString;
164
+ popularity: z.ZodOptional<z.ZodNumber>;
165
+ previewUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
166
+ restrictions: z.ZodOptional<z.ZodObject<{
167
+ reason: z.ZodString;
168
+ }, z.core.$strip>>;
169
+ trackNumber: z.ZodOptional<z.ZodNumber>;
170
+ type: z.ZodLiteral<"track">;
171
+ uri: z.ZodOptional<z.ZodString>;
172
+ }, z.core.$strip>>;
173
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
174
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
175
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
176
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
177
+ }, z.core.$strip>>[] | undefined>], undefined>;
178
+ declare const getArtistRelatedArtists: _keystrokehq_core0.Operation<z.ZodObject<{
179
+ id: z.ZodString;
180
+ }, z.core.$strip>, z.ZodObject<{
181
+ artists: z.ZodArray<z.ZodObject<{
182
+ externalUrls: z.ZodOptional<z.ZodObject<{
183
+ spotify: z.ZodOptional<z.ZodURL>;
184
+ }, z.core.$strip>>;
185
+ href: z.ZodOptional<z.ZodURL>;
186
+ id: z.ZodString;
187
+ name: z.ZodString;
188
+ type: z.ZodLiteral<"artist">;
189
+ uri: z.ZodOptional<z.ZodString>;
190
+ followers: z.ZodOptional<z.ZodObject<{
191
+ href: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
192
+ total: z.ZodNumber;
193
+ }, z.core.$strip>>;
194
+ genres: z.ZodOptional<z.ZodArray<z.ZodString>>;
195
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
196
+ url: z.ZodURL;
197
+ height: z.ZodNullable<z.ZodNumber>;
198
+ width: z.ZodNullable<z.ZodNumber>;
199
+ }, z.core.$strip>>>;
200
+ popularity: z.ZodOptional<z.ZodNumber>;
201
+ }, z.core.$strip>>;
202
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
203
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
204
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
205
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
206
+ }, z.core.$strip>>[] | undefined>], undefined>;
207
+ declare const getSeveralArtists: _keystrokehq_core0.Operation<z.ZodObject<{
208
+ ids: z.ZodArray<z.ZodString>;
209
+ }, z.core.$strip>, z.ZodObject<{
210
+ artists: z.ZodArray<z.ZodObject<{
211
+ externalUrls: z.ZodOptional<z.ZodObject<{
212
+ spotify: z.ZodOptional<z.ZodURL>;
213
+ }, z.core.$strip>>;
214
+ href: z.ZodOptional<z.ZodURL>;
215
+ id: z.ZodString;
216
+ name: z.ZodString;
217
+ type: z.ZodLiteral<"artist">;
218
+ uri: z.ZodOptional<z.ZodString>;
219
+ followers: z.ZodOptional<z.ZodObject<{
220
+ href: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
221
+ total: z.ZodNumber;
222
+ }, z.core.$strip>>;
223
+ genres: z.ZodOptional<z.ZodArray<z.ZodString>>;
224
+ images: z.ZodOptional<z.ZodArray<z.ZodObject<{
225
+ url: z.ZodURL;
226
+ height: z.ZodNullable<z.ZodNumber>;
227
+ width: z.ZodNullable<z.ZodNumber>;
228
+ }, z.core.$strip>>>;
229
+ popularity: z.ZodOptional<z.ZodNumber>;
230
+ }, z.core.$strip>>;
231
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
232
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
233
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
234
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
235
+ }, z.core.$strip>>[] | undefined>], undefined>;
236
+ //#endregion
237
+ export { getArtist, getArtistAlbums, getArtistRelatedArtists, getArtistTopTracks, getSeveralArtists };
@@ -0,0 +1,84 @@
1
+ import { spotifyAlbumPageSchema, spotifyArtistSchema, spotifyIdSchema, spotifyMarketSchema, spotifyTrackSchema } 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/artists.ts
7
+ const artistIdListSchema = z.array(spotifyIdSchema).min(1).max(50);
8
+ const artistAlbumGroupSchema = z.enum([
9
+ "album",
10
+ "single",
11
+ "appears_on",
12
+ "compilation"
13
+ ]);
14
+ const pagingSchema = z.object({
15
+ limit: z.number().int().positive().max(50).optional(),
16
+ offset: z.number().int().nonnegative().optional()
17
+ });
18
+ const severalArtistsResponseSchema = z.object({ artists: z.array(spotifyArtistSchema) });
19
+ const artistTopTracksResponseSchema = z.object({ tracks: z.array(spotifyTrackSchema) });
20
+ const getArtist = spotifyOperation({
21
+ id: "get_spotify_artist",
22
+ name: "Get Spotify Artist",
23
+ description: "Fetch a Spotify artist by its ID.",
24
+ input: z.object({ id: spotifyIdSchema }),
25
+ output: spotifyArtistSchema,
26
+ run: async (input, credentials) => {
27
+ return createSpotifyClient(credentials).artists.getArtist(input.id);
28
+ }
29
+ });
30
+ const getArtistAlbums = spotifyOperation({
31
+ id: "get_spotify_artist_albums",
32
+ name: "Get Spotify Artist Albums",
33
+ description: "List albums released by a Spotify artist.",
34
+ input: pagingSchema.extend({
35
+ id: spotifyIdSchema,
36
+ includeGroups: z.array(artistAlbumGroupSchema).min(1).optional(),
37
+ market: spotifyMarketSchema.optional()
38
+ }),
39
+ output: spotifyAlbumPageSchema,
40
+ run: async (input, credentials) => {
41
+ return createSpotifyClient(credentials).artists.getArtistAlbums(input.id, {
42
+ include_groups: input.includeGroups,
43
+ market: input.market,
44
+ limit: input.limit,
45
+ offset: input.offset
46
+ });
47
+ }
48
+ });
49
+ const getArtistTopTracks = spotifyOperation({
50
+ id: "get_spotify_artist_top_tracks",
51
+ name: "Get Spotify Artist Top Tracks",
52
+ description: "Fetch the top tracks for a Spotify artist in a market.",
53
+ input: z.object({
54
+ id: spotifyIdSchema,
55
+ market: spotifyMarketSchema
56
+ }),
57
+ output: artistTopTracksResponseSchema,
58
+ run: async (input, credentials) => {
59
+ return createSpotifyClient(credentials).artists.getArtistTopTracks(input.id, input.market);
60
+ }
61
+ });
62
+ const getArtistRelatedArtists = spotifyOperation({
63
+ id: "get_spotify_artist_related_artists",
64
+ name: "Get Spotify Artist Related Artists",
65
+ description: "Fetch artists related to a Spotify artist. Deprecated upstream by Spotify.",
66
+ input: z.object({ id: spotifyIdSchema }),
67
+ output: severalArtistsResponseSchema,
68
+ run: async (input, credentials) => {
69
+ return createSpotifyClient(credentials).artists.getArtistRelatedArtists(input.id);
70
+ }
71
+ });
72
+ const getSeveralArtists = spotifyOperation({
73
+ id: "get_spotify_several_artists",
74
+ name: "Get Several Spotify Artists",
75
+ description: "Fetch multiple Spotify artists in one request.",
76
+ input: z.object({ ids: artistIdListSchema }),
77
+ output: severalArtistsResponseSchema,
78
+ run: async (input, credentials) => {
79
+ return createSpotifyClient(credentials).artists.getSeveralArtists(input.ids);
80
+ }
81
+ });
82
+
83
+ //#endregion
84
+ export { getArtist, getArtistAlbums, getArtistRelatedArtists, getArtistTopTracks, getSeveralArtists };
@@ -0,0 +1,91 @@
1
+ import { z } from "zod";
2
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
3
+ import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
+
5
+ //#region src/audio-analysis.d.ts
6
+ declare const getAudioAnalysis: _keystrokehq_core0.Operation<z.ZodObject<{
7
+ id: z.ZodString;
8
+ }, z.core.$strip>, z.ZodObject<{
9
+ bars: z.ZodOptional<z.ZodArray<z.ZodObject<{
10
+ start: z.ZodNumber;
11
+ duration: z.ZodNumber;
12
+ confidence: z.ZodOptional<z.ZodNumber>;
13
+ }, z.core.$strip>>>;
14
+ beats: z.ZodOptional<z.ZodArray<z.ZodObject<{
15
+ start: z.ZodNumber;
16
+ duration: z.ZodNumber;
17
+ confidence: z.ZodOptional<z.ZodNumber>;
18
+ }, z.core.$strip>>>;
19
+ meta: z.ZodOptional<z.ZodObject<{
20
+ analyzerVersion: z.ZodOptional<z.ZodString>;
21
+ platform: z.ZodOptional<z.ZodString>;
22
+ detailedStatus: z.ZodOptional<z.ZodString>;
23
+ statusCode: z.ZodOptional<z.ZodNumber>;
24
+ timestamp: z.ZodOptional<z.ZodNumber>;
25
+ analysisTime: z.ZodOptional<z.ZodNumber>;
26
+ inputProcess: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strip>>;
28
+ sections: z.ZodOptional<z.ZodArray<z.ZodObject<{
29
+ start: z.ZodNumber;
30
+ duration: z.ZodNumber;
31
+ confidence: z.ZodOptional<z.ZodNumber>;
32
+ loudness: z.ZodOptional<z.ZodNumber>;
33
+ tempo: z.ZodOptional<z.ZodNumber>;
34
+ tempoConfidence: z.ZodOptional<z.ZodNumber>;
35
+ key: z.ZodOptional<z.ZodNumber>;
36
+ keyConfidence: z.ZodOptional<z.ZodNumber>;
37
+ mode: z.ZodOptional<z.ZodNumber>;
38
+ modeConfidence: z.ZodOptional<z.ZodNumber>;
39
+ timeSignature: z.ZodOptional<z.ZodNumber>;
40
+ timeSignatureConfidence: z.ZodOptional<z.ZodNumber>;
41
+ }, z.core.$strip>>>;
42
+ segments: z.ZodOptional<z.ZodArray<z.ZodObject<{
43
+ start: z.ZodNumber;
44
+ duration: z.ZodNumber;
45
+ confidence: z.ZodOptional<z.ZodNumber>;
46
+ loudnessStart: z.ZodOptional<z.ZodNumber>;
47
+ loudnessMax: z.ZodOptional<z.ZodNumber>;
48
+ loudnessMaxTime: z.ZodOptional<z.ZodNumber>;
49
+ loudnessEnd: z.ZodOptional<z.ZodNumber>;
50
+ pitches: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
51
+ timbre: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
52
+ }, z.core.$strip>>>;
53
+ tatums: z.ZodOptional<z.ZodArray<z.ZodObject<{
54
+ start: z.ZodNumber;
55
+ duration: z.ZodNumber;
56
+ confidence: z.ZodOptional<z.ZodNumber>;
57
+ }, z.core.$strip>>>;
58
+ track: z.ZodOptional<z.ZodObject<{
59
+ duration: z.ZodOptional<z.ZodNumber>;
60
+ sampleMd5: z.ZodOptional<z.ZodString>;
61
+ offsetSeconds: z.ZodOptional<z.ZodNumber>;
62
+ windowSeconds: z.ZodOptional<z.ZodNumber>;
63
+ analysisSampleRate: z.ZodOptional<z.ZodNumber>;
64
+ analysisChannels: z.ZodOptional<z.ZodNumber>;
65
+ endOfFadeIn: z.ZodOptional<z.ZodNumber>;
66
+ startOfFadeOut: z.ZodOptional<z.ZodNumber>;
67
+ loudness: z.ZodOptional<z.ZodNumber>;
68
+ tempo: z.ZodOptional<z.ZodNumber>;
69
+ tempoConfidence: z.ZodOptional<z.ZodNumber>;
70
+ timeSignature: z.ZodOptional<z.ZodNumber>;
71
+ timeSignatureConfidence: z.ZodOptional<z.ZodNumber>;
72
+ key: z.ZodOptional<z.ZodNumber>;
73
+ keyConfidence: z.ZodOptional<z.ZodNumber>;
74
+ mode: z.ZodOptional<z.ZodNumber>;
75
+ modeConfidence: z.ZodOptional<z.ZodNumber>;
76
+ codestring: z.ZodOptional<z.ZodString>;
77
+ codeVersion: z.ZodOptional<z.ZodNumber>;
78
+ echoprintstring: z.ZodOptional<z.ZodString>;
79
+ echoprintVersion: z.ZodOptional<z.ZodNumber>;
80
+ synchstring: z.ZodOptional<z.ZodString>;
81
+ synchVersion: z.ZodOptional<z.ZodNumber>;
82
+ rhythmstring: z.ZodOptional<z.ZodString>;
83
+ rhythmVersion: z.ZodOptional<z.ZodNumber>;
84
+ }, z.core.$strip>>;
85
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
86
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
87
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
88
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
89
+ }, z.core.$strip>>[] | undefined>], undefined>;
90
+ //#endregion
91
+ export { getAudioAnalysis };
@@ -0,0 +1,19 @@
1
+ import { spotifyAudioAnalysisSchema, spotifyIdSchema } 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/audio-analysis.ts
7
+ const getAudioAnalysis = spotifyOperation({
8
+ id: "get_spotify_audio_analysis",
9
+ name: "Get Spotify Audio Analysis",
10
+ description: "Fetch the detailed Spotify audio analysis for a track.",
11
+ input: z.object({ id: spotifyIdSchema }),
12
+ output: spotifyAudioAnalysisSchema,
13
+ run: async (input, credentials) => {
14
+ return createSpotifyClient(credentials).audioAnalysis.getAudioAnalysis(input.id);
15
+ }
16
+ });
17
+
18
+ //#endregion
19
+ export { getAudioAnalysis };
@@ -0,0 +1,61 @@
1
+ import { z } from "zod";
2
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
3
+ import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
+
5
+ //#region src/audio-features.d.ts
6
+ declare const getAudioFeatures: _keystrokehq_core0.Operation<z.ZodObject<{
7
+ id: z.ZodString;
8
+ }, z.core.$strip>, z.ZodObject<{
9
+ acousticness: z.ZodNumber;
10
+ analysisUrl: z.ZodOptional<z.ZodURL>;
11
+ danceability: z.ZodNumber;
12
+ durationMs: z.ZodNumber;
13
+ energy: z.ZodNumber;
14
+ id: z.ZodString;
15
+ instrumentalness: z.ZodNumber;
16
+ key: z.ZodNumber;
17
+ liveness: z.ZodNumber;
18
+ loudness: z.ZodNumber;
19
+ mode: z.ZodNumber;
20
+ speechiness: z.ZodNumber;
21
+ tempo: z.ZodNumber;
22
+ timeSignature: z.ZodNumber;
23
+ trackHref: z.ZodOptional<z.ZodURL>;
24
+ type: z.ZodLiteral<"audio_features">;
25
+ uri: z.ZodOptional<z.ZodString>;
26
+ valence: z.ZodNumber;
27
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
28
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
29
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
30
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
31
+ }, z.core.$strip>>[] | undefined>], undefined>;
32
+ declare const getSeveralAudioFeatures: _keystrokehq_core0.Operation<z.ZodObject<{
33
+ ids: z.ZodArray<z.ZodString>;
34
+ }, z.core.$strip>, z.ZodObject<{
35
+ audioFeatures: z.ZodArray<z.ZodNullable<z.ZodObject<{
36
+ acousticness: z.ZodNumber;
37
+ analysisUrl: z.ZodOptional<z.ZodURL>;
38
+ danceability: z.ZodNumber;
39
+ durationMs: z.ZodNumber;
40
+ energy: z.ZodNumber;
41
+ id: z.ZodString;
42
+ instrumentalness: z.ZodNumber;
43
+ key: z.ZodNumber;
44
+ liveness: z.ZodNumber;
45
+ loudness: z.ZodNumber;
46
+ mode: z.ZodNumber;
47
+ speechiness: z.ZodNumber;
48
+ tempo: z.ZodNumber;
49
+ timeSignature: z.ZodNumber;
50
+ trackHref: z.ZodOptional<z.ZodURL>;
51
+ type: z.ZodLiteral<"audio_features">;
52
+ uri: z.ZodOptional<z.ZodString>;
53
+ valence: z.ZodNumber;
54
+ }, z.core.$strip>>>;
55
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
56
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
57
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
58
+ SPOTIFY_ACCESS_TOKEN: z.ZodString;
59
+ }, z.core.$strip>>[] | undefined>], undefined>;
60
+ //#endregion
61
+ export { getAudioFeatures, getSeveralAudioFeatures };
@@ -0,0 +1,31 @@
1
+ import { spotifyAudioFeaturesSchema, spotifyIdSchema } 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/audio-features.ts
7
+ const trackIdListSchema = z.array(spotifyIdSchema).min(1).max(100);
8
+ const severalAudioFeaturesResponseSchema = z.object({ audioFeatures: z.array(spotifyAudioFeaturesSchema.nullable()) });
9
+ const getAudioFeatures = spotifyOperation({
10
+ id: "get_spotify_audio_features",
11
+ name: "Get Spotify Audio Features",
12
+ description: "Fetch Spotify audio features for a track.",
13
+ input: z.object({ id: spotifyIdSchema }),
14
+ output: spotifyAudioFeaturesSchema,
15
+ run: async (input, credentials) => {
16
+ return createSpotifyClient(credentials).audioFeatures.getAudioFeatures(input.id);
17
+ }
18
+ });
19
+ const getSeveralAudioFeatures = spotifyOperation({
20
+ id: "get_spotify_several_audio_features",
21
+ name: "Get Several Spotify Audio Features",
22
+ description: "Fetch Spotify audio features for multiple tracks.",
23
+ input: z.object({ ids: trackIdListSchema }),
24
+ output: severalAudioFeaturesResponseSchema,
25
+ run: async (input, credentials) => {
26
+ return createSpotifyClient(credentials).audioFeatures.getSeveralAudioFeatures(input.ids);
27
+ }
28
+ });
29
+
30
+ //#endregion
31
+ export { getAudioFeatures, getSeveralAudioFeatures };