@audius/sdk 0.0.37 → 0.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { Base } from './base';
2
- import { Nullable } from '../utils';
2
+ import type { Nullable } from '../utils';
3
3
  export declare enum Action {
4
4
  CREATE = "Create",
5
5
  UPDATE = "Update",
@@ -17,22 +17,40 @@ export interface PlaylistOperationResponse {
17
17
  * Block number of playlist transaction
18
18
  */
19
19
  blockNumber: Nullable<number>;
20
- /**
21
- * ID of playlist being modified
22
- */
23
- playlistId: Nullable<number>;
24
20
  /**
25
21
  * String error message returned
26
22
  */
27
23
  error: Nullable<string>;
28
24
  }
25
+ declare type PlaylistTrack = {
26
+ time: number;
27
+ metadata_time?: number;
28
+ track: number;
29
+ };
30
+ declare type PlaylistParam = {
31
+ playlist_id: number;
32
+ playlist_name: string;
33
+ artwork?: {
34
+ file?: File;
35
+ url?: string;
36
+ };
37
+ playlist_contents: {
38
+ track_ids: PlaylistTrack[];
39
+ };
40
+ cover_art_sizes: string;
41
+ description: string;
42
+ is_private: boolean;
43
+ is_album: boolean;
44
+ };
29
45
  export declare class EntityManager extends Base {
30
46
  /**
31
47
  * Generate random integer between two known values
32
48
  */
33
49
  getRandomInt(min: number, max: number): number;
34
- getFullPlaylist(playlistId: number, userId: number): Promise<any>;
35
- mapAddedTimestamps(addedTimestamps: any): any;
50
+ mapTimestamps(addedTimestamps: PlaylistTrack[]): {
51
+ track: number;
52
+ time: number;
53
+ }[];
36
54
  /**
37
55
  * Playlist default response values
38
56
  */
@@ -40,59 +58,15 @@ export declare class EntityManager extends Base {
40
58
  /**
41
59
  * Create a playlist using updated data contracts flow
42
60
  */
43
- createPlaylist({ playlistId, playlistName, trackIds, description, isAlbum, isPrivate, coverArt, coverArtSizes, logger }: {
44
- playlistId: number;
45
- playlistName: string;
46
- trackIds: number[];
47
- description: string;
48
- isAlbum: boolean;
49
- isPrivate: boolean;
50
- coverArt: string;
51
- coverArtSizes: string;
52
- logger: Console;
53
- }): Promise<PlaylistOperationResponse>;
61
+ createPlaylist(playlist: PlaylistParam): Promise<PlaylistOperationResponse>;
54
62
  /**
55
63
  * Delete a playlist using updated data contracts flow
56
64
  */
57
- deletePlaylist({ playlistId, logger }: {
58
- playlistId: number;
59
- logger: any;
60
- }): Promise<{
61
- blockHash: any;
62
- blockNumber: any;
63
- }>;
65
+ deletePlaylist(playlistId: number): Promise<PlaylistOperationResponse>;
64
66
  /**
65
67
  * Update a playlist using updated data contracts flow
66
- **/
67
- editPlaylist({ playlistId, playlistName, description, isAlbum, isPrivate, coverArt, logger }: {
68
- playlistId: number;
69
- playlistName: Nullable<string>;
70
- description: Nullable<string>;
71
- isAlbum: Nullable<boolean>;
72
- isPrivate: Nullable<boolean>;
73
- coverArt: Nullable<string>;
74
- logger: Console;
75
- }): Promise<PlaylistOperationResponse>;
76
- addPlaylistTrack({ playlistId, trackId, timestamp, logger }: {
77
- playlistId: number;
78
- trackId: number;
79
- timestamp: number;
80
- logger: Console;
81
- }): Promise<PlaylistOperationResponse>;
82
- deletePlaylistTrack({ playlistId, trackId, timestamp, logger }: {
83
- playlistId: number;
84
- trackId: number;
85
- timestamp: number;
86
- logger: Console;
87
- }): Promise<PlaylistOperationResponse>;
88
- /**
89
- * Update a playlist using updated data contracts flow
90
- **/
91
- orderPlaylist({ playlistId, trackIds, logger }: {
92
- playlistId: number;
93
- trackIds: number[];
94
- logger: Console;
95
- }): Promise<PlaylistOperationResponse>;
68
+ */
69
+ updatePlaylist(playlist: PlaylistParam): Promise<PlaylistOperationResponse>;
96
70
  /**
97
71
  * Manage an entity with the updated data contract flow
98
72
  * Leveraged to manipulate User/Track/Playlist/+ other entities
@@ -111,3 +85,4 @@ export declare class EntityManager extends Base {
111
85
  error: string;
112
86
  }>;
113
87
  }
88
+ export {};