Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into pay-2842-manager-mode…
Browse files Browse the repository at this point in the history
…-pay-and-earn

* origin/main:
  [C-4353] Add recent searches to search v2 (#8615)
  [QA-1335] Fix embed for non-premium tracks (#8658)
  Upgrade mobile apps to .99 (#8655)
  Fix sdk typecheck (#8656)
  [C-4427] react-native-video rough POC (#8654)
  Small fix to static image imports (#8653)
  Version Packages (#8189)
  [C-4309] Add ssr metatags (#8649)
  Audius Protocol v0.6.115
  Move EditTrackForm to edit-track component directory (#8641)
  [C-4320] Add web mobile profile page for SSR (#8642)
  [QA-1330] Fix mobile track edit button (#8644)
  [QA-1325] Fix playing icon position (#8643)
  • Loading branch information
schottra committed May 30, 2024
2 parents e08e731 + 15a34b3 commit ff1dc8c
Show file tree
Hide file tree
Showing 174 changed files with 2,345 additions and 502 deletions.
5 changes: 0 additions & 5 deletions .changeset/breezy-avocados-sip.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/calm-pens-teach.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/healthy-ants-wave.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/lucky-otters-look.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/nervous-rules-shop.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/new-taxis-trade.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/old-humans-wash.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/plenty-toes-report.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/six-pens-flash.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/sixty-bugs-eat.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/spicy-bananas-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@audius/sdk': minor
---

Add getUsers and getPlaylists methods
6 changes: 0 additions & 6 deletions .changeset/spicy-elephants-shout.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tame-bears-hope.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/violet-cups-bake.md

This file was deleted.

31 changes: 31 additions & 0 deletions docs/docs/developers/sdk/albums.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,37 @@ album as described below.

---

### getBulkAlbums

#### getBulkAlbum(`params`)

Get a list of albums by id.

Example:

```ts
const { data: albums } = await audiusSdk.album.getBulkAlbum({
id: ['D7KyD', '68yPZb'],
})

console.log(albums)
```

#### Params

Create an object with the following fields and pass it as the first argument, as shown in the
example above.

| Name | Type | Description | Required? |
| :--- | :--------- | :-------------------- | :----------- |
| `id` | `string[]` | The IDs of the albums | **Required** |

#### Returns

Returns an array of albums, see [`getAlbum`](#getalbum).

---

### getAlbumTracks

#### getAlbumTracks(`params`)
Expand Down
31 changes: 31 additions & 0 deletions docs/docs/developers/sdk/playlists.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,37 @@ playlist as described below.

---

### getBulkPlaylists

#### getBulkPlaylists(`params`)

Get a list of playlists by id.

Example:

```ts
const { data: playlists } = await audiusSdk.playlists.getBulkPlaylists({
id: ['D7KyD', '68yPZb'],
})

console.log(playlists)
```

#### Params

Create an object with the following fields and pass it as the first argument, as shown in the
example above.

| Name | Type | Description | Required? |
| :---- | :--------- | :----------------------- | :----------- |
| `ids` | `string[]` | The IDs of the playlists | **Required** |

#### Returns

Returns an array of playlists, see [`getPlaylist`](#getplaylist).

---

### getPlaylistTracks

#### getPlaylistTracks(`params`)
Expand Down
31 changes: 31 additions & 0 deletions docs/docs/developers/sdk/users.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,37 @@ user as described below.

---

### getBulkUsers

#### getBulkUser(`params`)

Gets a list of users.

Example:

```ts
const { data: users } = await audiusSdk.users.getBulkUsers({
id: ['eAZl3', 'v7O9O'],
})

console.log(users)
```

#### Params

Create an object with the following fields and pass it as the first argument, as shown in the
example above.

| Name | Type | Description | Required? |
| :--- | :--------- | :------------------- | :----------- |
| `id` | `string[]` | The IDs of the users | **Required** |

#### Returns

Returns an array of users, see [`getUser`](#getuser).

---

### getAIAttributedTracksByUserHandle

#### getAIAttributedTracksByUserHandle(`params`)
Expand Down
2 changes: 1 addition & 1 deletion mediorum/.version.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"version": "0.6.114",
"version": "0.6.115",
"service": "content-node"
}
16 changes: 3 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 11 additions & 2 deletions packages/common/src/api/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,26 @@ const collectionApi = createApi({
{
playlistId,
currentUserId
}: { playlistId: Nullable<ID>; currentUserId: Nullable<ID> },
}: { playlistId: Nullable<ID>; currentUserId?: Nullable<ID> },
{ apiClient }
) => {
if (!playlistId) return null
return (
await apiClient.getPlaylist({
playlistId,
currentUserId
currentUserId: currentUserId ?? null
})
)[0]
},
fetchBatch: async (
{ ids, currentUserId }: { ids: ID[]; currentUserId?: Nullable<ID> },
{ apiClient }
) => {
return await apiClient.getPlaylists({
playlistIds: ids,
currentUserId: currentUserId ?? null
})
},
options: {
idArgKey: 'playlistId',
kind: Kind.COLLECTIONS,
Expand Down
18 changes: 9 additions & 9 deletions packages/common/src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
export * from './relatedArtists'
export * from './track'
export * from './account'
export * from './authorizedApps'
export * from './collection'
export * from './user'
export * from './developerApps'
export * from './authorizedApps'
export * from './suggestedTracks'
export * from './trending'
export * from './library'
export * from './purchases'
export * from './utils'
export * from './topArtists'
export * from './account'
export * from './relatedArtists'
export * from './signUp'
export * from './suggestedTracks'
export * from './topArtists'
export * from './track'
export * from './trending'
export * from './user'
export * from './utils'
14 changes: 7 additions & 7 deletions packages/common/src/api/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ import { trendingApiReducer } from './trending'
import { userApiReducer } from './user'

export default combineReducers({
accountApi: accountApiReducer,
authorizedAppsApi: authorizedAppsApiReducer,
collectionApi: collectionApiReducer,
relatedArtistsApi: relatedArtistsApiReducer,
trackApi: trackApiReducer,
userApi: userApiReducer,
developerAppsApi: developerAppsApiReducer,
authorizedAppsApi: authorizedAppsApiReducer,
favoritesApi: favoritesApiReducer,
trendingApi: trendingApiReducer,
libraryApi: libraryApiReducer,
purchasesApi: purchasesApiReducer,
relatedArtistsApi: relatedArtistsApiReducer,
signUpApi: signUpReducer,
topArtistsApi: topArtistsApiReducer,
accountApi: accountApiReducer,
signUpApi: signUpReducer
trackApi: trackApiReducer,
trendingApi: trendingApiReducer,
userApi: userApiReducer
})
4 changes: 2 additions & 2 deletions packages/common/src/api/track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ const trackApi = createApi({
endpoints: {
getTrackById: {
fetch: async (
{ id, currentUserId }: { id: ID; currentUserId?: ID },
{ id, currentUserId }: { id: ID; currentUserId?: Nullable<ID> },
{ apiClient }
) => {
return await apiClient.getTrack({ id, currentUserId })
},
fetchBatch: async (
{ ids, currentUserId }: { ids: ID[]; currentUserId?: ID },
{ ids, currentUserId }: { ids: ID[]; currentUserId?: Nullable<ID> },
{ apiClient }
) => {
return (
Expand Down
13 changes: 12 additions & 1 deletion packages/common/src/api/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const userApi = createApi({
endpoints: {
getUserById: {
fetch: async (
{ id, currentUserId }: { id: ID; currentUserId: Nullable<ID> },
{ id, currentUserId }: { id: ID; currentUserId?: Nullable<ID> },
{ audiusSdk }
) => {
const sdk = await audiusSdk()
Expand All @@ -56,6 +56,17 @@ const userApi = createApi({
})
return userMetadataListFromSDK(users)[0]
},
fetchBatch: async (
{ ids, currentUserId }: { ids: ID[]; currentUserId?: Nullable<ID> },
{ audiusSdk }
) => {
const sdk = await audiusSdk()
const { data: users = [] } = await sdk.full.users.getBulkUsers({
id: ids.map((id) => Id.parse(id)),
userId: OptionalId.parse(currentUserId)
})
return userMetadataListFromSDK(users)
},
options: {
idArgKey: 'id',
kind: Kind.USERS,
Expand Down
Loading

0 comments on commit ff1dc8c

Please sign in to comment.