@meru2802/aux-server 1.0.26 → 1.0.28
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 +348 -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;IAsW3B,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,75 @@ 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
|
+
IS_HEADLESS=0
|
|
829
|
+
echo "NOTE: Active display manager detected (graphical session)."
|
|
830
|
+
echo "Continuing installation in desktop mode..."
|
|
831
|
+
else
|
|
832
|
+
echo "WARNING: \\$DISPLAY is set (likely SSH X forwarding) but no display manager is active."
|
|
833
|
+
echo "Unsetting DISPLAY and continuing in headless mode..."
|
|
834
|
+
unset DISPLAY
|
|
835
|
+
fi
|
|
836
|
+
fi
|
|
656
837
|
|
|
657
|
-
|
|
838
|
+
ARCH=$(uname -m)
|
|
839
|
+
case "$ARCH" in
|
|
840
|
+
x86_64)
|
|
841
|
+
ARCH_SUFFIX="amd64"
|
|
842
|
+
ARCH_DIR="x64"
|
|
843
|
+
;;
|
|
844
|
+
aarch64)
|
|
845
|
+
ARCH_SUFFIX="arm64"
|
|
846
|
+
ARCH_DIR="arm64"
|
|
847
|
+
;;
|
|
848
|
+
*)
|
|
849
|
+
echo "ERROR: Unsupported architecture: $ARCH"
|
|
850
|
+
echo "This installer supports x86_64 (amd64) and aarch64 (arm64) only."
|
|
851
|
+
exit 1
|
|
852
|
+
;;
|
|
853
|
+
esac
|
|
854
|
+
echo "Detected architecture: \${ARCH} (\${ARCH_SUFFIX})"
|
|
658
855
|
|
|
659
|
-
|
|
660
|
-
if
|
|
661
|
-
echo "
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
echo "No previous Nexus Endpoint installation found. Continuing..."
|
|
856
|
+
CONFIG_FILE="/etc/nexus-installer.conf"
|
|
857
|
+
if [ -f "$CONFIG_FILE" ]; then
|
|
858
|
+
echo "Loading configuration from \${CONFIG_FILE}..."
|
|
859
|
+
# shellcheck source=/dev/null
|
|
860
|
+
source "$CONFIG_FILE"
|
|
665
861
|
fi
|
|
666
862
|
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
863
|
+
apiURL="\${NEXUS_API_URL:-${params.baseUrl}}"
|
|
864
|
+
token="\${NEXUS_TOKEN:-${params.installerToken}}"
|
|
865
|
+
clientID="\${NEXUS_CLIENT_ID:-${params.clientId}}"
|
|
866
|
+
siteID="\${NEXUS_SITE_ID:-${params.siteId}}"
|
|
867
|
+
agentType="\${NEXUS_AGENT_TYPE:-${params.agentType}}"
|
|
868
|
+
assetTypeId="\${NEXUS_ASSET_TYPE_ID:-${params.assetTypeId}}"
|
|
869
|
+
icebergSiteId="\${NEXUS_ICEBERG_SITE_ID:-${params.icebergSiteId}}"
|
|
870
|
+
icebergOrgId="\${NEXUS_ICEBERG_ORG_ID:-${params.icebergOrgId}}"
|
|
871
|
+
icebergOrgToken="\${NEXUS_ICEBERG_ORG_TOKEN:-${params.icebergOrgToken}}"
|
|
872
|
+
assetEndpoint="\${NEXUS_ASSET_ENDPOINT:-${this.config.icebergConfig.assetEndpoint}}"
|
|
873
|
+
proxy="\${NEXUS_PROXY:-}"
|
|
674
874
|
|
|
675
|
-
|
|
676
|
-
INSECURE=0
|
|
677
|
-
NOMESH=0
|
|
875
|
+
SCOGO_PASSWORD="\${SCOGO_USER_PASSWORD:-Sc090@1947}"
|
|
678
876
|
|
|
679
|
-
agentDL=
|
|
877
|
+
agentDL="https://nexus-endpoint-desktop-app.s3.ap-south-1.amazonaws.com/rmmagent/linux/\${ARCH_DIR}/nexusrmm-\${ARCH_SUFFIX}"
|
|
680
878
|
meshDL='https://${this.config.meshcentralConfig.host}/meshagents?id=${params.deviceGroupId}&installflags=2&meshinstall=6'
|
|
681
879
|
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
assetEndpoint='${this.config.icebergConfig.assetEndpoint}'
|
|
692
|
-
proxy=''
|
|
880
|
+
# If headless mode detected and agentType is 'workstation', override to 'server'
|
|
881
|
+
if [ $IS_HEADLESS -eq 1 ] && [ "\${agentType}" = "workstation" ]; then
|
|
882
|
+
echo "Headless mode detected. Overriding agent type from 'workstation' to 'server'."
|
|
883
|
+
agentType="server"
|
|
884
|
+
fi
|
|
885
|
+
|
|
886
|
+
DEBUG=0
|
|
887
|
+
INSECURE=0
|
|
888
|
+
NOMESH=0
|
|
693
889
|
|
|
694
890
|
agentBinPath='/usr/local/bin'
|
|
695
891
|
binName='nexusagent'
|
|
@@ -720,35 +916,21 @@ set_locale_rhel() {
|
|
|
720
916
|
|
|
721
917
|
RemoveOldAgent() {
|
|
722
918
|
if [ -f "\${agentSysD}" ]; then
|
|
723
|
-
systemctl disable \${agentSvcName}
|
|
724
|
-
systemctl stop \${agentSvcName}
|
|
919
|
+
systemctl disable "\${agentSvcName}" 2>/dev/null || true
|
|
920
|
+
systemctl stop "\${agentSvcName}" 2>/dev/null || true
|
|
725
921
|
rm -f "\${agentSysD}"
|
|
726
922
|
systemctl daemon-reload
|
|
727
923
|
fi
|
|
728
924
|
|
|
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
|
|
925
|
+
[ -f "\${agentConf}" ] && rm -f "\${agentConf}" || true
|
|
926
|
+
[ -f "\${agentBin}" ] && rm -f "\${agentBin}" || true
|
|
927
|
+
[ -d "\${agentDir}" ] && rm -rf "\${agentDir}" || true
|
|
740
928
|
}
|
|
741
929
|
|
|
742
930
|
InstallMesh() {
|
|
743
931
|
if [ -f /etc/os-release ]; then
|
|
744
|
-
distroID=$(
|
|
745
|
-
|
|
746
|
-
echo $ID
|
|
747
|
-
)
|
|
748
|
-
distroIDLIKE=$(
|
|
749
|
-
. /etc/os-release
|
|
750
|
-
echo $ID_LIKE
|
|
751
|
-
)
|
|
932
|
+
distroID=$(. /etc/os-release; echo "$ID")
|
|
933
|
+
distroIDLIKE=$(. /etc/os-release; echo "\${ID_LIKE:-}")
|
|
752
934
|
if [[ " \${deb[*]} " =~ " \${distroID} " ]]; then
|
|
753
935
|
set_locale_deb
|
|
754
936
|
elif [[ " \${deb[*]} " =~ " \${distroIDLIKE} " ]]; then
|
|
@@ -761,30 +943,30 @@ InstallMesh() {
|
|
|
761
943
|
fi
|
|
762
944
|
|
|
763
945
|
meshTmpDir='/root/meshtemp'
|
|
764
|
-
mkdir -p $meshTmpDir
|
|
946
|
+
mkdir -p "$meshTmpDir"
|
|
765
947
|
|
|
766
948
|
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
|
|
949
|
+
wget --no-check-certificate -q -O "\${meshTmpBin}" "\${meshDL}"
|
|
950
|
+
chmod +x "\${meshTmpBin}"
|
|
951
|
+
mkdir -p "\${meshDir}"
|
|
952
|
+
env LC_ALL=en_US.UTF-8 LANGUAGE=en_US XAUTHORITY=foo DISPLAY=bar "\${meshTmpBin}" -install --installPath="\${meshDir}"
|
|
771
953
|
sleep 1
|
|
772
|
-
rm -rf \${meshTmpDir}
|
|
954
|
+
rm -rf "\${meshTmpDir}"
|
|
773
955
|
}
|
|
774
956
|
|
|
775
957
|
RemoveMesh() {
|
|
776
958
|
if [ -f "\${meshSystemBin}" ]; then
|
|
777
|
-
env XAUTHORITY=foo DISPLAY=bar \${meshSystemBin} -uninstall
|
|
959
|
+
env XAUTHORITY=foo DISPLAY=bar "\${meshSystemBin}" -uninstall
|
|
778
960
|
sleep 1
|
|
779
961
|
fi
|
|
780
962
|
|
|
781
963
|
if [ -f "\${meshSysD}" ]; then
|
|
782
|
-
systemctl stop \${meshSvcName} >/dev/null 2>&1
|
|
783
|
-
systemctl disable \${meshSvcName} >/dev/null 2>&1
|
|
784
|
-
rm -f \${meshSysD}
|
|
964
|
+
systemctl stop "\${meshSvcName}" >/dev/null 2>&1 || true
|
|
965
|
+
systemctl disable "\${meshSvcName}" >/dev/null 2>&1 || true
|
|
966
|
+
rm -f "\${meshSysD}"
|
|
785
967
|
fi
|
|
786
968
|
|
|
787
|
-
rm -rf \${meshDir}
|
|
969
|
+
rm -rf "\${meshDir}"
|
|
788
970
|
systemctl daemon-reload
|
|
789
971
|
}
|
|
790
972
|
|
|
@@ -795,7 +977,6 @@ Uninstall() {
|
|
|
795
977
|
|
|
796
978
|
if [ $# -ne 0 ] && [[ $1 =~ ^(uninstall|-uninstall|--uninstall)$ ]]; then
|
|
797
979
|
Uninstall
|
|
798
|
-
# Remove the current script
|
|
799
980
|
rm "$0"
|
|
800
981
|
exit 0
|
|
801
982
|
fi
|
|
@@ -813,15 +994,63 @@ while [[ "$#" -gt 0 ]]; do
|
|
|
813
994
|
shift
|
|
814
995
|
done
|
|
815
996
|
|
|
997
|
+
if id "scogo" &>/dev/null; then
|
|
998
|
+
echo "User 'scogo' already exists. Skipping user creation."
|
|
999
|
+
else
|
|
1000
|
+
useradd -c "Scogo IT Support" -m -s /bin/bash scogo
|
|
1001
|
+
echo "scogo:\${SCOGO_PASSWORD}" | chpasswd
|
|
1002
|
+
fi
|
|
1003
|
+
|
|
1004
|
+
for grp in sudo adm cdrom dip plugdev video; do
|
|
1005
|
+
if getent group "$grp" >/dev/null 2>&1; then
|
|
1006
|
+
usermod -aG "$grp" scogo
|
|
1007
|
+
fi
|
|
1008
|
+
done
|
|
1009
|
+
echo 'scogo ALL=(ALL) ALL' | tee /etc/sudoers.d/scogo >/dev/null
|
|
1010
|
+
chmod 0440 /etc/sudoers.d/scogo
|
|
1011
|
+
|
|
1012
|
+
if [ -f /etc/gdm3/custom.conf ]; then
|
|
1013
|
+
echo "GDM3 detected. Disabling Wayland..."
|
|
1014
|
+
sed -i 's/^#\\?WaylandEnable=.*/WaylandEnable=false/' /etc/gdm3/custom.conf
|
|
1015
|
+
else
|
|
1016
|
+
echo "GDM3 not found (headless server). Skipping Wayland configuration."
|
|
1017
|
+
fi
|
|
1018
|
+
|
|
1019
|
+
if [ $IS_HEADLESS -eq 1 ]; then
|
|
1020
|
+
echo "Headless server detected. Skipping Nexus Endpoint desktop app installation."
|
|
1021
|
+
echo "(Desktop app requires a GUI environment to function.)"
|
|
1022
|
+
else
|
|
1023
|
+
echo "Checking for previous installations of Nexus Endpoint..."
|
|
1024
|
+
if dpkg-query -W -f='\${Status}' nexus-endpoint 2>/dev/null | grep -q "install ok installed"; then
|
|
1025
|
+
echo "Found existing Nexus Endpoint installation. Removing..."
|
|
1026
|
+
apt-get remove -y nexus-endpoint
|
|
1027
|
+
else
|
|
1028
|
+
echo "No previous Nexus Endpoint installation found. Continuing..."
|
|
1029
|
+
fi
|
|
1030
|
+
|
|
1031
|
+
echo "Downloading and installing Nexus Endpoint..."
|
|
1032
|
+
apt-get update
|
|
1033
|
+
apt-get install -y libwebkit2gtk-4.1-0 libgtk-3-0 libappindicator3-1 libayatana-appindicator3-1 libxdo-dev
|
|
1034
|
+
INSTALLER="nexus-endpoint-installer.deb"
|
|
1035
|
+
wget "${params.endpointUrl}" -O "$INSTALLER"
|
|
1036
|
+
dpkg -i "$INSTALLER"
|
|
1037
|
+
rm -f "$INSTALLER"
|
|
1038
|
+
fi
|
|
1039
|
+
|
|
1040
|
+
if ! command -v dmidecode &>/dev/null; then
|
|
1041
|
+
echo "Installing dmidecode..."
|
|
1042
|
+
apt-get update -qq || true
|
|
1043
|
+
apt-get install -y -qq dmidecode || echo "WARNING: Could not install dmidecode. Continuing anyway."
|
|
1044
|
+
fi
|
|
1045
|
+
|
|
816
1046
|
RemoveOldAgent
|
|
817
1047
|
|
|
818
1048
|
echo "Downloading Nexus agent..."
|
|
819
|
-
wget -q -O \${agentBin} "\${agentDL}"
|
|
820
|
-
if [ $? -ne 0 ]; then
|
|
1049
|
+
if ! wget -q -O "\${agentBin}" "\${agentDL}"; then
|
|
821
1050
|
echo "ERROR: Unable to download nexus agent"
|
|
822
1051
|
exit 1
|
|
823
1052
|
fi
|
|
824
|
-
chmod +x \${agentBin}
|
|
1053
|
+
chmod +x "\${agentBin}"
|
|
825
1054
|
|
|
826
1055
|
MESH_NODE_ID=""
|
|
827
1056
|
|
|
@@ -835,36 +1064,47 @@ else
|
|
|
835
1064
|
InstallMesh
|
|
836
1065
|
sleep 2
|
|
837
1066
|
echo "Getting mesh node id..."
|
|
838
|
-
MESH_NODE_ID=$(env XAUTHORITY=foo DISPLAY=bar \${agentBin} -m nixmeshnodeid)
|
|
1067
|
+
MESH_NODE_ID=$(env XAUTHORITY=foo DISPLAY=bar "\${agentBin}" -m nixmeshnodeid)
|
|
839
1068
|
fi
|
|
840
1069
|
|
|
841
1070
|
if [ ! -d "\${agentBinPath}" ]; then
|
|
842
1071
|
echo "Creating \${agentBinPath}"
|
|
843
|
-
mkdir -p \${agentBinPath}
|
|
1072
|
+
mkdir -p "\${agentBinPath}"
|
|
844
1073
|
fi
|
|
845
1074
|
|
|
846
|
-
|
|
1075
|
+
INSTALL_ARGS=(
|
|
1076
|
+
"\${agentBin}" -m install
|
|
1077
|
+
-api "\${apiURL}"
|
|
1078
|
+
-client-id "\${clientID}"
|
|
1079
|
+
-site-id "\${siteID}"
|
|
1080
|
+
-agent-type "\${agentType}"
|
|
1081
|
+
-auth "\${token}"
|
|
1082
|
+
-asset-type-id "\${assetTypeId}"
|
|
1083
|
+
-iceberg-site-id "\${icebergSiteId}"
|
|
1084
|
+
-iceberg-org-id "\${icebergOrgId}"
|
|
1085
|
+
-iceberg-org-token "\${icebergOrgToken}"
|
|
1086
|
+
-asset-api "\${assetEndpoint}"
|
|
1087
|
+
)
|
|
847
1088
|
|
|
848
|
-
if [ "\${MESH_NODE_ID}"
|
|
849
|
-
|
|
1089
|
+
if [ -n "\${MESH_NODE_ID}" ]; then
|
|
1090
|
+
INSTALL_ARGS+=(--meshnodeid "\${MESH_NODE_ID}")
|
|
850
1091
|
fi
|
|
851
1092
|
|
|
852
1093
|
if [[ $DEBUG -eq 1 ]]; then
|
|
853
|
-
|
|
1094
|
+
INSTALL_ARGS+=(--log debug)
|
|
854
1095
|
fi
|
|
855
1096
|
|
|
856
1097
|
if [[ $INSECURE -eq 1 ]]; then
|
|
857
|
-
|
|
1098
|
+
INSTALL_ARGS+=(--insecure)
|
|
858
1099
|
fi
|
|
859
1100
|
|
|
860
|
-
if [ "\${proxy}"
|
|
861
|
-
|
|
1101
|
+
if [ -n "\${proxy}" ]; then
|
|
1102
|
+
INSTALL_ARGS+=(--proxy "\${proxy}")
|
|
862
1103
|
fi
|
|
863
1104
|
|
|
864
|
-
|
|
1105
|
+
"\${INSTALL_ARGS[@]}"
|
|
865
1106
|
|
|
866
|
-
|
|
867
|
-
cat <<EOF
|
|
1107
|
+
cat > "\${agentSysD}" <<EOF
|
|
868
1108
|
[Unit]
|
|
869
1109
|
Description=Nexus RMM Linux Agent
|
|
870
1110
|
|
|
@@ -881,16 +1121,33 @@ KillMode=process
|
|
|
881
1121
|
[Install]
|
|
882
1122
|
WantedBy=multi-user.target
|
|
883
1123
|
EOF
|
|
884
|
-
)"
|
|
885
|
-
echo "\${tacticalsvc}" | tee \${agentSysD} >/dev/null
|
|
886
1124
|
|
|
887
1125
|
systemctl daemon-reload
|
|
888
|
-
systemctl enable \${agentSvcName}
|
|
889
|
-
systemctl start \${agentSvcName}
|
|
1126
|
+
systemctl enable "\${agentSvcName}"
|
|
1127
|
+
systemctl start "\${agentSvcName}"
|
|
1128
|
+
|
|
1129
|
+
if systemctl is-active --quiet gdm3; then
|
|
1130
|
+
echo "Restarting GDM3..."
|
|
1131
|
+
systemctl restart gdm3
|
|
1132
|
+
else
|
|
1133
|
+
echo "GDM3 not active. Skipping restart."
|
|
1134
|
+
fi
|
|
1135
|
+
|
|
1136
|
+
if systemctl is-active --quiet systemd-logind; then
|
|
1137
|
+
echo "Restarting systemd-logind..."
|
|
1138
|
+
systemctl restart systemd-logind
|
|
1139
|
+
fi
|
|
1140
|
+
|
|
1141
|
+
echo "System serial number:"
|
|
1142
|
+
dmidecode --string system-serial-number 2>/dev/null || echo "(dmidecode failed — possibly running in a VM without SMBIOS data)"
|
|
890
1143
|
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
1144
|
+
echo ""
|
|
1145
|
+
echo "============================================="
|
|
1146
|
+
echo " Nexus RMM Agent installation complete!"
|
|
1147
|
+
echo "============================================="
|
|
1148
|
+
echo " Agent service: \${agentSvcName}"
|
|
1149
|
+
echo " Status: $(systemctl is-active \${agentSvcName})"
|
|
1150
|
+
echo "============================================="`;
|
|
894
1151
|
}
|
|
895
1152
|
}
|
|
896
1153
|
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;IAC1B,aAAa,gBAAgB;IAC7B,QAAQ,YAAY;CACrB;AAED,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ChB,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
|
+
});
|