@keystrokehq/spotify 0.0.15 → 0.0.16-integration-id-canonicalization.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 (81) hide show
  1. package/README.md +22 -53
  2. package/dist/{schemas.mjs → browse-BaBol4IR.mjs} +87 -72
  3. package/dist/credential-sets/index.d.mts +2 -0
  4. package/dist/credential-sets/index.mjs +4 -0
  5. package/dist/index.d.mts +4 -1
  6. package/dist/index.mjs +6 -1
  7. package/dist/operations/index.d.mts +2 -0
  8. package/dist/operations/index.mjs +3 -0
  9. package/dist/{schemas.d.mts → schemas/index.d.mts} +408 -398
  10. package/dist/schemas/index.mjs +3 -0
  11. package/dist/spotify-app.credential-set-DT2fivE7.d.mts +34 -0
  12. package/dist/spotify-app.credential-set-O5UKOpLR.mjs +16 -0
  13. package/dist/spotify.credential-set-CS3lCW-x.mjs +44 -0
  14. package/dist/upload-playlist-cover-image.operation-CnyIlv11.mjs +4247 -0
  15. package/dist/upload-playlist-cover-image.operation-Cqbmylzz.d.mts +5246 -0
  16. package/package.json +12 -128
  17. package/dist/_official/index.d.mts +0 -28
  18. package/dist/_official/index.mjs +0 -3
  19. package/dist/_runtime/index.d.mts +0 -1
  20. package/dist/_runtime/index.mjs +0 -1
  21. package/dist/albums.d.mts +0 -256
  22. package/dist/albums.mjs +0 -72
  23. package/dist/artists.d.mts +0 -226
  24. package/dist/artists.mjs +0 -84
  25. package/dist/audio-analysis.d.mts +0 -88
  26. package/dist/audio-analysis.mjs +0 -19
  27. package/dist/audio-features.d.mts +0 -56
  28. package/dist/audio-features.mjs +0 -31
  29. package/dist/audiobooks.d.mts +0 -169
  30. package/dist/audiobooks.mjs +0 -59
  31. package/dist/browse.d.mts +0 -71
  32. package/dist/browse.mjs +0 -31
  33. package/dist/categories.d.mts +0 -111
  34. package/dist/categories.mjs +0 -66
  35. package/dist/chapters.d.mts +0 -158
  36. package/dist/chapters.mjs +0 -39
  37. package/dist/client.d.mts +0 -3486
  38. package/dist/client.mjs +0 -758
  39. package/dist/connection.d.mts +0 -2
  40. package/dist/connection.mjs +0 -3
  41. package/dist/episodes.d.mts +0 -144
  42. package/dist/episodes.mjs +0 -39
  43. package/dist/errors.d.mts +0 -34
  44. package/dist/errors.mjs +0 -89
  45. package/dist/events.d.mts +0 -613
  46. package/dist/events.mjs +0 -55
  47. package/dist/factory-DMprpzS1.mjs +0 -8
  48. package/dist/follow.d.mts +0 -74
  49. package/dist/follow.mjs +0 -65
  50. package/dist/genres.d.mts +0 -11
  51. package/dist/genres.mjs +0 -19
  52. package/dist/integration-B5oEi2sg.d.mts +0 -27
  53. package/dist/integration-D9ABjTOP.mjs +0 -51
  54. package/dist/library.d.mts +0 -431
  55. package/dist/library.mjs +0 -225
  56. package/dist/markets.d.mts +0 -11
  57. package/dist/markets.mjs +0 -20
  58. package/dist/me.d.mts +0 -162
  59. package/dist/me.mjs +0 -58
  60. package/dist/messaging.d.mts +0 -1
  61. package/dist/messaging.mjs +0 -1
  62. package/dist/operations.d.mts +0 -6
  63. package/dist/operations.mjs +0 -237
  64. package/dist/player.d.mts +0 -846
  65. package/dist/player.mjs +0 -220
  66. package/dist/playlists.d.mts +0 -517
  67. package/dist/playlists.mjs +0 -243
  68. package/dist/recommendations.d.mts +0 -141
  69. package/dist/recommendations.mjs +0 -137
  70. package/dist/search.d.mts +0 -386
  71. package/dist/search.mjs +0 -42
  72. package/dist/shows.d.mts +0 -152
  73. package/dist/shows.mjs +0 -59
  74. package/dist/tracks.d.mts +0 -168
  75. package/dist/tracks.mjs +0 -37
  76. package/dist/triggers.d.mts +0 -45
  77. package/dist/triggers.mjs +0 -186
  78. package/dist/users.d.mts +0 -32
  79. package/dist/users.mjs +0 -20
  80. package/dist/verification.d.mts +0 -1
  81. package/dist/verification.mjs +0 -1
package/dist/library.mjs DELETED
@@ -1,225 +0,0 @@
1
- import { spotifyBooleanListSchema, spotifyIdSchema, spotifyMarketSchema, spotifyMutationSuccessSchema, spotifySavedAlbumPageSchema, spotifySavedAudiobookPageSchema, spotifySavedEpisodePageSchema, spotifySavedShowPageSchema, spotifySavedTrackPageSchema } from "./schemas.mjs";
2
- import { createSpotifyClient } from "./client.mjs";
3
- import { t as spotifyOperation } from "./factory-DMprpzS1.mjs";
4
- import { z } from "zod";
5
-
6
- //#region src/library.ts
7
- const offsetPaginationInputSchema = z.object({
8
- limit: z.number().int().positive().max(50).optional(),
9
- offset: z.number().int().nonnegative().optional()
10
- });
11
- const marketOffsetPaginationInputSchema = offsetPaginationInputSchema.extend({ market: spotifyMarketSchema.optional() });
12
- const savedItemIdsInputSchema = z.object({ ids: z.array(spotifyIdSchema).min(1).max(50) });
13
- const listSavedAlbums = spotifyOperation({
14
- id: "spotify.list-saved-albums",
15
- name: "List Saved Albums",
16
- description: "List albums saved in the connected Spotify account library.",
17
- input: marketOffsetPaginationInputSchema,
18
- output: spotifySavedAlbumPageSchema,
19
- run: async (input, credentials) => {
20
- return createSpotifyClient(credentials).library.listSavedAlbums(input);
21
- }
22
- });
23
- const saveAlbums = spotifyOperation({
24
- id: "spotify.save-albums",
25
- name: "Save Albums",
26
- description: "Save albums to the connected Spotify account library.",
27
- input: savedItemIdsInputSchema,
28
- output: spotifyMutationSuccessSchema,
29
- needsApproval: true,
30
- run: async (input, credentials) => {
31
- return createSpotifyClient(credentials).library.saveAlbums(input.ids);
32
- }
33
- });
34
- const removeSavedAlbums = spotifyOperation({
35
- id: "spotify.remove-saved-albums",
36
- name: "Remove Saved Albums",
37
- description: "Remove saved albums from the connected Spotify account library.",
38
- input: savedItemIdsInputSchema,
39
- output: spotifyMutationSuccessSchema,
40
- needsApproval: true,
41
- run: async (input, credentials) => {
42
- return createSpotifyClient(credentials).library.removeSavedAlbums(input.ids);
43
- }
44
- });
45
- const checkSavedAlbums = spotifyOperation({
46
- id: "spotify.check-saved-albums",
47
- name: "Check Saved Albums",
48
- description: "Check whether albums are saved in the connected Spotify account library.",
49
- input: savedItemIdsInputSchema,
50
- output: spotifyBooleanListSchema,
51
- run: async (input, credentials) => {
52
- return createSpotifyClient(credentials).library.checkSavedAlbums(input.ids);
53
- }
54
- });
55
- const listSavedTracks = spotifyOperation({
56
- id: "spotify.list-saved-tracks",
57
- name: "List Saved Tracks",
58
- description: "List tracks saved in the connected Spotify account library.",
59
- input: marketOffsetPaginationInputSchema,
60
- output: spotifySavedTrackPageSchema,
61
- run: async (input, credentials) => {
62
- return createSpotifyClient(credentials).library.listSavedTracks(input);
63
- }
64
- });
65
- const saveTracks = spotifyOperation({
66
- id: "spotify.save-tracks",
67
- name: "Save Tracks",
68
- description: "Save tracks to the connected Spotify account library.",
69
- input: savedItemIdsInputSchema,
70
- output: spotifyMutationSuccessSchema,
71
- needsApproval: true,
72
- run: async (input, credentials) => {
73
- return createSpotifyClient(credentials).library.saveTracks(input.ids);
74
- }
75
- });
76
- const removeSavedTracks = spotifyOperation({
77
- id: "spotify.remove-saved-tracks",
78
- name: "Remove Saved Tracks",
79
- description: "Remove saved tracks from the connected Spotify account library.",
80
- input: savedItemIdsInputSchema,
81
- output: spotifyMutationSuccessSchema,
82
- needsApproval: true,
83
- run: async (input, credentials) => {
84
- return createSpotifyClient(credentials).library.removeSavedTracks(input.ids);
85
- }
86
- });
87
- const checkSavedTracks = spotifyOperation({
88
- id: "spotify.check-saved-tracks",
89
- name: "Check Saved Tracks",
90
- description: "Check whether tracks are saved in the connected Spotify account library.",
91
- input: savedItemIdsInputSchema,
92
- output: spotifyBooleanListSchema,
93
- run: async (input, credentials) => {
94
- return createSpotifyClient(credentials).library.checkSavedTracks(input.ids);
95
- }
96
- });
97
- const listSavedShows = spotifyOperation({
98
- id: "spotify.list-saved-shows",
99
- name: "List Saved Shows",
100
- description: "List shows saved in the connected Spotify account library.",
101
- input: offsetPaginationInputSchema,
102
- output: spotifySavedShowPageSchema,
103
- run: async (input, credentials) => {
104
- return createSpotifyClient(credentials).library.listSavedShows(input);
105
- }
106
- });
107
- const saveShows = spotifyOperation({
108
- id: "spotify.save-shows",
109
- name: "Save Shows",
110
- description: "Save shows to the connected Spotify account library.",
111
- input: savedItemIdsInputSchema,
112
- output: spotifyMutationSuccessSchema,
113
- needsApproval: true,
114
- run: async (input, credentials) => {
115
- return createSpotifyClient(credentials).library.saveShows(input.ids);
116
- }
117
- });
118
- const removeSavedShows = spotifyOperation({
119
- id: "spotify.remove-saved-shows",
120
- name: "Remove Saved Shows",
121
- description: "Remove saved shows from the connected Spotify account library.",
122
- input: savedItemIdsInputSchema,
123
- output: spotifyMutationSuccessSchema,
124
- needsApproval: true,
125
- run: async (input, credentials) => {
126
- return createSpotifyClient(credentials).library.removeSavedShows(input.ids);
127
- }
128
- });
129
- const checkSavedShows = spotifyOperation({
130
- id: "spotify.check-saved-shows",
131
- name: "Check Saved Shows",
132
- description: "Check whether shows are saved in the connected Spotify account library.",
133
- input: savedItemIdsInputSchema,
134
- output: spotifyBooleanListSchema,
135
- run: async (input, credentials) => {
136
- return createSpotifyClient(credentials).library.checkSavedShows(input.ids);
137
- }
138
- });
139
- const listSavedEpisodes = spotifyOperation({
140
- id: "spotify.list-saved-episodes",
141
- name: "List Saved Episodes",
142
- description: "List episodes saved in the connected Spotify account library.",
143
- input: marketOffsetPaginationInputSchema,
144
- output: spotifySavedEpisodePageSchema,
145
- run: async (input, credentials) => {
146
- return createSpotifyClient(credentials).library.listSavedEpisodes(input);
147
- }
148
- });
149
- const saveEpisodes = spotifyOperation({
150
- id: "spotify.save-episodes",
151
- name: "Save Episodes",
152
- description: "Save episodes to the connected Spotify account library.",
153
- input: savedItemIdsInputSchema,
154
- output: spotifyMutationSuccessSchema,
155
- needsApproval: true,
156
- run: async (input, credentials) => {
157
- return createSpotifyClient(credentials).library.saveEpisodes(input.ids);
158
- }
159
- });
160
- const removeSavedEpisodes = spotifyOperation({
161
- id: "spotify.remove-saved-episodes",
162
- name: "Remove Saved Episodes",
163
- description: "Remove saved episodes from the connected Spotify account library.",
164
- input: savedItemIdsInputSchema,
165
- output: spotifyMutationSuccessSchema,
166
- needsApproval: true,
167
- run: async (input, credentials) => {
168
- return createSpotifyClient(credentials).library.removeSavedEpisodes(input.ids);
169
- }
170
- });
171
- const checkSavedEpisodes = spotifyOperation({
172
- id: "spotify.check-saved-episodes",
173
- name: "Check Saved Episodes",
174
- description: "Check whether episodes are saved in the connected Spotify account library.",
175
- input: savedItemIdsInputSchema,
176
- output: spotifyBooleanListSchema,
177
- run: async (input, credentials) => {
178
- return createSpotifyClient(credentials).library.checkSavedEpisodes(input.ids);
179
- }
180
- });
181
- const listSavedAudiobooks = spotifyOperation({
182
- id: "spotify.list-saved-audiobooks",
183
- name: "List Saved Audiobooks",
184
- description: "List audiobooks saved in the connected Spotify account library.",
185
- input: offsetPaginationInputSchema,
186
- output: spotifySavedAudiobookPageSchema,
187
- run: async (input, credentials) => {
188
- return createSpotifyClient(credentials).library.listSavedAudiobooks(input);
189
- }
190
- });
191
- const saveAudiobooks = spotifyOperation({
192
- id: "spotify.save-audiobooks",
193
- name: "Save Audiobooks",
194
- description: "Save audiobooks to the connected Spotify account library.",
195
- input: savedItemIdsInputSchema,
196
- output: spotifyMutationSuccessSchema,
197
- needsApproval: true,
198
- run: async (input, credentials) => {
199
- return createSpotifyClient(credentials).library.saveAudiobooks(input.ids);
200
- }
201
- });
202
- const removeSavedAudiobooks = spotifyOperation({
203
- id: "spotify.remove-saved-audiobooks",
204
- name: "Remove Saved Audiobooks",
205
- description: "Remove saved audiobooks from the connected Spotify account library.",
206
- input: savedItemIdsInputSchema,
207
- output: spotifyMutationSuccessSchema,
208
- needsApproval: true,
209
- run: async (input, credentials) => {
210
- return createSpotifyClient(credentials).library.removeSavedAudiobooks(input.ids);
211
- }
212
- });
213
- const checkSavedAudiobooks = spotifyOperation({
214
- id: "spotify.check-saved-audiobooks",
215
- name: "Check Saved Audiobooks",
216
- description: "Check whether audiobooks are saved in the connected Spotify account library.",
217
- input: savedItemIdsInputSchema,
218
- output: spotifyBooleanListSchema,
219
- run: async (input, credentials) => {
220
- return createSpotifyClient(credentials).library.checkSavedAudiobooks(input.ids);
221
- }
222
- });
223
-
224
- //#endregion
225
- export { checkSavedAlbums, checkSavedAudiobooks, checkSavedEpisodes, checkSavedShows, checkSavedTracks, listSavedAlbums, listSavedAudiobooks, listSavedEpisodes, listSavedShows, listSavedTracks, removeSavedAlbums, removeSavedAudiobooks, removeSavedEpisodes, removeSavedShows, removeSavedTracks, saveAlbums, saveAudiobooks, saveEpisodes, saveShows, saveTracks };
@@ -1,11 +0,0 @@
1
- import { z } from "zod";
2
- import * as _keystrokehq_core0 from "@keystrokehq/core";
3
-
4
- //#region src/markets.d.ts
5
- declare const getAvailableMarkets: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
6
- markets: z.ZodArray<z.ZodString>;
7
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:spotify", z.ZodObject<{
8
- SPOTIFY_ACCESS_TOKEN: z.ZodString;
9
- }, z.core.$strip>>], undefined>;
10
- //#endregion
11
- export { getAvailableMarkets };
package/dist/markets.mjs DELETED
@@ -1,20 +0,0 @@
1
- import { spotifyMarketSchema } from "./schemas.mjs";
2
- import { createSpotifyClient } from "./client.mjs";
3
- import { t as spotifyOperation } from "./factory-DMprpzS1.mjs";
4
- import { z } from "zod";
5
-
6
- //#region src/markets.ts
7
- const availableMarketsResponseSchema = z.object({ markets: z.array(spotifyMarketSchema) });
8
- const getAvailableMarkets = spotifyOperation({
9
- id: "spotify.get-spotify-available-markets",
10
- name: "Get Spotify Available Markets",
11
- description: "List the markets currently supported by Spotify.",
12
- input: z.object({}),
13
- output: availableMarketsResponseSchema,
14
- run: async (_input, credentials) => {
15
- return createSpotifyClient(credentials).discovery.getAvailableMarkets();
16
- }
17
- });
18
-
19
- //#endregion
20
- export { getAvailableMarkets };
package/dist/me.d.mts DELETED
@@ -1,162 +0,0 @@
1
- import { z } from "zod";
2
- import * as _keystrokehq_core0 from "@keystrokehq/core";
3
-
4
- //#region src/me.d.ts
5
- declare const getMe: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
6
- displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7
- externalUrls: z.ZodOptional<z.ZodObject<{
8
- spotify: z.ZodOptional<z.ZodURL>;
9
- }, z.core.$strip>>;
10
- followers: z.ZodOptional<z.ZodObject<{
11
- href: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
12
- total: z.ZodNumber;
13
- }, z.core.$strip>>;
14
- href: z.ZodOptional<z.ZodURL>;
15
- id: z.ZodString;
16
- type: z.ZodLiteral<"user">;
17
- uri: z.ZodOptional<z.ZodString>;
18
- email: z.ZodOptional<z.ZodEmail>;
19
- country: z.ZodOptional<z.ZodString>;
20
- product: z.ZodOptional<z.ZodString>;
21
- images: z.ZodOptional<z.ZodArray<z.ZodObject<{
22
- url: z.ZodURL;
23
- height: z.ZodNullable<z.ZodNumber>;
24
- width: z.ZodNullable<z.ZodNumber>;
25
- }, z.core.$strip>>>;
26
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:spotify", z.ZodObject<{
27
- SPOTIFY_ACCESS_TOKEN: z.ZodString;
28
- }, z.core.$strip>>], undefined>;
29
- declare const getMyTopArtists: _keystrokehq_core0.Operation<z.ZodObject<{
30
- timeRange: z.ZodOptional<z.ZodEnum<{
31
- short_term: "short_term";
32
- medium_term: "medium_term";
33
- long_term: "long_term";
34
- }>>;
35
- limit: z.ZodOptional<z.ZodNumber>;
36
- offset: z.ZodOptional<z.ZodNumber>;
37
- }, z.core.$strip>, z.ZodObject<{
38
- href: z.ZodOptional<z.ZodURL>;
39
- items: z.ZodArray<z.ZodObject<{
40
- externalUrls: z.ZodOptional<z.ZodObject<{
41
- spotify: z.ZodOptional<z.ZodURL>;
42
- }, z.core.$strip>>;
43
- href: z.ZodOptional<z.ZodURL>;
44
- id: z.ZodString;
45
- name: z.ZodString;
46
- type: z.ZodLiteral<"artist">;
47
- uri: z.ZodOptional<z.ZodString>;
48
- followers: z.ZodOptional<z.ZodObject<{
49
- href: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
50
- total: z.ZodNumber;
51
- }, z.core.$strip>>;
52
- genres: z.ZodOptional<z.ZodArray<z.ZodString>>;
53
- images: z.ZodOptional<z.ZodArray<z.ZodObject<{
54
- url: z.ZodURL;
55
- height: z.ZodNullable<z.ZodNumber>;
56
- width: z.ZodNullable<z.ZodNumber>;
57
- }, z.core.$strip>>>;
58
- popularity: z.ZodOptional<z.ZodNumber>;
59
- }, z.core.$strip>>;
60
- limit: z.ZodNumber;
61
- nextPageToken: z.ZodOptional<z.ZodString>;
62
- offset: z.ZodNumber;
63
- previousPageToken: z.ZodOptional<z.ZodString>;
64
- total: z.ZodOptional<z.ZodNumber>;
65
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:spotify", z.ZodObject<{
66
- SPOTIFY_ACCESS_TOKEN: z.ZodString;
67
- }, z.core.$strip>>], undefined>;
68
- declare const getMyTopTracks: _keystrokehq_core0.Operation<z.ZodObject<{
69
- timeRange: z.ZodOptional<z.ZodEnum<{
70
- short_term: "short_term";
71
- medium_term: "medium_term";
72
- long_term: "long_term";
73
- }>>;
74
- limit: z.ZodOptional<z.ZodNumber>;
75
- offset: z.ZodOptional<z.ZodNumber>;
76
- }, z.core.$strip>, z.ZodObject<{
77
- href: z.ZodOptional<z.ZodURL>;
78
- items: z.ZodArray<z.ZodObject<{
79
- album: z.ZodOptional<z.ZodObject<{
80
- albumType: z.ZodOptional<z.ZodEnum<{
81
- album: "album";
82
- single: "single";
83
- compilation: "compilation";
84
- }>>;
85
- artists: z.ZodArray<z.ZodObject<{
86
- externalUrls: z.ZodOptional<z.ZodObject<{
87
- spotify: z.ZodOptional<z.ZodURL>;
88
- }, z.core.$strip>>;
89
- href: z.ZodOptional<z.ZodURL>;
90
- id: z.ZodString;
91
- name: z.ZodString;
92
- type: z.ZodLiteral<"artist">;
93
- uri: z.ZodOptional<z.ZodString>;
94
- }, z.core.$strip>>;
95
- availableMarkets: z.ZodOptional<z.ZodArray<z.ZodString>>;
96
- externalUrls: z.ZodOptional<z.ZodObject<{
97
- spotify: z.ZodOptional<z.ZodURL>;
98
- }, z.core.$strip>>;
99
- href: z.ZodOptional<z.ZodURL>;
100
- id: z.ZodString;
101
- images: z.ZodArray<z.ZodObject<{
102
- url: z.ZodURL;
103
- height: z.ZodNullable<z.ZodNumber>;
104
- width: z.ZodNullable<z.ZodNumber>;
105
- }, z.core.$strip>>;
106
- name: z.ZodString;
107
- releaseDate: z.ZodOptional<z.ZodString>;
108
- releaseDatePrecision: z.ZodOptional<z.ZodEnum<{
109
- year: "year";
110
- month: "month";
111
- day: "day";
112
- }>>;
113
- totalTracks: z.ZodOptional<z.ZodNumber>;
114
- type: z.ZodLiteral<"album">;
115
- uri: z.ZodOptional<z.ZodString>;
116
- }, z.core.$strip>>;
117
- artists: z.ZodArray<z.ZodObject<{
118
- externalUrls: z.ZodOptional<z.ZodObject<{
119
- spotify: z.ZodOptional<z.ZodURL>;
120
- }, z.core.$strip>>;
121
- href: z.ZodOptional<z.ZodURL>;
122
- id: z.ZodString;
123
- name: z.ZodString;
124
- type: z.ZodLiteral<"artist">;
125
- uri: z.ZodOptional<z.ZodString>;
126
- }, z.core.$strip>>;
127
- availableMarkets: z.ZodOptional<z.ZodArray<z.ZodString>>;
128
- discNumber: z.ZodOptional<z.ZodNumber>;
129
- durationMs: z.ZodNumber;
130
- explicit: z.ZodBoolean;
131
- externalIds: z.ZodOptional<z.ZodObject<{
132
- isrc: z.ZodOptional<z.ZodString>;
133
- ean: z.ZodOptional<z.ZodString>;
134
- upc: z.ZodOptional<z.ZodString>;
135
- }, z.core.$strip>>;
136
- externalUrls: z.ZodOptional<z.ZodObject<{
137
- spotify: z.ZodOptional<z.ZodURL>;
138
- }, z.core.$strip>>;
139
- href: z.ZodOptional<z.ZodURL>;
140
- id: z.ZodString;
141
- isLocal: z.ZodOptional<z.ZodBoolean>;
142
- isPlayable: z.ZodOptional<z.ZodBoolean>;
143
- name: z.ZodString;
144
- popularity: z.ZodOptional<z.ZodNumber>;
145
- previewUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
146
- restrictions: z.ZodOptional<z.ZodObject<{
147
- reason: z.ZodString;
148
- }, z.core.$strip>>;
149
- trackNumber: z.ZodOptional<z.ZodNumber>;
150
- type: z.ZodLiteral<"track">;
151
- uri: z.ZodOptional<z.ZodString>;
152
- }, z.core.$strip>>;
153
- limit: z.ZodNumber;
154
- nextPageToken: z.ZodOptional<z.ZodString>;
155
- offset: z.ZodNumber;
156
- previousPageToken: z.ZodOptional<z.ZodString>;
157
- total: z.ZodOptional<z.ZodNumber>;
158
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:spotify", z.ZodObject<{
159
- SPOTIFY_ACCESS_TOKEN: z.ZodString;
160
- }, z.core.$strip>>], undefined>;
161
- //#endregion
162
- export { getMe, getMyTopArtists, getMyTopTracks };
package/dist/me.mjs DELETED
@@ -1,58 +0,0 @@
1
- import { spotifyArtistPageSchema, spotifyTrackPageSchema, spotifyUserSchema } from "./schemas.mjs";
2
- import { createSpotifyClient } from "./client.mjs";
3
- import { t as spotifyOperation } from "./factory-DMprpzS1.mjs";
4
- import { z } from "zod";
5
-
6
- //#region src/me.ts
7
- const emptyInputSchema = z.object({});
8
- const topItemTimeRangeSchema = z.enum([
9
- "short_term",
10
- "medium_term",
11
- "long_term"
12
- ]);
13
- const topItemsInputSchema = z.object({
14
- timeRange: topItemTimeRangeSchema.optional(),
15
- limit: z.number().int().min(1).max(50).optional(),
16
- offset: z.number().int().nonnegative().optional()
17
- });
18
- const getMe = spotifyOperation({
19
- id: "spotify.get-spotify-me",
20
- name: "Get Spotify Me",
21
- description: "Fetch the current Spotify user profile.",
22
- input: emptyInputSchema,
23
- output: spotifyUserSchema,
24
- run: async (_input, credentials) => {
25
- return createSpotifyClient(credentials).users.getMe();
26
- }
27
- });
28
- const getMyTopArtists = spotifyOperation({
29
- id: "spotify.get-spotify-my-top-artists",
30
- name: "Get My Top Spotify Artists",
31
- description: "List the current user's top Spotify artists.",
32
- input: topItemsInputSchema,
33
- output: spotifyArtistPageSchema,
34
- run: async (input, credentials) => {
35
- return createSpotifyClient(credentials).users.getMyTopArtists({
36
- time_range: input.timeRange,
37
- limit: input.limit,
38
- offset: input.offset
39
- });
40
- }
41
- });
42
- const getMyTopTracks = spotifyOperation({
43
- id: "spotify.get-spotify-my-top-tracks",
44
- name: "Get My Top Spotify Tracks",
45
- description: "List the current user's top Spotify tracks.",
46
- input: topItemsInputSchema,
47
- output: spotifyTrackPageSchema,
48
- run: async (input, credentials) => {
49
- return createSpotifyClient(credentials).users.getMyTopTracks({
50
- time_range: input.timeRange,
51
- limit: input.limit,
52
- offset: input.offset
53
- });
54
- }
55
- });
56
-
57
- //#endregion
58
- export { getMe, getMyTopArtists, getMyTopTracks };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1,6 +0,0 @@
1
- import { AnyOperation } from "@keystrokehq/core/operation";
2
-
3
- //#region src/operations.d.ts
4
- declare const spotifyOperations: Readonly<Record<string, AnyOperation>>;
5
- //#endregion
6
- export { spotifyOperations };