Skip to content

Commit 88cb8b7

Browse files
committed
Drop v1 full from sdk
1 parent da1984f commit 88cb8b7

328 files changed

Lines changed: 99 additions & 41118 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/commands/src/album/get-album.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const getAlbumCommand = new Command('get')
88
.action(async (albumId, { from }) => {
99
const audiusSdk = await initializeAudiusSdk({ handle: from })
1010
const userId = await getCurrentUserId()
11-
const { data: playlist } = await audiusSdk.full.playlists.getPlaylist({
11+
const { data: playlist } = await audiusSdk.playlists.getPlaylist({
1212
userId,
1313
playlistId: albumId
1414
})

packages/commands/src/playlist/get-playlist.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const getPlaylistCommand = new Command('get')
88
.action(async (playlistId, { from }) => {
99
const audiusSdk = await initializeAudiusSdk({ handle: from })
1010
const userId = await getCurrentUserId()
11-
const { data: playlist } = await audiusSdk.full.playlists.getPlaylist({
11+
const { data: playlist } = await audiusSdk.playlists.getPlaylist({
1212
userId,
1313
playlistId
1414
})

packages/commands/src/track/get-track.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const getTrackCommand = new Command('get')
88
.action(async (trackId, { from }) => {
99
const audiusSdk = await initializeAudiusSdk({ handle: from })
1010
const userId = await getCurrentUserId()
11-
const { data: track } = await audiusSdk.full.tracks.getTrack({
11+
const { data: track } = await audiusSdk.tracks.getTrack({
1212
userId,
1313
trackId
1414
})

packages/commands/src/user/get-user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ export const getUserCommand = new Command('get')
88
.action(async (id, { from }) => {
99
const audiusSdk = await initializeAudiusSdk({ handle: from })
1010
const userId = await getCurrentUserId()
11-
const { data: track } = await audiusSdk.full.users.getUser({ userId, id })
11+
const { data: track } = await audiusSdk.users.getUser({ userId, id })
1212
console.info(track)
1313
})

packages/commands/src/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export const getCurrentUserId = async () => {
207207
throw new Error('sdk not initialized')
208208
}
209209
const [address] = await audiusSdk.services.audiusWalletClient.getAddresses()
210-
const { data } = await audiusSdk.full.users.getUserAccount({
210+
const { data } = await audiusSdk.users.getUserAccount({
211211
wallet: address
212212
})
213213
if (!data?.user) {
@@ -224,7 +224,7 @@ export const getCurrentUserHandle = async () => {
224224
return currentHandle
225225
}
226226
const [address] = await audiusSdk.services.audiusWalletClient.getAddresses()
227-
const { data } = await audiusSdk.full.users.getUserAccount({
227+
const { data } = await audiusSdk.users.getUserAccount({
228228
wallet: address
229229
})
230230
if (!data?.user) {

packages/common/src/adapters/activity.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import type {
2-
Activity,
3-
Playlist,
4-
Track
5-
} from '@audius/sdk'
1+
import type { Activity, Playlist, Track } from '@audius/sdk'
62
import { ActivityItemTypeEnum } from '@audius/sdk'
73

84
import { userCollectionMetadataFromSDK } from './collection'

packages/common/src/adapters/collection.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ export const userCollectionMetadataFromSDK = (
127127
? accessConditionsFromSDK(input.streamConditions)
128128
: null,
129129
tracks: transformAndCleanList(
130-
('tracks' in input ? (input.tracks ?? []) : []) as (Track | SearchTrack)[],
130+
('tracks' in input ? (input.tracks ?? []) : []) as (
131+
| Track
132+
| SearchTrack
133+
)[],
131134
userTrackMetadataFromSDK
132135
),
133136
user,

packages/common/src/adapters/imageSize.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import type {
2-
CoverArt,
3-
CoverPhoto,
4-
ProfilePicture
5-
} from '@audius/sdk'
1+
import type { CoverArt, CoverPhoto, ProfilePicture } from '@audius/sdk'
62

73
import {
84
CoverArtSizesCids,

packages/common/src/adapters/user.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ import { playlistLibraryFromSDK } from './playlistLibrary'
3434
import { transformAndCleanList } from './utils'
3535

3636
/** Converts a SDK User response to a UserMetadata. Note: Will _not_ include the "current user" fields as those aren't returned by the Users API */
37-
export const userMetadataFromSDK = (
38-
input: User
39-
): UserMetadata | undefined => {
37+
export const userMetadataFromSDK = (input: User): UserMetadata | undefined => {
4038
const decodedUserId = OptionalHashId.parse(input.id)
4139
if (!decodedUserId) {
4240
return undefined
@@ -82,7 +80,9 @@ export const userMetadataFromSDK = (
8280
? (() => {
8381
const pic = input.profilePicture!
8482
const mirrors =
85-
'mirrors' in pic && Array.isArray(pic.mirrors) ? pic.mirrors : undefined
83+
'mirrors' in pic && Array.isArray(pic.mirrors)
84+
? pic.mirrors
85+
: undefined
8686
return {
8787
'150x150': pic._150x150,
8888
'480x480': pic._480x480,

packages/common/src/api/tan-query/batchers/__tests__/getCollectionsBatcher.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ describe('getCollectionsBatcher', () => {
116116
playlists: {
117117
getBulkPlaylists: vi
118118
.fn()
119-
.mockImplementation((params: GetBulkPlaylistsRequest) => {
120-
const collections = params.id?.map((collectionId) =>
121-
createMockSdkCollection(HashId.parse(collectionId))
122-
)
123-
return Promise.resolve({ data: collections })
124-
})
119+
.mockImplementation((params: GetBulkPlaylistsRequest) => {
120+
const collections = params.id?.map((collectionId) =>
121+
createMockSdkCollection(HashId.parse(collectionId))
122+
)
123+
return Promise.resolve({ data: collections })
124+
})
125125
}
126126
} as unknown as BatchContext['sdk']
127127

0 commit comments

Comments
 (0)