Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PAY-3646] Remove audius api client #10720

Merged
merged 4 commits into from
Dec 15, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
30 changes: 30 additions & 0 deletions packages/common/src/adapters/activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,36 @@ import { full } from '@audius/sdk'
import { userCollectionMetadataFromSDK } from './collection'
import { userTrackMetadataFromSDK } from './track'

export const activityFromSDK = (input: full.ActivityFull) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I cannot remember if repost and favorite are compatible responses, so this needs some testing 😅

const { timestamp, itemType: item_type, item } = input
if (item_type === full.ActivityFullItemTypeEnum.Track) {
return {
timestamp,
item_type,
item: userTrackMetadataFromSDK(item as full.TrackFull)
}
} else if (item_type === full.ActivityFullItemTypeEnum.Playlist) {
return {
timestamp,
item_type,
item: userCollectionMetadataFromSDK(item as full.PlaylistFull)
}
}
return undefined
}

export const trackActivityFromSDK = (input: full.ActivityFull) => {
const { timestamp, itemType: item_type, item } = input
if (item_type === full.ActivityFullItemTypeEnum.Track) {
return {
timestamp,
item_type,
item: userTrackMetadataFromSDK(item as full.TrackFull)
}
}
return undefined
}

export const repostActivityFromSDK = (input: full.ActivityFull) => {
const { timestamp, itemType: item_type, item } = input
if (item_type === full.ActivityFullItemTypeEnum.Track) {
Expand Down
5 changes: 0 additions & 5 deletions packages/common/src/audius-query/AudiusQueryContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { AudiusSdk } from '@audius/sdk'
import type { Dispatch } from 'redux'
import { getContext } from 'typed-redux-saga'

import type { AudiusAPIClient } from '~/services/audius-api-client'
import type { AuthService, IdentityService } from '~/services/auth'
import {
AudiusBackend,
Expand All @@ -21,7 +20,6 @@ import {
} from '../models'

export type AudiusQueryContextType = {
apiClient: AudiusAPIClient
audiusSdk: () => Promise<AudiusSdk>
audiusBackend: AudiusBackend
authService: AuthService
Expand Down Expand Up @@ -77,9 +75,6 @@ export function* getAudiusQueryContext(): Generator<
> {
// We can't use common typed `getContext` here because of circular dependency
return {
apiClient: yield* getContext<AudiusQueryContextType['apiClient']>(
'apiClient'
),
audiusBackend: yield* getContext<AudiusQueryContextType['audiusBackend']>(
'audiusBackendInstance'
),
Expand Down
172 changes: 0 additions & 172 deletions packages/common/src/services/audius-api-client/AudiusAPIClient.ts

This file was deleted.

Loading