manageos 1.0.0 → 1.0.2
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/README.md +142 -0
- package/dist/audio.d.ts +38 -0
- package/dist/audio.d.ts.map +1 -0
- package/dist/audio.js +178 -0
- package/dist/audio.js.map +1 -0
- package/dist/clipboard.d.ts +16 -0
- package/dist/clipboard.d.ts.map +1 -0
- package/dist/clipboard.js +56 -0
- package/dist/clipboard.js.map +1 -0
- package/dist/encryption.d.ts +16 -0
- package/dist/encryption.d.ts.map +1 -0
- package/dist/encryption.js +53 -0
- package/dist/encryption.js.map +1 -0
- package/dist/filesystem.d.ts +2 -0
- package/dist/filesystem.d.ts.map +1 -1
- package/dist/filesystem.js +40 -15
- package/dist/filesystem.js.map +1 -1
- package/dist/firewall.d.ts +39 -0
- package/dist/firewall.d.ts.map +1 -0
- package/dist/firewall.js +116 -0
- package/dist/firewall.js.map +1 -0
- package/dist/index.d.ts +22 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -11
- package/dist/index.js.map +1 -1
- package/dist/network.d.ts +82 -0
- package/dist/network.d.ts.map +1 -0
- package/dist/network.js +355 -0
- package/dist/network.js.map +1 -0
- package/dist/notification.d.ts +81 -0
- package/dist/notification.d.ts.map +1 -0
- package/dist/notification.js +146 -0
- package/dist/notification.js.map +1 -0
- package/dist/power.d.ts +18 -0
- package/dist/power.d.ts.map +1 -0
- package/dist/power.js +65 -0
- package/dist/power.js.map +1 -0
- package/dist/regedit.js +38 -2
- package/dist/regedit.js.map +1 -1
- package/dist/screen.d.ts +11 -0
- package/dist/screen.d.ts.map +1 -0
- package/dist/screen.js +13 -0
- package/dist/screen.js.map +1 -0
- package/dist/services.d.ts +60 -0
- package/dist/services.d.ts.map +1 -0
- package/dist/services.js +322 -0
- package/dist/services.js.map +1 -0
- package/dist/systeminfo.js +21 -15
- package/dist/systeminfo.js.map +1 -1
- package/dist/taskmgr.js +11 -8
- package/dist/taskmgr.js.map +1 -1
- package/dist/uac.d.ts +28 -0
- package/dist/uac.d.ts.map +1 -0
- package/dist/uac.js +69 -0
- package/dist/uac.js.map +1 -0
- package/dist/{usermanager.d.ts → users.d.ts} +2 -2
- package/dist/users.d.ts.map +1 -0
- package/dist/{usermanager.js → users.js} +7 -4
- package/dist/users.js.map +1 -0
- package/package.json +11 -1
- package/dist/usermanager.d.ts.map +0 -1
- package/dist/usermanager.js.map +0 -1
package/dist/filesystem.js
CHANGED
|
@@ -1,18 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
3
8
|
class Sync {
|
|
9
|
+
static createFile(filePath, content = "") {
|
|
10
|
+
try {
|
|
11
|
+
(0, child_process_1.execSync)(`echo ${content} > "${filePath}"`);
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
catch (e) {
|
|
15
|
+
return e;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
4
18
|
static currentPath() {
|
|
5
19
|
return __dirname;
|
|
6
20
|
}
|
|
7
21
|
static listDirectory(dirPath) {
|
|
8
22
|
try {
|
|
9
|
-
const stdout = execSync(`dir "${dirPath}" /B`, { encoding: "utf8" });
|
|
23
|
+
const stdout = (0, child_process_1.execSync)(`dir "${dirPath}" /B`, { encoding: "utf8" });
|
|
10
24
|
const files = stdout
|
|
11
25
|
.trim()
|
|
12
26
|
.split("\n")
|
|
13
27
|
.map((name) => ({
|
|
14
28
|
name: name.trim(),
|
|
15
|
-
path:
|
|
29
|
+
path: path_1.default.join(dirPath, name.trim()),
|
|
16
30
|
size: "",
|
|
17
31
|
isDirectory: false,
|
|
18
32
|
}));
|
|
@@ -24,7 +38,7 @@ class Sync {
|
|
|
24
38
|
}
|
|
25
39
|
static readFile(filePath) {
|
|
26
40
|
try {
|
|
27
|
-
const content = execSync(`type "${filePath}"`, { encoding: "utf8" });
|
|
41
|
+
const content = (0, child_process_1.execSync)(`type "${filePath}"`, { encoding: "utf8" });
|
|
28
42
|
return content;
|
|
29
43
|
}
|
|
30
44
|
catch (error) {
|
|
@@ -33,7 +47,7 @@ class Sync {
|
|
|
33
47
|
}
|
|
34
48
|
static deleteFile(filePath, force = false) {
|
|
35
49
|
try {
|
|
36
|
-
execSync(`del ${force ? "/F" : ""} "${filePath}"`);
|
|
50
|
+
(0, child_process_1.execSync)(`del ${force ? "/F" : ""} "${filePath}"`);
|
|
37
51
|
return true;
|
|
38
52
|
}
|
|
39
53
|
catch (e) {
|
|
@@ -42,7 +56,7 @@ class Sync {
|
|
|
42
56
|
}
|
|
43
57
|
static createDirectory(dirPath) {
|
|
44
58
|
try {
|
|
45
|
-
execSync(`mkdir "${dirPath}"`);
|
|
59
|
+
(0, child_process_1.execSync)(`mkdir "${dirPath}"`);
|
|
46
60
|
return true;
|
|
47
61
|
}
|
|
48
62
|
catch (e) {
|
|
@@ -51,7 +65,7 @@ class Sync {
|
|
|
51
65
|
}
|
|
52
66
|
static deleteDirectory(dirPath, force = false) {
|
|
53
67
|
try {
|
|
54
|
-
execSync(`rmdir ${force ? "/S /Q" : ""} "${dirPath}"`);
|
|
68
|
+
(0, child_process_1.execSync)(`rmdir ${force ? "/S /Q" : ""} "${dirPath}"`);
|
|
55
69
|
return true;
|
|
56
70
|
}
|
|
57
71
|
catch (e) {
|
|
@@ -63,9 +77,19 @@ class Async {
|
|
|
63
77
|
static currentPath() {
|
|
64
78
|
return __dirname;
|
|
65
79
|
}
|
|
80
|
+
static createFile(filePath, content = "") {
|
|
81
|
+
return new Promise((resolve) => {
|
|
82
|
+
(0, child_process_1.exec)(`echo ${content} > "${filePath}"`, (err) => {
|
|
83
|
+
if (err)
|
|
84
|
+
resolve(err);
|
|
85
|
+
else
|
|
86
|
+
resolve(true);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
66
90
|
static listDirectory(dirPath) {
|
|
67
91
|
return new Promise((resolve, reject) => {
|
|
68
|
-
exec(`dir "${dirPath}" /B`, (err, stdout) => {
|
|
92
|
+
(0, child_process_1.exec)(`dir "${dirPath}" /B`, (err, stdout) => {
|
|
69
93
|
if (err)
|
|
70
94
|
return reject(err);
|
|
71
95
|
const files = stdout
|
|
@@ -73,7 +97,7 @@ class Async {
|
|
|
73
97
|
.split("\n")
|
|
74
98
|
.map((name) => ({
|
|
75
99
|
name: name.trim(),
|
|
76
|
-
path:
|
|
100
|
+
path: path_1.default.join(dirPath, name.trim()),
|
|
77
101
|
size: "",
|
|
78
102
|
isDirectory: false,
|
|
79
103
|
}));
|
|
@@ -83,7 +107,7 @@ class Async {
|
|
|
83
107
|
}
|
|
84
108
|
static readFile(filePath) {
|
|
85
109
|
return new Promise((resolve, reject) => {
|
|
86
|
-
exec(`type "${filePath}"`, (err, stdout) => {
|
|
110
|
+
(0, child_process_1.exec)(`type "${filePath}"`, (err, stdout) => {
|
|
87
111
|
if (err)
|
|
88
112
|
return reject(err);
|
|
89
113
|
resolve(stdout);
|
|
@@ -92,7 +116,7 @@ class Async {
|
|
|
92
116
|
}
|
|
93
117
|
static deleteFile(filePath, force = false) {
|
|
94
118
|
return new Promise((resolve) => {
|
|
95
|
-
exec(`del ${force ? "/F" : ""} "${filePath}"`, (err) => {
|
|
119
|
+
(0, child_process_1.exec)(`del ${force ? "/F" : ""} "${filePath}"`, (err) => {
|
|
96
120
|
if (err)
|
|
97
121
|
resolve(err);
|
|
98
122
|
else {
|
|
@@ -103,7 +127,7 @@ class Async {
|
|
|
103
127
|
}
|
|
104
128
|
static createDirectory(dirPath) {
|
|
105
129
|
return new Promise((resolve) => {
|
|
106
|
-
exec(`mkdir "${dirPath}"`, (err) => {
|
|
130
|
+
(0, child_process_1.exec)(`mkdir "${dirPath}"`, (err) => {
|
|
107
131
|
if (err)
|
|
108
132
|
resolve(err);
|
|
109
133
|
else {
|
|
@@ -114,7 +138,7 @@ class Async {
|
|
|
114
138
|
}
|
|
115
139
|
static deleteDirectory(dirPath, force = false) {
|
|
116
140
|
return new Promise((resolve) => {
|
|
117
|
-
exec(`rmdir ${force ? "/S /Q" : ""} "${dirPath}"`, (err) => {
|
|
141
|
+
(0, child_process_1.exec)(`rmdir ${force ? "/S /Q" : ""} "${dirPath}"`, (err) => {
|
|
118
142
|
if (err)
|
|
119
143
|
resolve(err);
|
|
120
144
|
else {
|
|
@@ -124,8 +148,9 @@ class Async {
|
|
|
124
148
|
});
|
|
125
149
|
}
|
|
126
150
|
}
|
|
127
|
-
|
|
151
|
+
class FileSystem {
|
|
128
152
|
static async = Async;
|
|
129
153
|
static sync = Sync;
|
|
130
154
|
}
|
|
155
|
+
exports.default = FileSystem;
|
|
131
156
|
//# sourceMappingURL=filesystem.js.map
|
package/dist/filesystem.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../src/filesystem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../src/filesystem.ts"],"names":[],"mappings":";;;;;AAAA,iDAA+C;AAC/C,gDAAwB;AASxB,MAAM,IAAI;IACR,MAAM,CAAC,UAAU,CAAC,QAAgB,EAAE,OAAO,GAAG,EAAE;QAC9C,IAAI,CAAC;YACH,IAAA,wBAAQ,EAAC,QAAQ,OAAO,OAAO,QAAQ,GAAG,CAAC,CAAC;YAC5C,OAAO,IAAI,CAAC;QACd,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,CAAC;QACX,CAAC;IACH,CAAC;IAED,MAAM,CAAC,WAAW;QAChB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,CAAC,aAAa,CAAC,OAAe;Q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AU,OAAO,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;gBACjC,IAAI,GAAG;oBAAE,OAAO,CAAC,GAAG,CAAC,CAAC;qBACjB,CAAC;oBACJ,OAAO,CAAC,IAAI,CAAC,CAAC;gBAChB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CAAC,eAAe,CACpB,OAAe,EACf,KAAK,GAAG,KAAK;QAEb,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7B,IAAA,oBAAI,EAAC,SAAS,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;gBACzD,IAAI,GAAG;oBAAE,OAAO,CAAC,GAAG,CAAC,CAAC;qBACjB,CAAC;oBACJ,OAAO,CAAC,IAAI,CAAC,CAAC;gBAChB,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAED,MAAqB,UAAU;IAC7B,MAAM,CAAU,KAAK,GAAG,KAAK,CAAC;IAC9B,MAAM,CAAU,IAAI,GAAG,IAAI,CAAC;;AAF9B,6BAGC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
type Rule = {
|
|
2
|
+
name: string;
|
|
3
|
+
direction?: "Inbound" | "Outbound";
|
|
4
|
+
action?: "Allow" | "Block";
|
|
5
|
+
protocol?: "TCP" | "UDP" | "Any";
|
|
6
|
+
localPort?: number | string;
|
|
7
|
+
remoteAddress?: string;
|
|
8
|
+
};
|
|
9
|
+
type FirewallResult = {
|
|
10
|
+
success: boolean;
|
|
11
|
+
error?: string;
|
|
12
|
+
};
|
|
13
|
+
type ListRulesResult = {
|
|
14
|
+
success: boolean;
|
|
15
|
+
rules?: string[];
|
|
16
|
+
error?: string;
|
|
17
|
+
};
|
|
18
|
+
declare class Async {
|
|
19
|
+
private static runCommand;
|
|
20
|
+
static addRule(rule: Rule): Promise<FirewallResult>;
|
|
21
|
+
static removeRule(name: string): Promise<FirewallResult>;
|
|
22
|
+
static listRules(): Promise<ListRulesResult>;
|
|
23
|
+
}
|
|
24
|
+
declare class Sync {
|
|
25
|
+
private static runCommand;
|
|
26
|
+
static addRule(rule: Rule): FirewallResult;
|
|
27
|
+
static removeRule(name: string): FirewallResult;
|
|
28
|
+
static listRules(): {
|
|
29
|
+
success: boolean;
|
|
30
|
+
rules?: string[];
|
|
31
|
+
error?: string;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export default class Firewall {
|
|
35
|
+
static readonly Sync: typeof Sync;
|
|
36
|
+
static readonly Async: typeof Async;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
39
|
+
//# sourceMappingURL=firewall.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firewall.d.ts","sourceRoot":"","sources":["../src/firewall.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IACnC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,eAAe,GAAG;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,cAAM,KAAK;IACT,OAAO,CAAC,MAAM,CAAC,UAAU;WASZ,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,cAAc,CAAC;WAsB5C,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;WAUjD,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC;CAmBnD;AAED,cAAM,IAAI;IACR,OAAO,CAAC,MAAM,CAAC,UAAU;IAIzB,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,cAAc;IAsB1C,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc;IAU/C,MAAM,CAAC,SAAS,IAAI;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;CAe3E;AAED,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,gBAAuB,IAAI,cAAQ;IACnC,gBAAuB,KAAK,eAAS;CACtC"}
|
package/dist/firewall.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const child_process_1 = require("child_process");
|
|
4
|
+
class Async {
|
|
5
|
+
static runCommand(cmd) {
|
|
6
|
+
return new Promise((resolve, reject) => {
|
|
7
|
+
(0, child_process_1.exec)(`powershell -Command "${cmd}"`, (error) => {
|
|
8
|
+
if (error)
|
|
9
|
+
reject(error);
|
|
10
|
+
else
|
|
11
|
+
resolve();
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
static async addRule(rule) {
|
|
16
|
+
try {
|
|
17
|
+
const parts = [
|
|
18
|
+
`-DisplayName "${rule.name}"`,
|
|
19
|
+
`-Direction ${rule.direction || "Inbound"}`,
|
|
20
|
+
`-Action ${rule.action || "Allow"}`,
|
|
21
|
+
];
|
|
22
|
+
if (rule.protocol)
|
|
23
|
+
parts.push(`-Protocol ${rule.protocol}`);
|
|
24
|
+
if (rule.localPort)
|
|
25
|
+
parts.push(`-LocalPort ${rule.localPort}`);
|
|
26
|
+
if (rule.remoteAddress)
|
|
27
|
+
parts.push(`-RemoteAddress ${rule.remoteAddress}`);
|
|
28
|
+
const cmd = `New-NetFirewallRule ${parts.join(" ")}`;
|
|
29
|
+
await this.runCommand(cmd);
|
|
30
|
+
return { success: true };
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
return { success: false, error: error.message };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
static async removeRule(name) {
|
|
37
|
+
try {
|
|
38
|
+
const cmd = `Remove-NetFirewallRule -DisplayName "${name}"`;
|
|
39
|
+
await this.runCommand(cmd);
|
|
40
|
+
return { success: true };
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
return { success: false, error: error.message };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
static async listRules() {
|
|
47
|
+
return new Promise((resolve) => {
|
|
48
|
+
(0, child_process_1.exec)(`powershell -Command "Get-NetFirewallRule | Select-Object -ExpandProperty DisplayName"`, { encoding: "utf-8" }, (error, stdout) => {
|
|
49
|
+
if (error) {
|
|
50
|
+
resolve({ success: false, error: error.message });
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const rules = stdout
|
|
54
|
+
.split("\n")
|
|
55
|
+
.map((line) => line.trim())
|
|
56
|
+
.filter((line) => line);
|
|
57
|
+
resolve({ success: true, rules });
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
class Sync {
|
|
63
|
+
static runCommand(cmd) {
|
|
64
|
+
(0, child_process_1.execSync)(`powershell -Command "${cmd}"`, { stdio: "ignore" });
|
|
65
|
+
}
|
|
66
|
+
static addRule(rule) {
|
|
67
|
+
try {
|
|
68
|
+
const parts = [
|
|
69
|
+
`-DisplayName "${rule.name}"`,
|
|
70
|
+
`-Direction ${rule.direction || "Inbound"}`,
|
|
71
|
+
`-Action ${rule.action || "Allow"}`,
|
|
72
|
+
];
|
|
73
|
+
if (rule.protocol)
|
|
74
|
+
parts.push(`-Protocol ${rule.protocol}`);
|
|
75
|
+
if (rule.localPort)
|
|
76
|
+
parts.push(`-LocalPort ${rule.localPort}`);
|
|
77
|
+
if (rule.remoteAddress)
|
|
78
|
+
parts.push(`-RemoteAddress ${rule.remoteAddress}`);
|
|
79
|
+
const cmd = `New-NetFirewallRule ${parts.join(" ")}`;
|
|
80
|
+
this.runCommand(cmd);
|
|
81
|
+
return { success: true };
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
return { success: false, error: error.message };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
static removeRule(name) {
|
|
88
|
+
try {
|
|
89
|
+
const cmd = `Remove-NetFirewallRule -DisplayName "${name}"`;
|
|
90
|
+
this.runCommand(cmd);
|
|
91
|
+
return { success: true };
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
return { success: false, error: error.message };
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
static listRules() {
|
|
98
|
+
try {
|
|
99
|
+
const output = (0, child_process_1.execSync)(`powershell -Command "Get-NetFirewallRule | Select-Object -ExpandProperty DisplayName"`, { encoding: "utf-8" });
|
|
100
|
+
const rules = output
|
|
101
|
+
.split("\n")
|
|
102
|
+
.map((line) => line.trim())
|
|
103
|
+
.filter((line) => line);
|
|
104
|
+
return { success: true, rules };
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
return { success: false, error: error.message };
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
class Firewall {
|
|
112
|
+
static Sync = Sync;
|
|
113
|
+
static Async = Async;
|
|
114
|
+
}
|
|
115
|
+
exports.default = Firewall;
|
|
116
|
+
//# sourceMappingURL=firewall.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"firewall.js","sourceRoot":"","sources":["../src/firewall.ts"],"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D,CAAC;IACH,CAAC;IAED,MAAM,CAAC,SAAS;QACd,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,IAAA,wBAAQ,EACrB,uFAAuF,EACvF,EAAE,QAAQ,EAAE,OAAO,EAAE,CACtB,CAAC;YACF,MAAM,KAAK,GAAG,MAAM;iBACjB,KAAK,CAAC,IAAI,CAAC;iBACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;iBAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;YAC1B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;QAClC,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC;QAClD,CAAC;IACH,CAAC;CACF;AAED,MAAqB,QAAQ;IACpB,MAAM,CAAU,IAAI,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAU,KAAK,GAAG,KAAK,CAAC;;AAFvC,2BAGC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,12 +2,32 @@ import Regedit from "./regedit";
|
|
|
2
2
|
import Taskmgr from "./taskmgr";
|
|
3
3
|
import FileSystem from "./filesystem";
|
|
4
4
|
import SystemInfo from "./systeminfo";
|
|
5
|
-
import
|
|
5
|
+
import Users from "./users";
|
|
6
|
+
import Network from "./network";
|
|
7
|
+
import Clipboard from "./clipboard";
|
|
8
|
+
import Audio from "./audio";
|
|
9
|
+
import Notification from "./notification";
|
|
10
|
+
import Screen from "./screen";
|
|
11
|
+
import Power from "./power";
|
|
12
|
+
import Services from "./services";
|
|
13
|
+
import Firewall from "./firewall";
|
|
14
|
+
import UAC from "./uac";
|
|
15
|
+
import Encryption from "./encryption";
|
|
6
16
|
export default class ManageOS {
|
|
7
17
|
static readonly Regedit: typeof Regedit;
|
|
8
18
|
static readonly Taskmgr: typeof Taskmgr;
|
|
9
19
|
static readonly FileSystem: typeof FileSystem;
|
|
10
20
|
static readonly SystemInfo: typeof SystemInfo;
|
|
11
|
-
static readonly
|
|
21
|
+
static readonly Users: typeof Users;
|
|
22
|
+
static readonly Network: typeof Network;
|
|
23
|
+
static readonly Clipboard: typeof Clipboard;
|
|
24
|
+
static readonly Audio: typeof Audio;
|
|
25
|
+
static readonly Notification: typeof Notification;
|
|
26
|
+
static readonly Screen: typeof Screen;
|
|
27
|
+
static readonly Power: typeof Power;
|
|
28
|
+
static readonly Services: typeof Services;
|
|
29
|
+
static readonly Firewall: typeof Firewall;
|
|
30
|
+
static readonly UAC: typeof UAC;
|
|
31
|
+
static readonly Encryption: typeof Encryption;
|
|
12
32
|
}
|
|
13
33
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,WAAW,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,YAAY,MAAM,gBAAgB,CAAC;AAC1C,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,KAAK,MAAM,SAAS,CAAC;AAC5B,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,QAAQ,MAAM,YAAY,CAAC;AAClC,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,MAAM,CAAC,OAAO,OAAO,QAAQ;IAC3B,MAAM,CAAC,QAAQ,CAAC,OAAO,iBAAW;IAClC,MAAM,CAAC,QAAQ,CAAC,OAAO,iBAAW;IAClC,MAAM,CAAC,QAAQ,CAAC,UAAU,oBAAc;IACxC,MAAM,CAAC,QAAQ,CAAC,UAAU,oBAAc;IACxC,MAAM,CAAC,QAAQ,CAAC,KAAK,eAAS;IAC9B,MAAM,CAAC,QAAQ,CAAC,OAAO,iBAAW;IAClC,MAAM,CAAC,QAAQ,CAAC,SAAS,mBAAa;IACtC,MAAM,CAAC,QAAQ,CAAC,KAAK,eAAS;IAC9B,MAAM,CAAC,QAAQ,CAAC,YAAY,sBAAgB;IAC5C,MAAM,CAAC,QAAQ,CAAC,MAAM,gBAAU;IAChC,MAAM,CAAC,QAAQ,CAAC,KAAK,eAAS;IAC9B,MAAM,CAAC,QAAQ,CAAC,QAAQ,kBAAY;IACpC,MAAM,CAAC,QAAQ,CAAC,QAAQ,kBAAY;IACpC,MAAM,CAAC,QAAQ,CAAC,GAAG,aAAO;IAC1B,MAAM,CAAC,QAAQ,CAAC,UAAU,oBAAc;CACzC"}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const regedit_1 = __importDefault(require("./regedit"));
|
|
7
|
+
const taskmgr_1 = __importDefault(require("./taskmgr"));
|
|
8
|
+
const filesystem_1 = __importDefault(require("./filesystem"));
|
|
9
|
+
const systeminfo_1 = __importDefault(require("./systeminfo"));
|
|
10
|
+
const users_1 = __importDefault(require("./users"));
|
|
11
|
+
const network_1 = __importDefault(require("./network"));
|
|
12
|
+
const clipboard_1 = __importDefault(require("./clipboard"));
|
|
13
|
+
const audio_1 = __importDefault(require("./audio"));
|
|
14
|
+
const notification_1 = __importDefault(require("./notification"));
|
|
15
|
+
const screen_1 = __importDefault(require("./screen"));
|
|
16
|
+
const power_1 = __importDefault(require("./power"));
|
|
17
|
+
const services_1 = __importDefault(require("./services"));
|
|
18
|
+
const firewall_1 = __importDefault(require("./firewall"));
|
|
19
|
+
const uac_1 = __importDefault(require("./uac"));
|
|
20
|
+
const encryption_1 = __importDefault(require("./encryption"));
|
|
21
|
+
class ManageOS {
|
|
22
|
+
static Regedit = regedit_1.default;
|
|
23
|
+
static Taskmgr = taskmgr_1.default;
|
|
24
|
+
static FileSystem = filesystem_1.default;
|
|
25
|
+
static SystemInfo = systeminfo_1.default;
|
|
26
|
+
static Users = users_1.default;
|
|
27
|
+
static Network = network_1.default;
|
|
28
|
+
static Clipboard = clipboard_1.default;
|
|
29
|
+
static Audio = audio_1.default;
|
|
30
|
+
static Notification = notification_1.default;
|
|
31
|
+
static Screen = screen_1.default;
|
|
32
|
+
static Power = power_1.default;
|
|
33
|
+
static Services = services_1.default;
|
|
34
|
+
static Firewall = firewall_1.default;
|
|
35
|
+
static UAC = uac_1.default;
|
|
36
|
+
static Encryption = encryption_1.default;
|
|
12
37
|
}
|
|
38
|
+
exports.default = ManageOS;
|
|
13
39
|
//# 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":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAgC;AAChC,wDAAgC;AAChC,8DAAsC;AACtC,8DAAsC;AACtC,oDAA4B;AAC5B,wDAAgC;AAChC,4DAAoC;AACpC,oDAA4B;AAC5B,kEAA0C;AAC1C,sDAA8B;AAC9B,oDAA4B;AAC5B,0DAAkC;AAClC,0DAAkC;AAClC,gDAAwB;AACxB,8DAAsC;AAEtC,MAAqB,QAAQ;IAC3B,MAAM,CAAU,OAAO,GAAG,iBAAO,CAAC;IAClC,MAAM,CAAU,OAAO,GAAG,iBAAO,CAAC;IAClC,MAAM,CAAU,UAAU,GAAG,oBAAU,CAAC;IACxC,MAAM,CAAU,UAAU,GAAG,oBAAU,CAAC;IACxC,MAAM,CAAU,KAAK,GAAG,eAAK,CAAC;IAC9B,MAAM,CAAU,OAAO,GAAG,iBAAO,CAAC;IAClC,MAAM,CAAU,SAAS,GAAG,mBAAS,CAAC;IACtC,MAAM,CAAU,KAAK,GAAG,eAAK,CAAC;IAC9B,MAAM,CAAU,YAAY,GAAG,sBAAY,CAAC;IAC5C,MAAM,CAAU,MAAM,GAAG,gBAAM,CAAC;IAChC,MAAM,CAAU,KAAK,GAAG,eAAK,CAAC;IAC9B,MAAM,CAAU,QAAQ,GAAG,kBAAQ,CAAC;IACpC,MAAM,CAAU,QAAQ,GAAG,kBAAQ,CAAC;IACpC,MAAM,CAAU,GAAG,GAAG,aAAG,CAAC;IAC1B,MAAM,CAAU,UAAU,GAAG,oBAAU,CAAC;;AAf1C,2BAgBC"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
type WifiConnectResult = {
|
|
2
|
+
success: boolean;
|
|
3
|
+
error?: string;
|
|
4
|
+
};
|
|
5
|
+
type PingResult = {
|
|
6
|
+
host: string;
|
|
7
|
+
alive: boolean;
|
|
8
|
+
time: number | null;
|
|
9
|
+
numeric_host: string | null;
|
|
10
|
+
details: object | null;
|
|
11
|
+
error?: string;
|
|
12
|
+
};
|
|
13
|
+
type PingCallback = (result: PingResult) => void;
|
|
14
|
+
type WifiProfile = {
|
|
15
|
+
name: string | null;
|
|
16
|
+
ssid: string | null;
|
|
17
|
+
networkType: string | null;
|
|
18
|
+
radioType: string | null;
|
|
19
|
+
authentication: string | null;
|
|
20
|
+
cipher: string | null;
|
|
21
|
+
keyContent: string | null;
|
|
22
|
+
raw: Record<string, string | number | boolean>;
|
|
23
|
+
} | null;
|
|
24
|
+
type BSSID = {
|
|
25
|
+
bssid: string;
|
|
26
|
+
signal?: string;
|
|
27
|
+
radioType?: string;
|
|
28
|
+
channel?: string;
|
|
29
|
+
basicRatesMbps?: string;
|
|
30
|
+
otherRatesMbps?: string;
|
|
31
|
+
[key: string]: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
type WifiNetwork = {
|
|
34
|
+
interfaceName?: string;
|
|
35
|
+
ssid?: string;
|
|
36
|
+
networkType?: string;
|
|
37
|
+
authentication?: string;
|
|
38
|
+
encryption?: string;
|
|
39
|
+
bssids: BSSID[];
|
|
40
|
+
};
|
|
41
|
+
type NetworkInterface = {
|
|
42
|
+
name: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
physicalAddress?: string;
|
|
45
|
+
dHCPEnabled?: string;
|
|
46
|
+
autoconfigurationEnabled?: string;
|
|
47
|
+
linkLocalIPv6Address?: string;
|
|
48
|
+
iPv4Address?: string;
|
|
49
|
+
subnetMask?: string;
|
|
50
|
+
defaultGateway?: string;
|
|
51
|
+
dHCPServer?: string;
|
|
52
|
+
dHCPv6IAID?: string;
|
|
53
|
+
dHCPv6ClientDUID?: string;
|
|
54
|
+
dNSServers?: string | string[];
|
|
55
|
+
leaseObtained?: string;
|
|
56
|
+
leaseExpires?: string;
|
|
57
|
+
mediaState?: string;
|
|
58
|
+
connectionSpecificDNSSuffix?: string;
|
|
59
|
+
netBIOSOverTcpip?: string;
|
|
60
|
+
};
|
|
61
|
+
declare class Sync {
|
|
62
|
+
static connectWifi(profileName: string, interfaceName?: string): WifiConnectResult;
|
|
63
|
+
static disconnectWifi(): boolean;
|
|
64
|
+
static wifiProfile(ssid: string): WifiProfile;
|
|
65
|
+
static interfaces(): NetworkInterface[];
|
|
66
|
+
static ping(hosts: string | string[], callback: PingCallback): PingResult[];
|
|
67
|
+
static wifiNetworks(): WifiNetwork[];
|
|
68
|
+
}
|
|
69
|
+
declare class Async {
|
|
70
|
+
static connectWifi(profileName: string, interfaceName?: string): Promise<WifiConnectResult>;
|
|
71
|
+
static disconnectWifi(): Promise<boolean>;
|
|
72
|
+
static wifiProfile(ssid: string): Promise<WifiProfile>;
|
|
73
|
+
static interfaces(): Promise<NetworkInterface[]>;
|
|
74
|
+
static ping(hosts: string | string[], callback?: PingCallback): Promise<PingResult[]>;
|
|
75
|
+
static wifiNetworks(): Promise<WifiNetwork[]>;
|
|
76
|
+
}
|
|
77
|
+
export default class Network {
|
|
78
|
+
static readonly sync: typeof Sync;
|
|
79
|
+
static readonly async: typeof Async;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
82
|
+
//# sourceMappingURL=network.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../src/network.ts"],"names":[],"mappings":"AAIA,KAAK,iBAAiB,GAAG;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,KAAK,YAAY,GAAG,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;A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