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
5 changes: 2 additions & 3 deletions packages/common/src/adapters/user.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
HashId,
OptionalHashId,
OptionalId,
type full,
type User,
type UpdateUserRequest
Expand Down Expand Up @@ -233,9 +232,9 @@ export const userMetadataToSdk = (
),
bio: input.bio ?? undefined,
website: input.website ?? undefined,
artistPickTrackId: OptionalId.parse(input.artist_pick_track_id ?? undefined),
artistPickTrackId: input.artist_pick_track_id ?? undefined,
events: {
referrer: OptionalId.parse(input.events?.referrer ?? undefined),
referrer: input.events?.referrer ?? undefined,
isMobileUser: input.events?.is_mobile_user ?? undefined
},
location: input.location ?? undefined,
Expand Down
6 changes: 4 additions & 2 deletions packages/common/src/api/tan-query/comments/usePinComment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,17 @@ export const usePinComment = () => {
userId: Id.parse(userId)!,
commentId: Id.parse(commentId)!,
metadata: {
entityId: trackId
entityId: trackId,
entityType: 'Track'
}
})
} else {
return await sdk.comments.unpinComment({
userId: Id.parse(userId)!,
commentId: Id.parse(commentId)!,
metadata: {
entityId: trackId
entityId: trackId,
entityType: 'Track'
}
})
}
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/src/sdk/api/developer-apps/DeveloperAppsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export class DeveloperAppsApi extends GeneratedDeveloperAppsApi {
) {
if (this.entityManager) {
return await this.createDeveloperAppWithEntityManager({
...params.createDeveloperAppRequestBody,
...params.metadata,
userId: params.userId
})
} else {
Expand Down Expand Up @@ -133,7 +133,7 @@ export class DeveloperAppsApi extends GeneratedDeveloperAppsApi {
) {
if (this.entityManager) {
return await this.updateDeveloperAppWithEntityManager({
...params.updateDeveloperAppRequestBody,
...params.metadata,
userId: params.userId,
appApiKey: params.address
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ models/CreateTrackResponse.ts
models/CreateUserDeveloperAppRequestBody.ts
models/CreateUserDeveloperAppResponse.ts
models/CreateUserRequestBody.ts
models/CreateUserRequestBodyEvents.ts
models/CreateUserRequestBodyPlaylistLibrary.ts
models/CreateUserRequestBodyPlaylistLibraryContentsInner.ts
models/CreateUserResponse.ts
models/DashboardWalletUser.ts
models/DashboardWalletUsersResponse.ts
Expand Down Expand Up @@ -114,9 +117,13 @@ models/MediaLink.ts
models/MonthlyAggregatePlay.ts
models/Mood.ts
models/MutualFollowersResponse.ts
models/PinCommentRequestBody.ts
models/Playlist.ts
models/PlaylistAddedTimestamp.ts
models/PlaylistArtwork.ts
models/PlaylistLibraryExplorePlaylistIdentifier.ts
models/PlaylistLibraryFolder.ts
models/PlaylistLibraryPlaylistIdentifier.ts
models/PlaylistResponse.ts
models/PlaylistSearchResult.ts
models/PlaylistTracksResponse.ts
Expand All @@ -127,6 +134,7 @@ models/PrizePublic.ts
models/PrizesResponse.ts
models/ProfilePicture.ts
models/PurchasersResponse.ts
models/ReactCommentRequestBody.ts
models/RedeemAmountResponse.ts
models/RelatedArtistResponse.ts
models/RemixParent.ts
Expand Down Expand Up @@ -190,6 +198,7 @@ models/UpdateDeveloperAppRequestBody.ts
models/UpdatePlaylistRequestBody.ts
models/UpdateTrackRequestBody.ts
models/UpdateUserRequestBody.ts
models/UpdateUserRequestBodyPlaylistLibrary.ts
models/User.ts
models/UserCoin.ts
models/UserCoinAccount.ts
Expand Down
9 changes: 0 additions & 9 deletions packages/sdk/src/sdk/api/generated/default/apis/UsersApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ import {
} from '../models';

export interface CreateUserRequest {
userId: string;
metadata: CreateUserRequestBody;
}

Expand Down Expand Up @@ -549,20 +548,12 @@ export class UsersApi extends runtime.BaseAPI {
* Creates a new user
*/
async createUserRaw(params: CreateUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CreateUserResponse>> {
if (params.userId === null || params.userId === undefined) {
throw new runtime.RequiredError('userId','Required parameter params.userId was null or undefined when calling createUser.');
}

if (params.metadata === null || params.metadata === undefined) {
throw new runtime.RequiredError('metadata','Required parameter params.metadata was null or undefined when calling createUser.');
}

const queryParameters: any = {};

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

const headerParameters: runtime.HTTPHeaders = {};

headerParameters['Content-Type'] = 'application/json';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@
*/

import { exists, mapValues } from '../runtime';
import type { CreateUserRequestBodyEvents } from './CreateUserRequestBodyEvents';
import {
CreateUserRequestBodyEventsFromJSON,
CreateUserRequestBodyEventsFromJSONTyped,
CreateUserRequestBodyEventsToJSON,
} from './CreateUserRequestBodyEvents';
import type { CreateUserRequestBodyPlaylistLibrary } from './CreateUserRequestBodyPlaylistLibrary';
import {
CreateUserRequestBodyPlaylistLibraryFromJSON,
CreateUserRequestBodyPlaylistLibraryFromJSONTyped,
CreateUserRequestBodyPlaylistLibraryToJSON,
} from './CreateUserRequestBodyPlaylistLibrary';

/**
*
* @export
Expand Down Expand Up @@ -128,6 +141,18 @@ export interface CreateUserRequestBody {
* @memberof CreateUserRequestBody
*/
splUsdcPayoutWallet?: string;
/**
*
* @type {CreateUserRequestBodyPlaylistLibrary}
* @memberof CreateUserRequestBody
*/
playlistLibrary?: CreateUserRequestBodyPlaylistLibrary;
/**
*
* @type {CreateUserRequestBodyEvents}
* @memberof CreateUserRequestBody
*/
events?: CreateUserRequestBodyEvents;
}


Expand Down Expand Up @@ -179,6 +204,8 @@ export function CreateUserRequestBodyFromJSONTyped(json: any, ignoreDiscriminato
'profileType': !exists(json, 'profile_type') ? undefined : json['profile_type'],
'allowAiAttribution': !exists(json, 'allow_ai_attribution') ? undefined : json['allow_ai_attribution'],
'splUsdcPayoutWallet': !exists(json, 'spl_usdc_payout_wallet') ? undefined : json['spl_usdc_payout_wallet'],
'playlistLibrary': !exists(json, 'playlist_library') ? undefined : CreateUserRequestBodyPlaylistLibraryFromJSON(json['playlist_library']),
'events': !exists(json, 'events') ? undefined : CreateUserRequestBodyEventsFromJSON(json['events']),
};
}

Expand Down Expand Up @@ -209,6 +236,8 @@ export function CreateUserRequestBodyToJSON(value?: CreateUserRequestBody | null
'profile_type': value.profileType,
'allow_ai_attribution': value.allowAiAttribution,
'spl_usdc_payout_wallet': value.splUsdcPayoutWallet,
'playlist_library': CreateUserRequestBodyPlaylistLibraryToJSON(value.playlistLibrary),
'events': CreateUserRequestBodyEventsToJSON(value.events),
};
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
/**
* API
* Audius V1 API
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { exists, mapValues } from '../runtime';
/**
* User events for tracking referrals and mobile users
* @export
* @interface CreateUserRequestBodyEvents
*/
export interface CreateUserRequestBodyEvents {
/**
* User ID of the referrer
* @type {number}
* @memberof CreateUserRequestBodyEvents
*/
referrer?: number;
/**
* Whether the user is on mobile
* @type {boolean}
* @memberof CreateUserRequestBodyEvents
*/
isMobileUser?: boolean;
}

/**
* Check if a given object implements the CreateUserRequestBodyEvents interface.
*/
export function instanceOfCreateUserRequestBodyEvents(value: object): value is CreateUserRequestBodyEvents {
let isInstance = true;

return isInstance;
}

export function CreateUserRequestBodyEventsFromJSON(json: any): CreateUserRequestBodyEvents {
return CreateUserRequestBodyEventsFromJSONTyped(json, false);
}

export function CreateUserRequestBodyEventsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateUserRequestBodyEvents {
if ((json === undefined) || (json === null)) {
return json;
}
return {

'referrer': !exists(json, 'referrer') ? undefined : json['referrer'],
'isMobileUser': !exists(json, 'is_mobile_user') ? undefined : json['is_mobile_user'],
};
}

export function CreateUserRequestBodyEventsToJSON(value?: CreateUserRequestBodyEvents | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {

'referrer': value.referrer,
'is_mobile_user': value.isMobileUser,
};
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/* tslint:disable */
/* eslint-disable */
// @ts-nocheck
/**
* API
* Audius V1 API
*
* The version of the OpenAPI document: 1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

import { exists, mapValues } from '../runtime';
import type { CreateUserRequestBodyPlaylistLibraryContentsInner } from './CreateUserRequestBodyPlaylistLibraryContentsInner';
import {
CreateUserRequestBodyPlaylistLibraryContentsInnerFromJSON,
CreateUserRequestBodyPlaylistLibraryContentsInnerFromJSONTyped,
CreateUserRequestBodyPlaylistLibraryContentsInnerToJSON,
} from './CreateUserRequestBodyPlaylistLibraryContentsInner';

/**
* User's playlist library with support for folders and playlists
* @export
* @interface CreateUserRequestBodyPlaylistLibrary
*/
export interface CreateUserRequestBodyPlaylistLibrary {
/**
* Array of folders and playlist identifiers
* @type {Array<CreateUserRequestBodyPlaylistLibraryContentsInner>}
* @memberof CreateUserRequestBodyPlaylistLibrary
*/
contents: Array<CreateUserRequestBodyPlaylistLibraryContentsInner>;
}

/**
* Check if a given object implements the CreateUserRequestBodyPlaylistLibrary interface.
*/
export function instanceOfCreateUserRequestBodyPlaylistLibrary(value: object): value is CreateUserRequestBodyPlaylistLibrary {
let isInstance = true;
isInstance = isInstance && "contents" in value && value["contents"] !== undefined;

return isInstance;
}

export function CreateUserRequestBodyPlaylistLibraryFromJSON(json: any): CreateUserRequestBodyPlaylistLibrary {
return CreateUserRequestBodyPlaylistLibraryFromJSONTyped(json, false);
}

export function CreateUserRequestBodyPlaylistLibraryFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateUserRequestBodyPlaylistLibrary {
if ((json === undefined) || (json === null)) {
return json;
}
return {

'contents': ((json['contents'] as Array<any>).map(CreateUserRequestBodyPlaylistLibraryContentsInnerFromJSON)),
};
}

export function CreateUserRequestBodyPlaylistLibraryToJSON(value?: CreateUserRequestBodyPlaylistLibrary | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {

'contents': ((value.contents as Array<any>).map(CreateUserRequestBodyPlaylistLibraryContentsInnerToJSON)),
};
}

Loading
Loading