Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: '10.27.0'
version: '10.30.1'

- name: Bootstrap
run: ./scripts/bootstrap
Expand All @@ -56,7 +56,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: '10.27.0'
version: '10.30.1'

- name: Bootstrap
run: ./scripts/bootstrap
Expand All @@ -65,14 +65,18 @@ jobs:
run: ./scripts/build

- name: Get GitHub OIDC Token
if: github.repository == 'stainless-sdks/spotify-typescript'
if: |-
github.repository == 'stainless-sdks/spotify-typescript' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
if: github.repository == 'stainless-sdks/spotify-typescript'
if: |-
github.repository == 'stainless-sdks/spotify-typescript' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
Expand All @@ -94,7 +98,7 @@ jobs:
- name: Set up pnpm
uses: pnpm/action-setup@v4
with:
version: '10.27.0'
version: '10.30.1'

- name: Bootstrap
run: ./scripts/bootstrap
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.4.0"
".": "0.5.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 97
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless-commons%2Fspotify-7ac9fe2ee73e38b2892f0393435f2d3a275d04b1d0728708382dd752da1d44de.yml
openapi_spec_hash: 6be3d4faa079ee82335208bec39c917a
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless-commons%2Fspotify-3ba45faf550c5b93f0307503d17c023c0e732e13835821995c97b2661af26f11.yml
openapi_spec_hash: 3232d211ced286eec6129772a2ef5105
config_hash: 130d32e101fcd29858ba4453473724d6
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## 0.5.0 (2026-03-10)

Full Changelog: [v0.4.0...v0.5.0](https://github.com/stainless-commons/spotify-typescript/compare/v0.4.0...v0.5.0)

### Features

* **api:** api update ([f5b1d5d](https://github.com/stainless-commons/spotify-typescript/commit/f5b1d5de361659231e7dce85d9eaaea58c7a275e))


### Bug Fixes

* **client:** preserve URL params already embedded in path ([e5856a1](https://github.com/stainless-commons/spotify-typescript/commit/e5856a1b2b4d98f9676985a2b48c895709e32cab))
* **docs/contributing:** correct pnpm link command ([2218729](https://github.com/stainless-commons/spotify-typescript/commit/2218729071f9670d3499d27cac7e064da28db02a))


### Chores

* **ci:** skip uploading artifacts on stainless-internal branches ([79c0b67](https://github.com/stainless-commons/spotify-typescript/commit/79c0b67c68c33383378838b706eda20d45510d5d))
* **internal:** codegen related update ([c989f3d](https://github.com/stainless-commons/spotify-typescript/commit/c989f3d049fb2bfb57a643fc966ce7aa1b005516))
* **internal:** move stringifyQuery implementation to internal function ([6e16469](https://github.com/stainless-commons/spotify-typescript/commit/6e16469e131fee1d5b928d3bf09098bd7fa9a94e))
* **internal:** update dependencies to address dependabot vulnerabilities ([1a98d5a](https://github.com/stainless-commons/spotify-typescript/commit/1a98d5a46eef1f95d70a4d1044bbeb915e8b523f))
* **internal:** upgrade pnpm version ([5ac3724](https://github.com/stainless-commons/spotify-typescript/commit/5ac3724a8aad0f4eea633be44a662d58090a0ebc))

## 0.4.0 (2026-02-23)

Full Changelog: [v0.3.0...v0.4.0](https://github.com/stainless-commons/spotify-typescript/compare/v0.3.0...v0.4.0)
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ $ yarn link @stainless-commons/spotify
# With pnpm
$ pnpm link --global
$ cd ../my-package
$ pnpm link -global @stainless-commons/spotify
$ pnpm link --global @stainless-commons/spotify
```

## Running tests
Expand Down
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@stainless-commons/spotify",
"version": "0.4.0",
"version": "0.5.0",
"description": "Stainless Commons TypeScript SDK for the Spotify API",
"author": "Spotify <commons@stainless.com>",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"type": "commonjs",
"repository": "github:stainless-commons/spotify-typescript",
"license": "Apache-2.0",
"packageManager": "pnpm@10.27.0",
"packageManager": "pnpm@10.30.1",
"files": [
"**/*"
],
Expand Down Expand Up @@ -50,6 +50,17 @@
"typescript": "5.8.3",
"typescript-eslint": "8.31.1"
},
"overrides": {
"minimatch": "^9.0.5"
},
"pnpm": {
"overrides": {
"minimatch": "^9.0.5"
}
},
"resolutions": {
"minimatch": "^9.0.5"
},
"exports": {
".": {
"import": "./dist/index.mjs",
Expand Down
45 changes: 10 additions & 35 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type { APIResponseProps } from './internal/parse';
import { getPlatformHeaders } from './internal/detect-platform';
import * as Shims from './internal/shims';
import * as Opts from './internal/request-options';
import * as qs from './internal/qs';
import { stringifyQuery } from './internal/utils/query';
import { VERSION } from './version';
import * as Errors from './core/error';
import * as Pagination from './core/pagination';
Expand Down Expand Up @@ -369,8 +369,8 @@ export class Spotify {
return buildHeaders([{ Authorization: `Bearer ${token.access_token}` }]);
}

protected stringifyQuery(query: Record<string, unknown>): string {
return qs.stringify(query, { arrayFormat: 'comma' });
protected stringifyQuery(query: object | Record<string, unknown>): string {
return stringifyQuery(query);
}

private getUserAgent(): string {
Expand Down Expand Up @@ -402,12 +402,13 @@ export class Spotify {
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));

const defaultQuery = this.defaultQuery();
if (!isEmptyObj(defaultQuery)) {
query = { ...defaultQuery, ...query };
const pathQuery = Object.fromEntries(url.searchParams);
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
query = { ...pathQuery, ...defaultQuery, ...query };
}

if (typeof query === 'object' && query && !Array.isArray(query)) {
url.search = this.stringifyQuery(query as Record<string, unknown>);
url.search = this.stringifyQuery(query);
}

return url.toString();
Expand Down Expand Up @@ -743,9 +744,9 @@ export class Spotify {
}
}

// If the API asks us to wait a certain amount of time (and it's a reasonable amount),
// just do what it says, but otherwise calculate a default
if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) {
// If the API asks us to wait a certain amount of time, just do what it
// says, but otherwise calculate a default
if (timeoutMillis === undefined) {
const maxRetries = options.maxRetries ?? this.maxRetries;
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
}
Expand Down Expand Up @@ -877,7 +878,7 @@ export class Spotify {
) {
return {
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
body: this.stringifyQuery(body as Record<string, unknown>),
body: this.stringifyQuery(body),
};
} else {
return this.#encoder({ body, headers });
Expand Down
1 change: 1 addition & 0 deletions src/internal/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ export * from './utils/env';
export * from './utils/log';
export * from './utils/uuid';
export * from './utils/sleep';
export * from './utils/query';
7 changes: 7 additions & 0 deletions src/internal/utils/query.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import * as qs from '../qs/stringify';

export function stringifyQuery(query: object | Record<string, unknown>) {
return qs.stringify(query, { arrayFormat: 'comma' });
}
4 changes: 2 additions & 2 deletions src/resources/albums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export interface AlbumRetrieveResponse {
copyrights?: Array<Shared.CopyrightObject>;

/**
* @deprecated Known external IDs for the album.
* Known external IDs for the album.
*/
external_ids?: Shared.ExternalIDObject;

Expand Down Expand Up @@ -300,7 +300,7 @@ export namespace AlbumBulkRetrieveResponse {
copyrights?: Array<Shared.CopyrightObject>;

/**
* @deprecated Known external IDs for the album.
* Known external IDs for the album.
*/
external_ids?: Shared.ExternalIDObject;

Expand Down
2 changes: 1 addition & 1 deletion src/resources/me/albums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export namespace AlbumListResponse {
copyrights?: Array<Shared.CopyrightObject>;

/**
* @deprecated Known external IDs for the album.
* Known external IDs for the album.
*/
external_ids?: Shared.ExternalIDObject;

Expand Down
2 changes: 1 addition & 1 deletion src/resources/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,7 @@ export interface TrackObject {
explicit?: boolean;

/**
* @deprecated Known external IDs for the track.
* Known external IDs for the track.
*/
external_ids?: ExternalIDObject;

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.4.0'; // x-release-please-version
export const VERSION = '0.5.0'; // x-release-please-version
Loading
Loading