@camera.ui/go2rtc 0.0.18 → 0.0.20
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 +10 -18
- package/dist/index.js.map +1 -1
- package/dist/install.js +30 -34
- package/dist/install.js.map +1 -1
- package/dist/utils.js +14 -41
- package/dist/utils.js.map +1 -1
- package/package.json +14 -13
package/dist/index.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import { platform } from 'node:os';
|
|
3
|
+
import { resolve } from 'node:path';
|
|
4
|
+
const __dirname = new URL('.', import.meta.url).pathname;
|
|
5
|
+
const go2rtcBinaryPath = resolve(__dirname, '../binary');
|
|
6
|
+
const go2rtcFile = 'go2rtc' + (platform() === 'win32' ? '.exe' : '');
|
|
7
|
+
const go2rtcExtractedFilePath = resolve(go2rtcBinaryPath, go2rtcFile);
|
|
8
|
+
export const go2rtcPath = () => go2rtcExtractedFilePath;
|
|
9
|
+
export const isGo2rtcAvailable = () => {
|
|
10
|
+
return fs.existsSync(go2rtcExtractedFilePath);
|
|
4
11
|
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.isGo2rtcAvailable = exports.go2rtcPath = void 0;
|
|
7
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
8
|
-
const os_1 = __importDefault(require("os"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const platform = os_1.default.platform();
|
|
11
|
-
const go2rtcBinaryPath = path_1.default.resolve(__dirname, '../binary');
|
|
12
|
-
const go2rtcFile = 'go2rtc' + (platform === 'win32' ? '.exe' : '');
|
|
13
|
-
const go2rtcExtractedFilePath = path_1.default.resolve(go2rtcBinaryPath, go2rtcFile);
|
|
14
|
-
const go2rtcPath = () => go2rtcExtractedFilePath;
|
|
15
|
-
exports.go2rtcPath = go2rtcPath;
|
|
16
|
-
const isGo2rtcAvailable = () => {
|
|
17
|
-
return fs_extra_1.default.existsSync(go2rtcExtractedFilePath);
|
|
18
|
-
};
|
|
19
|
-
exports.isGo2rtcAvailable = isGo2rtcAvailable;
|
|
20
12
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;AAEzD,MAAM,gBAAgB,GAAG,OAAO,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AACzD,MAAM,UAAU,GAAG,QAAQ,GAAG,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACrE,MAAM,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,UAAU,GAAG,GAAW,EAAE,CAAC,uBAAuB,CAAC;AAEhE,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAY,EAAE;IAC7C,OAAO,EAAE,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAAC;AAChD,CAAC,CAAC"}
|
package/dist/install.js
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const promises_1 = require("stream/promises");
|
|
12
|
-
const unzipper_1 = __importDefault(require("unzipper"));
|
|
13
|
-
const _1 = require(".");
|
|
14
|
-
const utils_1 = require("./utils");
|
|
2
|
+
import axios from 'axios';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
import { platform } from 'node:os';
|
|
5
|
+
import { extname, resolve } from 'node:path';
|
|
6
|
+
import { pipeline } from 'stream/promises';
|
|
7
|
+
import { Open } from 'unzipper';
|
|
8
|
+
import { go2rtcPath } from './index.js';
|
|
9
|
+
import { getArmArchitecture } from './utils.js';
|
|
10
|
+
const __dirname = new URL('.', import.meta.url).pathname;
|
|
15
11
|
const binaries = {
|
|
16
12
|
darwin: {
|
|
17
13
|
x64: 'go2rtc_mac_amd64.zip',
|
|
@@ -32,23 +28,23 @@ const binaries = {
|
|
|
32
28
|
},
|
|
33
29
|
};
|
|
34
30
|
const GO2RTC_VERSION = 'v1.9.4';
|
|
35
|
-
const arch =
|
|
36
|
-
const
|
|
37
|
-
const filename = binaries[
|
|
31
|
+
const arch = getArmArchitecture();
|
|
32
|
+
const sysPlatform = platform();
|
|
33
|
+
const filename = binaries[sysPlatform]?.[arch];
|
|
38
34
|
const releasesUrl = 'https://api.github.com/repos/AlexxIT/go2rtc/releases';
|
|
39
|
-
console.log(`Detected platform: ${
|
|
40
|
-
const go2rtcBinaryPath =
|
|
41
|
-
|
|
42
|
-
const go2rtcFilePath =
|
|
43
|
-
const go2rtcExtractedFilePath =
|
|
35
|
+
console.log(`Detected platform: ${sysPlatform} / ${arch}`);
|
|
36
|
+
const go2rtcBinaryPath = resolve(__dirname, '../binary');
|
|
37
|
+
fs.ensureDirSync(go2rtcBinaryPath);
|
|
38
|
+
const go2rtcFilePath = resolve(go2rtcBinaryPath, filename);
|
|
39
|
+
const go2rtcExtractedFilePath = go2rtcPath();
|
|
44
40
|
const isZipUrl = (url) => {
|
|
45
41
|
const pathArray = new URL(url).pathname.split('/');
|
|
46
42
|
const fileName = pathArray[pathArray.length - 1];
|
|
47
|
-
return fileName !== undefined &&
|
|
43
|
+
return fileName !== undefined && extname(fileName) === '.zip';
|
|
48
44
|
};
|
|
49
45
|
const downloadFile = async (url) => {
|
|
50
46
|
console.log(`Downloading Go2Rtc ${GO2RTC_VERSION} to ${go2rtcFilePath}...`);
|
|
51
|
-
const { data } = await
|
|
47
|
+
const { data } = await axios.get(url, {
|
|
52
48
|
onDownloadProgress: (progressEvent) => {
|
|
53
49
|
if (process.env.CI || !progressEvent.total) {
|
|
54
50
|
return;
|
|
@@ -63,25 +59,25 @@ const downloadFile = async (url) => {
|
|
|
63
59
|
maxRedirects: 3,
|
|
64
60
|
responseType: 'stream',
|
|
65
61
|
});
|
|
66
|
-
await
|
|
67
|
-
const streams = [data,
|
|
68
|
-
await
|
|
62
|
+
await fs.ensureDir(go2rtcBinaryPath);
|
|
63
|
+
const streams = [data, fs.createWriteStream(go2rtcFilePath)];
|
|
64
|
+
await pipeline(streams);
|
|
69
65
|
if (isZipUrl(url)) {
|
|
70
66
|
console.log(`Extracting ${go2rtcFilePath} to ${go2rtcExtractedFilePath}...`);
|
|
71
|
-
const directory = await
|
|
67
|
+
const directory = await Open.file(go2rtcFilePath);
|
|
72
68
|
await new Promise((resolve, reject) => {
|
|
73
|
-
directory.files[0].stream().pipe(
|
|
69
|
+
directory.files[0].stream().pipe(fs.createWriteStream(go2rtcExtractedFilePath)).on('error', reject).on('finish', resolve);
|
|
74
70
|
});
|
|
75
71
|
console.log(`Removing ${go2rtcFilePath}...`);
|
|
76
|
-
await
|
|
72
|
+
await fs.remove(go2rtcFilePath);
|
|
77
73
|
}
|
|
78
74
|
else {
|
|
79
75
|
console.log(`Renaming ${go2rtcFilePath} to ${go2rtcExtractedFilePath}...`);
|
|
80
|
-
await
|
|
76
|
+
await fs.rename(go2rtcFilePath, go2rtcExtractedFilePath);
|
|
81
77
|
}
|
|
82
78
|
};
|
|
83
79
|
const getReleaseAssets = async (version) => {
|
|
84
|
-
const response = await
|
|
80
|
+
const response = await axios.get(`${releasesUrl}/tags/${version}`);
|
|
85
81
|
const assets = response.data.assets.map((asset) => asset.browser_download_url);
|
|
86
82
|
const files = assets.map((asset) => asset.split(`${version}/`)[1]);
|
|
87
83
|
return {
|
|
@@ -92,13 +88,13 @@ const getReleaseAssets = async (version) => {
|
|
|
92
88
|
const downloadGo2Rtc = async () => {
|
|
93
89
|
const release = await getReleaseAssets(GO2RTC_VERSION);
|
|
94
90
|
if (!filename || !release.assets.find((r) => r.endsWith(filename))) {
|
|
95
|
-
throw new Error(`No go2rtc binary found for architecture (${
|
|
91
|
+
throw new Error(`No go2rtc binary found for architecture (${sysPlatform} / ${arch})`);
|
|
96
92
|
}
|
|
97
93
|
const downloadUrl = release.assets.find((r) => r.endsWith(filename));
|
|
98
94
|
await downloadFile(downloadUrl);
|
|
99
|
-
if (
|
|
95
|
+
if (sysPlatform === 'linux' || sysPlatform === 'darwin') {
|
|
100
96
|
console.log(`Making ${go2rtcExtractedFilePath} executable...`);
|
|
101
|
-
|
|
97
|
+
fs.chmodSync(go2rtcExtractedFilePath, 0o755);
|
|
102
98
|
}
|
|
103
99
|
console.log('Done!');
|
|
104
100
|
};
|
package/dist/install.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"install.js","sourceRoot":"","sources":["../src/install.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAE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2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getArmArchitecture = void 0;
|
|
27
|
-
const child_process_1 = require("child_process");
|
|
28
|
-
const os = __importStar(require("os"));
|
|
29
|
-
function getArmArchitecture() {
|
|
30
|
-
const platform = os.platform();
|
|
31
|
-
let arch = os.arch();
|
|
32
|
-
if (platform === 'win32') {
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
import { arch, platform } from 'node:os';
|
|
3
|
+
export function getArmArchitecture() {
|
|
4
|
+
const sysPlatform = platform();
|
|
5
|
+
let sysArch = arch();
|
|
6
|
+
if (sysPlatform === 'win32') {
|
|
33
7
|
try {
|
|
34
|
-
const output =
|
|
8
|
+
const output = execSync('wmic cpu get architecture', { encoding: 'utf8' });
|
|
35
9
|
const architecture = output.trim().split('\n')[1].trim();
|
|
36
10
|
if (architecture === '5') {
|
|
37
|
-
|
|
11
|
+
sysArch = 'arm6';
|
|
38
12
|
}
|
|
39
13
|
else if (architecture === '7') {
|
|
40
|
-
|
|
14
|
+
sysArch = 'arm7';
|
|
41
15
|
}
|
|
42
16
|
}
|
|
43
17
|
catch (error) {
|
|
44
18
|
console.error('Error executing "wmic cpu get architecture":', error);
|
|
45
19
|
}
|
|
46
20
|
}
|
|
47
|
-
else if (
|
|
21
|
+
else if (sysPlatform === 'linux') {
|
|
48
22
|
try {
|
|
49
|
-
const output =
|
|
23
|
+
const output = execSync('cat /proc/cpuinfo | grep "model name"', { encoding: 'utf8' });
|
|
50
24
|
const modelName = output.trim().split(':')[1].trim();
|
|
51
25
|
if (modelName.includes('ARMv6')) {
|
|
52
|
-
|
|
26
|
+
sysArch = 'arm6';
|
|
53
27
|
}
|
|
54
28
|
else if (modelName.includes('ARMv7')) {
|
|
55
|
-
|
|
29
|
+
sysArch = 'arm7';
|
|
56
30
|
}
|
|
57
31
|
}
|
|
58
32
|
catch (error) {
|
|
59
33
|
console.error('Error executing "cat /proc/cpuinfo | grep "model name":', error);
|
|
60
34
|
}
|
|
61
35
|
}
|
|
62
|
-
return
|
|
36
|
+
return sysArch;
|
|
63
37
|
}
|
|
64
|
-
exports.getArmArchitecture = getArmArchitecture;
|
|
65
38
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIzC,MAAM,UAAU,kBAAkB;IAChC,MAAM,WAAW,GAAG,QAAQ,EAAE,CAAC;IAC/B,IAAI,OAAO,GAAG,IAAI,EAAU,CAAC;IAE7B,IAAI,WAAW,KAAK,OAAO,EAAE,CAAC;QAC5B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,QAAQ,CAAC,2BAA2B,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YAC3E,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAEzD,IAAI,YAAY,KAAK,GAAG,EAAE,CAAC;gBACzB,OAAO,GAAG,MAAM,CAAC;YACnB,CAAC;iBAAM,IAAI,YAAY,KAAK,GAAG,EAAE,CAAC;gBAChC,OAAO,GAAG,MAAM,CAAC;YACnB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,8CAA8C,EAAE,KAAK,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;SAAM,IAAI,WAAW,KAAK,OAAO,EAAE,CAAC;QACnC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,QAAQ,CAAC,uCAAuC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;YACvF,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YAErD,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBAChC,OAAO,GAAG,MAAM,CAAC;YACnB,CAAC;iBAAM,IAAI,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;gBACvC,OAAO,GAAG,MAAM,CAAC;YACnB,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,yDAAyD,EAAE,KAAK,CAAC,CAAC;QAClF,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camera.ui/go2rtc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"description": "camera.ui go2rtc package",
|
|
5
5
|
"author": "seydx (https://github.com/seydx/camera.ui)",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
11
|
"default": "./dist/index.js",
|
|
@@ -21,26 +22,26 @@
|
|
|
21
22
|
"prepublishOnly": "npm i --package-lock-only && npm run lint && npm run format && npm run build"
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
|
-
"axios": "^1.7.
|
|
25
|
+
"axios": "^1.7.3",
|
|
25
26
|
"fs-extra": "11.2.0",
|
|
26
27
|
"unzipper": "^0.10.14"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
|
-
"@rushstack/eslint-patch": "^1.10.
|
|
30
|
+
"@rushstack/eslint-patch": "^1.10.4",
|
|
30
31
|
"@types/fs-extra": "^11.0.4",
|
|
31
|
-
"@types/node": "^
|
|
32
|
-
"@types/ws": "^8.5.
|
|
33
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
34
|
-
"@typescript-eslint/parser": "^
|
|
35
|
-
"@types/unzipper": "^0.10.
|
|
32
|
+
"@types/node": "^22.1.0",
|
|
33
|
+
"@types/ws": "^8.5.12",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^8.0.1",
|
|
35
|
+
"@typescript-eslint/parser": "^8.0.1",
|
|
36
|
+
"@types/unzipper": "^0.10.10",
|
|
36
37
|
"concurrently": "^8.2.2",
|
|
37
38
|
"eslint": "8.57.0",
|
|
38
39
|
"eslint-config-prettier": "^9.1.0",
|
|
39
|
-
"eslint-plugin-prettier": "^5.1
|
|
40
|
-
"prettier": "^3.3.
|
|
41
|
-
"rimraf": "^
|
|
42
|
-
"typescript": "^5.4
|
|
43
|
-
"updates": "^16.
|
|
40
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
41
|
+
"prettier": "^3.3.3",
|
|
42
|
+
"rimraf": "^6.0.1",
|
|
43
|
+
"typescript": "^5.5.4",
|
|
44
|
+
"updates": "^16.3.7"
|
|
44
45
|
},
|
|
45
46
|
"bugs": {
|
|
46
47
|
"url": "https://github.com/seydx/camera.ui/issues"
|