comty.js 0.59.2 → 0.60.3

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.
Files changed (48) hide show
  1. package/dist/handlers/measurePing.js +0 -0
  2. package/dist/handlers/request.js +0 -0
  3. package/dist/helpers/handleAfterRequest.js +14 -14
  4. package/dist/helpers/handleBeforeRequest.js +3 -9
  5. package/dist/helpers/handleRegenerationEvent.js +0 -0
  6. package/dist/helpers/measurePing.js +62 -0
  7. package/dist/helpers/refreshToken.js +42 -0
  8. package/dist/helpers/withSettings.js +0 -0
  9. package/dist/helpers/withStorage.js +0 -0
  10. package/dist/hooks/useRequest/index.js +3 -4
  11. package/dist/index.js +107 -87
  12. package/dist/models/auth/index.js +115 -33
  13. package/dist/models/chats/index.js +37 -0
  14. package/dist/models/feed/index.js +46 -14
  15. package/dist/models/follows/index.js +36 -18
  16. package/dist/models/index.js +1 -4
  17. package/dist/models/livestream/index.js +0 -0
  18. package/dist/models/music/getters/featuredPlaylists.js +11 -0
  19. package/dist/models/music/getters/index.js +36 -0
  20. package/dist/models/music/getters/myReleases.js +26 -0
  21. package/dist/models/music/getters/playlistData.js +11 -0
  22. package/dist/models/music/getters/playlistItem.js +11 -0
  23. package/dist/models/music/getters/playlists.js +29 -0
  24. package/dist/models/music/getters/releaseData.js +11 -0
  25. package/dist/models/music/getters/releases.js +29 -0
  26. package/dist/models/music/getters/search.js +26 -0
  27. package/dist/models/music/getters/trackData.js +12 -0
  28. package/dist/models/music/getters/trackLyrics.js +31 -0
  29. package/dist/models/music/getters/tracks.js +29 -0
  30. package/dist/models/music/index.js +95 -240
  31. package/dist/models/nfc/index.js +27 -1
  32. package/dist/models/playlists/index.js +0 -0
  33. package/dist/models/post/index.js +133 -70
  34. package/dist/models/search/index.js +17 -4
  35. package/dist/models/session/index.js +105 -56
  36. package/dist/models/sync/cores/spotifyCore.js +0 -0
  37. package/dist/models/sync/index.js +9 -15
  38. package/dist/models/sync/services/spotify.js +0 -0
  39. package/dist/models/sync/services/tidal.js +1 -1
  40. package/dist/models/sync/services/vrc.js +0 -0
  41. package/dist/models/user/index.js +78 -100
  42. package/dist/models/widget/index.js +0 -0
  43. package/dist/remote.js +43 -0
  44. package/dist/remotes.js +5 -63
  45. package/dist/request.js +51 -0
  46. package/dist/utils/generateRequest.js +52 -0
  47. package/dist/utils/importFrom.js +22 -0
  48. package/package.json +5 -4
@@ -1,20 +1,38 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _request = require('../../handlers/request'); var _request2 = _interopRequireDefault(_request);
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _request = require('../../request'); var _request2 = _interopRequireDefault(_request);
2
2
  var _session = require('../session'); var _session2 = _interopRequireDefault(_session);
3
3
 
4
- const emailRegex = new RegExp(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/)
5
-
6
4
  class AuthModel {
7
- static __initStatic() {this.login = async (payload, callback) => {
5
+ /**
6
+ * Async function to handle the login process.
7
+ *
8
+ * @param {Object} payload - The payload containing username, password, and MFA code.
9
+ * @param {Function} callback - Optional callback function to handle further actions.
10
+ * @return {Object|boolean} The response data if login successful, false if MFA is required.
11
+ */
12
+ static async login(payload, callback) {
8
13
  const response = await _request2.default.call(void 0, {
9
14
  method: "post",
10
- url: "/auth/login",
11
- data: {
12
- username: payload.username, //window.btoa(payload.username),
13
- password: payload.password, //window.btoa(payload.password),
14
- },
15
+ url: "/auth",
16
+ data: payload,
15
17
  })
16
18
 
19
+ if (response.data.mfa_required) {
20
+ __comty_shared_state.eventBus.emit("auth:mfa_required")
21
+
22
+ if (typeof callback === "function") {
23
+ await callback({
24
+ mfa_required: {
25
+ method: response.data.method,
26
+ sended_to: response.data.sended_to,
27
+ },
28
+ })
29
+ }
30
+
31
+ return false
32
+ }
33
+
17
34
  _session2.default.token = response.data.token
35
+ _session2.default.refreshToken = response.data.refreshToken
18
36
 
19
37
  if (typeof callback === "function") {
20
38
  await callback()
@@ -23,26 +41,43 @@ const emailRegex = new RegExp(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/)
23
41
  __comty_shared_state.eventBus.emit("auth:login_success")
24
42
 
25
43
  return response.data
26
- }}
27
-
28
- static __initStatic2() {this.logout = async () => {
44
+ }
45
+
46
+ /**
47
+ * Asynchronously logs out the user by destroying the current session and emitting an event for successful logout.
48
+ *
49
+ * @return {Promise<void>} A Promise that resolves after the logout process is completed.
50
+ */
51
+ static async logout() {
29
52
  await _session2.default.destroyCurrentSession()
30
53
 
31
54
  _session2.default.removeToken()
32
55
 
33
56
  __comty_shared_state.eventBus.emit("auth:logout_success")
34
- }}
35
-
36
- static __initStatic3() {this.register = async (payload) => {
37
- const { username, password, email } = payload
57
+ }
58
+
59
+ /**
60
+ * Registers a new user with the provided payload.
61
+ *
62
+ * @param {Object} payload - The payload containing the user's information.
63
+ * @param {string} payload.username - The username of the user.
64
+ * @param {string} payload.password - The password of the user.
65
+ * @param {string} payload.email - The email of the user.
66
+ * @param {boolean} payload.tos - The acceptance of the terms of service.
67
+ * @return {Promise<Object>} A Promise that resolves with the response data if the registration is successful, or false if there was an error.
68
+ * @throws {Error} Throws an error if the registration fails.
69
+ */
70
+ static async register(payload) {
71
+ const { username, password, email, tos } = payload
38
72
 
39
73
  const response = await _request2.default.call(void 0, {
40
74
  method: "post",
41
- url: "/auth/register",
75
+ url: "/register",
42
76
  data: {
43
77
  username,
44
78
  password,
45
79
  email,
80
+ accept_tos: tos,
46
81
  }
47
82
  }).catch((error) => {
48
83
  console.error(error)
@@ -55,22 +90,19 @@ const emailRegex = new RegExp(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/)
55
90
  }
56
91
 
57
92
  return response
58
- }}
59
-
60
- static __initStatic4() {this.usernameValidation = async (username) => {
61
- let payload = {}
62
-
63
- // check if usename arguemnt is an email
64
- if (emailRegex.test(username)) {
65
- payload.email = username
66
- } else {
67
- payload.username = username
68
- }
69
-
93
+ }
94
+
95
+ /**
96
+ * Validates the existence of a username by making a GET request to the `/auth/{username}/exists` endpoint.
97
+ *
98
+ * @param {string} username - The username to validate.
99
+ * @return {Promise<boolean|Object>} A Promise that resolves with the response data if the validation is successful,
100
+ * or false if there was an error. Throws an error if the validation fails.
101
+ */
102
+ static async usernameValidation(username) {
70
103
  const response = await _request2.default.call(void 0, {
71
104
  method: "get",
72
- url: "/auth/login/validation",
73
- params: payload,
105
+ url: `/auth/${username}/exists`,
74
106
  }).catch((error) => {
75
107
  console.error(error)
76
108
 
@@ -82,5 +114,55 @@ const emailRegex = new RegExp(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/)
82
114
  }
83
115
 
84
116
  return response.data
85
- }}
86
- } AuthModel.__initStatic(); AuthModel.__initStatic2(); AuthModel.__initStatic3(); AuthModel.__initStatic4(); exports.default = AuthModel;
117
+ }
118
+
119
+ /**
120
+ * Retrieves the availability of a username and email by making a GET request to the `/availability` endpoint.
121
+ *
122
+ * @param {Object} payload - The payload containing the username and email.
123
+ * @param {string} payload.username - The username to check availability for.
124
+ * @param {string} payload.email - The email to check availability for.
125
+ * @return {Promise<Object|boolean>} A Promise that resolves with the availability data if successful, or false if an error occurred.
126
+ */
127
+ static async availability(payload) {
128
+ const { username, email } = payload
129
+
130
+ const response = await _request2.default.call(void 0, {
131
+ method: "get",
132
+ url: `/availability`,
133
+ params: {
134
+ username,
135
+ email,
136
+ }
137
+ }).catch((error) => {
138
+ console.error(error)
139
+
140
+ return false
141
+ })
142
+
143
+ return response.data
144
+ }
145
+
146
+ /**
147
+ * A function to change the user's password.
148
+ *
149
+ * @param {Object} payload - An object containing the currentPassword and newPassword.
150
+ * @param {string} payload.currentPassword - The current password of the user.
151
+ * @param {string} payload.newPassword - The new password to set for the user.
152
+ * @return {Promise<Object>} The data response after changing the password.
153
+ */
154
+ static async changePassword(payload) {
155
+ const { currentPassword, newPassword } = payload
156
+
157
+ const { data } = await _request2.default.call(void 0, {
158
+ method: "put",
159
+ url: "/auth/password",
160
+ data: {
161
+ old_password: currentPassword,
162
+ new_password: newPassword,
163
+ }
164
+ })
165
+
166
+ return data
167
+ }
168
+ } exports.default = AuthModel;
@@ -0,0 +1,37 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _request = require('../../request'); var _request2 = _interopRequireDefault(_request);
2
+
3
+ class ChatsService {
4
+ /**
5
+ * Retrieves the chat history for a given chat ID.
6
+ *
7
+ * @param {string} chat_id - The ID of the chat.
8
+ * @return {Promise<Object>} The chat history data.
9
+ * @throws {Error} If the chat_id is not provided.
10
+ */
11
+ static async getChatHistory(chat_id) {
12
+ if (!chat_id) {
13
+ throw new Error("chat_id is required")
14
+ }
15
+
16
+ const { data } = await _request2.default.call(void 0, {
17
+ method: "GET",
18
+ url: `/chats/${chat_id}/history`,
19
+ })
20
+
21
+ return data
22
+ }
23
+
24
+ /**
25
+ * Retrieves the recent chats for the current user.
26
+ *
27
+ * @return {Promise<Object>} The chat history data.
28
+ */
29
+ static async getRecentChats() {
30
+ const { data } = await _request2.default.call(void 0, {
31
+ method: "GET",
32
+ url: "/chats/my",
33
+ })
34
+
35
+ return data
36
+ }
37
+ } exports.default = ChatsService;
@@ -1,11 +1,19 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _request = require('../../handlers/request'); var _request2 = _interopRequireDefault(_request);
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }var _request = require('../../request'); var _request2 = _interopRequireDefault(_request);
2
2
  var _withSettings = require('../../helpers/withSettings'); var _withSettings2 = _interopRequireDefault(_withSettings);
3
3
 
4
4
  class FeedModel {
5
- static __initStatic() {this.getMusicFeed = async ({ trim, limit } = {}) => {
5
+ /**
6
+ * Retrieves music feed with optional trimming and limiting.
7
+ *
8
+ * @param {Object} options - Optional parameters for trimming and limiting the feed
9
+ * @param {number} options.trim - The number of items to trim from the feed
10
+ * @param {number} options.limit - The maximum number of items to fetch from the feed
11
+ * @return {Promise<Object>} The music feed data
12
+ */
13
+ static async getMusicFeed({ trim, limit } = {}) {
6
14
  const { data } = await _request2.default.call(void 0, {
7
15
  method: "GET",
8
- url: `/feed/music`,
16
+ url: `/music/feed/my`,
9
17
  params: {
10
18
  trim: _nullishCoalesce(trim, () => ( 0)),
11
19
  limit: _nullishCoalesce(limit, () => ( _withSettings2.default.get("feed_max_fetch"))),
@@ -13,12 +21,20 @@ var _withSettings = require('../../helpers/withSettings'); var _withSettings2 =
13
21
  })
14
22
 
15
23
  return data
16
- }}
24
+ }
17
25
 
18
- static __initStatic2() {this.getGlobalMusicFeed = async ({ trim, limit } = {}) => {
26
+ /**
27
+ * Retrieves the global music feed with optional trimming and limiting.
28
+ *
29
+ * @param {Object} options - An object containing optional parameters:
30
+ * @param {number} options.trim - The number of items to trim from the feed
31
+ * @param {number} options.limit - The maximum number of items to fetch from the feed
32
+ * @return {Promise<Object>} The global music feed data
33
+ */
34
+ static async getGlobalMusicFeed({ trim, limit } = {}) {
19
35
  const { data } = await _request2.default.call(void 0, {
20
36
  method: "GET",
21
- url: `/feed/music/global`,
37
+ url: `/music/feed`,
22
38
  params: {
23
39
  trim: _nullishCoalesce(trim, () => ( 0)),
24
40
  limit: _nullishCoalesce(limit, () => ( _withSettings2.default.get("feed_max_fetch"))),
@@ -26,12 +42,20 @@ var _withSettings = require('../../helpers/withSettings'); var _withSettings2 =
26
42
  })
27
43
 
28
44
  return data
29
- }}
45
+ }
30
46
 
31
- static __initStatic3() {this.getTimelineFeed = async ({ trim, limit = 10 } = {}) => {
47
+ /**
48
+ * Retrieves the timeline feed with optional trimming and limiting.
49
+ *
50
+ * @param {object} options - Object containing trim and limit properties
51
+ * @param {number} options.trim - The number of feed items to trim
52
+ * @param {number} options.limit - The maximum number of feed items to retrieve
53
+ * @return {Promise<object>} The timeline feed data
54
+ */
55
+ static async getTimelineFeed({ trim, limit } = {}) {
32
56
  const { data } = await _request2.default.call(void 0, {
33
57
  method: "GET",
34
- url: `/feed/timeline`,
58
+ url: `/posts/feed/timeline`,
35
59
  params: {
36
60
  trim: _nullishCoalesce(trim, () => ( 0)),
37
61
  limit: _nullishCoalesce(limit, () => ( _withSettings2.default.get("feed_max_fetch"))),
@@ -39,12 +63,20 @@ var _withSettings = require('../../helpers/withSettings'); var _withSettings2 =
39
63
  })
40
64
 
41
65
  return data
42
- }}
66
+ }
43
67
 
44
- static __initStatic4() {this.getPostsFeed = async ({ trim, limit } = {}) => {
68
+ /**
69
+ * Retrieves the posts feed with options to trim and limit the results.
70
+ *
71
+ * @param {Object} options - An object containing optional parameters for trimming and limiting the feed.
72
+ * @param {number} options.trim - The number of characters to trim the feed content.
73
+ * @param {number} options.limit - The maximum number of posts to fetch from the feed.
74
+ * @return {Promise<Object>} The posts feed data.
75
+ */
76
+ static async getGlobalTimelineFeed({ trim, limit } = {}) {
45
77
  const { data } = await _request2.default.call(void 0, {
46
78
  method: "GET",
47
- url: `/feed/posts`,
79
+ url: `/posts/feed/global`,
48
80
  params: {
49
81
  trim: _nullishCoalesce(trim, () => ( 0)),
50
82
  limit: _nullishCoalesce(limit, () => ( _withSettings2.default.get("feed_max_fetch"))),
@@ -52,5 +84,5 @@ var _withSettings = require('../../helpers/withSettings'); var _withSettings2 =
52
84
  })
53
85
 
54
86
  return data
55
- }}
56
- } FeedModel.__initStatic(); FeedModel.__initStatic2(); FeedModel.__initStatic3(); FeedModel.__initStatic4(); exports.default = FeedModel;
87
+ }
88
+ } exports.default = FeedModel;
@@ -1,48 +1,66 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _models = require('../../models');
2
- var _request = require('../../handlers/request'); var _request2 = _interopRequireDefault(_request);
2
+ var _request = require('../../request'); var _request2 = _interopRequireDefault(_request);
3
3
 
4
4
  class FollowsModel {
5
- static __initStatic() {this.imFollowing = async (user_id) => {
5
+ /**
6
+ * Checks if the current user is following the specified user.
7
+ *
8
+ * @param {string} user_id - The ID of the user to check if the current user is following.
9
+ * @return {Promise<Object>} A promise that resolves with the response data indicating if the current user is following the specified user.
10
+ * @throws {Error} If the user_id parameter is not provided.
11
+ */
12
+ static async imFollowing(user_id) {
6
13
  if (!user_id) {
7
14
  throw new Error("user_id is required")
8
15
  }
9
16
 
10
17
  const response = await _request2.default.call(void 0, {
11
18
  method: "GET",
12
- url: `/follow/user/${user_id}`,
19
+ url: `/users/${user_id}/following`,
13
20
  })
14
21
 
15
22
  return response.data
16
- }}
23
+ }
17
24
 
18
- static __initStatic2() {this.getFollowers = async (user_id) => {
25
+ /**
26
+ * Retrieves the list of followers for a given user.
27
+ *
28
+ * @param {string} user_id - The ID of the user. If not provided, the current user ID will be used.
29
+ * @param {boolean} fetchData - Whether to fetch additional data for each follower. Defaults to false.
30
+ * @return {Promise<Object>} A promise that resolves with the list of followers and their data.
31
+ */
32
+ static async getFollowers(user_id, fetchData) {
19
33
  if (!user_id) {
20
- // set current user_id
21
34
  user_id = _models.SessionModel.user_id
22
35
  }
23
36
 
24
37
  const response = await _request2.default.call(void 0, {
25
38
  method: "GET",
26
- url: `/follow/user/${user_id}/followers`,
39
+ url: `/users/${user_id}/followers`,
40
+ params: {
41
+ fetchData: fetchData
42
+ }
27
43
  })
28
44
 
29
45
  return response.data
30
- }}
46
+ }
31
47
 
32
- static __initStatic3() {this.toggleFollow = async ({ user_id, username }) => {
33
- if (!user_id && !username) {
34
- throw new Error("user_id or username is required")
48
+ /**
49
+ * Toggles the follow status for a user.
50
+ *
51
+ * @param {Object} user_id - The ID of the user to toggle follow status.
52
+ * @return {Promise} The response data after toggling follow status.
53
+ */
54
+ static async toggleFollow({ user_id }) {
55
+ if (!user_id) {
56
+ throw new Error("user_id is required")
35
57
  }
36
58
 
37
59
  const response = await _request2.default.call(void 0, {
38
60
  method: "POST",
39
- url: "/follow/user/toggle",
40
- data: {
41
- user_id: user_id,
42
- username: username
43
- },
61
+ url: `/users/${user_id}/follow`,
44
62
  })
45
63
 
46
64
  return response.data
47
- }}
48
- } FollowsModel.__initStatic(); FollowsModel.__initStatic2(); FollowsModel.__initStatic3(); exports.default = FollowsModel;
65
+ }
66
+ } exports.default = FollowsModel;
@@ -1,7 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _auth = require('./auth'); var _auth2 = _interopRequireDefault(_auth);
2
2
  var _feed = require('./feed'); var _feed2 = _interopRequireDefault(_feed);
3
3
  var _follows = require('./follows'); var _follows2 = _interopRequireDefault(_follows);
4
- var _livestream = require('./livestream'); var _livestream2 = _interopRequireDefault(_livestream);
5
4
  var _post = require('./post'); var _post2 = _interopRequireDefault(_post);
6
5
  var _session = require('./session'); var _session2 = _interopRequireDefault(_session);
7
6
  var _sync = require('./sync'); var _sync2 = _interopRequireDefault(_sync);
@@ -20,7 +19,6 @@ function createHandlers() {
20
19
  auth: getEndpointsFromModel(_auth2.default),
21
20
  feed: getEndpointsFromModel(_feed2.default),
22
21
  follows: getEndpointsFromModel(_follows2.default),
23
- livestream: getEndpointsFromModel(_livestream2.default),
24
22
  post: getEndpointsFromModel(_post2.default),
25
23
  session: getEndpointsFromModel(_session2.default),
26
24
  sync: getEndpointsFromModel(_sync2.default),
@@ -37,5 +35,4 @@ function createHandlers() {
37
35
 
38
36
 
39
37
 
40
-
41
- exports.AuthModel = _auth2.default; exports.FeedModel = _feed2.default; exports.FollowsModel = _follows2.default; exports.LivestreamModel = _livestream2.default; exports.PostModel = _post2.default; exports.SessionModel = _session2.default; exports.SyncModel = _sync2.default; exports.UserModel = _user2.default; exports.createHandlers = createHandlers;
38
+ exports.AuthModel = _auth2.default; exports.FeedModel = _feed2.default; exports.FollowsModel = _follows2.default; exports.PostModel = _post2.default; exports.SessionModel = _session2.default; exports.SyncModel = _sync2.default; exports.UserModel = _user2.default; exports.createHandlers = createHandlers;
File without changes
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _request = require('../../../request'); var _request2 = _interopRequireDefault(_request);
2
+
3
+ exports. default = async () => {
4
+ const response = await _request2.default.call(void 0, {
5
+ method: "GET",
6
+ url: "/music/playlists/featured",
7
+ })
8
+
9
+ // @ts-ignore
10
+ return response.data
11
+ }
@@ -0,0 +1,36 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});async function exportObjs() {
2
+ if (window) {
3
+ let paths = {
4
+ ...import.meta.glob("./**.ts"),
5
+ ...import.meta.glob("./**.js"),
6
+ }
7
+
8
+ let fns = {}
9
+
10
+ for (const path in paths) {
11
+ const name = path.split("/").pop().replace(".ts", "").replace(".js", "")
12
+ const fn = await paths[path]()
13
+
14
+ fns[name] = fn.default
15
+ }
16
+
17
+ return fns
18
+ } else {
19
+ let objs = {}
20
+
21
+ const dirs = fs.readdirSync(__dirname).filter(file => file !== "index.js")
22
+
23
+ const fs = require("fs")
24
+ const path = require("path")
25
+
26
+ dirs.forEach((file) => {
27
+ const model = require(path.join(__dirname, file)).default
28
+
29
+ objs[file.replace(".js", "")] = model
30
+ })
31
+
32
+ return objs
33
+ }
34
+ }
35
+
36
+ exports. default = await exportObjs()
@@ -0,0 +1,26 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _request = require('../../../request'); var _request2 = _interopRequireDefault(_request);
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+ exports. default = async ({
10
+ limit,
11
+ offset,
12
+ keywords,
13
+ }) => {
14
+ const response = await _request2.default.call(void 0, {
15
+ method: "GET",
16
+ url: "/music/releases/self",
17
+ params: {
18
+ limit: limit,
19
+ offset: offset,
20
+ keywords: keywords,
21
+ }
22
+ })
23
+
24
+ // @ts-ignore
25
+ return response.data
26
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _request = require('../../../request'); var _request2 = _interopRequireDefault(_request);
2
+
3
+ exports. default = async (id) => {
4
+ const response = await _request2.default.call(void 0, {
5
+ method: "GET",
6
+ url: `/music/playlists/${id}/data`,
7
+ })
8
+
9
+ // @ts-ignore
10
+ return response.data
11
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _request = require('../../../request'); var _request2 = _interopRequireDefault(_request);
2
+
3
+ exports. default = async (id) => {
4
+ const response = await _request2.default.call(void 0, {
5
+ method: "GET",
6
+ url: `/music/playlists/${id}/items`,
7
+ })
8
+
9
+ // @ts-ignore
10
+ return response.data
11
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _request = require('../../../request'); var _request2 = _interopRequireDefault(_request);
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+ exports. default = async ({
11
+ keywords,
12
+ user_id,
13
+ limit,
14
+ offset,
15
+ }) => {
16
+ const response = await _request2.default.call(void 0, {
17
+ method: "GET",
18
+ url: "/music/playlists",
19
+ params: {
20
+ keywords: keywords,
21
+ user_id: user_id,
22
+ limit: limit,
23
+ offset: offset,
24
+ }
25
+ })
26
+
27
+ // @ts-ignore
28
+ return response.data
29
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _request = require('../../../request'); var _request2 = _interopRequireDefault(_request);
2
+
3
+ exports. default = async (id) => {
4
+ const response = await _request2.default.call(void 0, {
5
+ method: "GET",
6
+ url: `/music/releases/${id}/data`,
7
+ })
8
+
9
+ // @ts-ignore
10
+ return response.data
11
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _request = require('../../../request'); var _request2 = _interopRequireDefault(_request);
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+ exports. default = async ({
11
+ keywords,
12
+ user_id,
13
+ limit,
14
+ offset,
15
+ }) => {
16
+ const response = await _request2.default.call(void 0, {
17
+ method: "GET",
18
+ url: "/music/releases",
19
+ params: {
20
+ keywords: keywords,
21
+ user_id: user_id,
22
+ limit: limit,
23
+ offset: offset,
24
+ }
25
+ })
26
+
27
+ // @ts-ignore
28
+ return response.data
29
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _request = require('../../../request'); var _request2 = _interopRequireDefault(_request);
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+ exports. default = async ({
10
+ keywords,
11
+ limit,
12
+ offset,
13
+ }) => {
14
+ const response = await _request2.default.call(void 0, {
15
+ method: "GET",
16
+ url: "/music/search",
17
+ params: {
18
+ keywords: keywords,
19
+ limit: limit,
20
+ offset: offset,
21
+ }
22
+ })
23
+
24
+ // @ts-ignore
25
+ return response.data
26
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _request = require('../../../request'); var _request2 = _interopRequireDefault(_request);
2
+
3
+ exports. default = async (id, options) => {
4
+ const response = await _request2.default.call(void 0, {
5
+ method: "GET",
6
+ url: `/music/tracks/${id}/data`,
7
+ params: options
8
+ })
9
+
10
+ // @ts-ignore
11
+ return response.data
12
+ }