@meru2802/aux-server 1.0.26 → 1.0.27
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/controllers/BaseController.d.ts +9 -0
- package/dist/controllers/BaseController.d.ts.map +1 -1
- package/dist/controllers/BaseController.js +39 -0
- package/dist/controllers/coreController.d.ts +2 -0
- package/dist/controllers/coreController.d.ts.map +1 -1
- package/dist/controllers/coreController.js +349 -91
- package/dist/controllers/healthController.js +1 -1
- package/dist/routes/coreRoutes.d.ts.map +1 -1
- package/dist/routes/coreRoutes.js +1 -0
- package/dist/types/index.d.ts +26 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +12 -1
- package/dist/types/schemas/index.d.ts +9 -1
- package/dist/types/schemas/index.d.ts.map +1 -1
- package/dist/types/schemas/index.js +16 -1
- package/package.json +1 -1
|
@@ -22,6 +22,15 @@ export declare abstract class BaseController {
|
|
|
22
22
|
existingUsers: MeshUser[];
|
|
23
23
|
failedToCreate: string[];
|
|
24
24
|
}>;
|
|
25
|
+
protected getEndpointIds(agentId: string | undefined, meshNodeId: string | undefined): Promise<{
|
|
26
|
+
meshNodeId: string;
|
|
27
|
+
meshNodeIdB64: string;
|
|
28
|
+
} | {
|
|
29
|
+
agentId: string;
|
|
30
|
+
meshNodeIdB64: string;
|
|
31
|
+
} | {
|
|
32
|
+
error: string;
|
|
33
|
+
}>;
|
|
25
34
|
private createSingleMeshUser;
|
|
26
35
|
private makeMeshPassword;
|
|
27
36
|
private getSecureRandomInt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseController.d.ts","sourceRoot":"","sources":["../../src/controllers/BaseController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"BaseController.d.ts","sourceRoot":"","sources":["../../src/controllers/BaseController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAe,MAAM,IAAI,CAAC;AACvC,O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QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAC1C;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CACpB;IAmDD,OAAO,CAAC,oBAAoB;IAwE5B,OAAO,CAAC,gBAAgB;IA2BxB,OAAO,CAAC,kBAAkB;CAS3B"}
|
|
@@ -8,6 +8,7 @@ const crypto_1 = __importDefault(require("crypto"));
|
|
|
8
8
|
const ServiceContainer_1 = require("../services/ServiceContainer");
|
|
9
9
|
const types_1 = require("../types");
|
|
10
10
|
const utils_1 = require("../lib/utils");
|
|
11
|
+
const utils_2 = require("@meru2802/rmm-lib/utils");
|
|
11
12
|
class BaseController {
|
|
12
13
|
constructor(serviceContainer) {
|
|
13
14
|
this.serviceContainer = serviceContainer || ServiceContainer_1.ServiceContainer.getInstance();
|
|
@@ -86,6 +87,44 @@ class BaseController {
|
|
|
86
87
|
});
|
|
87
88
|
return { createdUsers, existingUsers, failedToCreate };
|
|
88
89
|
}
|
|
90
|
+
async getEndpointIds(agentId, meshNodeId) {
|
|
91
|
+
var _a, _b;
|
|
92
|
+
if (!agentId && !meshNodeId) {
|
|
93
|
+
return { error: "Either agentId or meshNodeId must be provided" };
|
|
94
|
+
}
|
|
95
|
+
if (agentId) {
|
|
96
|
+
const query = "SELECT mesh_node_id FROM agents_agent WHERE agent_id = $1";
|
|
97
|
+
const result = await this.dbPool.query(query, [agentId]);
|
|
98
|
+
if (!result || result.rows.length === 0) {
|
|
99
|
+
return {
|
|
100
|
+
error: `Mesh Node Id corresponding to Agent ID: '${agentId}' Not Found`,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
const resolvedMeshNodeId = (_a = result.rows[0]) === null || _a === void 0 ? void 0 : _a.mesh_node_id;
|
|
104
|
+
if (!resolvedMeshNodeId) {
|
|
105
|
+
return {
|
|
106
|
+
error: `Mesh Node Id corresponding to Agent ID: '${agentId}' Not Found`,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
const meshNodeIdB64 = (0, utils_2.hexToBase64)(resolvedMeshNodeId);
|
|
110
|
+
return { meshNodeId: resolvedMeshNodeId, meshNodeIdB64 };
|
|
111
|
+
}
|
|
112
|
+
const nexus_epm_agent_id_query = "SELECT agent_id FROM agents_agent where mesh_node_id= $1";
|
|
113
|
+
const nexus_epm_agent_id = await this.dbPool.query(nexus_epm_agent_id_query, [meshNodeId]);
|
|
114
|
+
if (nexus_epm_agent_id.rows.length === 0) {
|
|
115
|
+
return {
|
|
116
|
+
error: `Agent Id corresponding to mesh node id ${meshNodeId}' Not Found`,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const resolvedAgentId = (_b = nexus_epm_agent_id.rows[0]) === null || _b === void 0 ? void 0 : _b.agent_id;
|
|
120
|
+
if (!resolvedAgentId) {
|
|
121
|
+
return {
|
|
122
|
+
error: `Agent Id corresponding to mesh node id ${meshNodeId}' Not Found`,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
const meshNodeIdB64 = (0, utils_2.hexToBase64)(meshNodeId);
|
|
126
|
+
return { meshNodeId: meshNodeId, meshNodeIdB64 };
|
|
127
|
+
}
|
|
89
128
|
createSingleMeshUser(user) {
|
|
90
129
|
return new Promise((resolve) => {
|
|
91
130
|
const responseId = this.genResponseId;
|
|
@@ -9,6 +9,8 @@ export declare class CoreController extends BaseController {
|
|
|
9
9
|
createDeviceGroup: (req: Request, res: Response) => Promise<void>;
|
|
10
10
|
addUserToGroup: (req: Request, res: Response) => Promise<void>;
|
|
11
11
|
getEndpointInstallScript: (req: Request, res: Response) => Promise<void>;
|
|
12
|
+
sendEndpointNotification: (req: Request, res: Response) => Promise<void>;
|
|
13
|
+
private waitForNotifyResponse;
|
|
12
14
|
private sendErrorResponse;
|
|
13
15
|
private ensureWebSocket;
|
|
14
16
|
private ensureMessageSent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreController.d.ts","sourceRoot":"","sources":["../../src/controllers/coreController.ts"],"names":[],"mappings":"AAAA,OAAO,E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AO,CAAC,mBAAmB;IAuW3B,OAAO,CAAC,aAAa,CAKnB;IAEF,OAAO,CAAC,cAAc,CAMpB;CACH"}
|
|
@@ -327,6 +327,141 @@ class CoreController extends BaseController_1.BaseController {
|
|
|
327
327
|
this.sendErrorResponse(res, 500, "Internal server error");
|
|
328
328
|
}
|
|
329
329
|
};
|
|
330
|
+
this.sendEndpointNotification = async (req, res) => {
|
|
331
|
+
try {
|
|
332
|
+
const { agent_ids, title, message, type, timeout } = req.body;
|
|
333
|
+
if (!this.ensureWebSocket(res))
|
|
334
|
+
return;
|
|
335
|
+
const requestId = this.genResponseId;
|
|
336
|
+
const results = [];
|
|
337
|
+
const resolvedAgents = [];
|
|
338
|
+
for (const agentId of agent_ids) {
|
|
339
|
+
const endpointResult = await this.getEndpointIds(agentId, undefined);
|
|
340
|
+
if ("error" in endpointResult) {
|
|
341
|
+
results.push({
|
|
342
|
+
agent_id: agentId,
|
|
343
|
+
mesh_node_id: "",
|
|
344
|
+
status: types_1.NotifyResultStatus.FAILED,
|
|
345
|
+
error: endpointResult.error,
|
|
346
|
+
});
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
const meshNodeId = "meshNodeId" in endpointResult ? endpointResult.meshNodeId : "";
|
|
350
|
+
resolvedAgents.push({
|
|
351
|
+
agentId,
|
|
352
|
+
meshNodeIdB64: endpointResult.meshNodeIdB64,
|
|
353
|
+
});
|
|
354
|
+
results.push({
|
|
355
|
+
agent_id: agentId,
|
|
356
|
+
mesh_node_id: meshNodeId,
|
|
357
|
+
status: types_1.NotifyResultStatus.FAILED,
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
if (resolvedAgents.length === 0) {
|
|
361
|
+
const response = {
|
|
362
|
+
success: false,
|
|
363
|
+
request_id: requestId,
|
|
364
|
+
results,
|
|
365
|
+
summary: {
|
|
366
|
+
total: agent_ids.length,
|
|
367
|
+
sent: 0,
|
|
368
|
+
failed: agent_ids.length,
|
|
369
|
+
},
|
|
370
|
+
};
|
|
371
|
+
res.status(200).json(response);
|
|
372
|
+
return;
|
|
373
|
+
}
|
|
374
|
+
if (type === types_1.NotifyDeliveryType.TOAST) {
|
|
375
|
+
const nodeIds = resolvedAgents.map((a) => `${a.meshNodeIdB64}`);
|
|
376
|
+
const responseId = this.genResponseId;
|
|
377
|
+
const toastMessage = {
|
|
378
|
+
action: "toast",
|
|
379
|
+
responseid: responseId,
|
|
380
|
+
msg: message,
|
|
381
|
+
nodeids: nodeIds,
|
|
382
|
+
title,
|
|
383
|
+
};
|
|
384
|
+
const sent = this.WebSocketService.sendMessage(toastMessage);
|
|
385
|
+
if (!sent) {
|
|
386
|
+
for (const agent of resolvedAgents) {
|
|
387
|
+
const entry = results.find((r) => r.agent_id === agent.agentId);
|
|
388
|
+
if (entry)
|
|
389
|
+
entry.error = "Could not send message over socket";
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
try {
|
|
394
|
+
await this.waitForNotifyResponse(responseId);
|
|
395
|
+
for (const agent of resolvedAgents) {
|
|
396
|
+
const entry = results.find((r) => r.agent_id === agent.agentId);
|
|
397
|
+
if (entry)
|
|
398
|
+
entry.status = types_1.NotifyResultStatus.SENT;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
catch (error) {
|
|
402
|
+
for (const agent of resolvedAgents) {
|
|
403
|
+
const entry = results.find((r) => r.agent_id === agent.agentId);
|
|
404
|
+
if (entry)
|
|
405
|
+
entry.error =
|
|
406
|
+
error instanceof Error
|
|
407
|
+
? error.message
|
|
408
|
+
: "Failed to get response";
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
else {
|
|
414
|
+
const sendPromises = resolvedAgents.map(async (agent) => {
|
|
415
|
+
const responseId = this.genResponseId;
|
|
416
|
+
const nodeId = agent.meshNodeIdB64;
|
|
417
|
+
const msgPayload = {
|
|
418
|
+
action: "msg",
|
|
419
|
+
responseid: responseId,
|
|
420
|
+
msg: message,
|
|
421
|
+
nodeid: nodeId,
|
|
422
|
+
title,
|
|
423
|
+
type,
|
|
424
|
+
};
|
|
425
|
+
if (type === types_1.NotifyDeliveryType.MESSAGEBOX && timeout !== undefined) {
|
|
426
|
+
msgPayload.timeout = timeout * 1000;
|
|
427
|
+
}
|
|
428
|
+
const sent = this.WebSocketService.sendMessage(msgPayload);
|
|
429
|
+
const entry = results.find((r) => r.agent_id === agent.agentId);
|
|
430
|
+
if (!sent) {
|
|
431
|
+
if (entry)
|
|
432
|
+
entry.error = "Could not send message over socket";
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
try {
|
|
436
|
+
await this.waitForNotifyResponse(responseId);
|
|
437
|
+
if (entry)
|
|
438
|
+
entry.status = types_1.NotifyResultStatus.SENT;
|
|
439
|
+
}
|
|
440
|
+
catch (error) {
|
|
441
|
+
if (entry)
|
|
442
|
+
entry.error =
|
|
443
|
+
error instanceof Error
|
|
444
|
+
? error.message
|
|
445
|
+
: "Failed to get response";
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
await Promise.allSettled(sendPromises);
|
|
449
|
+
}
|
|
450
|
+
const sent = results.filter((r) => r.status === types_1.NotifyResultStatus.SENT).length;
|
|
451
|
+
const failed = results.length - sent;
|
|
452
|
+
const response = {
|
|
453
|
+
success: failed === 0,
|
|
454
|
+
request_id: requestId,
|
|
455
|
+
results,
|
|
456
|
+
summary: { total: results.length, sent, failed },
|
|
457
|
+
};
|
|
458
|
+
res.status(200).json(response);
|
|
459
|
+
}
|
|
460
|
+
catch (error) {
|
|
461
|
+
console.error("Error sending notification to endpoint:", error);
|
|
462
|
+
this.sendErrorResponse(res, 500, "Internal server error");
|
|
463
|
+
}
|
|
464
|
+
};
|
|
330
465
|
this.parseBootTime = (bootTime) => {
|
|
331
466
|
if (bootTime === null || bootTime === undefined) {
|
|
332
467
|
return null;
|
|
@@ -347,6 +482,42 @@ class CoreController extends BaseController_1.BaseController {
|
|
|
347
482
|
}
|
|
348
483
|
return this.instance;
|
|
349
484
|
}
|
|
485
|
+
waitForNotifyResponse(responseId) {
|
|
486
|
+
return new Promise((resolve, reject) => {
|
|
487
|
+
let responseReceived = false;
|
|
488
|
+
const timeout = setTimeout(() => {
|
|
489
|
+
var _a;
|
|
490
|
+
if (!responseReceived) {
|
|
491
|
+
responseReceived = true;
|
|
492
|
+
(_a = this.webSocket) === null || _a === void 0 ? void 0 : _a.removeListener("message", messageHandler);
|
|
493
|
+
reject(new Error("Timeout waiting for notification response"));
|
|
494
|
+
}
|
|
495
|
+
}, 30000);
|
|
496
|
+
const messageHandler = (data) => {
|
|
497
|
+
var _a;
|
|
498
|
+
if (responseReceived)
|
|
499
|
+
return;
|
|
500
|
+
try {
|
|
501
|
+
const message = JSON.parse(data.toString());
|
|
502
|
+
if (message.responseid !== responseId)
|
|
503
|
+
return;
|
|
504
|
+
responseReceived = true;
|
|
505
|
+
clearTimeout(timeout);
|
|
506
|
+
(_a = this.webSocket) === null || _a === void 0 ? void 0 : _a.removeListener("message", messageHandler);
|
|
507
|
+
if (message.result === "OK" || message.result === "ok") {
|
|
508
|
+
resolve();
|
|
509
|
+
}
|
|
510
|
+
else {
|
|
511
|
+
reject(new Error(message.result || "Notification delivery failed"));
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
catch (_b) {
|
|
515
|
+
// Ignore parse errors for messages that aren't relevant
|
|
516
|
+
}
|
|
517
|
+
};
|
|
518
|
+
this.webSocket.on("message", messageHandler);
|
|
519
|
+
});
|
|
520
|
+
}
|
|
350
521
|
sendErrorResponse(res, status, error) {
|
|
351
522
|
const errorResponse = {
|
|
352
523
|
error,
|
|
@@ -634,8 +805,9 @@ If (Get-Service $serviceName -ErrorAction SilentlyContinue) {
|
|
|
634
805
|
`;
|
|
635
806
|
}
|
|
636
807
|
generateLinuxScript(params) {
|
|
637
|
-
return
|
|
638
|
-
|
|
808
|
+
return `#!/usr/bin/env bash
|
|
809
|
+
|
|
810
|
+
set -uo pipefail
|
|
639
811
|
|
|
640
812
|
if [ $EUID -ne 0 ]; then
|
|
641
813
|
echo "ERROR: Must be run as root"
|
|
@@ -645,51 +817,76 @@ fi
|
|
|
645
817
|
HAS_SYSTEMD=$(ps --no-headers -o comm 1)
|
|
646
818
|
if [ "\${HAS_SYSTEMD}" != 'systemd' ]; then
|
|
647
819
|
echo "This install script only supports systemd"
|
|
648
|
-
echo "Please install systemd or manually create the service using your
|
|
820
|
+
echo "Please install systemd or manually create the service using your system's service manager"
|
|
649
821
|
exit 1
|
|
650
822
|
fi
|
|
651
823
|
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
824
|
+
IS_HEADLESS=1
|
|
825
|
+
if [[ -n "\${DISPLAY:-}" ]]; then
|
|
826
|
+
# Check if this is just X forwarding or an actual desktop session
|
|
827
|
+
if systemctl is-active --quiet gdm3 || systemctl is-active --quiet lightdm || systemctl is-active --quiet sddm; then
|
|
828
|
+
echo "ERROR: Display detected with an active display manager."
|
|
829
|
+
echo "Installer only supports running headless, i.e from ssh."
|
|
830
|
+
echo "Run 'sudo systemctl isolate multi-user.target' to switch to a non-graphical session."
|
|
831
|
+
exit 1
|
|
832
|
+
else
|
|
833
|
+
echo "WARNING: \\$DISPLAY is set (likely SSH X forwarding) but no display manager is active."
|
|
834
|
+
echo "Unsetting DISPLAY and continuing in headless mode..."
|
|
835
|
+
unset DISPLAY
|
|
836
|
+
fi
|
|
837
|
+
fi
|
|
656
838
|
|
|
657
|
-
|
|
839
|
+
ARCH=$(uname -m)
|
|
840
|
+
case "$ARCH" in
|
|
841
|
+
x86_64)
|
|
842
|
+
ARCH_SUFFIX="amd64"
|
|
843
|
+
ARCH_DIR="x64"
|
|
844
|
+
;;
|
|
845
|
+
aarch64)
|
|
846
|
+
ARCH_SUFFIX="arm64"
|
|
847
|
+
ARCH_DIR="arm64"
|
|
848
|
+
;;
|
|
849
|
+
*)
|
|
850
|
+
echo "ERROR: Unsupported architecture: $ARCH"
|
|
851
|
+
echo "This installer supports x86_64 (amd64) and aarch64 (arm64) only."
|
|
852
|
+
exit 1
|
|
853
|
+
;;
|
|
854
|
+
esac
|
|
855
|
+
echo "Detected architecture: \${ARCH} (\${ARCH_SUFFIX})"
|
|
658
856
|
|
|
659
|
-
|
|
660
|
-
if
|
|
661
|
-
echo "
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
echo "No previous Nexus Endpoint installation found. Continuing..."
|
|
857
|
+
CONFIG_FILE="/etc/nexus-installer.conf"
|
|
858
|
+
if [ -f "$CONFIG_FILE" ]; then
|
|
859
|
+
echo "Loading configuration from \${CONFIG_FILE}..."
|
|
860
|
+
# shellcheck source=/dev/null
|
|
861
|
+
source "$CONFIG_FILE"
|
|
665
862
|
fi
|
|
666
863
|
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
864
|
+
apiURL="\${NEXUS_API_URL:-${params.baseUrl}}"
|
|
865
|
+
token="\${NEXUS_TOKEN:-${params.installerToken}}"
|
|
866
|
+
clientID="\${NEXUS_CLIENT_ID:-${params.clientId}}"
|
|
867
|
+
siteID="\${NEXUS_SITE_ID:-${params.siteId}}"
|
|
868
|
+
agentType="\${NEXUS_AGENT_TYPE:-${params.agentType}}"
|
|
869
|
+
assetTypeId="\${NEXUS_ASSET_TYPE_ID:-${params.assetTypeId}}"
|
|
870
|
+
icebergSiteId="\${NEXUS_ICEBERG_SITE_ID:-${params.icebergSiteId}}"
|
|
871
|
+
icebergOrgId="\${NEXUS_ICEBERG_ORG_ID:-${params.icebergOrgId}}"
|
|
872
|
+
icebergOrgToken="\${NEXUS_ICEBERG_ORG_TOKEN:-${params.icebergOrgToken}}"
|
|
873
|
+
assetEndpoint="\${NEXUS_ASSET_ENDPOINT:-${this.config.icebergConfig.assetEndpoint}}"
|
|
874
|
+
proxy="\${NEXUS_PROXY:-}"
|
|
674
875
|
|
|
675
|
-
|
|
676
|
-
INSECURE=0
|
|
677
|
-
NOMESH=0
|
|
876
|
+
SCOGO_PASSWORD="\${SCOGO_USER_PASSWORD:-Sc090@1947}"
|
|
678
877
|
|
|
679
|
-
agentDL=
|
|
878
|
+
agentDL="https://nexus-endpoint-desktop-app.s3.ap-south-1.amazonaws.com/rmmagent/linux/\${ARCH_DIR}/nexusrmm-\${ARCH_SUFFIX}"
|
|
680
879
|
meshDL='https://${this.config.meshcentralConfig.host}/meshagents?id=${params.deviceGroupId}&installflags=2&meshinstall=6'
|
|
681
880
|
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
assetEndpoint='${this.config.icebergConfig.assetEndpoint}'
|
|
692
|
-
proxy=''
|
|
881
|
+
# If headless mode detected and agentType is 'workstation', override to 'server'
|
|
882
|
+
if [ $IS_HEADLESS -eq 1 ] && [ "\${agentType}" = "workstation" ]; then
|
|
883
|
+
echo "Headless mode detected. Overriding agent type from 'workstation' to 'server'."
|
|
884
|
+
agentType="server"
|
|
885
|
+
fi
|
|
886
|
+
|
|
887
|
+
DEBUG=0
|
|
888
|
+
INSECURE=0
|
|
889
|
+
NOMESH=0
|
|
693
890
|
|
|
694
891
|
agentBinPath='/usr/local/bin'
|
|
695
892
|
binName='nexusagent'
|
|
@@ -720,35 +917,21 @@ set_locale_rhel() {
|
|
|
720
917
|
|
|
721
918
|
RemoveOldAgent() {
|
|
722
919
|
if [ -f "\${agentSysD}" ]; then
|
|
723
|
-
systemctl disable \${agentSvcName}
|
|
724
|
-
systemctl stop \${agentSvcName}
|
|
920
|
+
systemctl disable "\${agentSvcName}" 2>/dev/null || true
|
|
921
|
+
systemctl stop "\${agentSvcName}" 2>/dev/null || true
|
|
725
922
|
rm -f "\${agentSysD}"
|
|
726
923
|
systemctl daemon-reload
|
|
727
924
|
fi
|
|
728
925
|
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
if [ -f "\${agentBin}" ]; then
|
|
734
|
-
rm -f "\${agentBin}"
|
|
735
|
-
fi
|
|
736
|
-
|
|
737
|
-
if [ -d "\${agentDir}" ]; then
|
|
738
|
-
rm -rf "\${agentDir}"
|
|
739
|
-
fi
|
|
926
|
+
[ -f "\${agentConf}" ] && rm -f "\${agentConf}" || true
|
|
927
|
+
[ -f "\${agentBin}" ] && rm -f "\${agentBin}" || true
|
|
928
|
+
[ -d "\${agentDir}" ] && rm -rf "\${agentDir}" || true
|
|
740
929
|
}
|
|
741
930
|
|
|
742
931
|
InstallMesh() {
|
|
743
932
|
if [ -f /etc/os-release ]; then
|
|
744
|
-
distroID=$(
|
|
745
|
-
|
|
746
|
-
echo $ID
|
|
747
|
-
)
|
|
748
|
-
distroIDLIKE=$(
|
|
749
|
-
. /etc/os-release
|
|
750
|
-
echo $ID_LIKE
|
|
751
|
-
)
|
|
933
|
+
distroID=$(. /etc/os-release; echo "$ID")
|
|
934
|
+
distroIDLIKE=$(. /etc/os-release; echo "\${ID_LIKE:-}")
|
|
752
935
|
if [[ " \${deb[*]} " =~ " \${distroID} " ]]; then
|
|
753
936
|
set_locale_deb
|
|
754
937
|
elif [[ " \${deb[*]} " =~ " \${distroIDLIKE} " ]]; then
|
|
@@ -761,30 +944,30 @@ InstallMesh() {
|
|
|
761
944
|
fi
|
|
762
945
|
|
|
763
946
|
meshTmpDir='/root/meshtemp'
|
|
764
|
-
mkdir -p $meshTmpDir
|
|
947
|
+
mkdir -p "$meshTmpDir"
|
|
765
948
|
|
|
766
949
|
meshTmpBin="\${meshTmpDir}/NexusMeshBackend"
|
|
767
|
-
wget --no-check-certificate -q -O \${meshTmpBin} \${meshDL}
|
|
768
|
-
chmod +x \${meshTmpBin}
|
|
769
|
-
mkdir -p \${meshDir}
|
|
770
|
-
env LC_ALL=en_US.UTF-8 LANGUAGE=en_US XAUTHORITY=foo DISPLAY=bar \${meshTmpBin} -install --installPath
|
|
950
|
+
wget --no-check-certificate -q -O "\${meshTmpBin}" "\${meshDL}"
|
|
951
|
+
chmod +x "\${meshTmpBin}"
|
|
952
|
+
mkdir -p "\${meshDir}"
|
|
953
|
+
env LC_ALL=en_US.UTF-8 LANGUAGE=en_US XAUTHORITY=foo DISPLAY=bar "\${meshTmpBin}" -install --installPath="\${meshDir}"
|
|
771
954
|
sleep 1
|
|
772
|
-
rm -rf \${meshTmpDir}
|
|
955
|
+
rm -rf "\${meshTmpDir}"
|
|
773
956
|
}
|
|
774
957
|
|
|
775
958
|
RemoveMesh() {
|
|
776
959
|
if [ -f "\${meshSystemBin}" ]; then
|
|
777
|
-
env XAUTHORITY=foo DISPLAY=bar \${meshSystemBin} -uninstall
|
|
960
|
+
env XAUTHORITY=foo DISPLAY=bar "\${meshSystemBin}" -uninstall
|
|
778
961
|
sleep 1
|
|
779
962
|
fi
|
|
780
963
|
|
|
781
964
|
if [ -f "\${meshSysD}" ]; then
|
|
782
|
-
systemctl stop \${meshSvcName} >/dev/null 2>&1
|
|
783
|
-
systemctl disable \${meshSvcName} >/dev/null 2>&1
|
|
784
|
-
rm -f \${meshSysD}
|
|
965
|
+
systemctl stop "\${meshSvcName}" >/dev/null 2>&1 || true
|
|
966
|
+
systemctl disable "\${meshSvcName}" >/dev/null 2>&1 || true
|
|
967
|
+
rm -f "\${meshSysD}"
|
|
785
968
|
fi
|
|
786
969
|
|
|
787
|
-
rm -rf \${meshDir}
|
|
970
|
+
rm -rf "\${meshDir}"
|
|
788
971
|
systemctl daemon-reload
|
|
789
972
|
}
|
|
790
973
|
|
|
@@ -795,7 +978,6 @@ Uninstall() {
|
|
|
795
978
|
|
|
796
979
|
if [ $# -ne 0 ] && [[ $1 =~ ^(uninstall|-uninstall|--uninstall)$ ]]; then
|
|
797
980
|
Uninstall
|
|
798
|
-
# Remove the current script
|
|
799
981
|
rm "$0"
|
|
800
982
|
exit 0
|
|
801
983
|
fi
|
|
@@ -813,15 +995,63 @@ while [[ "$#" -gt 0 ]]; do
|
|
|
813
995
|
shift
|
|
814
996
|
done
|
|
815
997
|
|
|
998
|
+
if id "scogo" &>/dev/null; then
|
|
999
|
+
echo "User 'scogo' already exists. Skipping user creation."
|
|
1000
|
+
else
|
|
1001
|
+
useradd -c "Scogo IT Support" -m -s /bin/bash scogo
|
|
1002
|
+
echo "scogo:\${SCOGO_PASSWORD}" | chpasswd
|
|
1003
|
+
fi
|
|
1004
|
+
|
|
1005
|
+
for grp in sudo adm cdrom dip plugdev video; do
|
|
1006
|
+
if getent group "$grp" >/dev/null 2>&1; then
|
|
1007
|
+
usermod -aG "$grp" scogo
|
|
1008
|
+
fi
|
|
1009
|
+
done
|
|
1010
|
+
echo 'scogo ALL=(ALL) ALL' | tee /etc/sudoers.d/scogo >/dev/null
|
|
1011
|
+
chmod 0440 /etc/sudoers.d/scogo
|
|
1012
|
+
|
|
1013
|
+
if [ -f /etc/gdm3/custom.conf ]; then
|
|
1014
|
+
echo "GDM3 detected. Disabling Wayland..."
|
|
1015
|
+
sed -i 's/^#\\?WaylandEnable=.*/WaylandEnable=false/' /etc/gdm3/custom.conf
|
|
1016
|
+
else
|
|
1017
|
+
echo "GDM3 not found (headless server). Skipping Wayland configuration."
|
|
1018
|
+
fi
|
|
1019
|
+
|
|
1020
|
+
if [ $IS_HEADLESS -eq 1 ]; then
|
|
1021
|
+
echo "Headless server detected. Skipping Nexus Endpoint desktop app installation."
|
|
1022
|
+
echo "(Desktop app requires a GUI environment to function.)"
|
|
1023
|
+
else
|
|
1024
|
+
echo "Checking for previous installations of Nexus Endpoint..."
|
|
1025
|
+
if dpkg-query -W -f='\${Status}' nexus-endpoint 2>/dev/null | grep -q "install ok installed"; then
|
|
1026
|
+
echo "Found existing Nexus Endpoint installation. Removing..."
|
|
1027
|
+
apt-get remove -y nexus-endpoint
|
|
1028
|
+
else
|
|
1029
|
+
echo "No previous Nexus Endpoint installation found. Continuing..."
|
|
1030
|
+
fi
|
|
1031
|
+
|
|
1032
|
+
echo "Downloading and installing Nexus Endpoint..."
|
|
1033
|
+
apt-get update
|
|
1034
|
+
apt-get install -y libwebkit2gtk-4.1-0 libgtk-3-0 libappindicator3-1 libayatana-appindicator3-1 libxdo-dev
|
|
1035
|
+
INSTALLER="nexus-endpoint-installer.deb"
|
|
1036
|
+
wget "${params.endpointUrl}" -O "$INSTALLER"
|
|
1037
|
+
dpkg -i "$INSTALLER"
|
|
1038
|
+
rm -f "$INSTALLER"
|
|
1039
|
+
fi
|
|
1040
|
+
|
|
1041
|
+
if ! command -v dmidecode &>/dev/null; then
|
|
1042
|
+
echo "Installing dmidecode..."
|
|
1043
|
+
apt-get update -qq || true
|
|
1044
|
+
apt-get install -y -qq dmidecode || echo "WARNING: Could not install dmidecode. Continuing anyway."
|
|
1045
|
+
fi
|
|
1046
|
+
|
|
816
1047
|
RemoveOldAgent
|
|
817
1048
|
|
|
818
1049
|
echo "Downloading Nexus agent..."
|
|
819
|
-
wget -q -O \${agentBin} "\${agentDL}"
|
|
820
|
-
if [ $? -ne 0 ]; then
|
|
1050
|
+
if ! wget -q -O "\${agentBin}" "\${agentDL}"; then
|
|
821
1051
|
echo "ERROR: Unable to download nexus agent"
|
|
822
1052
|
exit 1
|
|
823
1053
|
fi
|
|
824
|
-
chmod +x \${agentBin}
|
|
1054
|
+
chmod +x "\${agentBin}"
|
|
825
1055
|
|
|
826
1056
|
MESH_NODE_ID=""
|
|
827
1057
|
|
|
@@ -835,36 +1065,47 @@ else
|
|
|
835
1065
|
InstallMesh
|
|
836
1066
|
sleep 2
|
|
837
1067
|
echo "Getting mesh node id..."
|
|
838
|
-
MESH_NODE_ID=$(env XAUTHORITY=foo DISPLAY=bar \${agentBin} -m nixmeshnodeid)
|
|
1068
|
+
MESH_NODE_ID=$(env XAUTHORITY=foo DISPLAY=bar "\${agentBin}" -m nixmeshnodeid)
|
|
839
1069
|
fi
|
|
840
1070
|
|
|
841
1071
|
if [ ! -d "\${agentBinPath}" ]; then
|
|
842
1072
|
echo "Creating \${agentBinPath}"
|
|
843
|
-
mkdir -p \${agentBinPath}
|
|
1073
|
+
mkdir -p "\${agentBinPath}"
|
|
844
1074
|
fi
|
|
845
1075
|
|
|
846
|
-
|
|
1076
|
+
INSTALL_ARGS=(
|
|
1077
|
+
"\${agentBin}" -m install
|
|
1078
|
+
-api "\${apiURL}"
|
|
1079
|
+
-client-id "\${clientID}"
|
|
1080
|
+
-site-id "\${siteID}"
|
|
1081
|
+
-agent-type "\${agentType}"
|
|
1082
|
+
-auth "\${token}"
|
|
1083
|
+
-asset-type-id "\${assetTypeId}"
|
|
1084
|
+
-iceberg-site-id "\${icebergSiteId}"
|
|
1085
|
+
-iceberg-org-id "\${icebergOrgId}"
|
|
1086
|
+
-iceberg-org-token "\${icebergOrgToken}"
|
|
1087
|
+
-asset-api "\${assetEndpoint}"
|
|
1088
|
+
)
|
|
847
1089
|
|
|
848
|
-
if [ "\${MESH_NODE_ID}"
|
|
849
|
-
|
|
1090
|
+
if [ -n "\${MESH_NODE_ID}" ]; then
|
|
1091
|
+
INSTALL_ARGS+=(--meshnodeid "\${MESH_NODE_ID}")
|
|
850
1092
|
fi
|
|
851
1093
|
|
|
852
1094
|
if [[ $DEBUG -eq 1 ]]; then
|
|
853
|
-
|
|
1095
|
+
INSTALL_ARGS+=(--log debug)
|
|
854
1096
|
fi
|
|
855
1097
|
|
|
856
1098
|
if [[ $INSECURE -eq 1 ]]; then
|
|
857
|
-
|
|
1099
|
+
INSTALL_ARGS+=(--insecure)
|
|
858
1100
|
fi
|
|
859
1101
|
|
|
860
|
-
if [ "\${proxy}"
|
|
861
|
-
|
|
1102
|
+
if [ -n "\${proxy}" ]; then
|
|
1103
|
+
INSTALL_ARGS+=(--proxy "\${proxy}")
|
|
862
1104
|
fi
|
|
863
1105
|
|
|
864
|
-
|
|
1106
|
+
"\${INSTALL_ARGS[@]}"
|
|
865
1107
|
|
|
866
|
-
|
|
867
|
-
cat <<EOF
|
|
1108
|
+
cat > "\${agentSysD}" <<EOF
|
|
868
1109
|
[Unit]
|
|
869
1110
|
Description=Nexus RMM Linux Agent
|
|
870
1111
|
|
|
@@ -881,16 +1122,33 @@ KillMode=process
|
|
|
881
1122
|
[Install]
|
|
882
1123
|
WantedBy=multi-user.target
|
|
883
1124
|
EOF
|
|
884
|
-
)"
|
|
885
|
-
echo "\${tacticalsvc}" | tee \${agentSysD} >/dev/null
|
|
886
1125
|
|
|
887
1126
|
systemctl daemon-reload
|
|
888
|
-
systemctl enable \${agentSvcName}
|
|
889
|
-
systemctl start \${agentSvcName}
|
|
1127
|
+
systemctl enable "\${agentSvcName}"
|
|
1128
|
+
systemctl start "\${agentSvcName}"
|
|
1129
|
+
|
|
1130
|
+
if systemctl is-active --quiet gdm3; then
|
|
1131
|
+
echo "Restarting GDM3..."
|
|
1132
|
+
systemctl restart gdm3
|
|
1133
|
+
else
|
|
1134
|
+
echo "GDM3 not active. Skipping restart."
|
|
1135
|
+
fi
|
|
1136
|
+
|
|
1137
|
+
if systemctl is-active --quiet systemd-logind; then
|
|
1138
|
+
echo "Restarting systemd-logind..."
|
|
1139
|
+
systemctl restart systemd-logind
|
|
1140
|
+
fi
|
|
1141
|
+
|
|
1142
|
+
echo "System serial number:"
|
|
1143
|
+
dmidecode --string system-serial-number 2>/dev/null || echo "(dmidecode failed — possibly running in a VM without SMBIOS data)"
|
|
890
1144
|
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
1145
|
+
echo ""
|
|
1146
|
+
echo "============================================="
|
|
1147
|
+
echo " Nexus RMM Agent installation complete!"
|
|
1148
|
+
echo "============================================="
|
|
1149
|
+
echo " Agent service: \${agentSvcName}"
|
|
1150
|
+
echo " Status: $(systemctl is-active \${agentSvcName})"
|
|
1151
|
+
echo "============================================="`;
|
|
894
1152
|
}
|
|
895
1153
|
}
|
|
896
1154
|
exports.CoreController = CoreController;
|
|
@@ -18,7 +18,7 @@ class HealthController extends BaseController_1.BaseController {
|
|
|
18
18
|
this.status = (req, res) => {
|
|
19
19
|
const response = {
|
|
20
20
|
service: "aux-server",
|
|
21
|
-
version: "1.0.
|
|
21
|
+
version: "1.0.27",
|
|
22
22
|
meshCentral: {
|
|
23
23
|
connected: this.isWebSocketConnected,
|
|
24
24
|
server: this.meshServer,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coreRoutes.d.ts","sourceRoot":"","sources":["../../src/routes/coreRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"coreRoutes.d.ts","sourceRoot":"","sources":["../../src/routes/coreRoutes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAW9D,eAAO,MAAM,gBAAgB,GAC3B,gBAAgB,cAAc,EAC9B,gBAAgB,cAAc,KAC7B,MAsLF,CAAC"}
|
|
@@ -153,6 +153,7 @@ const createCoreRoutes = (coreController, authMiddleware) => {
|
|
|
153
153
|
*/
|
|
154
154
|
router.post("/add-user-to-group", authMiddleware.hmacAuth, (0, middleware_1.validateData)(schemas_1.addUserToGroupSchema), (0, middleware_1.asyncHandler)(coreController.addUserToGroup));
|
|
155
155
|
router.post("/endpoint/get-install-script", authMiddleware.hmacAuth, (0, middleware_1.validateData)(schemas_1.getEndpointInstallScriptSchema), (0, middleware_1.asyncHandler)(coreController.getEndpointInstallScript));
|
|
156
|
+
router.post("/endpoint/notify", authMiddleware.hmacAuth, (0, middleware_1.validateData)(schemas_1.endpointNotifyRequestSchema), (0, middleware_1.asyncHandler)(coreController.sendEndpointNotification));
|
|
156
157
|
return router;
|
|
157
158
|
};
|
|
158
159
|
exports.createCoreRoutes = createCoreRoutes;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -37,6 +37,15 @@ export declare enum MeshNodePowerState {
|
|
|
37
37
|
Present = 7,
|
|
38
38
|
Off = 8
|
|
39
39
|
}
|
|
40
|
+
export declare enum NotifyDeliveryType {
|
|
41
|
+
TOAST = "toast",
|
|
42
|
+
MESSAGEBOX = "messagebox",
|
|
43
|
+
ALERTBOX = "alertbox"
|
|
44
|
+
}
|
|
45
|
+
export declare enum NotifyResultStatus {
|
|
46
|
+
SENT = "sent",
|
|
47
|
+
FAILED = "failed"
|
|
48
|
+
}
|
|
40
49
|
export declare const LIMITS: {
|
|
41
50
|
readonly MAX_ID: number;
|
|
42
51
|
readonly MAX_URL_LENGTH: 4096;
|
|
@@ -327,5 +336,22 @@ export interface EPMInstalledSoftwaresResponse {
|
|
|
327
336
|
software?: EPMSoftwareItem[];
|
|
328
337
|
agent?: number;
|
|
329
338
|
}
|
|
339
|
+
interface DeviceNotifyResult {
|
|
340
|
+
agent_id: string;
|
|
341
|
+
mesh_node_id: string;
|
|
342
|
+
status: NotifyResultStatus;
|
|
343
|
+
error?: string;
|
|
344
|
+
}
|
|
345
|
+
interface DeviceNotifySummary {
|
|
346
|
+
total: number;
|
|
347
|
+
sent: number;
|
|
348
|
+
failed: number;
|
|
349
|
+
}
|
|
350
|
+
export interface DeviceNotifyResponse {
|
|
351
|
+
success: boolean;
|
|
352
|
+
request_id: string;
|
|
353
|
+
results: DeviceNotifyResult[];
|
|
354
|
+
summary: DeviceNotifySummary;
|
|
355
|
+
}
|
|
330
356
|
export {};
|
|
331
357
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAEnC,oBAAY,WAAW;IACrB,OAAO,WAAW;IAClB,KAAK,UAAU;IACf,WAAW,eAAe;IA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,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,6BAA6B;IAC5C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,kBAAkB;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,OAAO,EAAE,mBAAmB,CAAC;CAC9B"}
|
package/dist/types/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OS_EXECUTABLE_EXTENSIONS = exports.LIMITS = exports.MeshNodePowerState = exports.MeshNodeConnectivityType = exports.OperatingSystems = exports.AgentTypes = exports.IcebergConnectEvents = exports.MeshActions = void 0;
|
|
3
|
+
exports.OS_EXECUTABLE_EXTENSIONS = exports.LIMITS = exports.NotifyResultStatus = exports.NotifyDeliveryType = exports.MeshNodePowerState = exports.MeshNodeConnectivityType = exports.OperatingSystems = exports.AgentTypes = exports.IcebergConnectEvents = exports.MeshActions = void 0;
|
|
4
4
|
var MeshActions;
|
|
5
5
|
(function (MeshActions) {
|
|
6
6
|
MeshActions["MESH_ES"] = "meshes";
|
|
@@ -45,6 +45,17 @@ var MeshNodePowerState;
|
|
|
45
45
|
MeshNodePowerState[MeshNodePowerState["Present"] = 7] = "Present";
|
|
46
46
|
MeshNodePowerState[MeshNodePowerState["Off"] = 8] = "Off";
|
|
47
47
|
})(MeshNodePowerState || (exports.MeshNodePowerState = MeshNodePowerState = {}));
|
|
48
|
+
var NotifyDeliveryType;
|
|
49
|
+
(function (NotifyDeliveryType) {
|
|
50
|
+
NotifyDeliveryType["TOAST"] = "toast";
|
|
51
|
+
NotifyDeliveryType["MESSAGEBOX"] = "messagebox";
|
|
52
|
+
NotifyDeliveryType["ALERTBOX"] = "alertbox";
|
|
53
|
+
})(NotifyDeliveryType || (exports.NotifyDeliveryType = NotifyDeliveryType = {}));
|
|
54
|
+
var NotifyResultStatus;
|
|
55
|
+
(function (NotifyResultStatus) {
|
|
56
|
+
NotifyResultStatus["SENT"] = "sent";
|
|
57
|
+
NotifyResultStatus["FAILED"] = "failed";
|
|
58
|
+
})(NotifyResultStatus || (exports.NotifyResultStatus = NotifyResultStatus = {}));
|
|
48
59
|
exports.LIMITS = {
|
|
49
60
|
MAX_ID: Number.MAX_SAFE_INTEGER,
|
|
50
61
|
MAX_URL_LENGTH: 4096,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import z from "zod";
|
|
2
|
-
import { AgentTypes, OperatingSystems } from "..";
|
|
2
|
+
import { AgentTypes, OperatingSystems, NotifyDeliveryType } from "..";
|
|
3
3
|
export declare const generateDownloadLinkSchema: z.ZodObject<{
|
|
4
4
|
deviceGroupId: z.ZodOptional<z.ZodString>;
|
|
5
5
|
deviceGroupName: z.ZodOptional<z.ZodString>;
|
|
@@ -27,9 +27,17 @@ export declare const getEndpointInstallScriptSchema: z.ZodObject<{
|
|
|
27
27
|
installerToken: z.ZodString;
|
|
28
28
|
os: z.ZodEnum<typeof OperatingSystems>;
|
|
29
29
|
}, z.core.$strict>;
|
|
30
|
+
export declare const endpointNotifyRequestSchema: z.ZodObject<{
|
|
31
|
+
agent_ids: z.ZodArray<z.ZodString>;
|
|
32
|
+
title: z.ZodString;
|
|
33
|
+
message: z.ZodString;
|
|
34
|
+
type: z.ZodEnum<typeof NotifyDeliveryType>;
|
|
35
|
+
timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
36
|
+
}, z.core.$strip>;
|
|
30
37
|
export type GenerateDownloadLinkRequest = z.infer<typeof generateDownloadLinkSchema>;
|
|
31
38
|
export type CreateDeviceGroupRequest = z.infer<typeof createDeviceGroupSchema>;
|
|
32
39
|
export type AddUserToGroupRequest = z.infer<typeof addUserToGroupSchema>;
|
|
33
40
|
export type GenerateConnectUrlsRequest = z.infer<typeof generateConnectUrlsSchema>;
|
|
34
41
|
export type GetEndpointInstallScriptRequest = z.infer<typeof getEndpointInstallScriptSchema>;
|
|
42
|
+
export type EndpointNotifyRequestSchema = z.infer<typeof endpointNotifyRequestSchema>;
|
|
35
43
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EACL,UAAU,EACV,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/schemas/index.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,EACL,UAAU,EACV,gBAAgB,EAGhB,kBAAkB,EACnB,MAAM,IAAI,CAAC;AAEZ,eAAO,MAAM,0BAA0B;;;iBAkEpC,CAAC;AAEJ,eAAO,MAAM,uBAAuB;;;iBA+BlC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;iBAkH9B,CAAC;AAEJ,eAAO,MAAM,yBAAyB;;;;;iBAgFnC,CAAC;AAEJ,eAAO,MAAM,8BAA8B;;;;;;;kBA8BvC,CAAC;AAEL,eAAO,MAAM,2BAA2B;;;;;;iBActC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,0BAA0B,CAClC,CAAC;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC/E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACzE,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,yBAAyB,CACjC,CAAC;AACF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CACnD,OAAO,8BAA8B,CACtC,CAAC;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,2BAA2B,CACnC,CAAC"}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getEndpointInstallScriptSchema = exports.generateConnectUrlsSchema = exports.addUserToGroupSchema = exports.createDeviceGroupSchema = exports.generateDownloadLinkSchema = void 0;
|
|
6
|
+
exports.endpointNotifyRequestSchema = exports.getEndpointInstallScriptSchema = exports.generateConnectUrlsSchema = exports.addUserToGroupSchema = exports.createDeviceGroupSchema = exports.generateDownloadLinkSchema = void 0;
|
|
7
7
|
const zod_1 = __importDefault(require("zod"));
|
|
8
8
|
const __1 = require("..");
|
|
9
9
|
exports.generateDownloadLinkSchema = zod_1.default
|
|
@@ -245,3 +245,18 @@ exports.getEndpointInstallScriptSchema = zod_1.default
|
|
|
245
245
|
const url = data.endpointUrl.toLowerCase();
|
|
246
246
|
return validExtensions.some((ext) => url.endsWith(ext.toLowerCase()));
|
|
247
247
|
});
|
|
248
|
+
exports.endpointNotifyRequestSchema = zod_1.default.object({
|
|
249
|
+
agent_ids: zod_1.default
|
|
250
|
+
.array(zod_1.default.string().min(1))
|
|
251
|
+
.min(1, "At least one agent_id is required"),
|
|
252
|
+
title: zod_1.default.string().min(1).max(256),
|
|
253
|
+
message: zod_1.default.string().min(1).max(2048),
|
|
254
|
+
type: zod_1.default.nativeEnum(__1.NotifyDeliveryType),
|
|
255
|
+
timeout: zod_1.default
|
|
256
|
+
.number()
|
|
257
|
+
.int()
|
|
258
|
+
.min(0)
|
|
259
|
+
.optional()
|
|
260
|
+
.default(0)
|
|
261
|
+
.describe("Seconds. Only applicable for messagebox. 0 = no timeout."),
|
|
262
|
+
});
|