comty.js 0.47.4 → 0.49.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.
- package/dist/index.js +3 -1
- package/dist/models/nfc/index.js +56 -0
- package/dist/models/playlists/index.js +2 -1
- package/dist/models/user/index.js +1 -1
- package/dist/remotes.js +14 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
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
|
|
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 _packagejson = require('../package.json'); var _packagejson2 = _interopRequireDefault(_packagejson);
|
|
2
|
+
var _events = require('@foxify/events'); var _events2 = _interopRequireDefault(_events);
|
|
2
3
|
|
|
3
4
|
var _axios = require('axios'); var _axios2 = _interopRequireDefault(_axios);
|
|
4
5
|
var _socketioclient = require('socket.io-client');
|
|
@@ -145,6 +146,7 @@ if (globalThis.isServerMode) {
|
|
|
145
146
|
instances: Object(),
|
|
146
147
|
wsInstances: Object(),
|
|
147
148
|
rest: null,
|
|
149
|
+
version: _packagejson2.default.version,
|
|
148
150
|
}
|
|
149
151
|
|
|
150
152
|
if (globalThis.isServerMode) {
|
|
@@ -0,0 +1,56 @@
|
|
|
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);
|
|
2
|
+
|
|
3
|
+
class NFCModel {
|
|
4
|
+
static async getOwnTags() {
|
|
5
|
+
const { data } = await _request2.default.call(void 0, {
|
|
6
|
+
method: "GET",
|
|
7
|
+
url: `/nfc/tags`
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
return data
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
static async getTagById(id) {
|
|
14
|
+
if (!id) {
|
|
15
|
+
throw new Error("ID is required")
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const { data } = await _request2.default.call(void 0, {
|
|
19
|
+
method: "GET",
|
|
20
|
+
url: `/nfc/tags/${id}`
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
return data
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
static async getTagBySerial(serial) {
|
|
27
|
+
if (!serial) {
|
|
28
|
+
throw new Error("Serial is required")
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const { data } = await _request2.default.call(void 0, {
|
|
32
|
+
method: "GET",
|
|
33
|
+
url: `/nfc/tag/serial/${serial}`
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
return data
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static async registerTag(serial, payload) {
|
|
40
|
+
if (!serial) {
|
|
41
|
+
throw new Error("Serial is required")
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (!payload) {
|
|
45
|
+
throw new Error("Payload is required")
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const { data } = await _request2.default.call(void 0, {
|
|
49
|
+
method: "POST",
|
|
50
|
+
url: `/nfc/tag/${serial}`,
|
|
51
|
+
data: payload
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
return data
|
|
55
|
+
}
|
|
56
|
+
} exports.default = NFCModel;
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
return data
|
|
35
35
|
}}
|
|
36
36
|
|
|
37
|
-
static __initStatic3() {this.deletePlaylist = async (id) => {
|
|
37
|
+
static __initStatic3() {this.deletePlaylist = async (id, options = {}) => {
|
|
38
38
|
if (!id) {
|
|
39
39
|
throw new Error("ID is required")
|
|
40
40
|
}
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
instance: PlaylistsModel.api_instance,
|
|
44
44
|
method: "DELETE",
|
|
45
45
|
url: `/playlists/${id}`,
|
|
46
|
+
params: options,
|
|
46
47
|
})
|
|
47
48
|
|
|
48
49
|
return data
|
|
@@ -92,7 +92,7 @@ var _request = require('../../handlers/request'); var _request2 = _interopRequir
|
|
|
92
92
|
|
|
93
93
|
const { data } = await _request2.default.call(void 0, {
|
|
94
94
|
method: "POST",
|
|
95
|
-
url: "/self/update_password",
|
|
95
|
+
url: "/user/self/update_password",
|
|
96
96
|
data: {
|
|
97
97
|
currentPassword,
|
|
98
98
|
newPassword,
|
package/dist/remotes.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
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
|
+
|
|
2
8
|
return envOrigins[_nullishCoalesce(process.env.NODE_ENV, () => ( "production"))][path]
|
|
3
9
|
}
|
|
4
10
|
|
|
@@ -19,6 +25,14 @@ const envOrigins = {
|
|
|
19
25
|
music: `http://${getCurrentHostname()}:3050`,
|
|
20
26
|
files: `http://${getCurrentHostname()}:3060`,
|
|
21
27
|
},
|
|
28
|
+
"indev": {
|
|
29
|
+
default: `https://indev_api.comty.app/default`,
|
|
30
|
+
chat: `https://indev_api.comty.app/chat`,
|
|
31
|
+
livestreaming: `https://indev_api.comty.app/livestreaming`,
|
|
32
|
+
marketplace: `https://indev_api.comty.app/marketplace`,
|
|
33
|
+
music: `https://indev_api.comty.app/music`,
|
|
34
|
+
files: `https://indev_api.comty.app/files`,
|
|
35
|
+
},
|
|
22
36
|
"production": {
|
|
23
37
|
default: "https://api.comty.app",
|
|
24
38
|
chat: `https://chat_api.comty.app`,
|