Skip to content
Merged
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
9 changes: 9 additions & 0 deletions .changeset/generated-api-updates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
'@audius/sdk': minor
---

Generated API updates: track download counts, /me endpoint

- Added `TracksApi.getTrackDownloadCount()` and `getTrackDownloadCounts()` from swagger
- Added `UsersApi.getMe()` for the authenticated user endpoint
- Fixed generator script (`gen.js` → `gen.cjs`) for ESM compatibility — the SDK package uses `"type": "module"` which caused Node to treat `.js` files as ESM, breaking the `require()`-based generator
4 changes: 2 additions & 2 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"sdk:config": "tsx ./src/sdk/scripts/generateServicesConfig.ts",
"sdk:verify-user": "tsx ./src/sdk/scripts/verifyUser.ts",
"gen": "npm run gen:prod",
"gen:dev": "node ./src/sdk/api/generator/gen.js --env dev",
"gen:prod": "node ./src/sdk/api/generator/gen.js",
"gen:dev": "node ./src/sdk/api/generator/gen.cjs --env dev",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yuk

"gen:prod": "node ./src/sdk/api/generator/gen.cjs",
"prepare": "patch-package",
"prepack": "turbo run build"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@ models/TrackArtwork.ts
models/TrackCommentCountResponse.ts
models/TrackCommentNotificationResponse.ts
models/TrackCommentsResponse.ts
models/TrackDownloadCountResponse.ts
models/TrackDownloadCountResponseData.ts
models/TrackDownloadCountsResponse.ts
models/TrackDownloadRequestBody.ts
models/TrackElementWrite.ts
models/TrackFavoritesResponse.ts
Expand Down
10 changes: 10 additions & 0 deletions packages/sdk/src/sdk/api/generated/default/apis/ChallengesApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ export class ChallengesApi extends runtime.BaseAPI {

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read"]);
}

const response = await this.request({
path: `/challenges/{challenge_id}/attest`.replace(`{${"challenge_id"}}`, encodeURIComponent(String(params.challengeId))),
method: 'GET',
Expand Down Expand Up @@ -137,6 +142,11 @@ export class ChallengesApi extends runtime.BaseAPI {

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read"]);
}

const response = await this.request({
path: `/challenges/undisbursed`,
method: 'GET',
Expand Down
45 changes: 45 additions & 0 deletions packages/sdk/src/sdk/api/generated/default/apis/CommentsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ export class CommentsApi extends runtime.BaseAPI {

headerParameters['Content-Type'] = 'application/json';

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["write"]);
}

if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
Expand Down Expand Up @@ -181,6 +186,11 @@ export class CommentsApi extends runtime.BaseAPI {

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["write"]);
}

if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
Expand Down Expand Up @@ -266,6 +276,11 @@ export class CommentsApi extends runtime.BaseAPI {

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read"]);
}

const response = await this.request({
path: `/comments/{comment_id}/replies`.replace(`{${"comment_id"}}`, encodeURIComponent(String(params.commentId))),
method: 'GET',
Expand Down Expand Up @@ -338,6 +353,11 @@ export class CommentsApi extends runtime.BaseAPI {

headerParameters['Content-Type'] = 'application/json';

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["write"]);
}

if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
Expand Down Expand Up @@ -395,6 +415,11 @@ export class CommentsApi extends runtime.BaseAPI {

headerParameters['Content-Type'] = 'application/json';

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["write"]);
}

if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
Expand Down Expand Up @@ -446,6 +471,11 @@ export class CommentsApi extends runtime.BaseAPI {

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["write"]);
}

if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
Expand Down Expand Up @@ -502,6 +532,11 @@ export class CommentsApi extends runtime.BaseAPI {

headerParameters['Content-Type'] = 'application/json';

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["write"]);
}

if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
Expand Down Expand Up @@ -559,6 +594,11 @@ export class CommentsApi extends runtime.BaseAPI {

headerParameters['Content-Type'] = 'application/json';

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["write"]);
}

if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
Expand Down Expand Up @@ -616,6 +656,11 @@ export class CommentsApi extends runtime.BaseAPI {

headerParameters['Content-Type'] = 'application/json';

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["write"]);
}

if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,11 @@ export class DeveloperAppsApi extends runtime.BaseAPI {

headerParameters['Content-Type'] = 'application/json';

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["write"]);
}

if (this.configuration && (this.configuration.username !== undefined || this.configuration.password !== undefined)) {
headerParameters["Authorization"] = "Basic " + btoa(this.configuration.username + ":" + this.configuration.password);
}
Expand Down
15 changes: 15 additions & 0 deletions packages/sdk/src/sdk/api/generated/default/apis/EventsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ export class EventsApi extends runtime.BaseAPI {

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read"]);
}

const response = await this.request({
path: `/events/all`,
method: 'GET',
Expand Down Expand Up @@ -123,6 +128,11 @@ export class EventsApi extends runtime.BaseAPI {

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read"]);
}

const response = await this.request({
path: `/events`,
method: 'GET',
Expand Down Expand Up @@ -179,6 +189,11 @@ export class EventsApi extends runtime.BaseAPI {

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read"]);
}

const response = await this.request({
path: `/events/entity`,
method: 'GET',
Expand Down
5 changes: 5 additions & 0 deletions packages/sdk/src/sdk/api/generated/default/apis/ExploreApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ export class ExploreApi extends runtime.BaseAPI {

const headerParameters: runtime.HTTPHeaders = {};

if (this.configuration && this.configuration.accessToken) {
// oauth required
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read"]);
}

const response = await this.request({
path: `/explore/best-selling`,
method: 'GET',
Expand Down
Loading
Loading