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
15 changes: 3 additions & 12 deletions packages/sdk/src/sdk/api/albums/AlbumsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ import type {
SolanaRelayService,
StorageService
} from '../../services'
import type {
EntityManagerService,
AdvancedOptions
} from '../../services/EntityManager/types'
import type { EntityManagerService } from '../../services/EntityManager/types'
import type { LoggerService } from '../../services/Logger'
import type { SolanaClient } from '../../services/Solana/programs/SolanaClient'
import { parseParams } from '../../utils/parseParams'
Expand Down Expand Up @@ -112,10 +109,7 @@ export class AlbumsApi {
* Upload an album
* Uploads the specified tracks and combines them into an album
*/
async uploadAlbum(
params: UploadAlbumRequest,
advancedOptions?: AdvancedOptions
) {
async uploadAlbum(params: UploadAlbumRequest) {
await parseParams('uploadAlbum', UploadAlbumSchema)(params)

const { albumName, ...playlistMetadata } = params.metadata
Expand All @@ -129,10 +123,7 @@ export class AlbumsApi {
}
}

return await this.playlistsApi.uploadPlaylist(
playlistParams,
advancedOptions
)
return await this.playlistsApi.uploadPlaylist(playlistParams)
}

/** @hidden
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.openapi-generator-ignore
apis/ChallengesApi.ts
apis/CoinsApi.ts
apis/CommentsApi.ts
Expand Down Expand Up @@ -73,6 +74,8 @@ models/CreateDeveloperAppRequestBody.ts
models/CreateDeveloperAppResponse.ts
models/CreateGrantRequestBody.ts
models/CreatePlaylistRequestBody.ts
models/CreatePlaylistRequestBodyCopyrightLine.ts
models/CreatePlaylistRequestBodyProducerCopyrightLine.ts
models/CreatePlaylistResponse.ts
models/CreateRewardCodeRequestBody.ts
models/CreateRewardCodeResponse.ts
Expand All @@ -85,6 +88,8 @@ models/CreateUserRequestBodyEvents.ts
models/CreateUserResponse.ts
models/DashboardWalletUser.ts
models/DashboardWalletUsersResponse.ts
models/DdexCopyright.ts
models/DdexResourceContributor.ts
models/DeactivateAccessKeyRequestBody.ts
models/DeactivateAccessKeyResponse.ts
models/DecodedUserToken.ts
Expand Down
80 changes: 80 additions & 0 deletions packages/sdk/src/sdk/api/generated/default/apis/TracksApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,16 @@ export interface GetTrendingUSDCPurchaseTracksWithVersionRequest {
time?: GetTrendingUSDCPurchaseTracksWithVersionTimeEnum;
}

export interface GetTrendingUndergroundWinnersRequest {
week?: Date;
userId?: string;
}

export interface GetTrendingWinnersRequest {
week?: Date;
userId?: string;
}

export interface GetUndergroundTrendingTracksRequest {
offset?: number;
limit?: number;
Expand Down Expand Up @@ -1524,6 +1534,76 @@ export class TracksApi extends runtime.BaseAPI {
return await response.value();
}

/**
* @hidden
* Gets weekly trending underground winners from the trending_results table. Returns full track objects for the specified week. Defaults to the most recent week with data when no week is provided.
*/
async getTrendingUndergroundWinnersRaw(params: GetTrendingUndergroundWinnersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TracksResponse>> {
const queryParameters: any = {};

if (params.week !== undefined) {
queryParameters['week'] = (params.week as any).toISOString().substr(0,10);
}

if (params.userId !== undefined) {
queryParameters['user_id'] = params.userId;
}

const headerParameters: runtime.HTTPHeaders = {};

const response = await this.request({
path: `/tracks/trending/underground/winners`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => TracksResponseFromJSON(jsonValue));
}

/**
* Gets weekly trending underground winners from the trending_results table. Returns full track objects for the specified week. Defaults to the most recent week with data when no week is provided.
*/
async getTrendingUndergroundWinners(params: GetTrendingUndergroundWinnersRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TracksResponse> {
const response = await this.getTrendingUndergroundWinnersRaw(params, initOverrides);
return await response.value();
}

/**
* @hidden
* Gets weekly trending winners from the trending_results table. Returns full track objects for the specified week. Defaults to the most recent week with data when no week is provided.
*/
async getTrendingWinnersRaw(params: GetTrendingWinnersRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TracksResponse>> {
const queryParameters: any = {};

if (params.week !== undefined) {
queryParameters['week'] = (params.week as any).toISOString().substr(0,10);
}

if (params.userId !== undefined) {
queryParameters['user_id'] = params.userId;
}

const headerParameters: runtime.HTTPHeaders = {};

const response = await this.request({
path: `/tracks/trending/winners`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);

return new runtime.JSONApiResponse(response, (jsonValue) => TracksResponseFromJSON(jsonValue));
}

/**
* Gets weekly trending winners from the trending_results table. Returns full track objects for the specified week. Defaults to the most recent week with data when no week is provided.
*/
async getTrendingWinners(params: GetTrendingWinnersRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TracksResponse> {
const response = await this.getTrendingWinnersRaw(params, initOverrides);
return await response.value();
}

/**
* @hidden
* Gets the top 100 trending underground tracks on Audius
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@ import {
AccessGateFromJSONTyped,
AccessGateToJSON,
} from './AccessGate';
import type { CreatePlaylistRequestBodyCopyrightLine } from './CreatePlaylistRequestBodyCopyrightLine';
import {
CreatePlaylistRequestBodyCopyrightLineFromJSON,
CreatePlaylistRequestBodyCopyrightLineFromJSONTyped,
CreatePlaylistRequestBodyCopyrightLineToJSON,
} from './CreatePlaylistRequestBodyCopyrightLine';
import type { CreatePlaylistRequestBodyProducerCopyrightLine } from './CreatePlaylistRequestBodyProducerCopyrightLine';
import {
CreatePlaylistRequestBodyProducerCopyrightLineFromJSON,
CreatePlaylistRequestBodyProducerCopyrightLineFromJSONTyped,
CreatePlaylistRequestBodyProducerCopyrightLineToJSON,
} from './CreatePlaylistRequestBodyProducerCopyrightLine';
import type { DdexResourceContributor } from './DdexResourceContributor';
import {
DdexResourceContributorFromJSON,
DdexResourceContributorFromJSONTyped,
DdexResourceContributorToJSON,
} from './DdexResourceContributor';
import type { Genre } from './Genre';
import {
GenreFromJSON,
Expand Down Expand Up @@ -50,7 +68,7 @@ export interface CreatePlaylistRequestBody {
* @type {string}
* @memberof CreatePlaylistRequestBody
*/
playlistId?: string | null;
playlistId?: string;
/**
* Playlist or album name
* @type {string}
Expand All @@ -62,67 +80,67 @@ export interface CreatePlaylistRequestBody {
* @type {string}
* @memberof CreatePlaylistRequestBody
*/
description?: string | null;
description?: string;
/**
* Whether the playlist is private
* @type {boolean}
* @memberof CreatePlaylistRequestBody
*/
isPrivate?: boolean | null;
isPrivate?: boolean;
/**
* Whether this is an album
* @type {boolean}
* @memberof CreatePlaylistRequestBody
*/
isAlbum?: boolean | null;
isAlbum?: boolean;
/**
*
* @type {Genre}
* @memberof CreatePlaylistRequestBody
*/
genre?: Genre | null;
genre?: Genre;
/**
*
* @type {Mood}
* @memberof CreatePlaylistRequestBody
*/
mood?: Mood | null;
mood?: Mood;
/**
* Comma-separated tags
* @type {string}
* @memberof CreatePlaylistRequestBody
*/
tags?: string | null;
tags?: string;
/**
* License type
* @type {string}
* @memberof CreatePlaylistRequestBody
*/
license?: string | null;
license?: string;
/**
* Universal Product Code (for albums)
* @type {string}
* @memberof CreatePlaylistRequestBody
*/
upc?: string | null;
upc?: string;
/**
* Release date
* @type {Date}
* @memberof CreatePlaylistRequestBody
*/
releaseDate?: Date | null;
releaseDate?: Date;
/**
* IPFS CID for cover art
* @type {string}
* @memberof CreatePlaylistRequestBody
*/
coverArtCid?: string | null;
coverArtCid?: string;
/**
* Array of tracks in the playlist
* @type {Array<PlaylistAddedTimestamp>}
* @memberof CreatePlaylistRequestBody
*/
playlistContents?: Array<PlaylistAddedTimestamp> | null;
playlistContents?: Array<PlaylistAddedTimestamp>;
/**
* Whether streaming is restricted behind an access gate
* @type {boolean}
Expand All @@ -146,31 +164,31 @@ export interface CreatePlaylistRequestBody {
* @type {string}
* @memberof CreatePlaylistRequestBody
*/
ddexApp?: string | null;
ddexApp?: string;
/**
* DDEX release identifiers
* @type {object}
* @type {{ [key: string]: string; }}
* @memberof CreatePlaylistRequestBody
*/
ddexReleaseIds?: object | null;
ddexReleaseIds?: { [key: string]: string; } | null;
/**
* DDEX resource contributors / artists
* @type {Array<object>}
* @type {Array<DdexResourceContributor>}
* @memberof CreatePlaylistRequestBody
*/
artists?: Array<object> | null;
artists?: Array<DdexResourceContributor> | null;
/**
* DDEX copyright line
* @type {object}
*
* @type {CreatePlaylistRequestBodyCopyrightLine}
* @memberof CreatePlaylistRequestBody
*/
copyrightLine?: object | null;
copyrightLine?: CreatePlaylistRequestBodyCopyrightLine | null;
/**
* DDEX producer copyright line
* @type {object}
*
* @type {CreatePlaylistRequestBodyProducerCopyrightLine}
* @memberof CreatePlaylistRequestBody
*/
producerCopyrightLine?: object | null;
producerCopyrightLine?: CreatePlaylistRequestBodyProducerCopyrightLine | null;
/**
* Parental warning type
* @type {string}
Expand Down Expand Up @@ -215,17 +233,17 @@ export function CreatePlaylistRequestBodyFromJSONTyped(json: any, ignoreDiscrimi
'tags': !exists(json, 'tags') ? undefined : json['tags'],
'license': !exists(json, 'license') ? undefined : json['license'],
'upc': !exists(json, 'upc') ? undefined : json['upc'],
'releaseDate': !exists(json, 'release_date') ? undefined : (json['release_date'] === null ? null : new Date(json['release_date'])),
'releaseDate': !exists(json, 'release_date') ? undefined : (new Date(json['release_date'])),
'coverArtCid': !exists(json, 'cover_art_cid') ? undefined : json['cover_art_cid'],
'playlistContents': !exists(json, 'playlist_contents') ? undefined : (json['playlist_contents'] === null ? null : (json['playlist_contents'] as Array<any>).map(PlaylistAddedTimestampFromJSON)),
'playlistContents': !exists(json, 'playlist_contents') ? undefined : ((json['playlist_contents'] as Array<any>).map(PlaylistAddedTimestampFromJSON)),
'isStreamGated': !exists(json, 'is_stream_gated') ? undefined : json['is_stream_gated'],
'isScheduledRelease': !exists(json, 'is_scheduled_release') ? undefined : json['is_scheduled_release'],
'streamConditions': !exists(json, 'stream_conditions') ? undefined : AccessGateFromJSON(json['stream_conditions']),
'ddexApp': !exists(json, 'ddex_app') ? undefined : json['ddex_app'],
'ddexReleaseIds': !exists(json, 'ddex_release_ids') ? undefined : json['ddex_release_ids'],
'artists': !exists(json, 'artists') ? undefined : json['artists'],
'copyrightLine': !exists(json, 'copyright_line') ? undefined : json['copyright_line'],
'producerCopyrightLine': !exists(json, 'producer_copyright_line') ? undefined : json['producer_copyright_line'],
'artists': !exists(json, 'artists') ? undefined : (json['artists'] === null ? null : (json['artists'] as Array<any>).map(DdexResourceContributorFromJSON)),
'copyrightLine': !exists(json, 'copyright_line') ? undefined : CreatePlaylistRequestBodyCopyrightLineFromJSON(json['copyright_line']),
'producerCopyrightLine': !exists(json, 'producer_copyright_line') ? undefined : CreatePlaylistRequestBodyProducerCopyrightLineFromJSON(json['producer_copyright_line']),
'parentalWarningType': !exists(json, 'parental_warning_type') ? undefined : json['parental_warning_type'],
'isImageAutogenerated': !exists(json, 'is_image_autogenerated') ? undefined : json['is_image_autogenerated'],
};
Expand All @@ -250,17 +268,17 @@ export function CreatePlaylistRequestBodyToJSON(value?: CreatePlaylistRequestBod
'tags': value.tags,
'license': value.license,
'upc': value.upc,
'release_date': value.releaseDate === undefined ? undefined : (value.releaseDate === null ? null : value.releaseDate.toISOString().substr(0,10)),
'release_date': value.releaseDate === undefined ? undefined : (value.releaseDate.toISOString().substr(0,10)),
'cover_art_cid': value.coverArtCid,
'playlist_contents': value.playlistContents === undefined ? undefined : (value.playlistContents === null ? null : (value.playlistContents as Array<any>).map(PlaylistAddedTimestampToJSON)),
'playlist_contents': value.playlistContents === undefined ? undefined : ((value.playlistContents as Array<any>).map(PlaylistAddedTimestampToJSON)),
'is_stream_gated': value.isStreamGated,
'is_scheduled_release': value.isScheduledRelease,
'stream_conditions': AccessGateToJSON(value.streamConditions),
'ddex_app': value.ddexApp,
'ddex_release_ids': value.ddexReleaseIds,
'artists': value.artists,
'copyright_line': value.copyrightLine,
'producer_copyright_line': value.producerCopyrightLine,
'artists': value.artists === undefined ? undefined : (value.artists === null ? null : (value.artists as Array<any>).map(DdexResourceContributorToJSON)),
'copyright_line': CreatePlaylistRequestBodyCopyrightLineToJSON(value.copyrightLine),
'producer_copyright_line': CreatePlaylistRequestBodyProducerCopyrightLineToJSON(value.producerCopyrightLine),
'parental_warning_type': value.parentalWarningType,
'is_image_autogenerated': value.isImageAutogenerated,
};
Expand Down
Loading
Loading