- RMM Overshell (migration 077): admin page, dispatch UI, executor/worker, target resolver, script registry (AD/DHCP/DNS/event-log/services/software/network/loglift) - LogLift evidence pipeline (migration 078): upload webhook, B2 storage client, receiver/matcher, EventLogCollector PowerShell script - IT Glue audit + write-back (migrations 075, 076): asset-audit runner, ticket xrefs, applications/configurations browse pages + apply/revert/audit endpoints - Link-aware analyzer bundles (migration 073) + provider toggle (migration 074): link-discovery service, OpenRouter LLM provider, related-tickets/itglue-suggestion panels, analyze-bundle endpoint - Endpoint data model + device-link reconciliation (migrations 079, 080): conflicts admin page, reconciler service, resolve endpoints - Dashboard overhaul: integration-health service + alerts, overview/health endpoints - Permissions: add itglue + rmm scopes; middleware: public /api/rmm/loglift route Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
57 lines
1.8 KiB
TypeScript
57 lines
1.8 KiB
TypeScript
/**
|
|
* Registry of RMM Overshell scripts.
|
|
*
|
|
* Adding a new script:
|
|
* 1. Create lib/services/rmm/scripts/<id>.ts exporting an RmmScript.
|
|
* 2. Import + add to SCRIPTS below.
|
|
* 3. Bump the script's `version` field if you change body or output shape.
|
|
* 4. Run npm test — registry tests verify ids are unique + ids match
|
|
* module exports.
|
|
*
|
|
* The DB never stores executable PowerShell. The runtime gates execution to
|
|
* the ids in this registry only.
|
|
*/
|
|
|
|
import type { RmmScript } from './types';
|
|
import { getServices } from './get-services';
|
|
import { getInstalledSoftware } from './get-installed-software';
|
|
import { getEventLogRecent } from './get-event-log-recent';
|
|
import { getAdHealth } from './get-ad-health';
|
|
import { getDhcpScopes } from './get-dhcp-scopes';
|
|
import { getDnsZones } from './get-dns-zones';
|
|
import { getNetworkDiscovery } from './get-network-discovery';
|
|
import { logliftEventLogs } from './loglift-eventlogs';
|
|
|
|
const _all: RmmScript[] = [
|
|
getServices,
|
|
getInstalledSoftware,
|
|
getEventLogRecent,
|
|
getAdHealth,
|
|
getDhcpScopes,
|
|
getDnsZones,
|
|
getNetworkDiscovery,
|
|
logliftEventLogs,
|
|
];
|
|
|
|
// Build the lookup map and verify ids are unique at module-load time.
|
|
export const SCRIPTS: Readonly<Record<string, RmmScript>> = (() => {
|
|
const map: Record<string, RmmScript> = {};
|
|
for (const s of _all) {
|
|
if (map[s.id]) {
|
|
throw new Error(`RMM script registry: duplicate id "${s.id}"`);
|
|
}
|
|
map[s.id] = s;
|
|
}
|
|
return Object.freeze(map);
|
|
})();
|
|
|
|
export function listScripts(): RmmScript[] {
|
|
return Object.values(SCRIPTS).sort((a, b) => a.name.localeCompare(b.name));
|
|
}
|
|
|
|
export function getScript(id: string): RmmScript | null {
|
|
return SCRIPTS[id] ?? null;
|
|
}
|
|
|
|
export type { RmmScript } from './types';
|
|
export { parseJsonOutput } from './types';
|