@keystrokehq/spotify 0.0.9 → 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.
- package/README.md +22 -53
- package/dist/{schemas.mjs → browse-BaBol4IR.mjs} +87 -72
- package/dist/credential-sets/index.d.mts +2 -0
- package/dist/credential-sets/index.mjs +4 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +6 -1
- package/dist/operations/index.d.mts +2 -0
- package/dist/operations/index.mjs +3 -0
- package/dist/{schemas.d.mts → schemas/index.d.mts} +407 -397
- package/dist/schemas/index.mjs +3 -0
- package/dist/spotify-app.credential-set-DT2fivE7.d.mts +34 -0
- package/dist/spotify-app.credential-set-O5UKOpLR.mjs +16 -0
- package/dist/spotify.credential-set-CS3lCW-x.mjs +44 -0
- package/dist/upload-playlist-cover-image.operation-CnyIlv11.mjs +4247 -0
- package/dist/upload-playlist-cover-image.operation-Cqbmylzz.d.mts +5246 -0
- package/package.json +11 -127
- package/dist/_official/index.d.mts +0 -32
- package/dist/_official/index.mjs +0 -3
- package/dist/_runtime/index.d.mts +0 -1
- package/dist/_runtime/index.mjs +0 -1
- package/dist/albums.d.mts +0 -265
- package/dist/albums.mjs +0 -72
- package/dist/artists.d.mts +0 -237
- package/dist/artists.mjs +0 -84
- package/dist/audio-analysis.d.mts +0 -91
- package/dist/audio-analysis.mjs +0 -19
- package/dist/audio-features.d.mts +0 -61
- package/dist/audio-features.mjs +0 -31
- package/dist/audiobooks.d.mts +0 -176
- package/dist/audiobooks.mjs +0 -59
- package/dist/browse.d.mts +0 -74
- package/dist/browse.mjs +0 -31
- package/dist/categories.d.mts +0 -118
- package/dist/categories.mjs +0 -66
- package/dist/chapters.d.mts +0 -163
- package/dist/chapters.mjs +0 -39
- package/dist/client.d.mts +0 -3486
- package/dist/client.mjs +0 -758
- package/dist/connection.d.mts +0 -2
- package/dist/connection.mjs +0 -3
- package/dist/episodes.d.mts +0 -149
- package/dist/episodes.mjs +0 -39
- package/dist/errors.d.mts +0 -34
- package/dist/errors.mjs +0 -89
- package/dist/events.d.mts +0 -613
- package/dist/events.mjs +0 -55
- package/dist/factory-C9W7aXmR.mjs +0 -7
- package/dist/follow.d.mts +0 -83
- package/dist/follow.mjs +0 -65
- package/dist/genres.d.mts +0 -14
- package/dist/genres.mjs +0 -19
- package/dist/integration-CrkQTg9q.mjs +0 -170
- package/dist/integration-DXXNe4_j.d.mts +0 -40
- package/dist/library.d.mts +0 -472
- package/dist/library.mjs +0 -225
- package/dist/markets.d.mts +0 -14
- package/dist/markets.mjs +0 -20
- package/dist/me.d.mts +0 -169
- package/dist/me.mjs +0 -58
- package/dist/messaging.d.mts +0 -1
- package/dist/messaging.mjs +0 -1
- package/dist/operations.d.mts +0 -6
- package/dist/operations.mjs +0 -237
- package/dist/player.d.mts +0 -877
- package/dist/player.mjs +0 -220
- package/dist/playlists.d.mts +0 -546
- package/dist/playlists.mjs +0 -243
- package/dist/recommendations.d.mts +0 -144
- package/dist/recommendations.mjs +0 -137
- package/dist/search.d.mts +0 -389
- package/dist/search.mjs +0 -42
- package/dist/shows.d.mts +0 -159
- package/dist/shows.mjs +0 -59
- package/dist/tracks.d.mts +0 -173
- package/dist/tracks.mjs +0 -37
- package/dist/triggers.d.mts +0 -44
- package/dist/triggers.mjs +0 -235
- package/dist/users.d.mts +0 -35
- package/dist/users.mjs +0 -20
- package/dist/verification.d.mts +0 -1
- package/dist/verification.mjs +0 -1
package/dist/follow.d.mts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
4
|
-
|
|
5
|
-
//#region src/follow.d.ts
|
|
6
|
-
declare const getFollowedArtists: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
7
|
-
after: z.ZodOptional<z.ZodString>;
|
|
8
|
-
limit: z.ZodOptional<z.ZodNumber>;
|
|
9
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
10
|
-
href: z.ZodOptional<z.ZodURL>;
|
|
11
|
-
items: z.ZodArray<z.ZodObject<{
|
|
12
|
-
externalUrls: z.ZodOptional<z.ZodObject<{
|
|
13
|
-
spotify: z.ZodOptional<z.ZodURL>;
|
|
14
|
-
}, z.core.$strip>>;
|
|
15
|
-
href: z.ZodOptional<z.ZodURL>;
|
|
16
|
-
id: z.ZodString;
|
|
17
|
-
name: z.ZodString;
|
|
18
|
-
type: z.ZodLiteral<"artist">;
|
|
19
|
-
uri: z.ZodOptional<z.ZodString>;
|
|
20
|
-
followers: z.ZodOptional<z.ZodObject<{
|
|
21
|
-
href: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
|
|
22
|
-
total: z.ZodNumber;
|
|
23
|
-
}, z.core.$strip>>;
|
|
24
|
-
genres: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
|
-
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
26
|
-
url: z.ZodURL;
|
|
27
|
-
height: z.ZodNullable<z.ZodNumber>;
|
|
28
|
-
width: z.ZodNullable<z.ZodNumber>;
|
|
29
|
-
}, z.core.$strip>>>;
|
|
30
|
-
popularity: z.ZodOptional<z.ZodNumber>;
|
|
31
|
-
}, z.core.$strip>>;
|
|
32
|
-
limit: z.ZodNumber;
|
|
33
|
-
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
34
|
-
previousPageToken: z.ZodOptional<z.ZodString>;
|
|
35
|
-
total: z.ZodOptional<z.ZodNumber>;
|
|
36
|
-
cursors: z.ZodOptional<z.ZodObject<{
|
|
37
|
-
after: z.ZodOptional<z.ZodString>;
|
|
38
|
-
before: z.ZodOptional<z.ZodString>;
|
|
39
|
-
}, z.core.$strip>>;
|
|
40
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
41
|
-
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
42
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
43
|
-
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
44
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
45
|
-
declare const followArtistsOrUsers: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
46
|
-
type: z.ZodEnum<{
|
|
47
|
-
artist: "artist";
|
|
48
|
-
user: "user";
|
|
49
|
-
}>;
|
|
50
|
-
ids: z.ZodArray<z.ZodString>;
|
|
51
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
52
|
-
success: z.ZodLiteral<true>;
|
|
53
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
54
|
-
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
55
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
56
|
-
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
57
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
58
|
-
declare const unfollowArtistsOrUsers: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
59
|
-
type: z.ZodEnum<{
|
|
60
|
-
artist: "artist";
|
|
61
|
-
user: "user";
|
|
62
|
-
}>;
|
|
63
|
-
ids: z.ZodArray<z.ZodString>;
|
|
64
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
65
|
-
success: z.ZodLiteral<true>;
|
|
66
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
67
|
-
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
68
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
69
|
-
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
70
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
71
|
-
declare const checkFollowingArtistsOrUsers: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
72
|
-
type: z.ZodEnum<{
|
|
73
|
-
artist: "artist";
|
|
74
|
-
user: "user";
|
|
75
|
-
}>;
|
|
76
|
-
ids: z.ZodArray<z.ZodString>;
|
|
77
|
-
}, z.core.$strip>, z.ZodArray<z.ZodBoolean>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
78
|
-
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
79
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
80
|
-
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
81
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
82
|
-
//#endregion
|
|
83
|
-
export { checkFollowingArtistsOrUsers, followArtistsOrUsers, getFollowedArtists, unfollowArtistsOrUsers };
|
package/dist/follow.mjs
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { createSpotifyCursorPageSchema, spotifyArtistSchema, spotifyBooleanListSchema, spotifyIdSchema, spotifyMutationSuccessSchema } from "./schemas.mjs";
|
|
2
|
-
import { createSpotifyClient } from "./client.mjs";
|
|
3
|
-
import { t as spotifyOperation } from "./factory-C9W7aXmR.mjs";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
|
|
6
|
-
//#region src/follow.ts
|
|
7
|
-
const followTypeSchema = z.enum(["artist", "user"]);
|
|
8
|
-
const followIdsSchema = z.array(spotifyIdSchema).min(1).max(50);
|
|
9
|
-
const followedArtistsPageSchema = createSpotifyCursorPageSchema(spotifyArtistSchema);
|
|
10
|
-
const followedArtistsInputSchema = z.object({
|
|
11
|
-
after: z.string().min(1).optional(),
|
|
12
|
-
limit: z.number().int().min(1).max(50).optional()
|
|
13
|
-
});
|
|
14
|
-
const followMutationInputSchema = z.object({
|
|
15
|
-
type: followTypeSchema,
|
|
16
|
-
ids: followIdsSchema
|
|
17
|
-
});
|
|
18
|
-
const getFollowedArtists = spotifyOperation({
|
|
19
|
-
id: "spotify.get-spotify-followed-artists",
|
|
20
|
-
name: "Get Followed Spotify Artists",
|
|
21
|
-
description: "List the artists followed by the current Spotify user.",
|
|
22
|
-
input: followedArtistsInputSchema,
|
|
23
|
-
output: followedArtistsPageSchema,
|
|
24
|
-
run: async (input, credentials) => {
|
|
25
|
-
return createSpotifyClient(credentials).follow.getFollowedArtists({
|
|
26
|
-
after: input.after,
|
|
27
|
-
limit: input.limit
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const followArtistsOrUsers = spotifyOperation({
|
|
32
|
-
id: "spotify.follow-spotify-artists-or-users",
|
|
33
|
-
name: "Follow Spotify Artists Or Users",
|
|
34
|
-
description: "Follow Spotify artists or users for the current account.",
|
|
35
|
-
needsApproval: true,
|
|
36
|
-
input: followMutationInputSchema,
|
|
37
|
-
output: spotifyMutationSuccessSchema,
|
|
38
|
-
run: async (input, credentials) => {
|
|
39
|
-
return createSpotifyClient(credentials).follow.followArtistsOrUsers(input.type, input.ids);
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
const unfollowArtistsOrUsers = spotifyOperation({
|
|
43
|
-
id: "spotify.unfollow-spotify-artists-or-users",
|
|
44
|
-
name: "Unfollow Spotify Artists Or Users",
|
|
45
|
-
description: "Unfollow Spotify artists or users for the current account.",
|
|
46
|
-
needsApproval: true,
|
|
47
|
-
input: followMutationInputSchema,
|
|
48
|
-
output: spotifyMutationSuccessSchema,
|
|
49
|
-
run: async (input, credentials) => {
|
|
50
|
-
return createSpotifyClient(credentials).follow.unfollowArtistsOrUsers(input.type, input.ids);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
const checkFollowingArtistsOrUsers = spotifyOperation({
|
|
54
|
-
id: "spotify.check-spotify-following-artists-or-users",
|
|
55
|
-
name: "Check Following Spotify Artists Or Users",
|
|
56
|
-
description: "Check whether the current Spotify user follows the given artists or users.",
|
|
57
|
-
input: followMutationInputSchema,
|
|
58
|
-
output: spotifyBooleanListSchema,
|
|
59
|
-
run: async (input, credentials) => {
|
|
60
|
-
return createSpotifyClient(credentials).follow.checkFollowingArtistsOrUsers(input.type, input.ids);
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
//#endregion
|
|
65
|
-
export { checkFollowingArtistsOrUsers, followArtistsOrUsers, getFollowedArtists, unfollowArtistsOrUsers };
|
package/dist/genres.d.mts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
4
|
-
|
|
5
|
-
//#region src/genres.d.ts
|
|
6
|
-
declare const getAvailableGenreSeeds: _keystrokehq_core0.Operation<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
7
|
-
genres: z.ZodArray<z.ZodString>;
|
|
8
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
9
|
-
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
10
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
11
|
-
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
12
|
-
}, z.core.$strip>>[] | undefined>], undefined>;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { getAvailableGenreSeeds };
|
package/dist/genres.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { createSpotifyClient } from "./client.mjs";
|
|
2
|
-
import { t as spotifyOperation } from "./factory-C9W7aXmR.mjs";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
|
|
5
|
-
//#region src/genres.ts
|
|
6
|
-
const availableGenreSeedsResponseSchema = z.object({ genres: z.array(z.string().min(1)) });
|
|
7
|
-
const getAvailableGenreSeeds = spotifyOperation({
|
|
8
|
-
id: "spotify.get-spotify-available-genre-seeds",
|
|
9
|
-
name: "Get Spotify Available Genre Seeds",
|
|
10
|
-
description: "List Spotify recommendation genre seeds. This endpoint is deprecated upstream by Spotify.",
|
|
11
|
-
input: z.object({}),
|
|
12
|
-
output: availableGenreSeedsResponseSchema,
|
|
13
|
-
run: async (_input, credentials) => {
|
|
14
|
-
return createSpotifyClient(credentials).discovery.getAvailableGenreSeeds();
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
export { getAvailableGenreSeeds };
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
import { CredentialSet, Operation } from "@keystrokehq/core";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//#region ../../packages/integration-authoring/dist/official/runtime.mjs
|
|
5
|
-
const REGISTRY_KEY = "__ks_official_integration_metadata_registry";
|
|
6
|
-
function getRegistry() {
|
|
7
|
-
const globalStore = globalThis;
|
|
8
|
-
if (!globalStore[REGISTRY_KEY]) globalStore[REGISTRY_KEY] = /* @__PURE__ */ new WeakMap();
|
|
9
|
-
return globalStore[REGISTRY_KEY];
|
|
10
|
-
}
|
|
11
|
-
function registerOfficialOperation(operation, metadata) {
|
|
12
|
-
getRegistry().set(operation, Object.freeze({ ...metadata }));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
//#region ../../packages/integration-authoring/dist/official/index.mjs
|
|
17
|
-
const OFFICIAL_CREDENTIAL_SET_ID_PREFIX = "keystroke:";
|
|
18
|
-
function officialCredentialSetId(id) {
|
|
19
|
-
return `${OFFICIAL_CREDENTIAL_SET_ID_PREFIX}${id}`;
|
|
20
|
-
}
|
|
21
|
-
function stripOfficialCredentialSetIdPrefix(id) {
|
|
22
|
-
return id.startsWith(OFFICIAL_CREDENTIAL_SET_ID_PREFIX) ? id.slice(10) : id;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Creates a factory for Keystroke-official integration operations.
|
|
26
|
-
*
|
|
27
|
-
* It keeps the same flat `run(input, credentials)` ergonomics as the generic
|
|
28
|
-
* operation factory, while registering official metadata for builder/runtime
|
|
29
|
-
* operation metadata.
|
|
30
|
-
*/
|
|
31
|
-
function createOfficialOperationFactory(credentialSet) {
|
|
32
|
-
const integrationId = stripOfficialCredentialSetIdPrefix(credentialSet.id);
|
|
33
|
-
return (config) => {
|
|
34
|
-
const wrappedRun = async (input, ctx) => {
|
|
35
|
-
const creds = ctx.credentials[credentialSet.id];
|
|
36
|
-
return config.run(input, creds);
|
|
37
|
-
};
|
|
38
|
-
const operation = new Operation({
|
|
39
|
-
id: config.id,
|
|
40
|
-
name: config.name,
|
|
41
|
-
description: config.description,
|
|
42
|
-
input: config.input,
|
|
43
|
-
output: config.output,
|
|
44
|
-
credentialSets: [credentialSet],
|
|
45
|
-
...config.tags !== void 0 ? { tags: config.tags } : {},
|
|
46
|
-
...config.needsApproval !== void 0 ? { needsApproval: config.needsApproval } : {},
|
|
47
|
-
...config.requiredOAuthScopes !== void 0 ? { requiredOAuthScopes: config.requiredOAuthScopes } : {},
|
|
48
|
-
...config.retries !== void 0 ? { retries: config.retries } : {},
|
|
49
|
-
...config.timeout !== void 0 ? { timeout: config.timeout } : {},
|
|
50
|
-
...config.maxDurationMs !== void 0 ? { maxDurationMs: config.maxDurationMs } : {},
|
|
51
|
-
run: wrappedRun
|
|
52
|
-
});
|
|
53
|
-
registerOfficialOperation(operation, { integrationId });
|
|
54
|
-
return operation;
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Creates an official integration bundle from a single config object.
|
|
59
|
-
*
|
|
60
|
-
* - Creates the public `CredentialSet` internally.
|
|
61
|
-
* - Accepts optional `internal` fields for Keystroke-owned platform credentials.
|
|
62
|
-
*/
|
|
63
|
-
function defineOfficialIntegration(config) {
|
|
64
|
-
const internalCredentialSets = config.internal ?? {};
|
|
65
|
-
const allInternalCredentialSets = [
|
|
66
|
-
...internalCredentialSets.providerApp ? [internalCredentialSets.providerApp] : [],
|
|
67
|
-
...internalCredentialSets.providerAppVariants ?? [],
|
|
68
|
-
...internalCredentialSets.webhookVerification ? [internalCredentialSets.webhookVerification] : [],
|
|
69
|
-
...internalCredentialSets.other ?? []
|
|
70
|
-
];
|
|
71
|
-
const credentialSet = new CredentialSet({
|
|
72
|
-
id: config.id,
|
|
73
|
-
name: config.name,
|
|
74
|
-
description: config.description,
|
|
75
|
-
auth: config.auth,
|
|
76
|
-
...config.connections ? { connections: config.connections } : {},
|
|
77
|
-
...config.proxy ? { proxy: config.proxy } : {},
|
|
78
|
-
...config.needsRawSecret === true ? { needsRawSecret: true } : {}
|
|
79
|
-
});
|
|
80
|
-
return Object.freeze({
|
|
81
|
-
integration: {
|
|
82
|
-
id: config.id,
|
|
83
|
-
name: config.name,
|
|
84
|
-
...config.description !== void 0 ? { description: config.description } : {},
|
|
85
|
-
auth: config.auth,
|
|
86
|
-
...config.proxy ? { proxy: config.proxy } : {},
|
|
87
|
-
...config.needsRawSecret === true ? { needsRawSecret: true } : {},
|
|
88
|
-
...config.connections ? { connections: config.connections } : {}
|
|
89
|
-
},
|
|
90
|
-
credentialSet,
|
|
91
|
-
internalCredentialSets,
|
|
92
|
-
allInternalCredentialSets
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
//#endregion
|
|
97
|
-
//#region src/_official/provider-app.ts
|
|
98
|
-
const spotifyAppCredentialSet = new CredentialSet({
|
|
99
|
-
id: officialCredentialSetId("spotify-app"),
|
|
100
|
-
exposure: "platform-only",
|
|
101
|
-
name: "Spotify App",
|
|
102
|
-
auth: z.object({
|
|
103
|
-
clientId: z.string().min(1),
|
|
104
|
-
clientSecret: z.string().min(1)
|
|
105
|
-
})
|
|
106
|
-
});
|
|
107
|
-
const spotifyOfficialProviderSeed = {
|
|
108
|
-
provider: "spotify",
|
|
109
|
-
appRef: "spotify-platform",
|
|
110
|
-
displayName: "Spotify Platform",
|
|
111
|
-
credentialSetName: "Keystroke Spotify Platform App",
|
|
112
|
-
envShape: {
|
|
113
|
-
KEYSTROKE_OFFICIAL_SPOTIFY_CLIENT_ID: z.string().optional(),
|
|
114
|
-
KEYSTROKE_OFFICIAL_SPOTIFY_CLIENT_SECRET: z.string().optional()
|
|
115
|
-
},
|
|
116
|
-
requiredEnvKeys: ["KEYSTROKE_OFFICIAL_SPOTIFY_CLIENT_ID", "KEYSTROKE_OFFICIAL_SPOTIFY_CLIENT_SECRET"],
|
|
117
|
-
externalAppIdEnvKey: "KEYSTROKE_OFFICIAL_SPOTIFY_CLIENT_ID",
|
|
118
|
-
buildCredentials: (env) => ({
|
|
119
|
-
clientId: env.KEYSTROKE_OFFICIAL_SPOTIFY_CLIENT_ID,
|
|
120
|
-
clientSecret: env.KEYSTROKE_OFFICIAL_SPOTIFY_CLIENT_SECRET
|
|
121
|
-
})
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
//#endregion
|
|
125
|
-
//#region src/integration.ts
|
|
126
|
-
const spotifyAuthSchema = z.object({ SPOTIFY_ACCESS_TOKEN: z.string().min(1) });
|
|
127
|
-
const spotifyScopes = [
|
|
128
|
-
"user-read-private",
|
|
129
|
-
"user-read-email",
|
|
130
|
-
"user-read-recently-played",
|
|
131
|
-
"user-top-read",
|
|
132
|
-
"user-library-read",
|
|
133
|
-
"user-library-modify",
|
|
134
|
-
"playlist-read-private",
|
|
135
|
-
"playlist-read-collaborative",
|
|
136
|
-
"playlist-modify-private",
|
|
137
|
-
"playlist-modify-public",
|
|
138
|
-
"user-read-currently-playing",
|
|
139
|
-
"user-modify-playback-state",
|
|
140
|
-
"user-read-playback-state",
|
|
141
|
-
"user-follow-read",
|
|
142
|
-
"user-follow-modify",
|
|
143
|
-
"user-read-playback-position",
|
|
144
|
-
"ugc-image-upload"
|
|
145
|
-
];
|
|
146
|
-
const spotifyOfficialIntegration = {
|
|
147
|
-
id: "spotify",
|
|
148
|
-
name: "Spotify",
|
|
149
|
-
description: "Spotify playback, catalog, playlists, library, and polling triggers for Keystroke workflows",
|
|
150
|
-
proxy: { hosts: ["api.spotify.com", "accounts.spotify.com"] },
|
|
151
|
-
auth: spotifyAuthSchema,
|
|
152
|
-
connections: [{
|
|
153
|
-
id: "oauth",
|
|
154
|
-
kind: "oauth",
|
|
155
|
-
tokenType: "refreshable",
|
|
156
|
-
authUrl: "https://accounts.spotify.com/authorize",
|
|
157
|
-
tokenUrl: "https://accounts.spotify.com/api/token",
|
|
158
|
-
revokeUrl: null,
|
|
159
|
-
scopes: [...spotifyScopes],
|
|
160
|
-
vault: { accessToken: "SPOTIFY_ACCESS_TOKEN" }
|
|
161
|
-
}]
|
|
162
|
-
};
|
|
163
|
-
const spotifyBundle = defineOfficialIntegration({
|
|
164
|
-
...spotifyOfficialIntegration,
|
|
165
|
-
internal: { providerApp: spotifyAppCredentialSet }
|
|
166
|
-
});
|
|
167
|
-
const spotify = spotifyBundle.credentialSet;
|
|
168
|
-
|
|
169
|
-
//#endregion
|
|
170
|
-
export { spotifyOfficialProviderSeed as a, spotifyAppCredentialSet as i, spotifyBundle as n, createOfficialOperationFactory as o, spotifyOfficialIntegration as r, spotify as t };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
|
|
4
|
-
import { InferCredentialSetAuth } from "@keystrokehq/core/credential-set";
|
|
5
|
-
|
|
6
|
-
//#region src/integration.d.ts
|
|
7
|
-
declare const spotifyOfficialIntegration: {
|
|
8
|
-
id: "spotify";
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
proxy: {
|
|
12
|
-
hosts: string[];
|
|
13
|
-
};
|
|
14
|
-
auth: z.ZodObject<{
|
|
15
|
-
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
16
|
-
}, z.core.$strip>;
|
|
17
|
-
connections: {
|
|
18
|
-
id: string;
|
|
19
|
-
kind: "oauth";
|
|
20
|
-
tokenType: "refreshable";
|
|
21
|
-
authUrl: string;
|
|
22
|
-
tokenUrl: string;
|
|
23
|
-
revokeUrl: null;
|
|
24
|
-
scopes: ("user-read-private" | "user-read-email" | "user-read-recently-played" | "user-top-read" | "user-library-read" | "user-library-modify" | "playlist-read-private" | "playlist-read-collaborative" | "playlist-modify-private" | "playlist-modify-public" | "user-read-currently-playing" | "user-modify-playback-state" | "user-read-playback-state" | "user-follow-read" | "user-follow-modify" | "user-read-playback-position" | "ugc-image-upload")[];
|
|
25
|
-
vault: {
|
|
26
|
-
accessToken: "SPOTIFY_ACCESS_TOKEN";
|
|
27
|
-
};
|
|
28
|
-
}[];
|
|
29
|
-
};
|
|
30
|
-
declare const spotifyBundle: undefined<"spotify", z.ZodObject<{
|
|
31
|
-
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
32
|
-
}, z.core.$strip>>;
|
|
33
|
-
declare const spotify: _keystrokehq_core0.CredentialSet<"spotify", z.ZodObject<{
|
|
34
|
-
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
35
|
-
}, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
|
|
36
|
-
SPOTIFY_ACCESS_TOKEN: z.ZodString;
|
|
37
|
-
}, z.core.$strip>>[] | undefined>;
|
|
38
|
-
type SpotifyCredentials = InferCredentialSetAuth<typeof spotify>;
|
|
39
|
-
//#endregion
|
|
40
|
-
export { spotifyOfficialIntegration as i, spotify as n, spotifyBundle as r, SpotifyCredentials as t };
|