spotted-ts 0.1.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/CHANGELOG.md +47 -0
- package/LICENSE +201 -0
- package/README.md +354 -0
- package/api-promise.d.mts +2 -0
- package/api-promise.d.mts.map +1 -0
- package/api-promise.d.ts +2 -0
- package/api-promise.d.ts.map +1 -0
- package/api-promise.js +6 -0
- package/api-promise.js.map +1 -0
- package/api-promise.mjs +2 -0
- package/api-promise.mjs.map +1 -0
- package/client.d.mts +261 -0
- package/client.d.mts.map +1 -0
- package/client.d.ts +261 -0
- package/client.d.ts.map +1 -0
- package/client.js +553 -0
- package/client.js.map +1 -0
- package/client.mjs +549 -0
- package/client.mjs.map +1 -0
- package/core/api-promise.d.mts +46 -0
- package/core/api-promise.d.mts.map +1 -0
- package/core/api-promise.d.ts +46 -0
- package/core/api-promise.d.ts.map +1 -0
- package/core/api-promise.js +74 -0
- package/core/api-promise.js.map +1 -0
- package/core/api-promise.mjs +70 -0
- package/core/api-promise.mjs.map +1 -0
- package/core/error.d.mts +46 -0
- package/core/error.d.mts.map +1 -0
- package/core/error.d.ts +46 -0
- package/core/error.d.ts.map +1 -0
- package/core/error.js +113 -0
- package/core/error.js.map +1 -0
- package/core/error.mjs +97 -0
- package/core/error.mjs.map +1 -0
- package/core/pagination.d.mts +50 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +50 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +104 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +98 -0
- package/core/pagination.mjs.map +1 -0
- package/core/resource.d.mts +6 -0
- package/core/resource.d.mts.map +1 -0
- package/core/resource.d.ts +6 -0
- package/core/resource.d.ts.map +1 -0
- package/core/resource.js +11 -0
- package/core/resource.js.map +1 -0
- package/core/resource.mjs +7 -0
- package/core/resource.mjs.map +1 -0
- package/core/uploads.d.mts +3 -0
- package/core/uploads.d.mts.map +1 -0
- package/core/uploads.d.ts +3 -0
- package/core/uploads.d.ts.map +1 -0
- package/core/uploads.js +6 -0
- package/core/uploads.js.map +1 -0
- package/core/uploads.mjs +2 -0
- package/core/uploads.mjs.map +1 -0
- package/error.d.mts +2 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +2 -0
- package/error.d.ts.map +1 -0
- package/error.js +6 -0
- package/error.js.map +1 -0
- package/error.mjs +2 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +7 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +7 -0
- package/index.d.ts.map +1 -0
- package/index.js +32 -0
- package/index.js.map +1 -0
- package/index.mjs +8 -0
- package/index.mjs.map +1 -0
- package/internal/builtin-types.d.mts +73 -0
- package/internal/builtin-types.d.mts.map +1 -0
- package/internal/builtin-types.d.ts +73 -0
- package/internal/builtin-types.d.ts.map +1 -0
- package/internal/builtin-types.js +4 -0
- package/internal/builtin-types.js.map +1 -0
- package/internal/builtin-types.mjs +3 -0
- package/internal/builtin-types.mjs.map +1 -0
- package/internal/detect-platform.d.mts +15 -0
- package/internal/detect-platform.d.mts.map +1 -0
- package/internal/detect-platform.d.ts +15 -0
- package/internal/detect-platform.d.ts.map +1 -0
- package/internal/detect-platform.js +162 -0
- package/internal/detect-platform.js.map +1 -0
- package/internal/detect-platform.mjs +157 -0
- package/internal/detect-platform.mjs.map +1 -0
- package/internal/errors.d.mts +3 -0
- package/internal/errors.d.mts.map +1 -0
- package/internal/errors.d.ts +3 -0
- package/internal/errors.d.ts.map +1 -0
- package/internal/errors.js +41 -0
- package/internal/errors.js.map +1 -0
- package/internal/errors.mjs +36 -0
- package/internal/errors.mjs.map +1 -0
- package/internal/headers.d.mts +20 -0
- package/internal/headers.d.mts.map +1 -0
- package/internal/headers.d.ts +20 -0
- package/internal/headers.d.ts.map +1 -0
- package/internal/headers.js +79 -0
- package/internal/headers.js.map +1 -0
- package/internal/headers.mjs +74 -0
- package/internal/headers.mjs.map +1 -0
- package/internal/parse.d.mts +12 -0
- package/internal/parse.d.mts.map +1 -0
- package/internal/parse.d.ts +12 -0
- package/internal/parse.d.ts.map +1 -0
- package/internal/parse.js +35 -0
- package/internal/parse.js.map +1 -0
- package/internal/parse.mjs +32 -0
- package/internal/parse.mjs.map +1 -0
- package/internal/qs/formats.d.mts +7 -0
- package/internal/qs/formats.d.mts.map +1 -0
- package/internal/qs/formats.d.ts +7 -0
- package/internal/qs/formats.d.ts.map +1 -0
- package/internal/qs/formats.js +13 -0
- package/internal/qs/formats.js.map +1 -0
- package/internal/qs/formats.mjs +9 -0
- package/internal/qs/formats.mjs.map +1 -0
- package/internal/qs/index.d.mts +10 -0
- package/internal/qs/index.d.mts.map +1 -0
- package/internal/qs/index.d.ts +10 -0
- package/internal/qs/index.d.ts.map +1 -0
- package/internal/qs/index.js +14 -0
- package/internal/qs/index.js.map +1 -0
- package/internal/qs/index.mjs +10 -0
- package/internal/qs/index.mjs.map +1 -0
- package/internal/qs/stringify.d.mts +3 -0
- package/internal/qs/stringify.d.mts.map +1 -0
- package/internal/qs/stringify.d.ts +3 -0
- package/internal/qs/stringify.d.ts.map +1 -0
- package/internal/qs/stringify.js +277 -0
- package/internal/qs/stringify.js.map +1 -0
- package/internal/qs/stringify.mjs +274 -0
- package/internal/qs/stringify.mjs.map +1 -0
- package/internal/qs/types.d.mts +57 -0
- package/internal/qs/types.d.mts.map +1 -0
- package/internal/qs/types.d.ts +57 -0
- package/internal/qs/types.d.ts.map +1 -0
- package/internal/qs/types.js +3 -0
- package/internal/qs/types.js.map +1 -0
- package/internal/qs/types.mjs +2 -0
- package/internal/qs/types.mjs.map +1 -0
- package/internal/qs/utils.d.mts +15 -0
- package/internal/qs/utils.d.mts.map +1 -0
- package/internal/qs/utils.d.ts +15 -0
- package/internal/qs/utils.d.ts.map +1 -0
- package/internal/qs/utils.js +230 -0
- package/internal/qs/utils.js.map +1 -0
- package/internal/qs/utils.mjs +217 -0
- package/internal/qs/utils.mjs.map +1 -0
- package/internal/request-options.d.mts +75 -0
- package/internal/request-options.d.mts.map +1 -0
- package/internal/request-options.d.ts +75 -0
- package/internal/request-options.d.ts.map +1 -0
- package/internal/request-options.js +14 -0
- package/internal/request-options.js.map +1 -0
- package/internal/request-options.mjs +10 -0
- package/internal/request-options.mjs.map +1 -0
- package/internal/shim-types.d.mts +17 -0
- package/internal/shim-types.d.mts.map +1 -0
- package/internal/shim-types.d.ts +17 -0
- package/internal/shim-types.d.ts.map +1 -0
- package/internal/shim-types.js +4 -0
- package/internal/shim-types.js.map +1 -0
- package/internal/shim-types.mjs +3 -0
- package/internal/shim-types.mjs.map +1 -0
- package/internal/shims.d.mts +20 -0
- package/internal/shims.d.mts.map +1 -0
- package/internal/shims.d.ts +20 -0
- package/internal/shims.d.ts.map +1 -0
- package/internal/shims.js +92 -0
- package/internal/shims.js.map +1 -0
- package/internal/shims.mjs +85 -0
- package/internal/shims.mjs.map +1 -0
- package/internal/to-file.d.mts +45 -0
- package/internal/to-file.d.mts.map +1 -0
- package/internal/to-file.d.ts +45 -0
- package/internal/to-file.d.ts.map +1 -0
- package/internal/to-file.js +91 -0
- package/internal/to-file.js.map +1 -0
- package/internal/to-file.mjs +88 -0
- package/internal/to-file.mjs.map +1 -0
- package/internal/tslib.js +81 -0
- package/internal/tslib.mjs +17 -0
- package/internal/types.d.mts +69 -0
- package/internal/types.d.mts.map +1 -0
- package/internal/types.d.ts +69 -0
- package/internal/types.d.ts.map +1 -0
- package/internal/types.js +4 -0
- package/internal/types.js.map +1 -0
- package/internal/types.mjs +3 -0
- package/internal/types.mjs.map +1 -0
- package/internal/uploads.d.mts +42 -0
- package/internal/uploads.d.mts.map +1 -0
- package/internal/uploads.d.ts +42 -0
- package/internal/uploads.d.ts.map +1 -0
- package/internal/uploads.js +141 -0
- package/internal/uploads.js.map +1 -0
- package/internal/uploads.mjs +131 -0
- package/internal/uploads.mjs.map +1 -0
- package/internal/utils/base64.d.mts +3 -0
- package/internal/utils/base64.d.mts.map +1 -0
- package/internal/utils/base64.d.ts +3 -0
- package/internal/utils/base64.d.ts.map +1 -0
- package/internal/utils/base64.js +38 -0
- package/internal/utils/base64.js.map +1 -0
- package/internal/utils/base64.mjs +33 -0
- package/internal/utils/base64.mjs.map +1 -0
- package/internal/utils/bytes.d.mts +4 -0
- package/internal/utils/bytes.d.mts.map +1 -0
- package/internal/utils/bytes.d.ts +4 -0
- package/internal/utils/bytes.d.ts.map +1 -0
- package/internal/utils/bytes.js +31 -0
- package/internal/utils/bytes.js.map +1 -0
- package/internal/utils/bytes.mjs +26 -0
- package/internal/utils/bytes.mjs.map +1 -0
- package/internal/utils/env.d.mts +9 -0
- package/internal/utils/env.d.mts.map +1 -0
- package/internal/utils/env.d.ts +9 -0
- package/internal/utils/env.d.ts.map +1 -0
- package/internal/utils/env.js +22 -0
- package/internal/utils/env.js.map +1 -0
- package/internal/utils/env.mjs +18 -0
- package/internal/utils/env.mjs.map +1 -0
- package/internal/utils/log.d.mts +37 -0
- package/internal/utils/log.d.mts.map +1 -0
- package/internal/utils/log.d.ts +37 -0
- package/internal/utils/log.d.ts.map +1 -0
- package/internal/utils/log.js +85 -0
- package/internal/utils/log.js.map +1 -0
- package/internal/utils/log.mjs +79 -0
- package/internal/utils/log.mjs.map +1 -0
- package/internal/utils/path.d.mts +15 -0
- package/internal/utils/path.d.mts.map +1 -0
- package/internal/utils/path.d.ts +15 -0
- package/internal/utils/path.d.ts.map +1 -0
- package/internal/utils/path.js +79 -0
- package/internal/utils/path.js.map +1 -0
- package/internal/utils/path.mjs +74 -0
- package/internal/utils/path.mjs.map +1 -0
- package/internal/utils/sleep.d.mts +2 -0
- package/internal/utils/sleep.d.mts.map +1 -0
- package/internal/utils/sleep.d.ts +2 -0
- package/internal/utils/sleep.d.ts.map +1 -0
- package/internal/utils/sleep.js +7 -0
- package/internal/utils/sleep.js.map +1 -0
- package/internal/utils/sleep.mjs +3 -0
- package/internal/utils/sleep.mjs.map +1 -0
- package/internal/utils/uuid.d.mts +5 -0
- package/internal/utils/uuid.d.mts.map +1 -0
- package/internal/utils/uuid.d.ts +5 -0
- package/internal/utils/uuid.d.ts.map +1 -0
- package/internal/utils/uuid.js +19 -0
- package/internal/utils/uuid.js.map +1 -0
- package/internal/utils/uuid.mjs +15 -0
- package/internal/utils/uuid.mjs.map +1 -0
- package/internal/utils/values.d.mts +18 -0
- package/internal/utils/values.d.mts.map +1 -0
- package/internal/utils/values.d.ts +18 -0
- package/internal/utils/values.d.ts.map +1 -0
- package/internal/utils/values.js +112 -0
- package/internal/utils/values.js.map +1 -0
- package/internal/utils/values.mjs +94 -0
- package/internal/utils/values.mjs.map +1 -0
- package/internal/utils.d.mts +7 -0
- package/internal/utils.d.mts.map +1 -0
- package/internal/utils.d.ts +7 -0
- package/internal/utils.d.ts.map +1 -0
- package/internal/utils.js +11 -0
- package/internal/utils.js.map +1 -0
- package/internal/utils.mjs +8 -0
- package/internal/utils.mjs.map +1 -0
- package/package.json +148 -0
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resource.d.mts +2 -0
- package/resource.d.mts.map +1 -0
- package/resource.d.ts +2 -0
- package/resource.d.ts.map +1 -0
- package/resource.js +6 -0
- package/resource.js.map +1 -0
- package/resource.mjs +2 -0
- package/resource.mjs.map +1 -0
- package/resources/albums.d.mts +333 -0
- package/resources/albums.d.mts.map +1 -0
- package/resources/albums.d.ts +333 -0
- package/resources/albums.d.ts.map +1 -0
- package/resources/albums.js +34 -0
- package/resources/albums.js.map +1 -0
- package/resources/albums.mjs +30 -0
- package/resources/albums.mjs.map +1 -0
- package/resources/artists.d.mts +166 -0
- package/resources/artists.d.mts.map +1 -0
- package/resources/artists.d.ts +166 -0
- package/resources/artists.d.ts.map +1 -0
- package/resources/artists.js +48 -0
- package/resources/artists.js.map +1 -0
- package/resources/artists.mjs +44 -0
- package/resources/artists.mjs.map +1 -0
- package/resources/audio-analysis.d.mts +365 -0
- package/resources/audio-analysis.d.mts.map +1 -0
- package/resources/audio-analysis.d.ts +365 -0
- package/resources/audio-analysis.d.ts.map +1 -0
- package/resources/audio-analysis.js +20 -0
- package/resources/audio-analysis.js.map +1 -0
- package/resources/audio-analysis.mjs +16 -0
- package/resources/audio-analysis.mjs.map +1 -0
- package/resources/audio-features.d.mts +253 -0
- package/resources/audio-features.d.mts.map +1 -0
- package/resources/audio-features.d.ts +253 -0
- package/resources/audio-features.d.ts.map +1 -0
- package/resources/audio-features.js +27 -0
- package/resources/audio-features.js.map +1 -0
- package/resources/audio-features.mjs +23 -0
- package/resources/audio-features.mjs.map +1 -0
- package/resources/audiobooks.d.mts +259 -0
- package/resources/audiobooks.d.mts.map +1 -0
- package/resources/audiobooks.d.ts +259 -0
- package/resources/audiobooks.d.ts.map +1 -0
- package/resources/audiobooks.js +37 -0
- package/resources/audiobooks.js.map +1 -0
- package/resources/audiobooks.mjs +33 -0
- package/resources/audiobooks.mjs.map +1 -0
- package/resources/browse/browse.d.mts +165 -0
- package/resources/browse/browse.d.mts.map +1 -0
- package/resources/browse/browse.d.ts +165 -0
- package/resources/browse/browse.d.ts.map +1 -0
- package/resources/browse/browse.js +33 -0
- package/resources/browse/browse.js.map +1 -0
- package/resources/browse/browse.mjs +28 -0
- package/resources/browse/browse.mjs.map +1 -0
- package/resources/browse/categories.d.mts +151 -0
- package/resources/browse/categories.d.mts.map +1 -0
- package/resources/browse/categories.d.ts +151 -0
- package/resources/browse/categories.d.ts.map +1 -0
- package/resources/browse/categories.js +32 -0
- package/resources/browse/categories.js.map +1 -0
- package/resources/browse/categories.mjs +28 -0
- package/resources/browse/categories.mjs.map +1 -0
- package/resources/browse/index.d.mts +3 -0
- package/resources/browse/index.d.mts.map +1 -0
- package/resources/browse/index.d.ts +3 -0
- package/resources/browse/index.d.ts.map +1 -0
- package/resources/browse/index.js +9 -0
- package/resources/browse/index.js.map +1 -0
- package/resources/browse/index.mjs +4 -0
- package/resources/browse/index.mjs.map +1 -0
- package/resources/browse.d.mts +2 -0
- package/resources/browse.d.mts.map +1 -0
- package/resources/browse.d.ts +2 -0
- package/resources/browse.d.ts.map +1 -0
- package/resources/browse.js +6 -0
- package/resources/browse.js.map +1 -0
- package/resources/browse.mjs +3 -0
- package/resources/browse.mjs.map +1 -0
- package/resources/chapters.d.mts +251 -0
- package/resources/chapters.d.mts.map +1 -0
- package/resources/chapters.d.ts +251 -0
- package/resources/chapters.d.ts.map +1 -0
- package/resources/chapters.js +26 -0
- package/resources/chapters.js.map +1 -0
- package/resources/chapters.mjs +22 -0
- package/resources/chapters.mjs.map +1 -0
- package/resources/episodes.d.mts +56 -0
- package/resources/episodes.d.mts.map +1 -0
- package/resources/episodes.d.ts +56 -0
- package/resources/episodes.d.ts.map +1 -0
- package/resources/episodes.js +23 -0
- package/resources/episodes.js.map +1 -0
- package/resources/episodes.mjs +19 -0
- package/resources/episodes.mjs.map +1 -0
- package/resources/index.d.mts +18 -0
- package/resources/index.d.mts.map +1 -0
- package/resources/index.d.ts +18 -0
- package/resources/index.d.ts.map +1 -0
- package/resources/index.js +39 -0
- package/resources/index.js.map +1 -0
- package/resources/index.mjs +19 -0
- package/resources/index.mjs.map +1 -0
- package/resources/markets.d.mts +16 -0
- package/resources/markets.d.mts.map +1 -0
- package/resources/markets.d.ts +16 -0
- package/resources/markets.d.ts.map +1 -0
- package/resources/markets.js +15 -0
- package/resources/markets.js.map +1 -0
- package/resources/markets.mjs +11 -0
- package/resources/markets.mjs.map +1 -0
- package/resources/me/albums.d.mts +250 -0
- package/resources/me/albums.d.mts.map +1 -0
- package/resources/me/albums.d.ts +250 -0
- package/resources/me/albums.d.ts.map +1 -0
- package/resources/me/albums.js +70 -0
- package/resources/me/albums.js.map +1 -0
- package/resources/me/albums.mjs +66 -0
- package/resources/me/albums.mjs.map +1 -0
- package/resources/me/audiobooks.d.mts +153 -0
- package/resources/me/audiobooks.d.mts.map +1 -0
- package/resources/me/audiobooks.d.ts +153 -0
- package/resources/me/audiobooks.d.ts.map +1 -0
- package/resources/me/audiobooks.js +79 -0
- package/resources/me/audiobooks.js.map +1 -0
- package/resources/me/audiobooks.mjs +75 -0
- package/resources/me/audiobooks.mjs.map +1 -0
- package/resources/me/episodes.d.mts +132 -0
- package/resources/me/episodes.d.mts.map +1 -0
- package/resources/me/episodes.d.ts +132 -0
- package/resources/me/episodes.d.ts.map +1 -0
- package/resources/me/episodes.js +81 -0
- package/resources/me/episodes.js.map +1 -0
- package/resources/me/episodes.mjs +77 -0
- package/resources/me/episodes.mjs.map +1 -0
- package/resources/me/following.d.mts +147 -0
- package/resources/me/following.d.mts.map +1 -0
- package/resources/me/following.d.ts +147 -0
- package/resources/me/following.d.ts.map +1 -0
- package/resources/me/following.js +70 -0
- package/resources/me/following.js.map +1 -0
- package/resources/me/following.mjs +66 -0
- package/resources/me/following.mjs.map +1 -0
- package/resources/me/index.d.mts +11 -0
- package/resources/me/index.d.mts.map +1 -0
- package/resources/me/index.d.ts +11 -0
- package/resources/me/index.d.ts.map +1 -0
- package/resources/me/index.js +25 -0
- package/resources/me/index.js.map +1 -0
- package/resources/me/index.mjs +12 -0
- package/resources/me/index.mjs.map +1 -0
- package/resources/me/me.d.mts +143 -0
- package/resources/me/me.d.mts.map +1 -0
- package/resources/me/me.d.ts +143 -0
- package/resources/me/me.d.ts.map +1 -0
- package/resources/me/me.js +61 -0
- package/resources/me/me.js.map +1 -0
- package/resources/me/me.mjs +56 -0
- package/resources/me/me.mjs.map +1 -0
- package/resources/me/player/index.d.mts +3 -0
- package/resources/me/player/index.d.mts.map +1 -0
- package/resources/me/player/index.d.ts +3 -0
- package/resources/me/player/index.d.ts.map +1 -0
- package/resources/me/player/index.js +9 -0
- package/resources/me/player/index.js.map +1 -0
- package/resources/me/player/index.mjs +4 -0
- package/resources/me/player/index.mjs.map +1 -0
- package/resources/me/player/player.d.mts +595 -0
- package/resources/me/player/player.d.mts.map +1 -0
- package/resources/me/player/player.d.ts +595 -0
- package/resources/me/player/player.d.ts.map +1 -0
- package/resources/me/player/player.js +236 -0
- package/resources/me/player/player.js.map +1 -0
- package/resources/me/player/player.mjs +231 -0
- package/resources/me/player/player.mjs.map +1 -0
- package/resources/me/player/queue.d.mts +53 -0
- package/resources/me/player/queue.d.mts.map +1 -0
- package/resources/me/player/queue.d.ts +53 -0
- package/resources/me/player/queue.d.ts.map +1 -0
- package/resources/me/player/queue.js +41 -0
- package/resources/me/player/queue.js.map +1 -0
- package/resources/me/player/queue.mjs +37 -0
- package/resources/me/player/queue.mjs.map +1 -0
- package/resources/me/player.d.mts +2 -0
- package/resources/me/player.d.mts.map +1 -0
- package/resources/me/player.d.ts +2 -0
- package/resources/me/player.d.ts.map +1 -0
- package/resources/me/player.js +6 -0
- package/resources/me/player.js.map +1 -0
- package/resources/me/player.mjs +3 -0
- package/resources/me/player.mjs.map +1 -0
- package/resources/me/playlists.d.mts +35 -0
- package/resources/me/playlists.d.mts.map +1 -0
- package/resources/me/playlists.d.ts +35 -0
- package/resources/me/playlists.d.ts.map +1 -0
- package/resources/me/playlists.js +27 -0
- package/resources/me/playlists.js.map +1 -0
- package/resources/me/playlists.mjs +23 -0
- package/resources/me/playlists.mjs.map +1 -0
- package/resources/me/shows.d.mts +109 -0
- package/resources/me/shows.d.mts.map +1 -0
- package/resources/me/shows.d.ts +109 -0
- package/resources/me/shows.d.ts.map +1 -0
- package/resources/me/shows.js +70 -0
- package/resources/me/shows.js.map +1 -0
- package/resources/me/shows.mjs +66 -0
- package/resources/me/shows.mjs.map +1 -0
- package/resources/me/top.d.mts +72 -0
- package/resources/me/top.d.mts.map +1 -0
- package/resources/me/top.d.ts +72 -0
- package/resources/me/top.d.ts.map +1 -0
- package/resources/me/top.js +44 -0
- package/resources/me/top.js.map +1 -0
- package/resources/me/top.mjs +40 -0
- package/resources/me/top.mjs.map +1 -0
- package/resources/me/tracks.d.mts +151 -0
- package/resources/me/tracks.d.mts.map +1 -0
- package/resources/me/tracks.d.ts +151 -0
- package/resources/me/tracks.d.ts.map +1 -0
- package/resources/me/tracks.js +70 -0
- package/resources/me/tracks.js.map +1 -0
- package/resources/me/tracks.mjs +66 -0
- package/resources/me/tracks.mjs.map +1 -0
- package/resources/me.d.mts +2 -0
- package/resources/me.d.mts.map +1 -0
- package/resources/me.d.ts +2 -0
- package/resources/me.d.ts.map +1 -0
- package/resources/me.js +6 -0
- package/resources/me.js.map +1 -0
- package/resources/me.mjs +3 -0
- package/resources/me.mjs.map +1 -0
- package/resources/playlists/followers.d.mts +61 -0
- package/resources/playlists/followers.d.mts.map +1 -0
- package/resources/playlists/followers.d.ts +61 -0
- package/resources/playlists/followers.d.ts.map +1 -0
- package/resources/playlists/followers.js +57 -0
- package/resources/playlists/followers.js.map +1 -0
- package/resources/playlists/followers.mjs +53 -0
- package/resources/playlists/followers.mjs.map +1 -0
- package/resources/playlists/images.d.mts +42 -0
- package/resources/playlists/images.d.mts.map +1 -0
- package/resources/playlists/images.d.ts +42 -0
- package/resources/playlists/images.d.ts.map +1 -0
- package/resources/playlists/images.js +45 -0
- package/resources/playlists/images.js.map +1 -0
- package/resources/playlists/images.mjs +41 -0
- package/resources/playlists/images.mjs.map +1 -0
- package/resources/playlists/index.d.mts +5 -0
- package/resources/playlists/index.d.mts.map +1 -0
- package/resources/playlists/index.d.ts +5 -0
- package/resources/playlists/index.d.ts.map +1 -0
- package/resources/playlists/index.js +13 -0
- package/resources/playlists/index.js.map +1 -0
- package/resources/playlists/index.mjs +6 -0
- package/resources/playlists/index.mjs.map +1 -0
- package/resources/playlists/playlists.d.mts +215 -0
- package/resources/playlists/playlists.d.mts.map +1 -0
- package/resources/playlists/playlists.d.ts +215 -0
- package/resources/playlists/playlists.d.ts.map +1 -0
- package/resources/playlists/playlists.js +56 -0
- package/resources/playlists/playlists.js.map +1 -0
- package/resources/playlists/playlists.mjs +51 -0
- package/resources/playlists/playlists.mjs.map +1 -0
- package/resources/playlists/tracks.d.mts +197 -0
- package/resources/playlists/tracks.d.mts.map +1 -0
- package/resources/playlists/tracks.d.ts +197 -0
- package/resources/playlists/tracks.d.ts.map +1 -0
- package/resources/playlists/tracks.js +75 -0
- package/resources/playlists/tracks.js.map +1 -0
- package/resources/playlists/tracks.mjs +71 -0
- package/resources/playlists/tracks.mjs.map +1 -0
- package/resources/playlists.d.mts +2 -0
- package/resources/playlists.d.mts.map +1 -0
- package/resources/playlists.d.ts +2 -0
- package/resources/playlists.d.ts.map +1 -0
- package/resources/playlists.js +6 -0
- package/resources/playlists.js.map +1 -0
- package/resources/playlists.mjs +3 -0
- package/resources/playlists.mjs.map +1 -0
- package/resources/recommendations.d.mts +420 -0
- package/resources/recommendations.d.mts.map +1 -0
- package/resources/recommendations.d.ts +420 -0
- package/resources/recommendations.d.ts.map +1 -0
- package/resources/recommendations.js +32 -0
- package/resources/recommendations.js.map +1 -0
- package/resources/recommendations.mjs +28 -0
- package/resources/recommendations.mjs.map +1 -0
- package/resources/search.d.mts +309 -0
- package/resources/search.d.mts.map +1 -0
- package/resources/search.d.ts +309 -0
- package/resources/search.d.ts.map +1 -0
- package/resources/search.js +17 -0
- package/resources/search.js.map +1 -0
- package/resources/search.mjs +13 -0
- package/resources/search.mjs.map +1 -0
- package/resources/shared.d.mts +1010 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +1010 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +4 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +3 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/shows.d.mts +125 -0
- package/resources/shows.d.mts.map +1 -0
- package/resources/shows.d.ts +125 -0
- package/resources/shows.d.ts.map +1 -0
- package/resources/shows.js +31 -0
- package/resources/shows.js.map +1 -0
- package/resources/shows.mjs +27 -0
- package/resources/shows.mjs.map +1 -0
- package/resources/tracks.d.mts +56 -0
- package/resources/tracks.d.mts.map +1 -0
- package/resources/tracks.d.ts +56 -0
- package/resources/tracks.d.ts.map +1 -0
- package/resources/tracks.js +23 -0
- package/resources/tracks.js.map +1 -0
- package/resources/tracks.mjs +19 -0
- package/resources/tracks.mjs.map +1 -0
- package/resources/users/index.d.mts +3 -0
- package/resources/users/index.d.mts.map +1 -0
- package/resources/users/index.d.ts +3 -0
- package/resources/users/index.d.ts.map +1 -0
- package/resources/users/index.js +9 -0
- package/resources/users/index.js.map +1 -0
- package/resources/users/index.mjs +4 -0
- package/resources/users/index.mjs.map +1 -0
- package/resources/users/playlists.d.mts +194 -0
- package/resources/users/playlists.d.mts.map +1 -0
- package/resources/users/playlists.d.ts +194 -0
- package/resources/users/playlists.d.ts.map +1 -0
- package/resources/users/playlists.js +43 -0
- package/resources/users/playlists.js.map +1 -0
- package/resources/users/playlists.mjs +39 -0
- package/resources/users/playlists.mjs.map +1 -0
- package/resources/users/users.d.mts +61 -0
- package/resources/users/users.d.mts.map +1 -0
- package/resources/users/users.d.ts +61 -0
- package/resources/users/users.d.ts.map +1 -0
- package/resources/users/users.js +31 -0
- package/resources/users/users.js.map +1 -0
- package/resources/users/users.mjs +26 -0
- package/resources/users/users.mjs.map +1 -0
- package/resources/users.d.mts +2 -0
- package/resources/users.d.mts.map +1 -0
- package/resources/users.d.ts +2 -0
- package/resources/users.d.ts.map +1 -0
- package/resources/users.js +6 -0
- package/resources/users.js.map +1 -0
- package/resources/users.mjs +3 -0
- package/resources/users.mjs.map +1 -0
- package/resources.d.mts +2 -0
- package/resources.d.mts.map +1 -0
- package/resources.d.ts +2 -0
- package/resources.d.ts.map +1 -0
- package/resources.js +5 -0
- package/resources.js.map +1 -0
- package/resources.mjs +2 -0
- package/resources.mjs.map +1 -0
- package/src/api-promise.ts +2 -0
- package/src/client.ts +1070 -0
- package/src/core/README.md +3 -0
- package/src/core/api-promise.ts +92 -0
- package/src/core/error.ts +130 -0
- package/src/core/pagination.ts +155 -0
- package/src/core/resource.ts +11 -0
- package/src/core/uploads.ts +2 -0
- package/src/error.ts +2 -0
- package/src/index.ts +23 -0
- package/src/internal/README.md +3 -0
- package/src/internal/builtin-types.ts +93 -0
- package/src/internal/detect-platform.ts +196 -0
- package/src/internal/errors.ts +33 -0
- package/src/internal/headers.ts +97 -0
- package/src/internal/parse.ts +50 -0
- package/src/internal/qs/LICENSE.md +13 -0
- package/src/internal/qs/README.md +3 -0
- package/src/internal/qs/formats.ts +10 -0
- package/src/internal/qs/index.ts +13 -0
- package/src/internal/qs/stringify.ts +385 -0
- package/src/internal/qs/types.ts +71 -0
- package/src/internal/qs/utils.ts +265 -0
- package/src/internal/request-options.ts +91 -0
- package/src/internal/shim-types.ts +26 -0
- package/src/internal/shims.ts +107 -0
- package/src/internal/to-file.ts +154 -0
- package/src/internal/types.ts +95 -0
- package/src/internal/uploads.ts +187 -0
- package/src/internal/utils/base64.ts +40 -0
- package/src/internal/utils/bytes.ts +32 -0
- package/src/internal/utils/env.ts +18 -0
- package/src/internal/utils/log.ts +126 -0
- package/src/internal/utils/path.ts +88 -0
- package/src/internal/utils/sleep.ts +3 -0
- package/src/internal/utils/uuid.ts +17 -0
- package/src/internal/utils/values.ts +105 -0
- package/src/internal/utils.ts +8 -0
- package/src/lib/.keep +4 -0
- package/src/pagination.ts +2 -0
- package/src/resource.ts +2 -0
- package/src/resources/albums.ts +427 -0
- package/src/resources/artists.ts +229 -0
- package/src/resources/audio-analysis.ts +438 -0
- package/src/resources/audio-features.ts +304 -0
- package/src/resources/audiobooks.ts +334 -0
- package/src/resources/browse/browse.ts +233 -0
- package/src/resources/browse/categories.ts +205 -0
- package/src/resources/browse/index.ts +18 -0
- package/src/resources/browse.ts +3 -0
- package/src/resources/chapters.ts +315 -0
- package/src/resources/episodes.ts +77 -0
- package/src/resources/index.ts +84 -0
- package/src/resources/markets.ts +22 -0
- package/src/resources/me/albums.ts +323 -0
- package/src/resources/me/audiobooks.ts +209 -0
- package/src/resources/me/episodes.ts +178 -0
- package/src/resources/me/following.ts +199 -0
- package/src/resources/me/index.ts +86 -0
- package/src/resources/me/me.ts +334 -0
- package/src/resources/me/player/index.ts +25 -0
- package/src/resources/me/player/player.ts +807 -0
- package/src/resources/me/player/queue.ts +71 -0
- package/src/resources/me/player.ts +3 -0
- package/src/resources/me/playlists.ts +49 -0
- package/src/resources/me/shows.ts +152 -0
- package/src/resources/me/top.ts +102 -0
- package/src/resources/me/tracks.ts +200 -0
- package/src/resources/me.ts +3 -0
- package/src/resources/playlists/followers.ts +97 -0
- package/src/resources/playlists/images.ts +59 -0
- package/src/resources/playlists/index.ts +25 -0
- package/src/resources/playlists/playlists.ts +306 -0
- package/src/resources/playlists/tracks.ts +261 -0
- package/src/resources/playlists.ts +3 -0
- package/src/resources/recommendations.ts +493 -0
- package/src/resources/search.ts +386 -0
- package/src/resources/shared.ts +1217 -0
- package/src/resources/shows.ts +171 -0
- package/src/resources/tracks.ts +77 -0
- package/src/resources/users/index.ts +9 -0
- package/src/resources/users/playlists.ts +249 -0
- package/src/resources/users/users.ts +84 -0
- package/src/resources/users.ts +3 -0
- package/src/resources.ts +1 -0
- package/src/tsconfig.json +11 -0
- package/src/uploads.ts +2 -0
- package/src/version.ts +1 -0
- package/uploads.d.mts +2 -0
- package/uploads.d.mts.map +1 -0
- package/uploads.d.ts +2 -0
- package/uploads.d.ts.map +1 -0
- package/uploads.js +6 -0
- package/uploads.js.map +1 -0
- package/uploads.mjs +2 -0
- package/uploads.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
package/src/client.ts
ADDED
|
@@ -0,0 +1,1070 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import type { RequestInit, RequestInfo, BodyInit } from './internal/builtin-types';
|
|
4
|
+
import type { HTTPMethod, PromiseOrValue, MergedRequestInit, FinalizedRequestInit } from './internal/types';
|
|
5
|
+
import { uuid4 } from './internal/utils/uuid';
|
|
6
|
+
import { validatePositiveInteger, isAbsoluteURL, safeJSON } from './internal/utils/values';
|
|
7
|
+
import { sleep } from './internal/utils/sleep';
|
|
8
|
+
export type { Logger, LogLevel } from './internal/utils/log';
|
|
9
|
+
import { castToError, isAbortError } from './internal/errors';
|
|
10
|
+
import type { APIResponseProps } from './internal/parse';
|
|
11
|
+
import { getPlatformHeaders } from './internal/detect-platform';
|
|
12
|
+
import * as Shims from './internal/shims';
|
|
13
|
+
import * as Opts from './internal/request-options';
|
|
14
|
+
import * as qs from './internal/qs';
|
|
15
|
+
import { VERSION } from './version';
|
|
16
|
+
import * as Errors from './core/error';
|
|
17
|
+
import * as Pagination from './core/pagination';
|
|
18
|
+
import { AbstractPage, CursorURLPageResponse } from './core/pagination';
|
|
19
|
+
import * as Uploads from './core/uploads';
|
|
20
|
+
import * as API from './resources/index';
|
|
21
|
+
import { APIPromise } from './core/api-promise';
|
|
22
|
+
import {
|
|
23
|
+
AlbumBulkRetrieveParams,
|
|
24
|
+
AlbumBulkRetrieveResponse,
|
|
25
|
+
AlbumListTracksParams,
|
|
26
|
+
AlbumRetrieveParams,
|
|
27
|
+
AlbumRetrieveResponse,
|
|
28
|
+
Albums,
|
|
29
|
+
} from './resources/albums';
|
|
30
|
+
import {
|
|
31
|
+
ArtistListAlbumsParams,
|
|
32
|
+
ArtistListAlbumsResponse,
|
|
33
|
+
ArtistListAlbumsResponsesCursorURLPage,
|
|
34
|
+
ArtistListParams,
|
|
35
|
+
ArtistListRelatedArtistsResponse,
|
|
36
|
+
ArtistListResponse,
|
|
37
|
+
ArtistListTopTracksParams,
|
|
38
|
+
ArtistListTopTracksResponse,
|
|
39
|
+
Artists,
|
|
40
|
+
} from './resources/artists';
|
|
41
|
+
import { AudioAnalysis, AudioAnalysisRetrieveResponse, TimeIntervalObject } from './resources/audio-analysis';
|
|
42
|
+
import {
|
|
43
|
+
AudioFeatureListParams,
|
|
44
|
+
AudioFeatureListResponse,
|
|
45
|
+
AudioFeatureRetrieveResponse,
|
|
46
|
+
AudioFeatures,
|
|
47
|
+
} from './resources/audio-features';
|
|
48
|
+
import {
|
|
49
|
+
AudiobookListChaptersParams,
|
|
50
|
+
AudiobookListParams,
|
|
51
|
+
AudiobookListResponse,
|
|
52
|
+
AudiobookRetrieveParams,
|
|
53
|
+
AudiobookRetrieveResponse,
|
|
54
|
+
Audiobooks,
|
|
55
|
+
SimplifiedChapterObject,
|
|
56
|
+
SimplifiedChapterObjectsCursorURLPage,
|
|
57
|
+
} from './resources/audiobooks';
|
|
58
|
+
import {
|
|
59
|
+
ChapterListParams,
|
|
60
|
+
ChapterListResponse,
|
|
61
|
+
ChapterRetrieveParams,
|
|
62
|
+
ChapterRetrieveResponse,
|
|
63
|
+
Chapters,
|
|
64
|
+
} from './resources/chapters';
|
|
65
|
+
import {
|
|
66
|
+
EpisodeListParams,
|
|
67
|
+
EpisodeListResponse,
|
|
68
|
+
EpisodeRetrieveParams,
|
|
69
|
+
Episodes,
|
|
70
|
+
} from './resources/episodes';
|
|
71
|
+
import { MarketListResponse, Markets } from './resources/markets';
|
|
72
|
+
import {
|
|
73
|
+
RecommendationGetParams,
|
|
74
|
+
RecommendationGetResponse,
|
|
75
|
+
RecommendationListAvailableGenreSeedsResponse,
|
|
76
|
+
Recommendations,
|
|
77
|
+
} from './resources/recommendations';
|
|
78
|
+
import { Search, SearchRetrieveParams, SearchRetrieveResponse } from './resources/search';
|
|
79
|
+
import {
|
|
80
|
+
ShowListEpisodesParams,
|
|
81
|
+
ShowListParams,
|
|
82
|
+
ShowListResponse,
|
|
83
|
+
ShowRetrieveParams,
|
|
84
|
+
ShowRetrieveResponse,
|
|
85
|
+
Shows,
|
|
86
|
+
} from './resources/shows';
|
|
87
|
+
import { TrackListParams, TrackListResponse, TrackRetrieveParams, Tracks } from './resources/tracks';
|
|
88
|
+
import {
|
|
89
|
+
Browse,
|
|
90
|
+
BrowseGetFeaturedPlaylistsParams,
|
|
91
|
+
BrowseGetFeaturedPlaylistsResponse,
|
|
92
|
+
BrowseGetNewReleasesParams,
|
|
93
|
+
BrowseGetNewReleasesResponse,
|
|
94
|
+
} from './resources/browse/browse';
|
|
95
|
+
import { Me, MeRetrieveResponse } from './resources/me/me';
|
|
96
|
+
import {
|
|
97
|
+
PlaylistRetrieveParams,
|
|
98
|
+
PlaylistRetrieveResponse,
|
|
99
|
+
PlaylistUpdateParams,
|
|
100
|
+
Playlists,
|
|
101
|
+
} from './resources/playlists/playlists';
|
|
102
|
+
import { UserRetrieveProfileResponse, Users } from './resources/users/users';
|
|
103
|
+
import { type Fetch } from './internal/builtin-types';
|
|
104
|
+
import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
|
|
105
|
+
import { FinalRequestOptions, RequestOptions } from './internal/request-options';
|
|
106
|
+
import { toBase64 } from './internal/utils/base64';
|
|
107
|
+
import { readEnv } from './internal/utils/env';
|
|
108
|
+
import {
|
|
109
|
+
type LogLevel,
|
|
110
|
+
type Logger,
|
|
111
|
+
formatRequestDetails,
|
|
112
|
+
loggerFor,
|
|
113
|
+
parseLogLevel,
|
|
114
|
+
} from './internal/utils/log';
|
|
115
|
+
import { isEmptyObj } from './internal/utils/values';
|
|
116
|
+
|
|
117
|
+
export interface ClientOptions {
|
|
118
|
+
/**
|
|
119
|
+
* Defaults to process.env['SPOTIFY_CLIENT_ID'].
|
|
120
|
+
*/
|
|
121
|
+
clientID?: string | undefined;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Defaults to process.env['SPOTIFY_CLIENT_SECRET'].
|
|
125
|
+
*/
|
|
126
|
+
clientSecret?: string | undefined;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Override the default base URL for the API, e.g., "https://api.example.com/v2/"
|
|
130
|
+
*
|
|
131
|
+
* Defaults to process.env['SPOTTED_BASE_URL'].
|
|
132
|
+
*/
|
|
133
|
+
baseURL?: string | null | undefined;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* The maximum amount of time (in milliseconds) that the client should wait for a response
|
|
137
|
+
* from the server before timing out a single request.
|
|
138
|
+
*
|
|
139
|
+
* Note that request timeouts are retried by default, so in a worst-case scenario you may wait
|
|
140
|
+
* much longer than this timeout before the promise succeeds or fails.
|
|
141
|
+
*
|
|
142
|
+
* @unit milliseconds
|
|
143
|
+
*/
|
|
144
|
+
timeout?: number | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* Additional `RequestInit` options to be passed to `fetch` calls.
|
|
147
|
+
* Properties will be overridden by per-request `fetchOptions`.
|
|
148
|
+
*/
|
|
149
|
+
fetchOptions?: MergedRequestInit | undefined;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Specify a custom `fetch` function implementation.
|
|
153
|
+
*
|
|
154
|
+
* If not provided, we expect that `fetch` is defined globally.
|
|
155
|
+
*/
|
|
156
|
+
fetch?: Fetch | undefined;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* The maximum number of times that the client will retry a request in case of a
|
|
160
|
+
* temporary failure, like a network error or a 5XX error from the server.
|
|
161
|
+
*
|
|
162
|
+
* @default 2
|
|
163
|
+
*/
|
|
164
|
+
maxRetries?: number | undefined;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Default headers to include with every request to the API.
|
|
168
|
+
*
|
|
169
|
+
* These can be removed in individual requests by explicitly setting the
|
|
170
|
+
* header to `null` in request options.
|
|
171
|
+
*/
|
|
172
|
+
defaultHeaders?: HeadersLike | undefined;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Default query parameters to include with every request to the API.
|
|
176
|
+
*
|
|
177
|
+
* These can be removed in individual requests by explicitly setting the
|
|
178
|
+
* param to `undefined` in request options.
|
|
179
|
+
*/
|
|
180
|
+
defaultQuery?: Record<string, string | undefined> | undefined;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Set the log level.
|
|
184
|
+
*
|
|
185
|
+
* Defaults to process.env['SPOTTED_LOG'] or 'warn' if it isn't set.
|
|
186
|
+
*/
|
|
187
|
+
logLevel?: LogLevel | undefined;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Set the logger.
|
|
191
|
+
*
|
|
192
|
+
* Defaults to globalThis.console.
|
|
193
|
+
*/
|
|
194
|
+
logger?: Logger | undefined;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* API Client for interfacing with the Spotted API.
|
|
199
|
+
*/
|
|
200
|
+
export class Spotted {
|
|
201
|
+
clientID: string;
|
|
202
|
+
clientSecret: string;
|
|
203
|
+
|
|
204
|
+
baseURL: string;
|
|
205
|
+
maxRetries: number;
|
|
206
|
+
timeout: number;
|
|
207
|
+
logger: Logger | undefined;
|
|
208
|
+
logLevel: LogLevel | undefined;
|
|
209
|
+
fetchOptions: MergedRequestInit | undefined;
|
|
210
|
+
|
|
211
|
+
private fetch: Fetch;
|
|
212
|
+
#encoder: Opts.RequestEncoder;
|
|
213
|
+
protected idempotencyHeader?: string;
|
|
214
|
+
private _options: ClientOptions;
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* API Client for interfacing with the Spotted API.
|
|
218
|
+
*
|
|
219
|
+
* @param {string | undefined} [opts.clientID=process.env['SPOTIFY_CLIENT_ID'] ?? undefined]
|
|
220
|
+
* @param {string | undefined} [opts.clientSecret=process.env['SPOTIFY_CLIENT_SECRET'] ?? undefined]
|
|
221
|
+
* @param {string} [opts.baseURL=process.env['SPOTTED_BASE_URL'] ?? https://api.spotify.com/v1] - Override the default base URL for the API.
|
|
222
|
+
* @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out.
|
|
223
|
+
* @param {MergedRequestInit} [opts.fetchOptions] - Additional `RequestInit` options to be passed to `fetch` calls.
|
|
224
|
+
* @param {Fetch} [opts.fetch] - Specify a custom `fetch` function implementation.
|
|
225
|
+
* @param {number} [opts.maxRetries=2] - The maximum number of times the client will retry a request.
|
|
226
|
+
* @param {HeadersLike} opts.defaultHeaders - Default headers to include with every request to the API.
|
|
227
|
+
* @param {Record<string, string | undefined>} opts.defaultQuery - Default query parameters to include with every request to the API.
|
|
228
|
+
*/
|
|
229
|
+
constructor({
|
|
230
|
+
baseURL = readEnv('SPOTTED_BASE_URL'),
|
|
231
|
+
clientID = readEnv('SPOTIFY_CLIENT_ID'),
|
|
232
|
+
clientSecret = readEnv('SPOTIFY_CLIENT_SECRET'),
|
|
233
|
+
...opts
|
|
234
|
+
}: ClientOptions = {}) {
|
|
235
|
+
if (clientID === undefined) {
|
|
236
|
+
throw new Errors.SpottedError(
|
|
237
|
+
"The SPOTIFY_CLIENT_ID environment variable is missing or empty; either provide it, or instantiate the Spotted client with an clientID option, like new Spotted({ clientID: 'My Client ID' }).",
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
if (clientSecret === undefined) {
|
|
241
|
+
throw new Errors.SpottedError(
|
|
242
|
+
"The SPOTIFY_CLIENT_SECRET environment variable is missing or empty; either provide it, or instantiate the Spotted client with an clientSecret option, like new Spotted({ clientSecret: 'My Client Secret' }).",
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
const options: ClientOptions = {
|
|
247
|
+
clientID,
|
|
248
|
+
clientSecret,
|
|
249
|
+
...opts,
|
|
250
|
+
baseURL: baseURL || `https://api.spotify.com/v1`,
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
this.baseURL = options.baseURL!;
|
|
254
|
+
this.timeout = options.timeout ?? Spotted.DEFAULT_TIMEOUT /* 1 minute */;
|
|
255
|
+
this.logger = options.logger ?? console;
|
|
256
|
+
const defaultLogLevel = 'warn';
|
|
257
|
+
// Set default logLevel early so that we can log a warning in parseLogLevel.
|
|
258
|
+
this.logLevel = defaultLogLevel;
|
|
259
|
+
this.logLevel =
|
|
260
|
+
parseLogLevel(options.logLevel, 'ClientOptions.logLevel', this) ??
|
|
261
|
+
parseLogLevel(readEnv('SPOTTED_LOG'), "process.env['SPOTTED_LOG']", this) ??
|
|
262
|
+
defaultLogLevel;
|
|
263
|
+
this.fetchOptions = options.fetchOptions;
|
|
264
|
+
this.maxRetries = options.maxRetries ?? 2;
|
|
265
|
+
this.fetch = options.fetch ?? Shims.getDefaultFetch();
|
|
266
|
+
this.#encoder = Opts.FallbackEncoder;
|
|
267
|
+
|
|
268
|
+
this._options = options;
|
|
269
|
+
|
|
270
|
+
this.clientID = clientID;
|
|
271
|
+
this.clientSecret = clientSecret;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Create a new client instance re-using the same options given to the current client with optional overriding.
|
|
276
|
+
*/
|
|
277
|
+
withOptions(options: Partial<ClientOptions>): this {
|
|
278
|
+
const client = new (this.constructor as any as new (props: ClientOptions) => typeof this)({
|
|
279
|
+
...this._options,
|
|
280
|
+
baseURL: this.baseURL,
|
|
281
|
+
maxRetries: this.maxRetries,
|
|
282
|
+
timeout: this.timeout,
|
|
283
|
+
logger: this.logger,
|
|
284
|
+
logLevel: this.logLevel,
|
|
285
|
+
fetch: this.fetch,
|
|
286
|
+
fetchOptions: this.fetchOptions,
|
|
287
|
+
clientID: this.clientID,
|
|
288
|
+
clientSecret: this.clientSecret,
|
|
289
|
+
...options,
|
|
290
|
+
});
|
|
291
|
+
client.oauth2_0AuthState = this.oauth2_0AuthState;
|
|
292
|
+
return client;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Check whether the base URL is set to its default.
|
|
297
|
+
*/
|
|
298
|
+
#baseURLOverridden(): boolean {
|
|
299
|
+
return this.baseURL !== 'https://api.spotify.com/v1';
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
protected defaultQuery(): Record<string, string | undefined> | undefined {
|
|
303
|
+
return this._options.defaultQuery;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
protected validateHeaders({ values, nulls }: NullableHeaders) {
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
private oauth2_0AuthState:
|
|
311
|
+
| {
|
|
312
|
+
promise: Promise<{
|
|
313
|
+
access_token: string;
|
|
314
|
+
token_type: string;
|
|
315
|
+
expires_in: number;
|
|
316
|
+
expires_at: Date;
|
|
317
|
+
refresh_token?: string;
|
|
318
|
+
}>;
|
|
319
|
+
clientID: string;
|
|
320
|
+
clientSecret: string;
|
|
321
|
+
}
|
|
322
|
+
| undefined;
|
|
323
|
+
protected async authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined> {
|
|
324
|
+
if (!this.clientID || !this.clientSecret) {
|
|
325
|
+
return undefined;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
// Invalidate the cache if the token is expired
|
|
329
|
+
if (this.oauth2_0AuthState && +(await this.oauth2_0AuthState.promise).expires_at < Date.now()) {
|
|
330
|
+
this.oauth2_0AuthState = undefined;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
// Invalidate the cache if the relevant state has been changed
|
|
334
|
+
if (
|
|
335
|
+
this.oauth2_0AuthState &&
|
|
336
|
+
this.oauth2_0AuthState.clientID !== this.clientID &&
|
|
337
|
+
this.oauth2_0AuthState.clientSecret !== this.clientSecret
|
|
338
|
+
) {
|
|
339
|
+
this.oauth2_0AuthState = undefined;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (!this.oauth2_0AuthState) {
|
|
343
|
+
this.oauth2_0AuthState = {
|
|
344
|
+
promise: this.fetch(
|
|
345
|
+
this.buildURL('https://accounts.spotify.com/api/token', { grant_type: 'client_credentials' }),
|
|
346
|
+
{
|
|
347
|
+
method: 'POST',
|
|
348
|
+
headers: {
|
|
349
|
+
Authorization: `Basic ${toBase64(`${this.clientID}:${this.clientSecret}`)}`,
|
|
350
|
+
},
|
|
351
|
+
},
|
|
352
|
+
).then(async (res) => {
|
|
353
|
+
if (!res.ok) {
|
|
354
|
+
const errText = await res.text().catch(() => '');
|
|
355
|
+
const errJSON = errText ? safeJSON(errText) : undefined;
|
|
356
|
+
const errMessage = errJSON ? undefined : errText;
|
|
357
|
+
throw this.makeStatusError(res.status, errJSON, errMessage, res.headers);
|
|
358
|
+
}
|
|
359
|
+
const json = (await res.json()) as {
|
|
360
|
+
access_token: string;
|
|
361
|
+
token_type: string;
|
|
362
|
+
expires_in: number;
|
|
363
|
+
refresh_token?: string;
|
|
364
|
+
};
|
|
365
|
+
const now = new Date();
|
|
366
|
+
now.setSeconds(now.getSeconds() + json.expires_in);
|
|
367
|
+
return { ...json, expires_at: now };
|
|
368
|
+
}),
|
|
369
|
+
clientID: this.clientID,
|
|
370
|
+
clientSecret: this.clientSecret,
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
const token = await this.oauth2_0AuthState.promise;
|
|
375
|
+
|
|
376
|
+
return buildHeaders([{ Authorization: `Bearer ${token.access_token}` }]);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
protected stringifyQuery(query: Record<string, unknown>): string {
|
|
380
|
+
return qs.stringify(query, { arrayFormat: 'comma' });
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
private getUserAgent(): string {
|
|
384
|
+
return `${this.constructor.name}/JS ${VERSION}`;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
protected defaultIdempotencyKey(): string {
|
|
388
|
+
return `stainless-node-retry-${uuid4()}`;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
protected makeStatusError(
|
|
392
|
+
status: number,
|
|
393
|
+
error: Object,
|
|
394
|
+
message: string | undefined,
|
|
395
|
+
headers: Headers,
|
|
396
|
+
): Errors.APIError {
|
|
397
|
+
return Errors.APIError.generate(status, error, message, headers);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
buildURL(
|
|
401
|
+
path: string,
|
|
402
|
+
query: Record<string, unknown> | null | undefined,
|
|
403
|
+
defaultBaseURL?: string | undefined,
|
|
404
|
+
): string {
|
|
405
|
+
const baseURL = (!this.#baseURLOverridden() && defaultBaseURL) || this.baseURL;
|
|
406
|
+
const url =
|
|
407
|
+
isAbsoluteURL(path) ?
|
|
408
|
+
new URL(path)
|
|
409
|
+
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
410
|
+
|
|
411
|
+
const defaultQuery = this.defaultQuery();
|
|
412
|
+
if (!isEmptyObj(defaultQuery)) {
|
|
413
|
+
query = { ...defaultQuery, ...query };
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
417
|
+
url.search = this.stringifyQuery(query as Record<string, unknown>);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
return url.toString();
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Used as a callback for mutating the given `FinalRequestOptions` object.
|
|
425
|
+
*/
|
|
426
|
+
protected async prepareOptions(options: FinalRequestOptions): Promise<void> {}
|
|
427
|
+
|
|
428
|
+
/**
|
|
429
|
+
* Used as a callback for mutating the given `RequestInit` object.
|
|
430
|
+
*
|
|
431
|
+
* This is useful for cases where you want to add certain headers based off of
|
|
432
|
+
* the request properties, e.g. `method` or `url`.
|
|
433
|
+
*/
|
|
434
|
+
protected async prepareRequest(
|
|
435
|
+
request: RequestInit,
|
|
436
|
+
{ url, options }: { url: string; options: FinalRequestOptions },
|
|
437
|
+
): Promise<void> {}
|
|
438
|
+
|
|
439
|
+
get<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
|
|
440
|
+
return this.methodRequest('get', path, opts);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
post<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
|
|
444
|
+
return this.methodRequest('post', path, opts);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
patch<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
|
|
448
|
+
return this.methodRequest('patch', path, opts);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
put<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
|
|
452
|
+
return this.methodRequest('put', path, opts);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
delete<Rsp>(path: string, opts?: PromiseOrValue<RequestOptions>): APIPromise<Rsp> {
|
|
456
|
+
return this.methodRequest('delete', path, opts);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
private methodRequest<Rsp>(
|
|
460
|
+
method: HTTPMethod,
|
|
461
|
+
path: string,
|
|
462
|
+
opts?: PromiseOrValue<RequestOptions>,
|
|
463
|
+
): APIPromise<Rsp> {
|
|
464
|
+
return this.request(
|
|
465
|
+
Promise.resolve(opts).then((opts) => {
|
|
466
|
+
return { method, path, ...opts };
|
|
467
|
+
}),
|
|
468
|
+
);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
request<Rsp>(
|
|
472
|
+
options: PromiseOrValue<FinalRequestOptions>,
|
|
473
|
+
remainingRetries: number | null = null,
|
|
474
|
+
): APIPromise<Rsp> {
|
|
475
|
+
return new APIPromise(this, this.makeRequest(options, remainingRetries, undefined));
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
private async makeRequest(
|
|
479
|
+
optionsInput: PromiseOrValue<FinalRequestOptions>,
|
|
480
|
+
retriesRemaining: number | null,
|
|
481
|
+
retryOfRequestLogID: string | undefined,
|
|
482
|
+
): Promise<APIResponseProps> {
|
|
483
|
+
const options = await optionsInput;
|
|
484
|
+
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
485
|
+
if (retriesRemaining == null) {
|
|
486
|
+
retriesRemaining = maxRetries;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
await this.prepareOptions(options);
|
|
490
|
+
|
|
491
|
+
const { req, url, timeout } = await this.buildRequest(options, {
|
|
492
|
+
retryCount: maxRetries - retriesRemaining,
|
|
493
|
+
});
|
|
494
|
+
|
|
495
|
+
await this.prepareRequest(req, { url, options });
|
|
496
|
+
|
|
497
|
+
/** Not an API request ID, just for correlating local log entries. */
|
|
498
|
+
const requestLogID = 'log_' + ((Math.random() * (1 << 24)) | 0).toString(16).padStart(6, '0');
|
|
499
|
+
const retryLogStr = retryOfRequestLogID === undefined ? '' : `, retryOf: ${retryOfRequestLogID}`;
|
|
500
|
+
const startTime = Date.now();
|
|
501
|
+
|
|
502
|
+
loggerFor(this).debug(
|
|
503
|
+
`[${requestLogID}] sending request`,
|
|
504
|
+
formatRequestDetails({
|
|
505
|
+
retryOfRequestLogID,
|
|
506
|
+
method: options.method,
|
|
507
|
+
url,
|
|
508
|
+
options,
|
|
509
|
+
headers: req.headers,
|
|
510
|
+
}),
|
|
511
|
+
);
|
|
512
|
+
|
|
513
|
+
if (options.signal?.aborted) {
|
|
514
|
+
throw new Errors.APIUserAbortError();
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
const controller = new AbortController();
|
|
518
|
+
const response = await this.fetchWithTimeout(url, req, timeout, controller).catch(castToError);
|
|
519
|
+
const headersTime = Date.now();
|
|
520
|
+
|
|
521
|
+
if (response instanceof globalThis.Error) {
|
|
522
|
+
const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;
|
|
523
|
+
if (options.signal?.aborted) {
|
|
524
|
+
throw new Errors.APIUserAbortError();
|
|
525
|
+
}
|
|
526
|
+
// detect native connection timeout errors
|
|
527
|
+
// deno throws "TypeError: error sending request for url (https://example/): client error (Connect): tcp connect error: Operation timed out (os error 60): Operation timed out (os error 60)"
|
|
528
|
+
// undici throws "TypeError: fetch failed" with cause "ConnectTimeoutError: Connect Timeout Error (attempted address: example:443, timeout: 1ms)"
|
|
529
|
+
// others do not provide enough information to distinguish timeouts from other connection errors
|
|
530
|
+
const isTimeout =
|
|
531
|
+
isAbortError(response) ||
|
|
532
|
+
/timed? ?out/i.test(String(response) + ('cause' in response ? String(response.cause) : ''));
|
|
533
|
+
if (retriesRemaining) {
|
|
534
|
+
loggerFor(this).info(
|
|
535
|
+
`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - ${retryMessage}`,
|
|
536
|
+
);
|
|
537
|
+
loggerFor(this).debug(
|
|
538
|
+
`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} (${retryMessage})`,
|
|
539
|
+
formatRequestDetails({
|
|
540
|
+
retryOfRequestLogID,
|
|
541
|
+
url,
|
|
542
|
+
durationMs: headersTime - startTime,
|
|
543
|
+
message: response.message,
|
|
544
|
+
}),
|
|
545
|
+
);
|
|
546
|
+
return this.retryRequest(options, retriesRemaining, retryOfRequestLogID ?? requestLogID);
|
|
547
|
+
}
|
|
548
|
+
loggerFor(this).info(
|
|
549
|
+
`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} - error; no more retries left`,
|
|
550
|
+
);
|
|
551
|
+
loggerFor(this).debug(
|
|
552
|
+
`[${requestLogID}] connection ${isTimeout ? 'timed out' : 'failed'} (error; no more retries left)`,
|
|
553
|
+
formatRequestDetails({
|
|
554
|
+
retryOfRequestLogID,
|
|
555
|
+
url,
|
|
556
|
+
durationMs: headersTime - startTime,
|
|
557
|
+
message: response.message,
|
|
558
|
+
}),
|
|
559
|
+
);
|
|
560
|
+
if (isTimeout) {
|
|
561
|
+
throw new Errors.APIConnectionTimeoutError();
|
|
562
|
+
}
|
|
563
|
+
throw new Errors.APIConnectionError({ cause: response });
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
const responseInfo = `[${requestLogID}${retryLogStr}] ${req.method} ${url} ${
|
|
567
|
+
response.ok ? 'succeeded' : 'failed'
|
|
568
|
+
} with status ${response.status} in ${headersTime - startTime}ms`;
|
|
569
|
+
|
|
570
|
+
if (!response.ok) {
|
|
571
|
+
const shouldRetry = await this.shouldRetry(response);
|
|
572
|
+
if (retriesRemaining && shouldRetry) {
|
|
573
|
+
const retryMessage = `retrying, ${retriesRemaining} attempts remaining`;
|
|
574
|
+
|
|
575
|
+
// We don't need the body of this response.
|
|
576
|
+
await Shims.CancelReadableStream(response.body);
|
|
577
|
+
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
|
|
578
|
+
loggerFor(this).debug(
|
|
579
|
+
`[${requestLogID}] response error (${retryMessage})`,
|
|
580
|
+
formatRequestDetails({
|
|
581
|
+
retryOfRequestLogID,
|
|
582
|
+
url: response.url,
|
|
583
|
+
status: response.status,
|
|
584
|
+
headers: response.headers,
|
|
585
|
+
durationMs: headersTime - startTime,
|
|
586
|
+
}),
|
|
587
|
+
);
|
|
588
|
+
return this.retryRequest(
|
|
589
|
+
options,
|
|
590
|
+
retriesRemaining,
|
|
591
|
+
retryOfRequestLogID ?? requestLogID,
|
|
592
|
+
response.headers,
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
const retryMessage = shouldRetry ? `error; no more retries left` : `error; not retryable`;
|
|
597
|
+
|
|
598
|
+
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
|
|
599
|
+
|
|
600
|
+
const errText = await response.text().catch((err: any) => castToError(err).message);
|
|
601
|
+
const errJSON = safeJSON(errText);
|
|
602
|
+
const errMessage = errJSON ? undefined : errText;
|
|
603
|
+
|
|
604
|
+
loggerFor(this).debug(
|
|
605
|
+
`[${requestLogID}] response error (${retryMessage})`,
|
|
606
|
+
formatRequestDetails({
|
|
607
|
+
retryOfRequestLogID,
|
|
608
|
+
url: response.url,
|
|
609
|
+
status: response.status,
|
|
610
|
+
headers: response.headers,
|
|
611
|
+
message: errMessage,
|
|
612
|
+
durationMs: Date.now() - startTime,
|
|
613
|
+
}),
|
|
614
|
+
);
|
|
615
|
+
|
|
616
|
+
const err = this.makeStatusError(response.status, errJSON, errMessage, response.headers);
|
|
617
|
+
throw err;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
loggerFor(this).info(responseInfo);
|
|
621
|
+
loggerFor(this).debug(
|
|
622
|
+
`[${requestLogID}] response start`,
|
|
623
|
+
formatRequestDetails({
|
|
624
|
+
retryOfRequestLogID,
|
|
625
|
+
url: response.url,
|
|
626
|
+
status: response.status,
|
|
627
|
+
headers: response.headers,
|
|
628
|
+
durationMs: headersTime - startTime,
|
|
629
|
+
}),
|
|
630
|
+
);
|
|
631
|
+
|
|
632
|
+
return { response, options, controller, requestLogID, retryOfRequestLogID, startTime };
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
getAPIList<Item, PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>>(
|
|
636
|
+
path: string,
|
|
637
|
+
Page: new (...args: any[]) => PageClass,
|
|
638
|
+
opts?: RequestOptions,
|
|
639
|
+
): Pagination.PagePromise<PageClass, Item> {
|
|
640
|
+
return this.requestAPIList(Page, { method: 'get', path, ...opts });
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
requestAPIList<
|
|
644
|
+
Item = unknown,
|
|
645
|
+
PageClass extends Pagination.AbstractPage<Item> = Pagination.AbstractPage<Item>,
|
|
646
|
+
>(
|
|
647
|
+
Page: new (...args: ConstructorParameters<typeof Pagination.AbstractPage>) => PageClass,
|
|
648
|
+
options: FinalRequestOptions,
|
|
649
|
+
): Pagination.PagePromise<PageClass, Item> {
|
|
650
|
+
const request = this.makeRequest(options, null, undefined);
|
|
651
|
+
return new Pagination.PagePromise<PageClass, Item>(this as any as Spotted, request, Page);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
async fetchWithTimeout(
|
|
655
|
+
url: RequestInfo,
|
|
656
|
+
init: RequestInit | undefined,
|
|
657
|
+
ms: number,
|
|
658
|
+
controller: AbortController,
|
|
659
|
+
): Promise<Response> {
|
|
660
|
+
const { signal, method, ...options } = init || {};
|
|
661
|
+
if (signal) signal.addEventListener('abort', () => controller.abort());
|
|
662
|
+
|
|
663
|
+
const timeout = setTimeout(() => controller.abort(), ms);
|
|
664
|
+
|
|
665
|
+
const isReadableBody =
|
|
666
|
+
((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
|
|
667
|
+
(typeof options.body === 'object' && options.body !== null && Symbol.asyncIterator in options.body);
|
|
668
|
+
|
|
669
|
+
const fetchOptions: RequestInit = {
|
|
670
|
+
signal: controller.signal as any,
|
|
671
|
+
...(isReadableBody ? { duplex: 'half' } : {}),
|
|
672
|
+
method: 'GET',
|
|
673
|
+
...options,
|
|
674
|
+
};
|
|
675
|
+
if (method) {
|
|
676
|
+
// Custom methods like 'patch' need to be uppercased
|
|
677
|
+
// See https://github.com/nodejs/undici/issues/2294
|
|
678
|
+
fetchOptions.method = method.toUpperCase();
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
try {
|
|
682
|
+
// use undefined this binding; fetch errors if bound to something else in browser/cloudflare
|
|
683
|
+
return await this.fetch.call(undefined, url, fetchOptions);
|
|
684
|
+
} finally {
|
|
685
|
+
clearTimeout(timeout);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
private async shouldRetry(response: Response): Promise<boolean> {
|
|
690
|
+
// Note this is not a standard header.
|
|
691
|
+
const shouldRetryHeader = response.headers.get('x-should-retry');
|
|
692
|
+
|
|
693
|
+
// If the server explicitly says whether or not to retry, obey.
|
|
694
|
+
if (shouldRetryHeader === 'true') return true;
|
|
695
|
+
if (shouldRetryHeader === 'false') return false;
|
|
696
|
+
|
|
697
|
+
// Retry if the token has expired
|
|
698
|
+
const oauth2_0Auth = await this.oauth2_0AuthState?.promise;
|
|
699
|
+
if (response.status === 401 && oauth2_0Auth && +oauth2_0Auth.expires_at - Date.now() < 10 * 1000) {
|
|
700
|
+
this.oauth2_0AuthState = undefined;
|
|
701
|
+
return true;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
// Retry on request timeouts.
|
|
705
|
+
if (response.status === 408) return true;
|
|
706
|
+
|
|
707
|
+
// Retry on lock timeouts.
|
|
708
|
+
if (response.status === 409) return true;
|
|
709
|
+
|
|
710
|
+
// Retry on rate limits.
|
|
711
|
+
if (response.status === 429) return true;
|
|
712
|
+
|
|
713
|
+
// Retry internal errors.
|
|
714
|
+
if (response.status >= 500) return true;
|
|
715
|
+
|
|
716
|
+
return false;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
private async retryRequest(
|
|
720
|
+
options: FinalRequestOptions,
|
|
721
|
+
retriesRemaining: number,
|
|
722
|
+
requestLogID: string,
|
|
723
|
+
responseHeaders?: Headers | undefined,
|
|
724
|
+
): Promise<APIResponseProps> {
|
|
725
|
+
let timeoutMillis: number | undefined;
|
|
726
|
+
|
|
727
|
+
// Note the `retry-after-ms` header may not be standard, but is a good idea and we'd like proactive support for it.
|
|
728
|
+
const retryAfterMillisHeader = responseHeaders?.get('retry-after-ms');
|
|
729
|
+
if (retryAfterMillisHeader) {
|
|
730
|
+
const timeoutMs = parseFloat(retryAfterMillisHeader);
|
|
731
|
+
if (!Number.isNaN(timeoutMs)) {
|
|
732
|
+
timeoutMillis = timeoutMs;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
// About the Retry-After header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After
|
|
737
|
+
const retryAfterHeader = responseHeaders?.get('retry-after');
|
|
738
|
+
if (retryAfterHeader && !timeoutMillis) {
|
|
739
|
+
const timeoutSeconds = parseFloat(retryAfterHeader);
|
|
740
|
+
if (!Number.isNaN(timeoutSeconds)) {
|
|
741
|
+
timeoutMillis = timeoutSeconds * 1000;
|
|
742
|
+
} else {
|
|
743
|
+
timeoutMillis = Date.parse(retryAfterHeader) - Date.now();
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
// If the API asks us to wait a certain amount of time (and it's a reasonable amount),
|
|
748
|
+
// just do what it says, but otherwise calculate a default
|
|
749
|
+
if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
|
|
750
|
+
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
751
|
+
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
752
|
+
}
|
|
753
|
+
await sleep(timeoutMillis);
|
|
754
|
+
|
|
755
|
+
return this.makeRequest(options, retriesRemaining - 1, requestLogID);
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
private calculateDefaultRetryTimeoutMillis(retriesRemaining: number, maxRetries: number): number {
|
|
759
|
+
const initialRetryDelay = 0.5;
|
|
760
|
+
const maxRetryDelay = 8.0;
|
|
761
|
+
|
|
762
|
+
const numRetries = maxRetries - retriesRemaining;
|
|
763
|
+
|
|
764
|
+
// Apply exponential backoff, but not more than the max.
|
|
765
|
+
const sleepSeconds = Math.min(initialRetryDelay * Math.pow(2, numRetries), maxRetryDelay);
|
|
766
|
+
|
|
767
|
+
// Apply some jitter, take up to at most 25 percent of the retry time.
|
|
768
|
+
const jitter = 1 - Math.random() * 0.25;
|
|
769
|
+
|
|
770
|
+
return sleepSeconds * jitter * 1000;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
async buildRequest(
|
|
774
|
+
inputOptions: FinalRequestOptions,
|
|
775
|
+
{ retryCount = 0 }: { retryCount?: number } = {},
|
|
776
|
+
): Promise<{ req: FinalizedRequestInit; url: string; timeout: number }> {
|
|
777
|
+
const options = { ...inputOptions };
|
|
778
|
+
const { method, path, query, defaultBaseURL } = options;
|
|
779
|
+
|
|
780
|
+
const url = this.buildURL(path!, query as Record<string, unknown>, defaultBaseURL);
|
|
781
|
+
if ('timeout' in options) validatePositiveInteger('timeout', options.timeout);
|
|
782
|
+
options.timeout = options.timeout ?? this.timeout;
|
|
783
|
+
const { bodyHeaders, body } = this.buildBody({ options });
|
|
784
|
+
const reqHeaders = await this.buildHeaders({ options: inputOptions, method, bodyHeaders, retryCount });
|
|
785
|
+
|
|
786
|
+
const req: FinalizedRequestInit = {
|
|
787
|
+
method,
|
|
788
|
+
headers: reqHeaders,
|
|
789
|
+
...(options.signal && { signal: options.signal }),
|
|
790
|
+
...((globalThis as any).ReadableStream &&
|
|
791
|
+
body instanceof (globalThis as any).ReadableStream && { duplex: 'half' }),
|
|
792
|
+
...(body && { body }),
|
|
793
|
+
...((this.fetchOptions as any) ?? {}),
|
|
794
|
+
...((options.fetchOptions as any) ?? {}),
|
|
795
|
+
};
|
|
796
|
+
|
|
797
|
+
return { req, url, timeout: options.timeout };
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
private async buildHeaders({
|
|
801
|
+
options,
|
|
802
|
+
method,
|
|
803
|
+
bodyHeaders,
|
|
804
|
+
retryCount,
|
|
805
|
+
}: {
|
|
806
|
+
options: FinalRequestOptions;
|
|
807
|
+
method: HTTPMethod;
|
|
808
|
+
bodyHeaders: HeadersLike;
|
|
809
|
+
retryCount: number;
|
|
810
|
+
}): Promise<Headers> {
|
|
811
|
+
let idempotencyHeaders: HeadersLike = {};
|
|
812
|
+
if (this.idempotencyHeader && method !== 'get') {
|
|
813
|
+
if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey();
|
|
814
|
+
idempotencyHeaders[this.idempotencyHeader] = options.idempotencyKey;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
const headers = buildHeaders([
|
|
818
|
+
idempotencyHeaders,
|
|
819
|
+
{
|
|
820
|
+
Accept: 'application/json',
|
|
821
|
+
'User-Agent': this.getUserAgent(),
|
|
822
|
+
'X-Stainless-Retry-Count': String(retryCount),
|
|
823
|
+
...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),
|
|
824
|
+
...getPlatformHeaders(),
|
|
825
|
+
},
|
|
826
|
+
await this.authHeaders(options),
|
|
827
|
+
this._options.defaultHeaders,
|
|
828
|
+
bodyHeaders,
|
|
829
|
+
options.headers,
|
|
830
|
+
]);
|
|
831
|
+
|
|
832
|
+
this.validateHeaders(headers);
|
|
833
|
+
|
|
834
|
+
return headers.values;
|
|
835
|
+
}
|
|
836
|
+
|
|
837
|
+
private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
|
|
838
|
+
bodyHeaders: HeadersLike;
|
|
839
|
+
body: BodyInit | undefined;
|
|
840
|
+
} {
|
|
841
|
+
if (!body) {
|
|
842
|
+
return { bodyHeaders: undefined, body: undefined };
|
|
843
|
+
}
|
|
844
|
+
const headers = buildHeaders([rawHeaders]);
|
|
845
|
+
if (
|
|
846
|
+
// Pass raw type verbatim
|
|
847
|
+
ArrayBuffer.isView(body) ||
|
|
848
|
+
body instanceof ArrayBuffer ||
|
|
849
|
+
body instanceof DataView ||
|
|
850
|
+
(typeof body === 'string' &&
|
|
851
|
+
// Preserve legacy string encoding behavior for now
|
|
852
|
+
headers.values.has('content-type')) ||
|
|
853
|
+
// `Blob` is superset of `File`
|
|
854
|
+
((globalThis as any).Blob && body instanceof (globalThis as any).Blob) ||
|
|
855
|
+
// `FormData` -> `multipart/form-data`
|
|
856
|
+
body instanceof FormData ||
|
|
857
|
+
// `URLSearchParams` -> `application/x-www-form-urlencoded`
|
|
858
|
+
body instanceof URLSearchParams ||
|
|
859
|
+
// Send chunked stream (each chunk has own `length`)
|
|
860
|
+
((globalThis as any).ReadableStream && body instanceof (globalThis as any).ReadableStream)
|
|
861
|
+
) {
|
|
862
|
+
return { bodyHeaders: undefined, body: body as BodyInit };
|
|
863
|
+
} else if (
|
|
864
|
+
typeof body === 'object' &&
|
|
865
|
+
(Symbol.asyncIterator in body ||
|
|
866
|
+
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
|
|
867
|
+
) {
|
|
868
|
+
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
|
|
869
|
+
} else {
|
|
870
|
+
return this.#encoder({ body, headers });
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
static Spotted = this;
|
|
875
|
+
static DEFAULT_TIMEOUT = 60000; // 1 minute
|
|
876
|
+
|
|
877
|
+
static SpottedError = Errors.SpottedError;
|
|
878
|
+
static APIError = Errors.APIError;
|
|
879
|
+
static APIConnectionError = Errors.APIConnectionError;
|
|
880
|
+
static APIConnectionTimeoutError = Errors.APIConnectionTimeoutError;
|
|
881
|
+
static APIUserAbortError = Errors.APIUserAbortError;
|
|
882
|
+
static NotFoundError = Errors.NotFoundError;
|
|
883
|
+
static ConflictError = Errors.ConflictError;
|
|
884
|
+
static RateLimitError = Errors.RateLimitError;
|
|
885
|
+
static BadRequestError = Errors.BadRequestError;
|
|
886
|
+
static AuthenticationError = Errors.AuthenticationError;
|
|
887
|
+
static InternalServerError = Errors.InternalServerError;
|
|
888
|
+
static PermissionDeniedError = Errors.PermissionDeniedError;
|
|
889
|
+
static UnprocessableEntityError = Errors.UnprocessableEntityError;
|
|
890
|
+
|
|
891
|
+
static toFile = Uploads.toFile;
|
|
892
|
+
|
|
893
|
+
albums: API.Albums = new API.Albums(this);
|
|
894
|
+
artists: API.Artists = new API.Artists(this);
|
|
895
|
+
shows: API.Shows = new API.Shows(this);
|
|
896
|
+
episodes: API.Episodes = new API.Episodes(this);
|
|
897
|
+
audiobooks: API.Audiobooks = new API.Audiobooks(this);
|
|
898
|
+
me: API.Me = new API.Me(this);
|
|
899
|
+
chapters: API.Chapters = new API.Chapters(this);
|
|
900
|
+
tracks: API.Tracks = new API.Tracks(this);
|
|
901
|
+
search: API.Search = new API.Search(this);
|
|
902
|
+
playlists: API.Playlists = new API.Playlists(this);
|
|
903
|
+
users: API.Users = new API.Users(this);
|
|
904
|
+
browse: API.Browse = new API.Browse(this);
|
|
905
|
+
audioFeatures: API.AudioFeatures = new API.AudioFeatures(this);
|
|
906
|
+
audioAnalysis: API.AudioAnalysis = new API.AudioAnalysis(this);
|
|
907
|
+
recommendations: API.Recommendations = new API.Recommendations(this);
|
|
908
|
+
markets: API.Markets = new API.Markets(this);
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
Spotted.Albums = Albums;
|
|
912
|
+
Spotted.Artists = Artists;
|
|
913
|
+
Spotted.Shows = Shows;
|
|
914
|
+
Spotted.Episodes = Episodes;
|
|
915
|
+
Spotted.Audiobooks = Audiobooks;
|
|
916
|
+
Spotted.Me = Me;
|
|
917
|
+
Spotted.Chapters = Chapters;
|
|
918
|
+
Spotted.Tracks = Tracks;
|
|
919
|
+
Spotted.Search = Search;
|
|
920
|
+
Spotted.Playlists = Playlists;
|
|
921
|
+
Spotted.Users = Users;
|
|
922
|
+
Spotted.Browse = Browse;
|
|
923
|
+
Spotted.AudioFeatures = AudioFeatures;
|
|
924
|
+
Spotted.AudioAnalysis = AudioAnalysis;
|
|
925
|
+
Spotted.Recommendations = Recommendations;
|
|
926
|
+
Spotted.Markets = Markets;
|
|
927
|
+
|
|
928
|
+
export declare namespace Spotted {
|
|
929
|
+
export type RequestOptions = Opts.RequestOptions;
|
|
930
|
+
|
|
931
|
+
export import CursorURLPage = Pagination.CursorURLPage;
|
|
932
|
+
export { type CursorURLPageResponse as CursorURLPageResponse };
|
|
933
|
+
|
|
934
|
+
export {
|
|
935
|
+
Albums as Albums,
|
|
936
|
+
type AlbumRetrieveResponse as AlbumRetrieveResponse,
|
|
937
|
+
type AlbumBulkRetrieveResponse as AlbumBulkRetrieveResponse,
|
|
938
|
+
type AlbumRetrieveParams as AlbumRetrieveParams,
|
|
939
|
+
type AlbumBulkRetrieveParams as AlbumBulkRetrieveParams,
|
|
940
|
+
type AlbumListTracksParams as AlbumListTracksParams,
|
|
941
|
+
};
|
|
942
|
+
|
|
943
|
+
export {
|
|
944
|
+
Artists as Artists,
|
|
945
|
+
type ArtistListResponse as ArtistListResponse,
|
|
946
|
+
type ArtistListAlbumsResponse as ArtistListAlbumsResponse,
|
|
947
|
+
type ArtistListRelatedArtistsResponse as ArtistListRelatedArtistsResponse,
|
|
948
|
+
type ArtistListTopTracksResponse as ArtistListTopTracksResponse,
|
|
949
|
+
type ArtistListAlbumsResponsesCursorURLPage as ArtistListAlbumsResponsesCursorURLPage,
|
|
950
|
+
type ArtistListParams as ArtistListParams,
|
|
951
|
+
type ArtistListAlbumsParams as ArtistListAlbumsParams,
|
|
952
|
+
type ArtistListTopTracksParams as ArtistListTopTracksParams,
|
|
953
|
+
};
|
|
954
|
+
|
|
955
|
+
export {
|
|
956
|
+
Shows as Shows,
|
|
957
|
+
type ShowRetrieveResponse as ShowRetrieveResponse,
|
|
958
|
+
type ShowListResponse as ShowListResponse,
|
|
959
|
+
type ShowRetrieveParams as ShowRetrieveParams,
|
|
960
|
+
type ShowListParams as ShowListParams,
|
|
961
|
+
type ShowListEpisodesParams as ShowListEpisodesParams,
|
|
962
|
+
};
|
|
963
|
+
|
|
964
|
+
export {
|
|
965
|
+
Episodes as Episodes,
|
|
966
|
+
type EpisodeListResponse as EpisodeListResponse,
|
|
967
|
+
type EpisodeRetrieveParams as EpisodeRetrieveParams,
|
|
968
|
+
type EpisodeListParams as EpisodeListParams,
|
|
969
|
+
};
|
|
970
|
+
|
|
971
|
+
export {
|
|
972
|
+
Audiobooks as Audiobooks,
|
|
973
|
+
type SimplifiedChapterObject as SimplifiedChapterObject,
|
|
974
|
+
type AudiobookRetrieveResponse as AudiobookRetrieveResponse,
|
|
975
|
+
type AudiobookListResponse as AudiobookListResponse,
|
|
976
|
+
type SimplifiedChapterObjectsCursorURLPage as SimplifiedChapterObjectsCursorURLPage,
|
|
977
|
+
type AudiobookRetrieveParams as AudiobookRetrieveParams,
|
|
978
|
+
type AudiobookListParams as AudiobookListParams,
|
|
979
|
+
type AudiobookListChaptersParams as AudiobookListChaptersParams,
|
|
980
|
+
};
|
|
981
|
+
|
|
982
|
+
export { Me as Me, type MeRetrieveResponse as MeRetrieveResponse };
|
|
983
|
+
|
|
984
|
+
export {
|
|
985
|
+
Chapters as Chapters,
|
|
986
|
+
type ChapterRetrieveResponse as ChapterRetrieveResponse,
|
|
987
|
+
type ChapterListResponse as ChapterListResponse,
|
|
988
|
+
type ChapterRetrieveParams as ChapterRetrieveParams,
|
|
989
|
+
type ChapterListParams as ChapterListParams,
|
|
990
|
+
};
|
|
991
|
+
|
|
992
|
+
export {
|
|
993
|
+
Tracks as Tracks,
|
|
994
|
+
type TrackListResponse as TrackListResponse,
|
|
995
|
+
type TrackRetrieveParams as TrackRetrieveParams,
|
|
996
|
+
type TrackListParams as TrackListParams,
|
|
997
|
+
};
|
|
998
|
+
|
|
999
|
+
export {
|
|
1000
|
+
Search as Search,
|
|
1001
|
+
type SearchRetrieveResponse as SearchRetrieveResponse,
|
|
1002
|
+
type SearchRetrieveParams as SearchRetrieveParams,
|
|
1003
|
+
};
|
|
1004
|
+
|
|
1005
|
+
export {
|
|
1006
|
+
Playlists as Playlists,
|
|
1007
|
+
type PlaylistRetrieveResponse as PlaylistRetrieveResponse,
|
|
1008
|
+
type PlaylistRetrieveParams as PlaylistRetrieveParams,
|
|
1009
|
+
type PlaylistUpdateParams as PlaylistUpdateParams,
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
export { Users as Users, type UserRetrieveProfileResponse as UserRetrieveProfileResponse };
|
|
1013
|
+
|
|
1014
|
+
export {
|
|
1015
|
+
Browse as Browse,
|
|
1016
|
+
type BrowseGetFeaturedPlaylistsResponse as BrowseGetFeaturedPlaylistsResponse,
|
|
1017
|
+
type BrowseGetNewReleasesResponse as BrowseGetNewReleasesResponse,
|
|
1018
|
+
type BrowseGetFeaturedPlaylistsParams as BrowseGetFeaturedPlaylistsParams,
|
|
1019
|
+
type BrowseGetNewReleasesParams as BrowseGetNewReleasesParams,
|
|
1020
|
+
};
|
|
1021
|
+
|
|
1022
|
+
export {
|
|
1023
|
+
AudioFeatures as AudioFeatures,
|
|
1024
|
+
type AudioFeatureRetrieveResponse as AudioFeatureRetrieveResponse,
|
|
1025
|
+
type AudioFeatureListResponse as AudioFeatureListResponse,
|
|
1026
|
+
type AudioFeatureListParams as AudioFeatureListParams,
|
|
1027
|
+
};
|
|
1028
|
+
|
|
1029
|
+
export {
|
|
1030
|
+
AudioAnalysis as AudioAnalysis,
|
|
1031
|
+
type TimeIntervalObject as TimeIntervalObject,
|
|
1032
|
+
type AudioAnalysisRetrieveResponse as AudioAnalysisRetrieveResponse,
|
|
1033
|
+
};
|
|
1034
|
+
|
|
1035
|
+
export {
|
|
1036
|
+
Recommendations as Recommendations,
|
|
1037
|
+
type RecommendationGetResponse as RecommendationGetResponse,
|
|
1038
|
+
type RecommendationListAvailableGenreSeedsResponse as RecommendationListAvailableGenreSeedsResponse,
|
|
1039
|
+
type RecommendationGetParams as RecommendationGetParams,
|
|
1040
|
+
};
|
|
1041
|
+
|
|
1042
|
+
export { Markets as Markets, type MarketListResponse as MarketListResponse };
|
|
1043
|
+
|
|
1044
|
+
export type AlbumRestrictionObject = API.AlbumRestrictionObject;
|
|
1045
|
+
export type ArtistObject = API.ArtistObject;
|
|
1046
|
+
export type AudiobookBase = API.AudiobookBase;
|
|
1047
|
+
export type AuthorObject = API.AuthorObject;
|
|
1048
|
+
export type ChapterRestrictionObject = API.ChapterRestrictionObject;
|
|
1049
|
+
export type CopyrightObject = API.CopyrightObject;
|
|
1050
|
+
export type EpisodeObject = API.EpisodeObject;
|
|
1051
|
+
export type EpisodeRestrictionObject = API.EpisodeRestrictionObject;
|
|
1052
|
+
export type ExternalIDObject = API.ExternalIDObject;
|
|
1053
|
+
export type ExternalURLObject = API.ExternalURLObject;
|
|
1054
|
+
export type FollowersObject = API.FollowersObject;
|
|
1055
|
+
export type ImageObject = API.ImageObject;
|
|
1056
|
+
export type LinkedTrackObject = API.LinkedTrackObject;
|
|
1057
|
+
export type NarratorObject = API.NarratorObject;
|
|
1058
|
+
export type PagingPlaylistObject = API.PagingPlaylistObject;
|
|
1059
|
+
export type PlaylistTrackObject = API.PlaylistTrackObject;
|
|
1060
|
+
export type PlaylistTracksRefObject = API.PlaylistTracksRefObject;
|
|
1061
|
+
export type PlaylistUserObject = API.PlaylistUserObject;
|
|
1062
|
+
export type ResumePointObject = API.ResumePointObject;
|
|
1063
|
+
export type ShowBase = API.ShowBase;
|
|
1064
|
+
export type SimplifiedArtistObject = API.SimplifiedArtistObject;
|
|
1065
|
+
export type SimplifiedEpisodeObject = API.SimplifiedEpisodeObject;
|
|
1066
|
+
export type SimplifiedPlaylistObject = API.SimplifiedPlaylistObject;
|
|
1067
|
+
export type SimplifiedTrackObject = API.SimplifiedTrackObject;
|
|
1068
|
+
export type TrackObject = API.TrackObject;
|
|
1069
|
+
export type TrackRestrictionObject = API.TrackRestrictionObject;
|
|
1070
|
+
}
|