diff --git a/docs/docs/developers/advancedOptions.md b/docs/docs/developers/advancedOptions.mdx similarity index 100% rename from docs/docs/developers/advancedOptions.md rename to docs/docs/developers/advancedOptions.mdx diff --git a/docs/docs/developers/hedgehog.md b/docs/docs/developers/hedgehog.mdx similarity index 100% rename from docs/docs/developers/hedgehog.md rename to docs/docs/developers/hedgehog.mdx diff --git a/docs/docs/developers/log-in-with-audius.md b/docs/docs/developers/log-in-with-audius.mdx similarity index 99% rename from docs/docs/developers/log-in-with-audius.md rename to docs/docs/developers/log-in-with-audius.mdx index 1009ce26984..03df9b2d6ac 100644 --- a/docs/docs/developers/log-in-with-audius.md +++ b/docs/docs/developers/log-in-with-audius.mdx @@ -215,7 +215,7 @@ Be careful to not expose API secrets on your frontend! - [Read full SDK `oauth` docs](sdk-oauth-methods) -- [Explore the API docs](./developers/sdk/Tracks) +- [Explore the API docs](/developers/sdk/Tracks) :::note diff --git a/docs/docs/developers/rest-api.md b/docs/docs/developers/rest-api.mdx similarity index 100% rename from docs/docs/developers/rest-api.md rename to docs/docs/developers/rest-api.mdx diff --git a/docs/docs/developers/sdk-oauth-methods.md b/docs/docs/developers/sdk-oauth-methods.mdx similarity index 100% rename from docs/docs/developers/sdk-oauth-methods.md rename to docs/docs/developers/sdk-oauth-methods.mdx diff --git a/docs/docs/developers/sdk/Albums.md b/docs/docs/developers/sdk/Albums.md deleted file mode 100644 index 6ebaebede5a..00000000000 --- a/docs/docs/developers/sdk/Albums.md +++ /dev/null @@ -1,471 +0,0 @@ -### getAlbum - -#### getAlbum(`params`) - -Get an album by id. - -Example: - -```typescript -const { data: album } = await audiusSdk.album.getAlbum({ - playlistId: "D7KyD", -}); - -console.log(album); -``` - -#### 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? | -| :-------- | :------- | :------------------ | :----------- | -| `albumId` | `string` | The ID of the album | **Required** | - -#### Returns - -Returns a `Promise` containing an object with a `data` field. `data` contains information about the album as described below. - -```ts -{ - artwork?: { - _1000x1000?: string; - _150x150?: string; - _480x480?: string; - }; - coverArtSizes?: string; - description?: string; - favoriteCount: number; - id: string; - isImageAutogenerated?: boolean; - isPrivate: boolean; - permalink?: string; - playlistContents: { - metadataTimestamp: number; - timestamp: number; - trackId: string; - }; - playlistName: string; - repostCount: number; - totalPlayCount: number; - user: { - albumCount: number; - artistPickTrackId?: string; - bio?: string; - coverPhoto?: { - _2000?: string; - _640?: string; - }; - doesFollowCurrentUser?: boolean; - ercWallet: string; - followeeCount: number; - followerCount: number; - handle: string; - id: string; - isAvailable: boolean; - isDeactivated: boolean; - isVerified: boolean; - location?: string; - name: string; - playlistCount: number; - profilePicture?: { - _1000x1000?: string; - _150x150?: string; - _480x480?: string; - }; - repostCount: number; - splWallet: string; - supporterCount: number; - supportingCount: number; - totalAudioBalance: number; - trackCount: number; - }; -}; -``` - ---- - -### getAlbumTracks - -#### getAlbumTracks(`params`) - -Get the tracks in an album. - -Example: - -```typescript -const { data: tracks } = await audiusSdk.albums.getAlbumTracks({ - albumId: "D7KyD", -}); - -console.log(tracks); -``` - -#### 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? | -| :-------- | :------- | :------------------ | :----------- | -| `albumId` | `string` | The ID of the album | **Required** | - -#### Returns - -The return type is the same as [`getBulkTracks`](Tracks#getbulktracks) - ---- - -### uploadAlbum - -#### uploadAlbum(`params`, `advancedOptions?`) - -Upload an album. - -Example: - -```typescript -import { Mood, Genre } from "@audius/sdk"; -import fs from "fs"; - -const coverArtBuffer = fs.readFileSync("path/to/cover-art.png"); -const trackBuffer1 = fs.readFileSync("path/to/track1.mp3"); -const trackBuffer2 = fs.readFileSync("path/to/track2.mp3"); -const trackBuffer3 = fs.readFileSync("path/to/track3.mp3"); - -const { albumId } = await audiusSdk.albums.uploadTrack({ - userId: "7eP5n", - coverArtFile: { - buffer: Buffer.from(coverArtBuffer), - name: "coverArt", - }, - metadata: { - albumName: "Songs of the Forest", - description: "My debut album.", - genre: Genre.ELECTRONIC, - mood: Mood.TENDER, - tags: "nature", - releaseDate: new Date("2023-07-20"), // Cannot be in the future - }, - trackMetadatas: [ - { - title: "Oak", - }, - { - title: "Sycamore", - }, - { - title: "Bush", - }, - ], - trackFiles: [ - { - buffer: Buffer.from(trackBuffer1), - name: "OakTrack", - }, - { - buffer: Buffer.from(trackBuffer2), - name: "SycamoreTrack", - }, - { - buffer: Buffer.from(trackBuffer3), - name: "BushTrack", - }, - ], -}); -``` - -#### `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? | -| :--------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- | :----------- | -| `coverArtFile` | `File` | A file that will be used as the cover art for the album | _Optional_ | -| `metadata` | {
  genre: Genre;
  albumName: string;
  description?: string;
  license?: string;
  mood?: Mood;
  releaseDate?: Date;
  tags?: string;
  upc?: string;
}
| An object containing the details of the album | **Required** | -| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | -| `trackFiles` | `Array` | An array of track audio files | **Required** | -| `trackMetadatas` | [`UploadTrackMetadata`](/developers/UploadTrackMetadata)`[]` | An array of track files | _Optional_ | -| `userId` | `string` | The ID of the user | **Required** | - -#### `advancedOptions` parameters (advanced) - -You can pass an optional [`advancedOptions`](/developers/advancedOptions) object as the second argument. - -#### Returns - -Returns a `Promise` containing an object with the new album's ID (`albumId`), as well as the block hash (`blockHash`) and block number (`blockNumber`) for the transaction. - -```ts -{ - blockHash: string; - blockNumber: number; - albumId: string; -} -``` - ---- - -### updateAlbum - -#### updateAlbum(`params`, `advancedOptions?`) - -Update an album. If cover art or any metadata fields are not provided, their values will be kept the same as before. - -Example: - -```typescript -import fs from "fs"; - -const coverArtBuffer = fs.readFileSync("path/to/updated-cover-art.png"); - -const { albumId } = await audiusSdk.albums.updateAlbum({ - albumId: "x5pJ3Az", - coverArtFile: { - buffer: Buffer.from(coverArtBuffer), - name: "coverArt", - }, - metadata: { - description: "The best tracks for Fido... new cover art!", - }, - onProgress: (progress) => { - console.log("Progress: ", progress / 100); - }, - userId: "7eP5n", -}); -``` - -#### `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? | -| :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- | :----------- | -| `albumId` | `string` | The ID of the album | **Required** | -| `userId` | `string` | The ID of the User | **Required** | -| `coverArtFile` | `string` | A file that will be used as the cover art for the album | _Optional_ | -| `metadata` | {
  albumName?: string;
  description?: string;
  albumContents?: {trackId: string, time: number}[],
  license?: string;
  mood?: Mood;
  releaseDate?: Date;
  tags?: string;
  upc?: string;
}
| An object containing the details of the album | **Required** | -| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | - -#### `advancedOptions` - -You can pass an optional [`advancedOptions`](/developers/advancedOptions) object as the second argument. - -#### Returns - -Returns a `Promise` containing an object with the block hash (`blockHash`) and block number (`blockNumber`) for the transaction. - -```ts - - blockHash: string; - blockNumber: number; -}; -``` - ---- - -### deleteAlbum - -#### deleteAlbum(`params`, `advancedOptions?`) - -Delete an album - -Example: - -```typescript -await audiusSdk.albums.deleteAlbum({ - albumId: "x5pJ3Bo", - userId: "7eP5n", -}); -``` - -#### `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? | -| :-------- | :------- | :------------------ | :----------- | -| `albumId` | `string` | The ID of the album | **Required** | -| `userId` | `string` | The ID of the User | **Required** | - -#### `advancedOptions` - -You can pass an optional [`advancedOptions`](/developers/advancedOptions) object as the second argument. - -#### Returns - -Returns a `Promise` containing an object with the block hash (`blockHash`) and block number (`blockNumber`) for the transaction. - -```ts -{ - blockHash: string; - blockNumber: number; -} -``` - ---- - -### favoriteAlbum - -#### favoriteAlbum(`params`, `advancedOptions?`) - -Favorite an album - -Example: - -```typescript -await audiusSdk.albums.favoriteAlbum({ - albumId: "x5pJ3Az", - userId: "7eP5n", -}); -``` - -#### `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? | -| :--------- | :----------------------------------------------------------- | :---------------------------------------------- | :----------- | -| `albumId` | `string` | The ID of the album | **Required** | -| `userId` | `string` | The ID of the User | **Required** | -| `metadata` | {
  isSaveOfRepost: boolean
}
| An object containing details about the favorite | _Optional_ | - -#### `advancedOptions` - -You can pass an optional [`advancedOptions`](/developers/advancedOptions) object as the second argument. - -#### Returns - -Returns a `Promise` containing an object with the block hash (`blockHash`) and block number (`blockNumber`) for the transaction. - -```ts -{ - blockHash: string; - blockNumber: number; -} -``` - ---- - -### unfavoriteAlbum - -#### unfavoriteAlbum(`params`, `advancedOptions?`) - -Unfavorite an album - -Example: - -```typescript -await audiusSdk.albums.unfavoriteAlbum({ - albumId: "x5pJ3Az", - userId: "7eP5n", -}); -``` - -#### `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? | -| :-------- | :------- | :------------------ | :----------- | -| `albumId` | `string` | The ID of the album | **Required** | -| `userId` | `string` | The ID of the User | **Required** | - -#### `advancedOptions` - -You can pass an optional [`advancedOptions`](/developers/advancedOptions) object as the second argument. - -#### Returns - -Returns a `Promise` containing an object with the block hash (`blockHash`) and block number (`blockNumber`) for the transaction. - -```ts -{ - blockHash: string; - blockNumber: number; -} -``` - ---- - -### repostAlbum - -#### repostAlbum(`params`, `advancedOptions?`) - -Repost a album - -Example: - -```typescript -await audiusSdk.albums.repostAlbum({ - albumId: "x5pJ3Az", - userId: "7eP5n", -}); -``` - -#### `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? | -| :--------- | :------------------------------------------------------------- | :-------------------------------------------- | :----------- | -| `albumId` | `string` | The ID of the album | **Required** | -| `userId` | `string` | The ID of the User | **Required** | -| `metadata` | {
  isRepostOfRepost: boolean
}
| An object containing details about the repost | _Optional_ | - -#### `advancedOptions` - -You can pass an optional [`advancedOptions`](/developers/advancedOptions) object as the second argument. - -#### Returns - -Returns a `Promise` containing an object with the block hash (`blockHash`) and block number (`blockNumber`) for the transaction. - -```ts -{ - blockHash: string; - blockNumber: number; -} -``` - ---- - -### unrepostAlbum - -#### unrepostAlbum(`params`, `advancedOptions?`) - -Unrepost an album - -Example: - -```typescript -await audiusSdk.albums.unrepostAlbum({ - albumId: "x5pJ3Az", - userId: "7eP5n", -}); -``` - -#### `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? | -| :-------- | :------- | :------------------ | :----------- | -| `albumId` | `string` | The ID of the album | **Required** | -| `userId` | `string` | The ID of the User | **Required** | - -#### `advancedOptions` - -You can pass an optional [`advancedOptions`](/developers/advancedOptions) object as the second argument. - -#### Returns - -Returns a `Promise` containing an object with the block hash (`blockHash`) and block number (`blockNumber`) for the transaction. - -```ts -{ - blockHash: string; - blockNumber: number; -} -``` - ---- diff --git a/docs/docs/developers/sdk/Albums.mdx b/docs/docs/developers/sdk/Albums.mdx new file mode 100644 index 00000000000..8f5cd909814 --- /dev/null +++ b/docs/docs/developers/sdk/Albums.mdx @@ -0,0 +1,509 @@ +### getAlbum + +#### getAlbum(`params`) + +Get an album by id. + +Example: + +```typescript +const { data: album } = await audiusSdk.album.getAlbum({ + playlistId: 'D7KyD' +}) + +console.log(album) +``` + +#### 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? | +| :-------- | :------- | :------------------ | :----------- | +| `albumId` | `string` | The ID of the album | **Required** | + +#### Returns + +Returns a `Promise` containing an object with a `data` field. `data` contains information about the album as described below. + +```ts +{ + artwork?: { + _1000x1000?: string; + _150x150?: string; + _480x480?: string; + }; + coverArtSizes?: string; + description?: string; + favoriteCount: number; + id: string; + isImageAutogenerated?: boolean; + isPrivate: boolean; + permalink?: string; + playlistContents: { + metadataTimestamp: number; + timestamp: number; + trackId: string; + }; + playlistName: string; + repostCount: number; + totalPlayCount: number; + user: { + albumCount: number; + artistPickTrackId?: string; + bio?: string; + coverPhoto?: { + _2000?: string; + _640?: string; + }; + doesFollowCurrentUser?: boolean; + ercWallet: string; + followeeCount: number; + followerCount: number; + handle: string; + id: string; + isAvailable: boolean; + isDeactivated: boolean; + isVerified: boolean; + location?: string; + name: string; + playlistCount: number; + profilePicture?: { + _1000x1000?: string; + _150x150?: string; + _480x480?: string; + }; + repostCount: number; + splWallet: string; + supporterCount: number; + supportingCount: number; + totalAudioBalance: number; + trackCount: number; + }; +}; +``` + +--- + +### getAlbumTracks + +#### getAlbumTracks(`params`) + +Get the tracks in an album. + +Example: + +```typescript +const { data: tracks } = await audiusSdk.albums.getAlbumTracks({ + albumId: 'D7KyD' +}) + +console.log(tracks) +``` + +#### 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? | +| :-------- | :------- | :------------------ | :----------- | +| `albumId` | `string` | The ID of the album | **Required** | + +#### Returns + +The return type is the same as [`getBulkTracks`](Tracks#getbulktracks) + +--- + +### uploadAlbum + +#### uploadAlbum(`params`, `advancedOptions?`) + +Upload an album. + +Example: + +```typescript +import { Mood, Genre } from '@audius/sdk' +import fs from 'fs' + +const coverArtBuffer = fs.readFileSync('path/to/cover-art.png') +const trackBuffer1 = fs.readFileSync('path/to/track1.mp3') +const trackBuffer2 = fs.readFileSync('path/to/track2.mp3') +const trackBuffer3 = fs.readFileSync('path/to/track3.mp3') + +const { albumId } = await audiusSdk.albums.uploadTrack({ + userId: '7eP5n', + coverArtFile: { + buffer: Buffer.from(coverArtBuffer), + name: 'coverArt' + }, + metadata: { + albumName: 'Songs of the Forest', + description: 'My debut album.', + genre: Genre.ELECTRONIC, + mood: Mood.TENDER, + tags: 'nature', + releaseDate: new Date('2023-07-20') // Cannot be in the future + }, + trackMetadatas: [ + { + title: 'Oak' + }, + { + title: 'Sycamore' + }, + { + title: 'Bush' + } + ], + trackFiles: [ + { + buffer: Buffer.from(trackBuffer1), + name: 'OakTrack' + }, + { + buffer: Buffer.from(trackBuffer2), + name: 'SycamoreTrack' + }, + { + buffer: Buffer.from(trackBuffer3), + name: 'BushTrack' + } + ] +}) +``` + +#### `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? | +| :--------------- | :----------------------------------------------------------- | :---------------------------------------------------------------------------- | :----------- | +| `coverArtFile` | `File` | A file that will be used as the cover art for the album | _Optional_ | +| `metadata` | _see code block below_ | An object containing the details of the album | **Required** | +| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | +| `trackFiles` | `Array` | An array of track audio files | **Required** | +| `trackMetadatas` | [`UploadTrackMetadata`](/developers/UploadTrackMetadata)`[]` | An array of track files | _Optional_ | +| `userId` | `string` | The ID of the user | **Required** | + +```json title="uploadAlbum metadata payload" +{ + genre: Genre; + albumName: string; + description?: string; + license?: string; + mood?: Mood; + releaseDate?: Date; + tags?: string; + upc?: string; +} +``` + +#### `advancedOptions` parameters (advanced) + +You can pass an optional [`advancedOptions`](/developers/advancedOptions) object as the second argument. + +#### Returns + +Returns a `Promise` containing an object with the new album's ID (`albumId`), as well as the block hash (`blockHash`) and block number (`blockNumber`) for the transaction. + +```ts +{ + blockHash: string + blockNumber: number + albumId: string +} +``` + +--- + +### updateAlbum + +#### updateAlbum(`params`, `advancedOptions?`) + +Update an album. If cover art or any metadata fields are not provided, their values will be kept the same as before. + +Example: + +```typescript +import fs from 'fs' + +const coverArtBuffer = fs.readFileSync('path/to/updated-cover-art.png') + +const { albumId } = await audiusSdk.albums.updateAlbum({ + albumId: 'x5pJ3Az', + coverArtFile: { + buffer: Buffer.from(coverArtBuffer), + name: 'coverArt' + }, + metadata: { + description: 'The best tracks for Fido... new cover art!' + }, + onProgress: (progress) => { + console.log('Progress: ', progress / 100) + }, + userId: '7eP5n' +}) +``` + +#### `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? | +| :------------- | :--------------------------- | :---------------------------------------------------------------------------- | :----------- | +| `albumId` | `string` | The ID of the album | **Required** | +| `userId` | `string` | The ID of the User | **Required** | +| `coverArtFile` | `string` | A file that will be used as the cover art for the album | _Optional_ | +| `metadata` | _see code block below_ | An object containing the details of the album | **Required** | +| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | + +```json title="updateAlbum metadata payload" +{ + albumName?: string; + description?: string; + albumContents?: {trackId: string, time: number}[], + license?: string; + mood?: Mood; + releaseDate?: Date; + tags?: string; + upc?: string; +} +``` + +#### `advancedOptions` + +You can pass an optional [`advancedOptions`](/developers/advancedOptions) object as the second argument. + +#### Returns + +Returns a `Promise` containing an object with the block hash (`blockHash`) and block number (`blockNumber`) for the transaction. + +```ts + + blockHash: string; + blockNumber: number; +}; +``` + +--- + +### deleteAlbum + +#### deleteAlbum(`params`, `advancedOptions?`) + +Delete an album + +Example: + +```typescript +await audiusSdk.albums.deleteAlbum({ + albumId: 'x5pJ3Bo', + userId: '7eP5n' +}) +``` + +#### `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? | +| :-------- | :------- | :------------------ | :----------- | +| `albumId` | `string` | The ID of the album | **Required** | +| `userId` | `string` | The ID of the User | **Required** | + +#### `advancedOptions` + +You can pass an optional [`advancedOptions`](/developers/advancedOptions) object as the second argument. + +#### Returns + +Returns a `Promise` containing an object with the block hash (`blockHash`) and block number (`blockNumber`) for the transaction. + +```ts +{ + blockHash: string + blockNumber: number +} +``` + +--- + +### favoriteAlbum + +#### favoriteAlbum(`params`, `advancedOptions?`) + +Favorite an album + +Example: + +```typescript +await audiusSdk.albums.favoriteAlbum({ + albumId: 'x5pJ3Az', + userId: '7eP5n' +}) +``` + +#### `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? | +| :--------- | :--------------------- | :---------------------------------------------- | :----------- | +| `albumId` | `string` | The ID of the album | **Required** | +| `userId` | `string` | The ID of the User | **Required** | +| `metadata` | _see code block below_ | An object containing details about the favorite | _Optional_ | + +```json title="favoriteAlbum metadata payload" +{ + isSaveOfRepost: boolean +} +``` + +#### `advancedOptions` + +You can pass an optional [`advancedOptions`](/developers/advancedOptions) object as the second argument. + +#### Returns + +Returns a `Promise` containing an object with the block hash (`blockHash`) and block number (`blockNumber`) for the transaction. + +```ts +{ + blockHash: string + blockNumber: number +} +``` + +--- + +### unfavoriteAlbum + +#### unfavoriteAlbum(`params`, `advancedOptions?`) + +Unfavorite an album + +Example: + +```typescript +await audiusSdk.albums.unfavoriteAlbum({ + albumId: 'x5pJ3Az', + userId: '7eP5n' +}) +``` + +#### `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? | +| :-------- | :------- | :------------------ | :----------- | +| `albumId` | `string` | The ID of the album | **Required** | +| `userId` | `string` | The ID of the User | **Required** | + +#### `advancedOptions` + +You can pass an optional [`advancedOptions`](/developers/advancedOptions) object as the second argument. + +#### Returns + +Returns a `Promise` containing an object with the block hash (`blockHash`) and block number (`blockNumber`) for the transaction. + +```ts +{ + blockHash: string + blockNumber: number +} +``` + +--- + +### repostAlbum + +#### repostAlbum(`params`, `advancedOptions?`) + +Repost a album + +Example: + +```typescript +await audiusSdk.albums.repostAlbum({ + albumId: 'x5pJ3Az', + userId: '7eP5n' +}) +``` + +#### `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? | +| :--------- | :--------------------- | :-------------------------------------------- | :----------- | +| `albumId` | `string` | The ID of the album | **Required** | +| `userId` | `string` | The ID of the User | **Required** | +| `metadata` | _see code block below_ | An object containing details about the repost | _Optional_ | + +```json title="repostAlbum metadata payload" +{ + isRepostOfRepost: boolean +} +``` + +#### `advancedOptions` + +You can pass an optional [`advancedOptions`](/developers/advancedOptions) object as the second argument. + +#### Returns + +Returns a `Promise` containing an object with the block hash (`blockHash`) and block number (`blockNumber`) for the transaction. + +```ts +{ + blockHash: string + blockNumber: number +} +``` + +--- + +### unrepostAlbum + +#### unrepostAlbum(`params`, `advancedOptions?`) + +Unrepost an album + +Example: + +```typescript +await audiusSdk.albums.unrepostAlbum({ + albumId: 'x5pJ3Az', + userId: '7eP5n' +}) +``` + +#### `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? | +| :-------- | :------- | :------------------ | :----------- | +| `albumId` | `string` | The ID of the album | **Required** | +| `userId` | `string` | The ID of the User | **Required** | + +#### `advancedOptions` + +You can pass an optional [`advancedOptions`](/developers/advancedOptions) object as the second argument. + +#### Returns + +Returns a `Promise` containing an object with the block hash (`blockHash`) and block number (`blockNumber`) for the transaction. + +```ts +{ + blockHash: string + blockNumber: number +} +``` + +--- diff --git a/docs/docs/developers/sdk/Playlists.md b/docs/docs/developers/sdk/Playlists.mdx similarity index 67% rename from docs/docs/developers/sdk/Playlists.md rename to docs/docs/developers/sdk/Playlists.mdx index bb7e24512bc..55e4b6e6293 100644 --- a/docs/docs/developers/sdk/Playlists.md +++ b/docs/docs/developers/sdk/Playlists.mdx @@ -264,13 +264,21 @@ const { playlistId } = await audiusSdk.playlists.createPlaylist({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------- | :----------- | -| `coverArtFile` | `File` | A file that will be used as the cover art for the playlist | _Optional_ | -| `metadata` | {
  playlistName: string;
  description?: string;
  isPrivate?: boolean;  
}
| An object containing the details of the playlist | **Required** | -| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | -| `trackIds` | `Array` | An array of track IDs to be included in the playlist | **Required** | -| `userId` | `string` | The ID of the user | **Required** | +| Name | Type | Description | Required? | +| :------------- | :--------------------------- | :---------------------------------------------------------------------------- | :----------- | +| `coverArtFile` | `File` | A file that will be used as the cover art for the playlist | _Optional_ | +| `metadata` | _see code block below_ | An object containing the details of the playlist | **Required** | +| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | +| `trackIds` | `Array` | An array of track IDs to be included in the playlist | **Required** | +| `userId` | `string` | The ID of the user | **Required** | + +```json title="createPlaylist metadata payload" +{ + playlistName: string; + description?: string; + isPrivate?: boolean; +} +``` #### `advancedOptions` @@ -356,14 +364,27 @@ const { playlistId } = await audiusSdk.playlists.uploadPlaylist({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :--------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- | :----------- | -| `coverArtFile` | `File` | A file that will be used as the cover art for the playlist | _Optional_ | -| `metadata` | {
  genre: Genre;
  playlistName: string;
  description?: string;
  license?: string;
  mood?: Mood;
  releaseDate?: Date;
  tags?: string;
  upc?: string;
}
| An object containing the details of the playlist | **Required** | -| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | -| `trackFiles` | `Array` | An array of track audio files | **Required** | -| `trackMetadatas` | [`UploadTrackMetadata`](/developers/UploadTrackMetadata)`[]` | An array of track files | _Optional_ | -| `userId` | `string` | The ID of the user | **Required** | +| Name | Type | Description | Required? | +| :--------------- | :----------------------------------------------------------- | :---------------------------------------------------------------------------- | :----------- | +| `coverArtFile` | `File` | A file that will be used as the cover art for the playlist | _Optional_ | +| `metadata` | _see code sample below_ | An object containing the details of the playlist | **Required** | +| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | +| `trackFiles` | `Array` | An array of track audio files | **Required** | +| `trackMetadatas` | [`UploadTrackMetadata`](/developers/UploadTrackMetadata)`[]` | An array of track files | _Optional_ | +| `userId` | `string` | The ID of the user | **Required** | + +```json +{ + genre: Genre; + playlistName: string; + description?: string; + license?: string; + mood?: Mood; + releaseDate?: Date; + tags?: string; + upc?: string; +} +``` #### `advancedOptions` @@ -514,13 +535,26 @@ const { playlistId } = await audiusSdk.playlists.updatePlaylist({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- | :----------- | -| `playlistId` | `string` | The ID of the playlist | **Required** | -| `userId` | `string` | The ID of the User | **Required** | -| `coverArtFile` | `string` | A file that will be used as the cover art for the playlist | _Optional_ | -| `metadata` | {
  playlistName?: string;
  description?: string;
  playlistContents?: {trackId: string, time: number}[],
  license?: string;
  mood?: Mood;
  releaseDate?: Date;
  tags?: string;
  upc?: string;
}
| An object containing the details of the playlist | **Required** | -| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | +| Name | Type | Description | Required? | +| :------------- | :--------------------------- | :---------------------------------------------------------------------------- | :----------- | +| `playlistId` | `string` | The ID of the playlist | **Required** | +| `userId` | `string` | The ID of the User | **Required** | +| `coverArtFile` | `string` | A file that will be used as the cover art for the playlist | _Optional_ | +| `metadata` | _see code block below_ | An object containing the details of the playlist | **Required** | +| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | + +```json title="updatePlaylist metadata payload" +{ + playlistName?: string; + description?: string; + playlistContents?: {trackId: string, time: number}[], + license?: string; + mood?: Mood; + releaseDate?: Date; + tags?: string; + upc?: string; +} +``` #### `advancedOptions` @@ -599,11 +633,17 @@ await audiusSdk.playlists.favoritePlaylist({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :----------- | :----------------------------------------------------------- | :---------------------------------------------- | :----------- | -| `playlistId` | `string` | The ID of the playlist | **Required** | -| `userId` | `string` | The ID of the User | **Required** | -| `metadata` | {
  isSaveOfRepost: boolean
}
| An object containing details about the favorite | _Optional_ | +| Name | Type | Description | Required? | +| :----------- | :--------------------- | :---------------------------------------------- | :----------- | +| `playlistId` | `string` | The ID of the playlist | **Required** | +| `userId` | `string` | The ID of the User | **Required** | +| `metadata` | _see code block below_ | An object containing details about the favorite | _Optional_ | + +```json title="favoritePlaylist metadata payload" +{ + isSaveOfRepost: boolean +} +``` #### `advancedOptions` @@ -682,11 +722,17 @@ await audiusSdk.playlists.repostPlaylist({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :----------- | :------------------------------------------------------------- | :-------------------------------------------- | :----------- | -| `playlistId` | `string` | The ID of the playlist | **Required** | -| `userId` | `string` | The ID of the User | **Required** | -| `metadata` | {
  isRepostOfRepost: boolean
}
| An object containing details about the repost | _Optional_ | +| Name | Type | Description | Required? | +| :----------- | :--------------------- | :-------------------------------------------- | :----------- | +| `playlistId` | `string` | The ID of the playlist | **Required** | +| `userId` | `string` | The ID of the User | **Required** | +| `metadata` | _see code block below_ | An object containing details about the repost | _Optional_ | + +```json title="repostPlaylist metadata payload" +{ + isRepostOfRepost: boolean +} +``` #### `advancedOptions` diff --git a/docs/docs/developers/sdk/Resolve.md b/docs/docs/developers/sdk/Resolve.mdx similarity index 100% rename from docs/docs/developers/sdk/Resolve.md rename to docs/docs/developers/sdk/Resolve.mdx diff --git a/docs/docs/developers/sdk/Tracks.md b/docs/docs/developers/sdk/Tracks.mdx similarity index 90% rename from docs/docs/developers/sdk/Tracks.md rename to docs/docs/developers/sdk/Tracks.mdx index 69425159fbf..d6f60de003d 100644 --- a/docs/docs/developers/sdk/Tracks.md +++ b/docs/docs/developers/sdk/Tracks.mdx @@ -475,11 +475,17 @@ await audiusSdk.tracks.favoriteTrack({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :--------- | :----------------------------------------------------------- | :------------------------------------------------------------------- | :----------- | -| `trackId` | `string` | The ID of the track | **Required** | -| `userId` | `string` | The ID of the user | **Required** | -| `metadata` | {
  isSaveOfRepost: boolean
}
| Set `isSaveOfRepost` to true if you are favoriting a reposted track. | _Optional_ | +| Name | Type | Description | Required? | +| :--------- | :--------------------- | :------------------------------------------------------------------- | :----------- | +| `trackId` | `string` | The ID of the track | **Required** | +| `userId` | `string` | The ID of the user | **Required** | +| `metadata` | _see code block below_ | Set `isSaveOfRepost` to true if you are favoriting a reposted track. | _Optional_ | + +```json title="favoriteTrack metadata payload" +{ + isSaveOfRepost: boolean +} +``` #### `advancedOptions` @@ -558,11 +564,17 @@ await audiusSdk.tracks.repostTrack({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :--------- | :------------------------------------------------------------- | :-------------------------------------------------------------------- | :----------- | -| `trackId` | `string` | The ID of the track | **Required** | -| `userId` | `string` | The ID of the user | **Required** | -| `metadata` | {
  isRepostOfRepost: boolean
}
| Set `isRepostOfRepost` to true if you are reposting a reposted track. | _Optional_ | +| Name | Type | Description | Required? | +| :--------- | :--------------------- | :-------------------------------------------------------------------- | :----------- | +| `trackId` | `string` | The ID of the track | **Required** | +| `userId` | `string` | The ID of the user | **Required** | +| `metadata` | _see code block below_ | Set `isRepostOfRepost` to true if you are reposting a reposted track. | _Optional_ | + +```json title="repostTrack metadata payload" +{ + isRepostOfRepost: boolean +} +``` #### `advancedOptions` diff --git a/docs/docs/developers/sdk/Users.md b/docs/docs/developers/sdk/Users.mdx similarity index 92% rename from docs/docs/developers/sdk/Users.md rename to docs/docs/developers/sdk/Users.mdx index fc6837c2d1d..10a0d2aef70 100644 --- a/docs/docs/developers/sdk/Users.md +++ b/docs/docs/developers/sdk/Users.mdx @@ -805,13 +805,23 @@ await audiusSdk.users.updateProfile({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- | :----------- | -| `profilePictureFile` | `File` | A file to be used as the profile picture | _Optional_ | -| `coverArtFile` | `File` | A file to be used as the cover art. This is the header on a profile page | _Optional_ | -| `metadata` | {
  name?: string;
  bio?: string;
  location?: string;
  isDeactivated?: boolean;
  artistPickTrackId?: string;
}
| An object with details about the user | **Required** | -| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image files upload | _Optional_ | -| `userId` | `string` | The ID of the user | **Required** | +| Name | Type | Description | Required? | +| :------------------- | :--------------------------- | :---------------------------------------------------------------------------- | :----------- | +| `profilePictureFile` | `File` | A file to be used as the profile picture | _Optional_ | +| `coverArtFile` | `File` | A file to be used as the cover art. This is the header on a profile page | _Optional_ | +| `metadata` | _see code block below_ | An object with details about the user | **Required** | +| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image files upload | _Optional_ | +| `userId` | `string` | The ID of the user | **Required** | + +```json title="updateProfile metadata payload" +{ + name?: string; + bio?: string; + location?: string; + isDeactivated?: boolean; + artistPickTrackId?: string; +} +``` #### `advancedOptions` diff --git a/docs/docs/developers/sdk/index.md b/docs/docs/developers/sdk/index.mdx similarity index 100% rename from docs/docs/developers/sdk/index.md rename to docs/docs/developers/sdk/index.mdx diff --git a/docs/docs/developers/subgraph/entities.md b/docs/docs/developers/subgraph/entities.mdx similarity index 100% rename from docs/docs/developers/subgraph/entities.md rename to docs/docs/developers/subgraph/entities.mdx diff --git a/docs/docs/developers/subgraph/queries.md b/docs/docs/developers/subgraph/queries.mdx similarity index 100% rename from docs/docs/developers/subgraph/queries.md rename to docs/docs/developers/subgraph/queries.mdx diff --git a/docs/docs/developers/subgraph/subgraphdata.md b/docs/docs/developers/subgraph/subgraphdata.mdx similarity index 100% rename from docs/docs/developers/subgraph/subgraphdata.md rename to docs/docs/developers/subgraph/subgraphdata.mdx diff --git a/docs/docs/developers/uploadTrackMetadata.md b/docs/docs/developers/uploadTrackMetadata.mdx similarity index 100% rename from docs/docs/developers/uploadTrackMetadata.md rename to docs/docs/developers/uploadTrackMetadata.mdx diff --git a/docs/docs/protocol/content-node/architecture.md b/docs/docs/protocol/content-node/architecture.mdx similarity index 100% rename from docs/docs/protocol/content-node/architecture.md rename to docs/docs/protocol/content-node/architecture.mdx diff --git a/docs/docs/protocol/content-node/overview.md b/docs/docs/protocol/content-node/overview.mdx similarity index 100% rename from docs/docs/protocol/content-node/overview.md rename to docs/docs/protocol/content-node/overview.mdx diff --git a/docs/docs/protocol/discovery-node/architecture.md b/docs/docs/protocol/discovery-node/architecture.mdx similarity index 100% rename from docs/docs/protocol/discovery-node/architecture.md rename to docs/docs/protocol/discovery-node/architecture.mdx diff --git a/docs/docs/protocol/discovery-node/overview.md b/docs/docs/protocol/discovery-node/overview.mdx similarity index 100% rename from docs/docs/protocol/discovery-node/overview.md rename to docs/docs/protocol/discovery-node/overview.mdx diff --git a/docs/docs/protocol/overview.md b/docs/docs/protocol/overview.mdx similarity index 94% rename from docs/docs/protocol/overview.md rename to docs/docs/protocol/overview.mdx index c61e1444e3b..aa03829dff3 100644 --- a/docs/docs/protocol/overview.md +++ b/docs/docs/protocol/overview.mdx @@ -11,7 +11,7 @@ The mission of the project is to give everyone the freedom to share, monetize, a The Audius Protocol [repository](https://github.com/AudiusProject/audius-protocol) is a mono-repository that has all the pieces that make and support the protocol including smart contracts, services, and other supporting libraries. -If you are interested in operating a service, see the [`running a node`](../token/running-a-node/introduction.md) section. If you're interested in contributing to the Audius protocol, explore the code below! +If you are interested in operating a service, see the [`running a node`](/token/running-a-node/introduction) section. If you're interested in contributing to the Audius protocol, explore the code below! ![](/img/architecture.png) @@ -28,7 +28,7 @@ Service providers can provide one or more of the following services by staking $ In the above diagram, creators can either run a content node themselves or use one of the network-registered content nodes. -For more details on the Audius architecture, see the [Audius protocol whitepaper](whitepaper.md). +For more details on the Audius architecture, see the [Audius protocol whitepaper](/protocol/whitepaper). ## Audius Services @@ -48,4 +48,4 @@ For more details on the Audius architecture, see the [Audius protocol whitepaper ## Service Provider Quickstart -If you're a service provider, a quickstart guide to running services on Audius can be found [here](../token/running-a-node/introduction.md) +If you're a service provider, a quickstart guide to running services on Audius can be found [here](/token/running-a-node/introduction) diff --git a/docs/docs/protocol/whitepaper.md b/docs/docs/protocol/whitepaper.mdx similarity index 100% rename from docs/docs/protocol/whitepaper.md rename to docs/docs/protocol/whitepaper.mdx diff --git a/docs/docs/token/audio.md b/docs/docs/token/audio.mdx similarity index 100% rename from docs/docs/token/audio.md rename to docs/docs/token/audio.mdx diff --git a/docs/docs/token/governance.md b/docs/docs/token/governance.mdx similarity index 100% rename from docs/docs/token/governance.md rename to docs/docs/token/governance.mdx diff --git a/docs/docs/token/running-a-node/hardware-requirements.md b/docs/docs/token/running-a-node/hardware-requirements.mdx similarity index 100% rename from docs/docs/token/running-a-node/hardware-requirements.md rename to docs/docs/token/running-a-node/hardware-requirements.mdx diff --git a/docs/docs/token/running-a-node/introduction.md b/docs/docs/token/running-a-node/introduction.mdx similarity index 100% rename from docs/docs/token/running-a-node/introduction.md rename to docs/docs/token/running-a-node/introduction.mdx diff --git a/docs/docs/token/running-a-node/setup/advanced.md b/docs/docs/token/running-a-node/setup/advanced.mdx similarity index 100% rename from docs/docs/token/running-a-node/setup/advanced.md rename to docs/docs/token/running-a-node/setup/advanced.mdx diff --git a/docs/docs/token/running-a-node/setup/claiming.md b/docs/docs/token/running-a-node/setup/claiming.mdx similarity index 100% rename from docs/docs/token/running-a-node/setup/claiming.md rename to docs/docs/token/running-a-node/setup/claiming.mdx diff --git a/docs/docs/token/running-a-node/setup/installation.md b/docs/docs/token/running-a-node/setup/installation.mdx similarity index 95% rename from docs/docs/token/running-a-node/setup/installation.md rename to docs/docs/token/running-a-node/setup/installation.mdx index edd81569652..60b4ab4f045 100644 --- a/docs/docs/token/running-a-node/setup/installation.md +++ b/docs/docs/token/running-a-node/setup/installation.mdx @@ -34,4 +34,4 @@ If you're using an externally managed Postgres DB please see [this section](/tok ## More options -For more advanced configuration options or migrating from Kubernetes check out the [Advanced Setup Guide](advanced.md) +For more advanced configuration options or migrating from Kubernetes check out the [Advanced Setup Guide](/token/running-a-node/setup/advanced) diff --git a/docs/docs/token/running-a-node/setup/registration.md b/docs/docs/token/running-a-node/setup/registration.mdx similarity index 100% rename from docs/docs/token/running-a-node/setup/registration.md rename to docs/docs/token/running-a-node/setup/registration.mdx diff --git a/docs/docs/token/running-a-node/setup/wallet_management.md b/docs/docs/token/running-a-node/setup/wallet_management.mdx similarity index 100% rename from docs/docs/token/running-a-node/setup/wallet_management.md rename to docs/docs/token/running-a-node/setup/wallet_management.mdx diff --git a/docs/docs/token/running-a-node/sla.md b/docs/docs/token/running-a-node/sla.mdx similarity index 100% rename from docs/docs/token/running-a-node/sla.md rename to docs/docs/token/running-a-node/sla.mdx diff --git a/docs/docs/token/staking.md b/docs/docs/token/staking.mdx similarity index 100% rename from docs/docs/token/staking.md rename to docs/docs/token/staking.mdx diff --git a/docs/docs/welcome.md b/docs/docs/welcome.mdx similarity index 100% rename from docs/docs/welcome.md rename to docs/docs/welcome.mdx diff --git a/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Albums.md b/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Albums.md index 3dd6f1581c0..f14c0db9c84 100644 --- a/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Albums.md +++ b/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Albums.md @@ -182,14 +182,27 @@ const { albumId } = await audiusSdk.albums.uploadTrack({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :--------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- | :----------- | -| `coverArtFile` | `File` | A file that will be used as the cover art for the album | _Optional_ | -| `metadata` | {
  genre: Genre;
  albumName: string;
  description?: string;
  license?: string;
  mood?: Mood;
  releaseDate?: Date;
  tags?: string;
  upc?: string;
}
| An object containing the details of the album | **Required** | -| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | -| `trackFiles` | `Array` | An array of track audio files | **Required** | -| `trackMetadatas` | [`UploadTrackMetadata`](/developers/UploadTrackMetadata)`[]` | An array of track files | _Optional_ | -| `userId` | `string` | The ID of the user | **Required** | +| Name | Type | Description | Required? | +| :--------------- | :----------------------------------------------------------- | :---------------------------------------------------------------------------- | :----------- | +| `coverArtFile` | `File` | A file that will be used as the cover art for the album | _Optional_ | +| `metadata` | _see code sample below_ | An object containing the details of the album | **Required** | +| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | +| `trackFiles` | `Array` | An array of track audio files | **Required** | +| `trackMetadatas` | [`UploadTrackMetadata`](/developers/UploadTrackMetadata)`[]` | An array of track files | _Optional_ | +| `userId` | `string` | The ID of the user | **Required** | + +```json +{ + genre: Genre; + albumName: string; + description?: string; + license?: string; + mood?: Mood; + releaseDate?: Date; + tags?: string; + upc?: string; +} +``` #### `advancedOptions` parameters (advanced) @@ -244,13 +257,26 @@ const { albumId } = await audiusSdk.albums.updateAlbum({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- | :----------- | -| `albumId` | `string` | The ID of the album | **Required** | -| `userId` | `string` | The ID of the User | **Required** | -| `coverArtFile` | `string` | A file that will be used as the cover art for the album | _Optional_ | -| `metadata` | {
  albumName?: string;
  description?: string;
  albumContents?: {trackId: string, time: number}[],
  license?: string;
  mood?: Mood;
  releaseDate?: Date;
  tags?: string;
  upc?: string;
}
| An object containing the details of the album | **Required** | -| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | +| Name | Type | Description | Required? | +| :------------- | :--------------------------- | :---------------------------------------------------------------------------- | :----------- | +| `albumId` | `string` | The ID of the album | **Required** | +| `userId` | `string` | The ID of the User | **Required** | +| `coverArtFile` | `string` | A file that will be used as the cover art for the album | _Optional_ | +| `metadata` | _see code sample below_ | An object containing the details of the album | **Required** | +| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | + +```json +{ + albumName?: string; + description?: string; + albumContents?: {trackId: string, time: number}[], + license?: string; + mood?: Mood; + releaseDate?: Date; + tags?: string; + upc?: string; +} +``` #### `advancedOptions` parameters (advanced) @@ -333,11 +359,17 @@ await audiusSdk.albums.favoriteAlbum({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :--------- | :----------------------------------------------------------- | :---------------------------------------------- | :----------- | -| `albumId` | `string` | The ID of the album | **Required** | -| `userId` | `string` | The ID of the User | **Required** | -| `metadata` | {
  isSaveOfRepost: boolean
}
| An object containing details about the favorite | _Optional_ | +| Name | Type | Description | Required? | +| :--------- | :---------------------- | :---------------------------------------------- | :----------- | +| `albumId` | `string` | The ID of the album | **Required** | +| `userId` | `string` | The ID of the User | **Required** | +| `metadata` | _see code sample below_ | An object containing details about the favorite | _Optional_ | + +```json +{ + isSaveOfRepost: boolean +} +``` #### `advancedOptions` @@ -420,11 +452,17 @@ await audiusSdk.albums.repostAlbum({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :--------- | :------------------------------------------------------------- | :-------------------------------------------- | :----------- | -| `albumId` | `string` | The ID of the album | **Required** | -| `userId` | `string` | The ID of the User | **Required** | -| `metadata` | {
  isRepostOfRepost: boolean
}
| An object containing details about the repost | _Optional_ | +| Name | Type | Description | Required? | +| :--------- | :---------------------- | :-------------------------------------------- | :----------- | +| `albumId` | `string` | The ID of the album | **Required** | +| `userId` | `string` | The ID of the User | **Required** | +| `metadata` | _see code sample below_ | An object containing details about the repost | _Optional_ | + +```json +{ + isRepostOfRepost: boolean +} +``` #### `advancedOptions` diff --git a/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Playlists.md b/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Playlists.md index 86b43f7e582..5c442c1239f 100644 --- a/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Playlists.md +++ b/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Playlists.md @@ -272,13 +272,21 @@ const { playlistId } = await audiusSdk.playlists.createPlaylist({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------- | :----------- | -| `coverArtFile` | `File` | A file that will be used as the cover art for the playlist | _Optional_ | -| `metadata` | {
  playlistName: string;
  description?: string;
  isPrivate?: boolean;  
}
| An object containing the details of the playlist | **Required** | -| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | -| `trackIds` | `Array` | An array of track IDs to be included in the playlist | **Required** | -| `userId` | `string` | The ID of the user | **Required** | +| Name | Type | Description | Required? | +| :------------- | :--------------------------- | :---------------------------------------------------------------------------- | :----------- | +| `coverArtFile` | `File` | A file that will be used as the cover art for the playlist | _Optional_ | +| `metadata` | _see code sample below_ | An object containing the details of the playlist | **Required** | +| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | +| `trackIds` | `Array` | An array of track IDs to be included in the playlist | **Required** | +| `userId` | `string` | The ID of the user | **Required** | + +```json +{ + playlistName: string; + description?: string; + isPrivate?: boolean; +} +``` #### `advancedOptions` @@ -360,14 +368,27 @@ const { playlistId } = await audiusSdk.playlists.uploadPlaylist({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :--------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- | :----------- | -| `coverArtFile` | `File` | A file that will be used as the cover art for the playlist | _Optional_ | -| `metadata` | {
  genre: Genre;
  playlistName: string;
  description?: string;
  license?: string;
  mood?: Mood;
  releaseDate?: Date;
  tags?: string;
  upc?: string;
}
| An object containing the details of the playlist | **Required** | -| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | -| `trackFiles` | `Array` | An array of track audio files | **Required** | -| `trackMetadatas` | [`UploadTrackMetadata`](/developers/UploadTrackMetadata)`[]` | An array of track files | _Optional_ | -| `userId` | `string` | The ID of the user | **Required** | +| Name | Type | Description | Required? | +| :--------------- | :----------------------------------------------------------- | :---------------------------------------------------------------------------- | :----------- | +| `coverArtFile` | `File` | A file that will be used as the cover art for the playlist | _Optional_ | +| `metadata` | _see code sample below_ | An object containing the details of the playlist | **Required** | +| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | +| `trackFiles` | `Array` | An array of track audio files | **Required** | +| `trackMetadatas` | [`UploadTrackMetadata`](/developers/UploadTrackMetadata)`[]` | An array of track files | _Optional_ | +| `userId` | `string` | The ID of the user | **Required** | + +```json +{ + playlistName?: string; + description?: string; + playlistContents?: {trackId: string, time: number}[], + license?: string; + mood?: Mood; + releaseDate?: Date; + tags?: string; + upc?: string; +} +``` #### `advancedOptions` @@ -524,13 +545,26 @@ const { playlistId } = await audiusSdk.playlists.updatePlaylist({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- | :----------- | -| `playlistId` | `string` | The ID of the playlist | **Required** | -| `userId` | `string` | The ID of the User | **Required** | -| `coverArtFile` | `string` | A file that will be used as the cover art for the playlist | _Optional_ | -| `metadata` | {
  playlistName?: string;
  description?: string;
  playlistContents?: {trackId: string, time: number}[],
  license?: string;
  mood?: Mood;
  releaseDate?: Date;
  tags?: string;
  upc?: string;
}
| An object containing the details of the playlist | **Required** | -| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | +| Name | Type | Description | Required? | +| :------------- | :--------------------------- | :---------------------------------------------------------------------------- | :----------- | +| `playlistId` | `string` | The ID of the playlist | **Required** | +| `userId` | `string` | The ID of the User | **Required** | +| `coverArtFile` | `string` | A file that will be used as the cover art for the playlist | _Optional_ | +| `metadata` | _see code sample below_ | An object containing the details of the playlist | **Required** | +| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image file uploads | _Optional_ | + +```json +{ + playlistName?: string; + description?: string; + playlistContents?: {trackId: string, time: number}[], + license?: string; + mood?: Mood; + releaseDate?: Date; + tags?: string; + upc?: string; +} +``` #### `advancedOptions` @@ -613,11 +647,17 @@ await audiusSdk.playlists.favoritePlaylist({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :----------- | :----------------------------------------------------------- | :---------------------------------------------- | :----------- | -| `playlistId` | `string` | The ID of the playlist | **Required** | -| `userId` | `string` | The ID of the User | **Required** | -| `metadata` | {
  isSaveOfRepost: boolean
}
| An object containing details about the favorite | _Optional_ | +| Name | Type | Description | Required? | +| :----------- | :---------------------- | :---------------------------------------------- | :----------- | +| `playlistId` | `string` | The ID of the playlist | **Required** | +| `userId` | `string` | The ID of the User | **Required** | +| `metadata` | _see code sample below_ | An object containing details about the favorite | _Optional_ | + +```json +{ + isSaveOfRepost: boolean +} +``` #### `advancedOptions` @@ -700,11 +740,17 @@ await audiusSdk.playlists.repostPlaylist({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :----------- | :------------------------------------------------------------- | :-------------------------------------------- | :----------- | -| `playlistId` | `string` | The ID of the playlist | **Required** | -| `userId` | `string` | The ID of the User | **Required** | -| `metadata` | {
  isRepostOfRepost: boolean
}
| An object containing details about the repost | _Optional_ | +| Name | Type | Description | Required? | +| :----------- | :---------------------- | :-------------------------------------------- | :----------- | +| `playlistId` | `string` | The ID of the playlist | **Required** | +| `userId` | `string` | The ID of the User | **Required** | +| `metadata` | _see code sample below_ | An object containing details about the repost | _Optional_ | + +```json +{ + isRepostOfRepost: boolean +} +``` #### `advancedOptions` diff --git a/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Tracks.md b/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Tracks.md index c19f1caa61a..a691c64195e 100644 --- a/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Tracks.md +++ b/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Tracks.md @@ -495,11 +495,17 @@ await audiusSdk.tracks.favoriteTrack({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :--------- | :----------------------------------------------------------- | :------------------------------------------------------------------- | :----------- | -| `trackId` | `string` | The ID of the track | **Required** | -| `userId` | `string` | The ID of the user | **Required** | -| `metadata` | {
  isSaveOfRepost: boolean
}
| Set `isSaveOfRepost` to true if you are favoriting a reposted track. | _Optional_ | +| Name | Type | Description | Required? | +| :--------- | :---------------------- | :------------------------------------------------------------------- | :----------- | +| `trackId` | `string` | The ID of the track | **Required** | +| `userId` | `string` | The ID of the user | **Required** | +| `metadata` | _see code sample below_ | Set `isSaveOfRepost` to true if you are favoriting a reposted track. | _Optional_ | + +```json +{ + isSaveOfRepost: boolean +} +``` #### `advancedOptions` @@ -582,11 +588,17 @@ await audiusSdk.tracks.repostTrack({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :--------- | :------------------------------------------------------------- | :-------------------------------------------------------------------- | :----------- | -| `trackId` | `string` | The ID of the track | **Required** | -| `userId` | `string` | The ID of the user | **Required** | -| `metadata` | {
  isRepostOfRepost: boolean
}
| Set `isRepostOfRepost` to true if you are reposting a reposted track. | _Optional_ | +| Name | Type | Description | Required? | +| :--------- | :---------------------- | :-------------------------------------------------------------------- | :----------- | +| `trackId` | `string` | The ID of the track | **Required** | +| `userId` | `string` | The ID of the user | **Required** | +| `metadata` | _see code sample below_ | Set `isRepostOfRepost` to true if you are reposting a reposted track. | _Optional_ | + +```json +{ + isRepostOfRepost: boolean +} +``` #### `advancedOptions` diff --git a/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Users.md b/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Users.md index 38c0504c2ef..bc7ccf99537 100644 --- a/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Users.md +++ b/docs/i18n-disabled/en/docusaurus-plugin-content-docs/current/developers/sdk/Users.md @@ -846,13 +846,23 @@ await audiusSdk.users.updateProfile({ Create an object with the following fields and pass it as the first argument, as shown in the example above. -| Name | Type | Description | Required? | -| :------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------- | :----------- | -| `profilePictureFile` | `File` | A file to be used as the profile picture | _Optional_ | -| `coverArtFile` | `File` | A file to be used as the cover art. This is the header on a profile page | _Optional_ | -| `metadata` | {
  name?: string;
  bio?: string;
  location?: string;
  isDeactivated?: boolean;
  artistPickTrackId?: string;
}
| An object with details about the user | **Required** | -| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image files upload | _Optional_ | -| `userId` | `string` | The ID of the user | **Required** | +| Name | Type | Description | Required? | +| :------------------- | :--------------------------- | :---------------------------------------------------------------------------- | :----------- | +| `profilePictureFile` | `File` | A file to be used as the profile picture | _Optional_ | +| `coverArtFile` | `File` | A file to be used as the cover art. This is the header on a profile page | _Optional_ | +| `metadata` | _see code sample below_ | An object with details about the user | **Required** | +| `onProgress` | `(progress: number) => void` | A function that will be called with progress events as the image files upload | _Optional_ | +| `userId` | `string` | The ID of the user | **Required** | + +```json +{ + name?: string; + bio?: string; + location?: string; + isDeactivated?: boolean; + artistPickTrackId?: string; +} +``` #### `advancedOptions`