@keystrokehq/spotify 0.0.8 → 0.0.9
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/dist/_official/index.d.mts +2 -2
- package/dist/_official/index.mjs +1 -1
- package/dist/albums.d.mts +5 -5
- package/dist/albums.mjs +1 -1
- package/dist/artists.d.mts +6 -6
- package/dist/artists.mjs +1 -1
- package/dist/audio-analysis.d.mts +2 -2
- package/dist/audio-analysis.mjs +1 -1
- package/dist/audio-features.d.mts +3 -3
- package/dist/audio-features.mjs +1 -1
- package/dist/audiobooks.d.mts +4 -4
- package/dist/audiobooks.mjs +1 -1
- package/dist/browse.d.mts +2 -2
- package/dist/browse.mjs +1 -1
- package/dist/categories.d.mts +4 -4
- package/dist/categories.mjs +1 -1
- package/dist/chapters.d.mts +3 -3
- package/dist/chapters.mjs +1 -1
- package/dist/client.d.mts +230 -230
- package/dist/connection.d.mts +1 -1
- package/dist/connection.mjs +1 -1
- package/dist/episodes.d.mts +3 -3
- package/dist/episodes.mjs +1 -1
- package/dist/factory-C9W7aXmR.mjs +7 -0
- package/dist/follow.d.mts +5 -5
- package/dist/follow.mjs +1 -1
- package/dist/genres.d.mts +2 -2
- package/dist/genres.mjs +1 -1
- package/dist/integration-CrkQTg9q.mjs +170 -0
- package/dist/{integration-Dzf1u4u-.d.mts → integration-DXXNe4_j.d.mts} +3 -4
- package/dist/library.d.mts +21 -21
- package/dist/library.mjs +1 -1
- package/dist/markets.d.mts +2 -2
- package/dist/markets.mjs +1 -1
- package/dist/me.d.mts +4 -4
- package/dist/me.mjs +1 -1
- package/dist/player.d.mts +18 -18
- package/dist/player.mjs +1 -1
- package/dist/playlists.d.mts +15 -15
- package/dist/playlists.mjs +1 -1
- package/dist/recommendations.d.mts +2 -2
- package/dist/recommendations.mjs +1 -1
- package/dist/schemas.d.mts +1 -1
- package/dist/search.d.mts +3 -3
- package/dist/search.mjs +1 -1
- package/dist/shows.d.mts +4 -4
- package/dist/shows.mjs +1 -1
- package/dist/tracks.d.mts +3 -3
- package/dist/tracks.mjs +1 -1
- package/dist/triggers.d.mts +2 -3
- package/dist/triggers.mjs +56 -7
- package/dist/users.d.mts +2 -2
- package/dist/users.mjs +1 -1
- package/package.json +4 -4
- package/dist/factory-C3uQLYXY.mjs +0 -8
- package/dist/integration-BK1PIn1V.mjs +0 -78
package/dist/playlists.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
3
|
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
4
4
|
|
|
5
5
|
//#region src/playlists.d.ts
|
|
@@ -56,7 +56,7 @@ declare const createPlaylist: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
56
56
|
}, z.core.$strip>>;
|
|
57
57
|
type: z.ZodLiteral<"playlist">;
|
|
58
58
|
uri: z.ZodOptional<z.ZodString>;
|
|
59
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
59
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
60
60
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
61
61
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
62
62
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -117,7 +117,7 @@ declare const getPlaylist: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
117
117
|
}, z.core.$strip>>;
|
|
118
118
|
type: z.ZodLiteral<"playlist">;
|
|
119
119
|
uri: z.ZodOptional<z.ZodString>;
|
|
120
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
120
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
121
121
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
122
122
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
123
123
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -130,7 +130,7 @@ declare const updatePlaylistDetails: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
130
130
|
description: z.ZodOptional<z.ZodString>;
|
|
131
131
|
}, z.core.$strip>, z.ZodObject<{
|
|
132
132
|
success: z.ZodLiteral<true>;
|
|
133
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
133
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
134
134
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
135
135
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
136
136
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -315,7 +315,7 @@ declare const getPlaylistItems: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
315
315
|
offset: z.ZodNumber;
|
|
316
316
|
previousPageToken: z.ZodOptional<z.ZodString>;
|
|
317
317
|
total: z.ZodOptional<z.ZodNumber>;
|
|
318
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
318
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
319
319
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
320
320
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
321
321
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -328,7 +328,7 @@ declare const getPlaylistCoverImage: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
328
328
|
height: z.ZodNullable<z.ZodNumber>;
|
|
329
329
|
width: z.ZodNullable<z.ZodNumber>;
|
|
330
330
|
}, z.core.$strip>>;
|
|
331
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
331
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
332
332
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
333
333
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
334
334
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -339,7 +339,7 @@ declare const addItemsToPlaylist: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
339
339
|
position: z.ZodOptional<z.ZodNumber>;
|
|
340
340
|
}, z.core.$strip>, z.ZodObject<{
|
|
341
341
|
snapshotId: z.ZodString;
|
|
342
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
342
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
343
343
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
344
344
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
345
345
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -357,7 +357,7 @@ declare const reorderOrReplacePlaylistItems: _keystrokehq_core0.Operation<z.ZodD
|
|
|
357
357
|
uris: z.ZodArray<z.ZodString>;
|
|
358
358
|
}, z.core.$strip>], "mode">, z.ZodObject<{
|
|
359
359
|
snapshotId: z.ZodString;
|
|
360
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
360
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
361
361
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
362
362
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
363
363
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -371,7 +371,7 @@ declare const removeItemsFromPlaylist: _keystrokehq_core0.Operation<z.ZodObject<
|
|
|
371
371
|
snapshotId: z.ZodOptional<z.ZodString>;
|
|
372
372
|
}, z.core.$strip>, z.ZodObject<{
|
|
373
373
|
snapshotId: z.ZodString;
|
|
374
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
374
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
375
375
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
376
376
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
377
377
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -435,7 +435,7 @@ declare const listMyPlaylists: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
435
435
|
offset: z.ZodNumber;
|
|
436
436
|
previousPageToken: z.ZodOptional<z.ZodString>;
|
|
437
437
|
total: z.ZodOptional<z.ZodNumber>;
|
|
438
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
438
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
439
439
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
440
440
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
441
441
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -500,7 +500,7 @@ declare const listUserPlaylists: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
500
500
|
offset: z.ZodNumber;
|
|
501
501
|
previousPageToken: z.ZodOptional<z.ZodString>;
|
|
502
502
|
total: z.ZodOptional<z.ZodNumber>;
|
|
503
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
503
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
504
504
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
505
505
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
506
506
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -510,7 +510,7 @@ declare const followPlaylist: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
510
510
|
public: z.ZodOptional<z.ZodBoolean>;
|
|
511
511
|
}, z.core.$strip>, z.ZodObject<{
|
|
512
512
|
success: z.ZodLiteral<true>;
|
|
513
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
513
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
514
514
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
515
515
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
516
516
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -519,7 +519,7 @@ declare const unfollowPlaylist: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
519
519
|
playlistId: z.ZodString;
|
|
520
520
|
}, z.core.$strip>, z.ZodObject<{
|
|
521
521
|
success: z.ZodLiteral<true>;
|
|
522
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
522
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
523
523
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
524
524
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
525
525
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -527,7 +527,7 @@ declare const unfollowPlaylist: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
527
527
|
declare const checkUsersFollowPlaylist: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
528
528
|
playlistId: z.ZodString;
|
|
529
529
|
userIds: z.ZodArray<z.ZodString>;
|
|
530
|
-
}, z.core.$strip>, z.ZodArray<z.ZodBoolean>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
530
|
+
}, z.core.$strip>, z.ZodArray<z.ZodBoolean>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
531
531
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
532
532
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
533
533
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -537,7 +537,7 @@ declare const uploadPlaylistCoverImage: _keystrokehq_core0.Operation<z.ZodObject
|
|
|
537
537
|
imageBase64: z.ZodString;
|
|
538
538
|
}, z.core.$strip>, z.ZodObject<{
|
|
539
539
|
success: z.ZodLiteral<true>;
|
|
540
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
540
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
541
541
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
542
542
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
543
543
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
package/dist/playlists.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spotifyBooleanListSchema, spotifyIdSchema, spotifyMarketSchema, spotifyMutationSuccessSchema, spotifyPlaylistImageSchema, spotifyPlaylistItemPageSchema, spotifyPlaylistPageSchema, spotifyPlaylistSchema, spotifySnapshotResponseSchema, spotifyUriSchema } from "./schemas.mjs";
|
|
2
2
|
import { createSpotifyClient } from "./client.mjs";
|
|
3
|
-
import { t as spotifyOperation } from "./factory-
|
|
3
|
+
import { t as spotifyOperation } from "./factory-C9W7aXmR.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/playlists.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
3
|
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
4
4
|
|
|
5
5
|
//#region src/recommendations.d.ts
|
|
@@ -135,7 +135,7 @@ declare const getRecommendations: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
135
135
|
type: z.ZodLiteral<"track">;
|
|
136
136
|
uri: z.ZodOptional<z.ZodString>;
|
|
137
137
|
}, z.core.$strip>>;
|
|
138
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
138
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
139
139
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
140
140
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
141
141
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
package/dist/recommendations.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spotifyIdSchema, spotifyMarketSchema, spotifyRecommendationsSchema } from "./schemas.mjs";
|
|
2
2
|
import { createSpotifyClient } from "./client.mjs";
|
|
3
|
-
import { t as spotifyOperation } from "./factory-
|
|
3
|
+
import { t as spotifyOperation } from "./factory-C9W7aXmR.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/recommendations.ts
|
package/dist/schemas.d.mts
CHANGED
|
@@ -1041,8 +1041,8 @@ declare const spotifyPlaybackStateSchema: z.ZodObject<{
|
|
|
1041
1041
|
shuffleState: z.ZodBoolean;
|
|
1042
1042
|
timestamp: z.ZodNumber;
|
|
1043
1043
|
currentlyPlayingType: z.ZodOptional<z.ZodEnum<{
|
|
1044
|
-
track: "track";
|
|
1045
1044
|
unknown: "unknown";
|
|
1045
|
+
track: "track";
|
|
1046
1046
|
episode: "episode";
|
|
1047
1047
|
ad: "ad";
|
|
1048
1048
|
}>>;
|
package/dist/search.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
3
|
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
4
4
|
|
|
5
5
|
//#region src/search.d.ts
|
|
@@ -8,11 +8,11 @@ declare const search: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
8
8
|
types: z.ZodArray<z.ZodEnum<{
|
|
9
9
|
artist: "artist";
|
|
10
10
|
track: "track";
|
|
11
|
+
playlist: "playlist";
|
|
11
12
|
album: "album";
|
|
12
13
|
show: "show";
|
|
13
14
|
episode: "episode";
|
|
14
15
|
audiobook: "audiobook";
|
|
15
|
-
playlist: "playlist";
|
|
16
16
|
}>>;
|
|
17
17
|
market: z.ZodOptional<z.ZodString>;
|
|
18
18
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
@@ -380,7 +380,7 @@ declare const search: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
380
380
|
previousPageToken: z.ZodOptional<z.ZodString>;
|
|
381
381
|
total: z.ZodOptional<z.ZodNumber>;
|
|
382
382
|
}, z.core.$strip>>;
|
|
383
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
383
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
384
384
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
385
385
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
386
386
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
package/dist/search.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spotifyMarketSchema, spotifySearchResultSchema } from "./schemas.mjs";
|
|
2
2
|
import { createSpotifyClient } from "./client.mjs";
|
|
3
|
-
import { t as spotifyOperation } from "./factory-
|
|
3
|
+
import { t as spotifyOperation } from "./factory-C9W7aXmR.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/search.ts
|
package/dist/shows.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
3
|
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
4
4
|
|
|
5
5
|
//#region src/shows.d.ts
|
|
@@ -33,7 +33,7 @@ declare const getShow: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
33
33
|
uri: z.ZodOptional<z.ZodString>;
|
|
34
34
|
htmlDescription: z.ZodOptional<z.ZodString>;
|
|
35
35
|
isExternallyHosted: z.ZodOptional<z.ZodBoolean>;
|
|
36
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
36
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
37
37
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
38
38
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
39
39
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -70,7 +70,7 @@ declare const getSeveralShows: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
70
70
|
htmlDescription: z.ZodOptional<z.ZodString>;
|
|
71
71
|
isExternallyHosted: z.ZodOptional<z.ZodBoolean>;
|
|
72
72
|
}, z.core.$strip>>;
|
|
73
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
73
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
74
74
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
75
75
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
76
76
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -150,7 +150,7 @@ declare const getShowEpisodes: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
150
150
|
offset: z.ZodNumber;
|
|
151
151
|
previousPageToken: z.ZodOptional<z.ZodString>;
|
|
152
152
|
total: z.ZodOptional<z.ZodNumber>;
|
|
153
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
153
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
154
154
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
155
155
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
156
156
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
package/dist/shows.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spotifyEpisodePageSchema, spotifyIdSchema, spotifyMarketSchema, spotifyShowSchema } from "./schemas.mjs";
|
|
2
2
|
import { createSpotifyClient } from "./client.mjs";
|
|
3
|
-
import { t as spotifyOperation } from "./factory-
|
|
3
|
+
import { t as spotifyOperation } from "./factory-C9W7aXmR.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/shows.ts
|
package/dist/tracks.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
3
|
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
4
4
|
|
|
5
5
|
//#region src/tracks.d.ts
|
|
@@ -80,7 +80,7 @@ declare const getTrack: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
80
80
|
trackNumber: z.ZodOptional<z.ZodNumber>;
|
|
81
81
|
type: z.ZodLiteral<"track">;
|
|
82
82
|
uri: z.ZodOptional<z.ZodString>;
|
|
83
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
83
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
84
84
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
85
85
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
86
86
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
@@ -164,7 +164,7 @@ declare const getSeveralTracks: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
164
164
|
type: z.ZodLiteral<"track">;
|
|
165
165
|
uri: z.ZodOptional<z.ZodString>;
|
|
166
166
|
}, z.core.$strip>>;
|
|
167
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
167
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
168
168
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
169
169
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
170
170
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
package/dist/tracks.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spotifyIdSchema, spotifyMarketSchema, spotifyTrackSchema } from "./schemas.mjs";
|
|
2
2
|
import { createSpotifyClient } from "./client.mjs";
|
|
3
|
-
import { t as spotifyOperation } from "./factory-
|
|
3
|
+
import { t as spotifyOperation } from "./factory-C9W7aXmR.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/tracks.ts
|
package/dist/triggers.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { n as spotify } from "./integration-
|
|
1
|
+
import { n as spotify } from "./integration-DXXNe4_j.mjs";
|
|
2
2
|
import { spotifyNewDeviceAddedEventSchema, spotifyPlaylistItemsChangedEventSchema, spotifyRecentlyPlayedTrackAddedEventSchema, spotifySavedItemAddedEventSchema, spotifyUserPlaylistsChangedEventSchema } from "./events.mjs";
|
|
3
|
+
import { BoundTrigger, Operation } from "@keystrokehq/core";
|
|
3
4
|
import { z } from "zod";
|
|
4
|
-
import { BoundTrigger } from "@keystrokehq/core";
|
|
5
|
-
import { IntegrationTriggerBindingOptions } from "@keystrokehq/integration-authoring";
|
|
6
5
|
import { PollingTriggerManifest } from "@keystrokehq/core/trigger";
|
|
7
6
|
|
|
8
7
|
//#region src/triggers.d.ts
|
package/dist/triggers.mjs
CHANGED
|
@@ -1,9 +1,58 @@
|
|
|
1
|
-
import { t as spotify } from "./integration-
|
|
1
|
+
import { t as spotify } from "./integration-CrkQTg9q.mjs";
|
|
2
2
|
import { createSpotifyClient } from "./client.mjs";
|
|
3
3
|
import { spotifyNewDeviceAddedEventSchema, spotifyPlaylistItemsChangedEventSchema, spotifyRecentlyPlayedTrackAddedEventSchema, spotifySavedItemAddedEventSchema, spotifyUserPlaylistsChangedEventSchema } from "./events.mjs";
|
|
4
|
+
import { Operation } from "@keystrokehq/core";
|
|
4
5
|
import { z } from "zod";
|
|
5
|
-
import {
|
|
6
|
+
import { pollingTrigger } from "@keystrokehq/core/trigger";
|
|
6
7
|
|
|
8
|
+
//#region ../../packages/integration-authoring/dist/index.mjs
|
|
9
|
+
const IntegrationConfigSchema = z.object({
|
|
10
|
+
id: z.string().min(1),
|
|
11
|
+
name: z.string().min(1),
|
|
12
|
+
description: z.string().optional()
|
|
13
|
+
});
|
|
14
|
+
function resolveMetadata(metadata, defaults) {
|
|
15
|
+
return {
|
|
16
|
+
id: metadata?.id ?? defaults.defaultId,
|
|
17
|
+
description: metadata?.description ?? defaults.defaultDescription
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function resolveAuthorPayload(payload, mapPayload) {
|
|
21
|
+
if (!mapPayload) return payload;
|
|
22
|
+
return mapPayload(payload);
|
|
23
|
+
}
|
|
24
|
+
function createIntegrationTriggerBindingFactory(config) {
|
|
25
|
+
const bind = (options) => {
|
|
26
|
+
const resolvedMetadata = resolveMetadata(options, config);
|
|
27
|
+
const baseTrigger = config.createBaseTrigger(resolvedMetadata);
|
|
28
|
+
const userTransform = options?.transform;
|
|
29
|
+
return baseTrigger({ transform: userTransform || config.mapPayload ? (runtimePayload, request) => {
|
|
30
|
+
const authorPayload = resolveAuthorPayload(runtimePayload, config.mapPayload);
|
|
31
|
+
if (authorPayload === null) throw new Error(`Trigger "${resolvedMetadata.id}" mapPayload returned null after the trigger filter passed; tighten the trigger filter schema.`);
|
|
32
|
+
if (!userTransform) return authorPayload;
|
|
33
|
+
return userTransform(authorPayload, request);
|
|
34
|
+
} : void 0 });
|
|
35
|
+
};
|
|
36
|
+
return Object.freeze(bind);
|
|
37
|
+
}
|
|
38
|
+
function createPollingTriggerBindingFactory(config) {
|
|
39
|
+
return createIntegrationTriggerBindingFactory({
|
|
40
|
+
defaultId: config.defaultId,
|
|
41
|
+
defaultDescription: config.defaultDescription,
|
|
42
|
+
mapPayload: config.mapPayload,
|
|
43
|
+
createBaseTrigger: (metadata) => pollingTrigger({
|
|
44
|
+
id: metadata.id,
|
|
45
|
+
description: metadata.description,
|
|
46
|
+
schedule: config.schedule,
|
|
47
|
+
response: config.response,
|
|
48
|
+
poll: config.poll,
|
|
49
|
+
...config.credentialSets ? { credentialSets: config.credentialSets } : {},
|
|
50
|
+
...config.filter ? { filter: config.filter } : {}
|
|
51
|
+
})
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
7
56
|
//#region src/triggers.ts
|
|
8
57
|
const nullableNewDeviceEventSchema = z.union([spotifyNewDeviceAddedEventSchema, z.null()]);
|
|
9
58
|
const nullablePlaylistItemsChangedEventSchema = z.union([spotifyPlaylistItemsChangedEventSchema, z.null()]);
|
|
@@ -18,7 +67,7 @@ function newDeviceAdded(options) {
|
|
|
18
67
|
credentialSets: [spotify],
|
|
19
68
|
response: nullableNewDeviceEventSchema,
|
|
20
69
|
poll: async (ctx) => {
|
|
21
|
-
const device = (await createSpotifyClient(ctx.credentials["
|
|
70
|
+
const device = (await createSpotifyClient(ctx.credentials["spotify"]).player.getAvailableDevices()).devices[0];
|
|
22
71
|
return device ? {
|
|
23
72
|
eventId: `device:${device.id ?? device.name}`,
|
|
24
73
|
type: "device.added",
|
|
@@ -39,7 +88,7 @@ function playlistItemsChanged(options) {
|
|
|
39
88
|
credentialSets: [spotify],
|
|
40
89
|
response: nullablePlaylistItemsChangedEventSchema,
|
|
41
90
|
poll: async (ctx) => {
|
|
42
|
-
const item = (await createSpotifyClient(ctx.credentials["
|
|
91
|
+
const item = (await createSpotifyClient(ctx.credentials["spotify"]).playlists.getPlaylistItems(options.playlistId, {
|
|
43
92
|
market: options.market,
|
|
44
93
|
limit: options.limit ?? 20
|
|
45
94
|
})).items[0];
|
|
@@ -66,7 +115,7 @@ function userPlaylistsChanged(options) {
|
|
|
66
115
|
credentialSets: [spotify],
|
|
67
116
|
response: nullableUserPlaylistsChangedEventSchema,
|
|
68
117
|
poll: async (ctx) => {
|
|
69
|
-
const playlist = (await createSpotifyClient(ctx.credentials["
|
|
118
|
+
const playlist = (await createSpotifyClient(ctx.credentials["spotify"]).playlists.listMyPlaylists({
|
|
70
119
|
limit: options?.limit ?? 20,
|
|
71
120
|
offset: options?.offset
|
|
72
121
|
})).items[0];
|
|
@@ -90,7 +139,7 @@ function recentlyPlayedTrackAdded(options) {
|
|
|
90
139
|
credentialSets: [spotify],
|
|
91
140
|
response: nullableRecentlyPlayedTrackAddedEventSchema,
|
|
92
141
|
poll: async (ctx) => {
|
|
93
|
-
const play = (await createSpotifyClient(ctx.credentials["
|
|
142
|
+
const play = (await createSpotifyClient(ctx.credentials["spotify"]).player.getRecentlyPlayed({
|
|
94
143
|
limit: options?.limit ?? 1,
|
|
95
144
|
after: ctx.lastPolledAt ? Date.parse(ctx.lastPolledAt) : void 0
|
|
96
145
|
})).items[0];
|
|
@@ -114,7 +163,7 @@ function savedItemAdded(options) {
|
|
|
114
163
|
credentialSets: [spotify],
|
|
115
164
|
response: nullableSavedItemAddedEventSchema,
|
|
116
165
|
poll: async (ctx) => {
|
|
117
|
-
const client = createSpotifyClient(ctx.credentials["
|
|
166
|
+
const client = createSpotifyClient(ctx.credentials["spotify"]);
|
|
118
167
|
if (options.itemType === "album") {
|
|
119
168
|
const item = (await client.library.listSavedAlbums({
|
|
120
169
|
limit: options.limit ?? 1,
|
package/dist/users.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
2
|
+
import { z } from "zod";
|
|
3
3
|
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
4
4
|
|
|
5
5
|
//#region src/users.d.ts
|
|
@@ -26,7 +26,7 @@ declare const getUser: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
|
26
26
|
height: z.ZodNullable<z.ZodNumber>;
|
|
27
27
|
width: z.ZodNullable<z.ZodNumber>;
|
|
28
28
|
}, z.core.$strip>>>;
|
|
29
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"
|
|
29
|
+
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
30
30
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
31
31
|
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
32
32
|
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
package/dist/users.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spotifyIdSchema, spotifyUserSchema } from "./schemas.mjs";
|
|
2
2
|
import { createSpotifyClient } from "./client.mjs";
|
|
3
|
-
import { t as spotifyOperation } from "./factory-
|
|
3
|
+
import { t as spotifyOperation } from "./factory-C9W7aXmR.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/users.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keystrokehq/spotify",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -144,7 +144,6 @@
|
|
|
144
144
|
"LICENSE"
|
|
145
145
|
],
|
|
146
146
|
"dependencies": {
|
|
147
|
-
"@keystrokehq/integration-authoring": "^0.0.8",
|
|
148
147
|
"zod": "^4.3.6"
|
|
149
148
|
},
|
|
150
149
|
"peerDependencies": {
|
|
@@ -155,9 +154,10 @@
|
|
|
155
154
|
"tsdown": "^0.20.3",
|
|
156
155
|
"typescript": "^5.9.3",
|
|
157
156
|
"vitest": "^4.0.18",
|
|
158
|
-
"@keystrokehq/core": "^0.0.
|
|
157
|
+
"@keystrokehq/core": "^0.0.12",
|
|
158
|
+
"@keystrokehq/typescript-config": "0.0.0",
|
|
159
159
|
"@keystrokehq/test-utils": "0.0.0",
|
|
160
|
-
"@keystrokehq/
|
|
160
|
+
"@keystrokehq/integration-authoring": "0.0.9"
|
|
161
161
|
},
|
|
162
162
|
"keywords": [
|
|
163
163
|
"spotify",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { t as spotify } from "./integration-BK1PIn1V.mjs";
|
|
2
|
-
import { createOfficialOperationFactory } from "@keystrokehq/integration-authoring/official";
|
|
3
|
-
|
|
4
|
-
//#region src/factory.ts
|
|
5
|
-
const spotifyOperation = createOfficialOperationFactory(spotify);
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
export { spotifyOperation as t };
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { defineOfficialIntegration, officialCredentialSetId } from "@keystrokehq/integration-authoring/official";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import { CredentialSet } from "@keystrokehq/core";
|
|
4
|
-
|
|
5
|
-
//#region src/_official/provider-app.ts
|
|
6
|
-
const spotifyAppCredentialSet = new CredentialSet({
|
|
7
|
-
id: officialCredentialSetId("spotify-app"),
|
|
8
|
-
exposure: "platform-only",
|
|
9
|
-
name: "Spotify App",
|
|
10
|
-
auth: z.object({
|
|
11
|
-
clientId: z.string().min(1),
|
|
12
|
-
clientSecret: z.string().min(1)
|
|
13
|
-
})
|
|
14
|
-
});
|
|
15
|
-
const spotifyOfficialProviderSeed = {
|
|
16
|
-
provider: "spotify",
|
|
17
|
-
appRef: "spotify-platform",
|
|
18
|
-
displayName: "Spotify Platform",
|
|
19
|
-
credentialSetName: "Keystroke Spotify Platform App",
|
|
20
|
-
envShape: {
|
|
21
|
-
KEYSTROKE_OFFICIAL_SPOTIFY_CLIENT_ID: z.string().optional(),
|
|
22
|
-
KEYSTROKE_OFFICIAL_SPOTIFY_CLIENT_SECRET: z.string().optional()
|
|
23
|
-
},
|
|
24
|
-
requiredEnvKeys: ["KEYSTROKE_OFFICIAL_SPOTIFY_CLIENT_ID", "KEYSTROKE_OFFICIAL_SPOTIFY_CLIENT_SECRET"],
|
|
25
|
-
externalAppIdEnvKey: "KEYSTROKE_OFFICIAL_SPOTIFY_CLIENT_ID",
|
|
26
|
-
buildCredentials: (env) => ({
|
|
27
|
-
clientId: env.KEYSTROKE_OFFICIAL_SPOTIFY_CLIENT_ID,
|
|
28
|
-
clientSecret: env.KEYSTROKE_OFFICIAL_SPOTIFY_CLIENT_SECRET
|
|
29
|
-
})
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
//#endregion
|
|
33
|
-
//#region src/integration.ts
|
|
34
|
-
const spotifyAuthSchema = z.object({ SPOTIFY_ACCESS_TOKEN: z.string().min(1) });
|
|
35
|
-
const spotifyScopes = [
|
|
36
|
-
"user-read-private",
|
|
37
|
-
"user-read-email",
|
|
38
|
-
"user-read-recently-played",
|
|
39
|
-
"user-top-read",
|
|
40
|
-
"user-library-read",
|
|
41
|
-
"user-library-modify",
|
|
42
|
-
"playlist-read-private",
|
|
43
|
-
"playlist-read-collaborative",
|
|
44
|
-
"playlist-modify-private",
|
|
45
|
-
"playlist-modify-public",
|
|
46
|
-
"user-read-currently-playing",
|
|
47
|
-
"user-modify-playback-state",
|
|
48
|
-
"user-read-playback-state",
|
|
49
|
-
"user-follow-read",
|
|
50
|
-
"user-follow-modify",
|
|
51
|
-
"user-read-playback-position",
|
|
52
|
-
"ugc-image-upload"
|
|
53
|
-
];
|
|
54
|
-
const spotifyOfficialIntegration = {
|
|
55
|
-
id: "spotify",
|
|
56
|
-
name: "Spotify",
|
|
57
|
-
description: "Spotify playback, catalog, playlists, library, and polling triggers for Keystroke workflows",
|
|
58
|
-
proxy: { hosts: ["api.spotify.com", "accounts.spotify.com"] },
|
|
59
|
-
auth: spotifyAuthSchema,
|
|
60
|
-
connections: [{
|
|
61
|
-
id: "oauth",
|
|
62
|
-
kind: "oauth",
|
|
63
|
-
tokenType: "refreshable",
|
|
64
|
-
authUrl: "https://accounts.spotify.com/authorize",
|
|
65
|
-
tokenUrl: "https://accounts.spotify.com/api/token",
|
|
66
|
-
revokeUrl: null,
|
|
67
|
-
scopes: [...spotifyScopes],
|
|
68
|
-
vault: { accessToken: "SPOTIFY_ACCESS_TOKEN" }
|
|
69
|
-
}]
|
|
70
|
-
};
|
|
71
|
-
const spotifyBundle = defineOfficialIntegration({
|
|
72
|
-
...spotifyOfficialIntegration,
|
|
73
|
-
internal: { providerApp: spotifyAppCredentialSet }
|
|
74
|
-
});
|
|
75
|
-
const spotify = spotifyBundle.credentialSet;
|
|
76
|
-
|
|
77
|
-
//#endregion
|
|
78
|
-
export { spotifyOfficialProviderSeed as a, spotifyAppCredentialSet as i, spotifyBundle as n, spotifyOfficialIntegration as r, spotify as t };
|