comty.js 0.59.2 → 0.60.4
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.
- package/dist/helpers/handleAfterRequest.js +14 -14
- package/dist/helpers/handleBeforeRequest.js +3 -9
- package/dist/helpers/measurePing.js +62 -0
- package/dist/helpers/{handleRegenerationEvent.js → refreshToken.js} +20 -21
- package/dist/hooks/useRequest/index.js +3 -4
- package/dist/index.js +107 -87
- package/dist/models/api/index.js +78 -0
- package/dist/models/auth/index.js +115 -33
- package/dist/models/chats/index.js +37 -0
- package/dist/models/feed/index.js +46 -14
- package/dist/models/follows/index.js +36 -18
- package/dist/models/index.js +1 -4
- package/dist/models/music/getters/featuredPlaylists.js +11 -0
- package/dist/models/music/getters/index.js +36 -0
- package/dist/models/music/getters/myReleases.js +26 -0
- package/dist/models/music/getters/playlistData.js +11 -0
- package/dist/models/music/getters/playlistItem.js +11 -0
- package/dist/models/music/getters/playlists.js +29 -0
- package/dist/models/music/getters/releaseData.js +11 -0
- package/dist/models/music/getters/releases.js +29 -0
- package/dist/models/music/getters/search.js +26 -0
- package/dist/models/music/getters/trackData.js +12 -0
- package/dist/models/music/getters/trackLyrics.js +31 -0
- package/dist/models/music/getters/tracks.js +29 -0
- package/dist/models/music/index.js +132 -552
- package/dist/models/music/setters/deleteRelease.js +11 -0
- package/dist/models/music/setters/index.js +36 -0
- package/dist/models/music/setters/putRelease.js +12 -0
- package/dist/models/music/setters/putTrack.js +12 -0
- package/dist/models/nfc/index.js +43 -4
- package/dist/models/payments/index.js +17 -0
- package/dist/models/post/index.js +141 -70
- package/dist/models/search/index.js +17 -4
- package/dist/models/session/index.js +112 -61
- package/dist/models/spectrum/index.js +96 -0
- package/dist/models/sync/index.js +9 -15
- package/dist/models/sync/services/tidal.js +1 -1
- package/dist/models/user/index.js +78 -100
- package/dist/remote.js +47 -0
- package/dist/{handlers/request.js → request.js} +3 -3
- package/dist/utils/generateRequest.js +52 -0
- package/dist/utils/importFrom.js +22 -0
- package/package.json +6 -5
- package/dist/handlers/measurePing.js +0 -58
- package/dist/models/livestream/index.js +0 -84
- package/dist/models/playlists/index.js +0 -124
- package/dist/models/sync/cores/spotifyCore.js +0 -87
- package/dist/models/sync/services/vrc.js +0 -121
- package/dist/models/widget/index.js +0 -18
- package/dist/remotes.js +0 -78
package/dist/remotes.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }function composeRemote(path) {
|
|
2
|
-
if (typeof window !== "undefined") {
|
|
3
|
-
if (window.localStorage.getItem("comty:use_indev") || window.location.hostname === "indev.comty.app") {
|
|
4
|
-
return envOrigins["indev"][path]
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
return envOrigins[_nullishCoalesce(globalThis._force_comtyjs_env, () => ( "production"))][path]
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function getCurrentHostname() {
|
|
12
|
-
if (typeof window === "undefined") {
|
|
13
|
-
return "localhost"
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return _nullishCoalesce(_optionalChain([window, 'optionalAccess', _ => _.location, 'optionalAccess', _2 => _2.hostname]), () => ( "localhost"))
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const envOrigins = {
|
|
20
|
-
"development": {
|
|
21
|
-
default: `http://${getCurrentHostname()}:3010`,
|
|
22
|
-
chat: `http://${getCurrentHostname()}:3020`,
|
|
23
|
-
livestreaming: `http://${getCurrentHostname()}:3030`,
|
|
24
|
-
marketplace: `http://${getCurrentHostname()}:3040`,
|
|
25
|
-
music: `http://${getCurrentHostname()}:3050`,
|
|
26
|
-
files: `http://${getCurrentHostname()}:3060`,
|
|
27
|
-
sync: `http://${getCurrentHostname()}:3070`,
|
|
28
|
-
},
|
|
29
|
-
"indev": {
|
|
30
|
-
default: `https://indev_api.comty.app/main`,
|
|
31
|
-
chat: `https://indev_api.comty.app/chat`,
|
|
32
|
-
livestreaming: `https://indev_api.comty.app/livestreaming`,
|
|
33
|
-
marketplace: `https://indev_api.comty.app/marketplace`,
|
|
34
|
-
music: `https://indev_api.comty.app/music`,
|
|
35
|
-
files: `https://indev_api.comty.app/files`,
|
|
36
|
-
sync: `https://indev_api.comty.app/sync`,
|
|
37
|
-
},
|
|
38
|
-
"production": {
|
|
39
|
-
default: "https://api.comty.app",
|
|
40
|
-
chat: `https://chat_api.comty.app`,
|
|
41
|
-
livestreaming: `https://livestreaming_api.comty.app`,
|
|
42
|
-
marketplace: `https://marketplace_api.comty.app`,
|
|
43
|
-
music: `https://music_api.comty.app`,
|
|
44
|
-
files: `https://files_api.comty.app`,
|
|
45
|
-
sync: `https://sync_api.comty.app`,
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
exports. default = {
|
|
50
|
-
default: {
|
|
51
|
-
origin: composeRemote("default"),
|
|
52
|
-
hasWebsocket: true,
|
|
53
|
-
},
|
|
54
|
-
chat: {
|
|
55
|
-
origin: composeRemote("chat"),
|
|
56
|
-
hasWebsocket: true,
|
|
57
|
-
},
|
|
58
|
-
music: {
|
|
59
|
-
origin: composeRemote("music"),
|
|
60
|
-
hasWebsocket: true,
|
|
61
|
-
},
|
|
62
|
-
livestreaming: {
|
|
63
|
-
origin: composeRemote("livestreaming"),
|
|
64
|
-
hasWebsocket: false,
|
|
65
|
-
},
|
|
66
|
-
marketplace: {
|
|
67
|
-
origin: composeRemote("marketplace"),
|
|
68
|
-
hasWebsocket: false,
|
|
69
|
-
},
|
|
70
|
-
files: {
|
|
71
|
-
origin: composeRemote("files"),
|
|
72
|
-
hasWebsocket: false,
|
|
73
|
-
},
|
|
74
|
-
sync: {
|
|
75
|
-
origin: composeRemote("sync"),
|
|
76
|
-
hasWebsocket: false,
|
|
77
|
-
}
|
|
78
|
-
}
|