@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
@@ -1,59 +0,0 @@
1
- import { spotifyAudiobookSchema, spotifyChapterPageSchema, spotifyIdSchema, 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/audiobooks.ts
7
- const audiobookIdsSchema = z.array(spotifyIdSchema).min(1).max(50);
8
- const audiobookLookupInputSchema = z.object({
9
- id: spotifyIdSchema,
10
- market: spotifyMarketSchema.optional()
11
- });
12
- const severalAudiobooksInputSchema = z.object({
13
- ids: audiobookIdsSchema,
14
- market: spotifyMarketSchema.optional()
15
- });
16
- const severalAudiobooksOutputSchema = z.object({ audiobooks: z.array(spotifyAudiobookSchema) });
17
- const audiobookChaptersInputSchema = z.object({
18
- id: spotifyIdSchema,
19
- market: spotifyMarketSchema.optional(),
20
- limit: z.number().int().min(1).max(50).optional(),
21
- offset: z.number().int().nonnegative().optional()
22
- });
23
- const getAudiobook = spotifyOperation({
24
- id: "spotify.get-spotify-audiobook",
25
- name: "Get Spotify Audiobook",
26
- description: "Fetch a single Spotify audiobook by ID.",
27
- input: audiobookLookupInputSchema,
28
- output: spotifyAudiobookSchema,
29
- run: async (input, credentials) => {
30
- return createSpotifyClient(credentials).audiobooks.getAudiobook(input.id, input.market);
31
- }
32
- });
33
- const getSeveralAudiobooks = spotifyOperation({
34
- id: "spotify.get-spotify-several-audiobooks",
35
- name: "Get Several Spotify Audiobooks",
36
- description: "Fetch multiple Spotify audiobooks in a single request.",
37
- input: severalAudiobooksInputSchema,
38
- output: severalAudiobooksOutputSchema,
39
- run: async (input, credentials) => {
40
- return createSpotifyClient(credentials).audiobooks.getSeveralAudiobooks(input.ids, input.market);
41
- }
42
- });
43
- const getAudiobookChapters = spotifyOperation({
44
- id: "spotify.get-spotify-audiobook-chapters",
45
- name: "Get Spotify Audiobook Chapters",
46
- description: "List chapters for a Spotify audiobook.",
47
- input: audiobookChaptersInputSchema,
48
- output: spotifyChapterPageSchema,
49
- run: async (input, credentials) => {
50
- return createSpotifyClient(credentials).audiobooks.getAudiobookChapters(input.id, {
51
- market: input.market,
52
- limit: input.limit,
53
- offset: input.offset
54
- });
55
- }
56
- });
57
-
58
- //#endregion
59
- export { getAudiobook, getAudiobookChapters, getSeveralAudiobooks };
package/dist/browse.d.mts DELETED
@@ -1,71 +0,0 @@
1
- import { z } from "zod";
2
- import * as _keystrokehq_core0 from "@keystrokehq/core";
3
-
4
- //#region src/browse.d.ts
5
- declare const getFeaturedPlaylists: _keystrokehq_core0.Operation<z.ZodObject<{
6
- country: z.ZodOptional<z.ZodString>;
7
- locale: z.ZodOptional<z.ZodString>;
8
- timestamp: z.ZodOptional<z.ZodISODateTime>;
9
- limit: z.ZodOptional<z.ZodNumber>;
10
- offset: z.ZodOptional<z.ZodNumber>;
11
- }, z.core.$strip>, z.ZodObject<{
12
- href: z.ZodOptional<z.ZodURL>;
13
- items: z.ZodArray<z.ZodObject<{
14
- collaborative: z.ZodBoolean;
15
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
16
- externalUrls: z.ZodOptional<z.ZodObject<{
17
- spotify: z.ZodOptional<z.ZodURL>;
18
- }, z.core.$strip>>;
19
- followers: z.ZodOptional<z.ZodObject<{
20
- href: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
21
- total: z.ZodNumber;
22
- }, z.core.$strip>>;
23
- href: z.ZodOptional<z.ZodURL>;
24
- id: z.ZodString;
25
- images: 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
- name: z.ZodString;
31
- owner: z.ZodObject<{
32
- displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
33
- externalUrls: z.ZodOptional<z.ZodObject<{
34
- spotify: z.ZodOptional<z.ZodURL>;
35
- }, z.core.$strip>>;
36
- followers: z.ZodOptional<z.ZodObject<{
37
- href: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
38
- total: z.ZodNumber;
39
- }, z.core.$strip>>;
40
- href: z.ZodOptional<z.ZodURL>;
41
- id: z.ZodString;
42
- type: z.ZodLiteral<"user">;
43
- uri: z.ZodOptional<z.ZodString>;
44
- email: z.ZodOptional<z.ZodEmail>;
45
- country: z.ZodOptional<z.ZodString>;
46
- product: z.ZodOptional<z.ZodString>;
47
- images: z.ZodOptional<z.ZodArray<z.ZodObject<{
48
- url: z.ZodURL;
49
- height: z.ZodNullable<z.ZodNumber>;
50
- width: z.ZodNullable<z.ZodNumber>;
51
- }, z.core.$strip>>>;
52
- }, z.core.$strip>;
53
- public: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
54
- snapshotId: z.ZodOptional<z.ZodString>;
55
- tracks: z.ZodOptional<z.ZodObject<{
56
- href: z.ZodOptional<z.ZodURL>;
57
- total: z.ZodOptional<z.ZodNumber>;
58
- }, z.core.$strip>>;
59
- type: z.ZodLiteral<"playlist">;
60
- uri: z.ZodOptional<z.ZodString>;
61
- }, z.core.$strip>>;
62
- limit: z.ZodNumber;
63
- nextPageToken: z.ZodOptional<z.ZodString>;
64
- offset: z.ZodNumber;
65
- previousPageToken: z.ZodOptional<z.ZodString>;
66
- total: z.ZodOptional<z.ZodNumber>;
67
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:spotify", z.ZodObject<{
68
- SPOTIFY_ACCESS_TOKEN: z.ZodString;
69
- }, z.core.$strip>>], undefined>;
70
- //#endregion
71
- export { getFeaturedPlaylists };
package/dist/browse.mjs DELETED
@@ -1,31 +0,0 @@
1
- import { spotifyMarketSchema, spotifyPlaylistPageSchema, spotifyTimestampSchema } 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/browse.ts
7
- const getFeaturedPlaylists = spotifyOperation({
8
- id: "spotify.get-spotify-featured-playlists",
9
- name: "Get Spotify Featured Playlists",
10
- description: "List featured Spotify playlists for a market. This endpoint is deprecated upstream by Spotify.",
11
- input: z.object({
12
- country: spotifyMarketSchema.optional(),
13
- locale: z.string().min(1).optional(),
14
- timestamp: spotifyTimestampSchema.optional(),
15
- limit: z.number().int().positive().max(50).optional(),
16
- offset: z.number().int().nonnegative().optional()
17
- }),
18
- output: spotifyPlaylistPageSchema,
19
- run: async (input, credentials) => {
20
- return createSpotifyClient(credentials).discovery.getFeaturedPlaylists({
21
- country: input.country,
22
- locale: input.locale,
23
- timestamp: input.timestamp,
24
- limit: input.limit,
25
- offset: input.offset
26
- });
27
- }
28
- });
29
-
30
- //#endregion
31
- export { getFeaturedPlaylists };
@@ -1,111 +0,0 @@
1
- import { z } from "zod";
2
- import * as _keystrokehq_core0 from "@keystrokehq/core";
3
-
4
- //#region src/categories.d.ts
5
- declare const getBrowseCategories: _keystrokehq_core0.Operation<z.ZodObject<{
6
- limit: z.ZodOptional<z.ZodNumber>;
7
- offset: z.ZodOptional<z.ZodNumber>;
8
- country: z.ZodOptional<z.ZodString>;
9
- locale: z.ZodOptional<z.ZodString>;
10
- }, z.core.$strip>, z.ZodObject<{
11
- href: z.ZodOptional<z.ZodURL>;
12
- items: z.ZodArray<z.ZodObject<{
13
- href: z.ZodOptional<z.ZodURL>;
14
- icons: z.ZodArray<z.ZodObject<{
15
- url: z.ZodURL;
16
- height: z.ZodNullable<z.ZodNumber>;
17
- width: z.ZodNullable<z.ZodNumber>;
18
- }, z.core.$strip>>;
19
- id: z.ZodString;
20
- name: z.ZodString;
21
- }, z.core.$strip>>;
22
- limit: z.ZodNumber;
23
- nextPageToken: z.ZodOptional<z.ZodString>;
24
- offset: z.ZodNumber;
25
- previousPageToken: z.ZodOptional<z.ZodString>;
26
- total: z.ZodOptional<z.ZodNumber>;
27
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:spotify", z.ZodObject<{
28
- SPOTIFY_ACCESS_TOKEN: z.ZodString;
29
- }, z.core.$strip>>], undefined>;
30
- declare const getBrowseCategory: _keystrokehq_core0.Operation<z.ZodObject<{
31
- id: z.ZodString;
32
- country: z.ZodOptional<z.ZodString>;
33
- locale: z.ZodOptional<z.ZodString>;
34
- }, z.core.$strip>, z.ZodObject<{
35
- href: z.ZodOptional<z.ZodURL>;
36
- icons: z.ZodArray<z.ZodObject<{
37
- url: z.ZodURL;
38
- height: z.ZodNullable<z.ZodNumber>;
39
- width: z.ZodNullable<z.ZodNumber>;
40
- }, z.core.$strip>>;
41
- id: z.ZodString;
42
- name: z.ZodString;
43
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:spotify", z.ZodObject<{
44
- SPOTIFY_ACCESS_TOKEN: z.ZodString;
45
- }, z.core.$strip>>], undefined>;
46
- declare const getCategoryPlaylists: _keystrokehq_core0.Operation<z.ZodObject<{
47
- limit: z.ZodOptional<z.ZodNumber>;
48
- offset: z.ZodOptional<z.ZodNumber>;
49
- id: z.ZodString;
50
- country: z.ZodOptional<z.ZodString>;
51
- }, z.core.$strip>, z.ZodObject<{
52
- href: z.ZodOptional<z.ZodURL>;
53
- items: z.ZodArray<z.ZodObject<{
54
- collaborative: z.ZodBoolean;
55
- description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
- externalUrls: z.ZodOptional<z.ZodObject<{
57
- spotify: z.ZodOptional<z.ZodURL>;
58
- }, z.core.$strip>>;
59
- followers: z.ZodOptional<z.ZodObject<{
60
- href: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
61
- total: z.ZodNumber;
62
- }, z.core.$strip>>;
63
- href: z.ZodOptional<z.ZodURL>;
64
- id: z.ZodString;
65
- images: z.ZodArray<z.ZodObject<{
66
- url: z.ZodURL;
67
- height: z.ZodNullable<z.ZodNumber>;
68
- width: z.ZodNullable<z.ZodNumber>;
69
- }, z.core.$strip>>;
70
- name: z.ZodString;
71
- owner: z.ZodObject<{
72
- displayName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
73
- externalUrls: z.ZodOptional<z.ZodObject<{
74
- spotify: z.ZodOptional<z.ZodURL>;
75
- }, z.core.$strip>>;
76
- followers: z.ZodOptional<z.ZodObject<{
77
- href: z.ZodOptional<z.ZodNullable<z.ZodURL>>;
78
- total: z.ZodNumber;
79
- }, z.core.$strip>>;
80
- href: z.ZodOptional<z.ZodURL>;
81
- id: z.ZodString;
82
- type: z.ZodLiteral<"user">;
83
- uri: z.ZodOptional<z.ZodString>;
84
- email: z.ZodOptional<z.ZodEmail>;
85
- country: z.ZodOptional<z.ZodString>;
86
- product: z.ZodOptional<z.ZodString>;
87
- images: z.ZodOptional<z.ZodArray<z.ZodObject<{
88
- url: z.ZodURL;
89
- height: z.ZodNullable<z.ZodNumber>;
90
- width: z.ZodNullable<z.ZodNumber>;
91
- }, z.core.$strip>>>;
92
- }, z.core.$strip>;
93
- public: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
94
- snapshotId: z.ZodOptional<z.ZodString>;
95
- tracks: z.ZodOptional<z.ZodObject<{
96
- href: z.ZodOptional<z.ZodURL>;
97
- total: z.ZodOptional<z.ZodNumber>;
98
- }, z.core.$strip>>;
99
- type: z.ZodLiteral<"playlist">;
100
- uri: z.ZodOptional<z.ZodString>;
101
- }, z.core.$strip>>;
102
- limit: z.ZodNumber;
103
- nextPageToken: z.ZodOptional<z.ZodString>;
104
- offset: z.ZodNumber;
105
- previousPageToken: z.ZodOptional<z.ZodString>;
106
- total: z.ZodOptional<z.ZodNumber>;
107
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:spotify", z.ZodObject<{
108
- SPOTIFY_ACCESS_TOKEN: z.ZodString;
109
- }, z.core.$strip>>], undefined>;
110
- //#endregion
111
- export { getBrowseCategories, getBrowseCategory, getCategoryPlaylists };
@@ -1,66 +0,0 @@
1
- import { spotifyCategoryPageSchema, spotifyCategorySchema, spotifyMarketSchema, spotifyPlaylistPageSchema } 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/categories.ts
7
- const browseCategoryIdSchema = z.string().min(1);
8
- const categoryPagingSchema = z.object({
9
- limit: z.number().int().positive().max(50).optional(),
10
- offset: z.number().int().nonnegative().optional()
11
- });
12
- const getBrowseCategories = spotifyOperation({
13
- id: "spotify.get-spotify-browse-categories",
14
- name: "Get Spotify Browse Categories",
15
- description: "List Spotify browse categories.",
16
- input: categoryPagingSchema.extend({
17
- country: spotifyMarketSchema.optional(),
18
- locale: z.string().min(1).optional()
19
- }),
20
- output: spotifyCategoryPageSchema,
21
- run: async (input, credentials) => {
22
- return createSpotifyClient(credentials).discovery.getBrowseCategories({
23
- country: input.country,
24
- locale: input.locale,
25
- limit: input.limit,
26
- offset: input.offset
27
- });
28
- }
29
- });
30
- const getBrowseCategory = spotifyOperation({
31
- id: "spotify.get-spotify-browse-category",
32
- name: "Get Spotify Browse Category",
33
- description: "Fetch a single Spotify browse category.",
34
- input: z.object({
35
- id: browseCategoryIdSchema,
36
- country: spotifyMarketSchema.optional(),
37
- locale: z.string().min(1).optional()
38
- }),
39
- output: spotifyCategorySchema,
40
- run: async (input, credentials) => {
41
- return createSpotifyClient(credentials).discovery.getBrowseCategory(input.id, {
42
- country: input.country,
43
- locale: input.locale
44
- });
45
- }
46
- });
47
- const getCategoryPlaylists = spotifyOperation({
48
- id: "spotify.get-spotify-category-playlists",
49
- name: "Get Spotify Category Playlists",
50
- description: "List playlists for a Spotify browse category. This endpoint is deprecated upstream by Spotify.",
51
- input: categoryPagingSchema.extend({
52
- id: browseCategoryIdSchema,
53
- country: spotifyMarketSchema.optional()
54
- }),
55
- output: spotifyPlaylistPageSchema,
56
- run: async (input, credentials) => {
57
- return createSpotifyClient(credentials).discovery.getCategoryPlaylists(input.id, {
58
- country: input.country,
59
- limit: input.limit,
60
- offset: input.offset
61
- });
62
- }
63
- });
64
-
65
- //#endregion
66
- export { getBrowseCategories, getBrowseCategory, getCategoryPlaylists };
@@ -1,158 +0,0 @@
1
- import { z } from "zod";
2
- import * as _keystrokehq_core0 from "@keystrokehq/core";
3
-
4
- //#region src/chapters.d.ts
5
- declare const getChapter: _keystrokehq_core0.Operation<z.ZodObject<{
6
- id: z.ZodString;
7
- market: z.ZodOptional<z.ZodString>;
8
- }, z.core.$strip>, z.ZodObject<{
9
- audioPreviewUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
10
- audiobook: z.ZodOptional<z.ZodObject<{
11
- authors: z.ZodOptional<z.ZodArray<z.ZodObject<{
12
- name: z.ZodString;
13
- }, z.core.$strip>>>;
14
- availableMarkets: z.ZodOptional<z.ZodArray<z.ZodString>>;
15
- copyrights: z.ZodOptional<z.ZodArray<z.ZodObject<{
16
- text: z.ZodString;
17
- type: z.ZodString;
18
- }, z.core.$strip>>>;
19
- description: z.ZodOptional<z.ZodString>;
20
- explicit: z.ZodOptional<z.ZodBoolean>;
21
- externalUrls: z.ZodOptional<z.ZodObject<{
22
- spotify: z.ZodOptional<z.ZodURL>;
23
- }, z.core.$strip>>;
24
- href: z.ZodOptional<z.ZodURL>;
25
- htmlDescription: z.ZodOptional<z.ZodString>;
26
- id: z.ZodString;
27
- images: z.ZodArray<z.ZodObject<{
28
- url: z.ZodURL;
29
- height: z.ZodNullable<z.ZodNumber>;
30
- width: z.ZodNullable<z.ZodNumber>;
31
- }, z.core.$strip>>;
32
- languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
- mediaType: z.ZodOptional<z.ZodString>;
34
- name: z.ZodString;
35
- narrators: z.ZodOptional<z.ZodArray<z.ZodObject<{
36
- name: z.ZodString;
37
- }, z.core.$strip>>>;
38
- publisher: z.ZodOptional<z.ZodString>;
39
- totalChapters: z.ZodOptional<z.ZodNumber>;
40
- type: z.ZodLiteral<"audiobook">;
41
- uri: z.ZodOptional<z.ZodString>;
42
- }, z.core.$strip>>;
43
- availableMarkets: z.ZodOptional<z.ZodArray<z.ZodString>>;
44
- chapterNumber: z.ZodOptional<z.ZodNumber>;
45
- description: z.ZodOptional<z.ZodString>;
46
- durationMs: z.ZodNumber;
47
- explicit: z.ZodBoolean;
48
- externalUrls: z.ZodOptional<z.ZodObject<{
49
- spotify: z.ZodOptional<z.ZodURL>;
50
- }, z.core.$strip>>;
51
- href: z.ZodOptional<z.ZodURL>;
52
- htmlDescription: z.ZodOptional<z.ZodString>;
53
- id: z.ZodString;
54
- images: z.ZodArray<z.ZodObject<{
55
- url: z.ZodURL;
56
- height: z.ZodNullable<z.ZodNumber>;
57
- width: z.ZodNullable<z.ZodNumber>;
58
- }, z.core.$strip>>;
59
- isPlayable: z.ZodOptional<z.ZodBoolean>;
60
- languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
61
- name: z.ZodString;
62
- releaseDate: z.ZodOptional<z.ZodString>;
63
- releaseDatePrecision: z.ZodOptional<z.ZodEnum<{
64
- year: "year";
65
- month: "month";
66
- day: "day";
67
- }>>;
68
- resumePoint: z.ZodOptional<z.ZodObject<{
69
- fullyPlayed: z.ZodBoolean;
70
- resumePositionMs: z.ZodNumber;
71
- }, z.core.$strip>>;
72
- restrictions: z.ZodOptional<z.ZodObject<{
73
- reason: z.ZodString;
74
- }, z.core.$strip>>;
75
- type: z.ZodLiteral<"chapter">;
76
- uri: z.ZodOptional<z.ZodString>;
77
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:spotify", z.ZodObject<{
78
- SPOTIFY_ACCESS_TOKEN: z.ZodString;
79
- }, z.core.$strip>>], undefined>;
80
- declare const getSeveralChapters: _keystrokehq_core0.Operation<z.ZodObject<{
81
- ids: z.ZodArray<z.ZodString>;
82
- market: z.ZodOptional<z.ZodString>;
83
- }, z.core.$strip>, z.ZodObject<{
84
- chapters: z.ZodArray<z.ZodObject<{
85
- audioPreviewUrl: z.ZodOptional<z.ZodUnion<readonly [z.ZodURL, z.ZodNull]>>;
86
- audiobook: z.ZodOptional<z.ZodObject<{
87
- authors: z.ZodOptional<z.ZodArray<z.ZodObject<{
88
- name: z.ZodString;
89
- }, z.core.$strip>>>;
90
- availableMarkets: z.ZodOptional<z.ZodArray<z.ZodString>>;
91
- copyrights: z.ZodOptional<z.ZodArray<z.ZodObject<{
92
- text: z.ZodString;
93
- type: z.ZodString;
94
- }, z.core.$strip>>>;
95
- description: z.ZodOptional<z.ZodString>;
96
- explicit: z.ZodOptional<z.ZodBoolean>;
97
- externalUrls: z.ZodOptional<z.ZodObject<{
98
- spotify: z.ZodOptional<z.ZodURL>;
99
- }, z.core.$strip>>;
100
- href: z.ZodOptional<z.ZodURL>;
101
- htmlDescription: z.ZodOptional<z.ZodString>;
102
- id: z.ZodString;
103
- images: z.ZodArray<z.ZodObject<{
104
- url: z.ZodURL;
105
- height: z.ZodNullable<z.ZodNumber>;
106
- width: z.ZodNullable<z.ZodNumber>;
107
- }, z.core.$strip>>;
108
- languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
109
- mediaType: z.ZodOptional<z.ZodString>;
110
- name: z.ZodString;
111
- narrators: z.ZodOptional<z.ZodArray<z.ZodObject<{
112
- name: z.ZodString;
113
- }, z.core.$strip>>>;
114
- publisher: z.ZodOptional<z.ZodString>;
115
- totalChapters: z.ZodOptional<z.ZodNumber>;
116
- type: z.ZodLiteral<"audiobook">;
117
- uri: z.ZodOptional<z.ZodString>;
118
- }, z.core.$strip>>;
119
- availableMarkets: z.ZodOptional<z.ZodArray<z.ZodString>>;
120
- chapterNumber: z.ZodOptional<z.ZodNumber>;
121
- description: z.ZodOptional<z.ZodString>;
122
- durationMs: z.ZodNumber;
123
- explicit: z.ZodBoolean;
124
- externalUrls: z.ZodOptional<z.ZodObject<{
125
- spotify: z.ZodOptional<z.ZodURL>;
126
- }, z.core.$strip>>;
127
- href: z.ZodOptional<z.ZodURL>;
128
- htmlDescription: z.ZodOptional<z.ZodString>;
129
- id: z.ZodString;
130
- images: z.ZodArray<z.ZodObject<{
131
- url: z.ZodURL;
132
- height: z.ZodNullable<z.ZodNumber>;
133
- width: z.ZodNullable<z.ZodNumber>;
134
- }, z.core.$strip>>;
135
- isPlayable: z.ZodOptional<z.ZodBoolean>;
136
- languages: z.ZodOptional<z.ZodArray<z.ZodString>>;
137
- name: z.ZodString;
138
- releaseDate: z.ZodOptional<z.ZodString>;
139
- releaseDatePrecision: z.ZodOptional<z.ZodEnum<{
140
- year: "year";
141
- month: "month";
142
- day: "day";
143
- }>>;
144
- resumePoint: z.ZodOptional<z.ZodObject<{
145
- fullyPlayed: z.ZodBoolean;
146
- resumePositionMs: z.ZodNumber;
147
- }, z.core.$strip>>;
148
- restrictions: z.ZodOptional<z.ZodObject<{
149
- reason: z.ZodString;
150
- }, z.core.$strip>>;
151
- type: z.ZodLiteral<"chapter">;
152
- uri: z.ZodOptional<z.ZodString>;
153
- }, z.core.$strip>>;
154
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:spotify", z.ZodObject<{
155
- SPOTIFY_ACCESS_TOKEN: z.ZodString;
156
- }, z.core.$strip>>], undefined>;
157
- //#endregion
158
- export { getChapter, getSeveralChapters };
package/dist/chapters.mjs DELETED
@@ -1,39 +0,0 @@
1
- import { spotifyChapterSchema, spotifyIdSchema, 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/chapters.ts
7
- const chapterIdsSchema = z.array(spotifyIdSchema).min(1).max(50);
8
- const chapterLookupInputSchema = z.object({
9
- id: spotifyIdSchema,
10
- market: spotifyMarketSchema.optional()
11
- });
12
- const severalChaptersInputSchema = z.object({
13
- ids: chapterIdsSchema,
14
- market: spotifyMarketSchema.optional()
15
- });
16
- const severalChaptersOutputSchema = z.object({ chapters: z.array(spotifyChapterSchema) });
17
- const getChapter = spotifyOperation({
18
- id: "spotify.get-spotify-chapter",
19
- name: "Get Spotify Chapter",
20
- description: "Fetch a single Spotify chapter by ID.",
21
- input: chapterLookupInputSchema,
22
- output: spotifyChapterSchema,
23
- run: async (input, credentials) => {
24
- return createSpotifyClient(credentials).chapters.getChapter(input.id, input.market);
25
- }
26
- });
27
- const getSeveralChapters = spotifyOperation({
28
- id: "spotify.get-spotify-several-chapters",
29
- name: "Get Several Spotify Chapters",
30
- description: "Fetch multiple Spotify chapters in a single request.",
31
- input: severalChaptersInputSchema,
32
- output: severalChaptersOutputSchema,
33
- run: async (input, credentials) => {
34
- return createSpotifyClient(credentials).chapters.getSeveralChapters(input.ids, input.market);
35
- }
36
- });
37
-
38
- //#endregion
39
- export { getChapter, getSeveralChapters };