Exports and providers ​
Provider exports are server-side. Trusted imports are allowlisted by resource name in Config.Evidence.EvidenceSources. Keep references stable and metadata JSON-safe; do not write directly to np_evidence SQL tables.
Add an observation ​
AddObservation(input) -> traceRef, status
Required input: kind from EvidenceTypes, externalRef (stable within the provider), and numeric { x, y, z } coordinates. Optional: description, JSON-safe metadata up to the configured payload limit. A duplicate stable key returns the existing trace reference and duplicate.
local traceRef, status = exports.np_evidence:AddObservation({
kind = 'cctv',
externalRef = ('camera:%s:clip:%s'):format(cameraId, clipId),
coords = { x = x, y = y, z = z },
description = 'Camera clip covering the scene entrance',
metadata = { cameraId = cameraId, clipId = clipId },
})
The trace is a source observation, not a physical sample or custody transfer.
Create a case ​
CreateCase(src, input) -> case, status
For a player action, pass the player's server ID; np_jobs access and jurisdiction are checked. For a trusted resource import, pass 0 and include title, summary, and stable externalRef; the import jurisdiction defaults to the configured default unless specified.
Read case and scene records ​
GetCase(src, caseId) -> detail, reasonreturns an authorized case, evidence traces, custody, analysis, and links.GetNearbyEvidence(src, coords, radius) -> traces, reasonrequires scene inspection and rejects coordinates outside the server position tolerance.GetIntegrationStatus() -> { { name, state }, ... }reports optional resource states.
Link an external record ​
LinkToCase(src, evidenceCaseId, provider, ref, kind, label) -> ok, reason
The player must have case-read access in the case jurisdiction. Only the provider name, stable record reference, kind, and display label are stored.
local ok, reason = exports.np_evidence:LinkToCase(
playerSource, evidenceCaseId, 'np_dispatch', callId, 'call', 'Dispatch call #' .. callId
)
Register an evidence type ​
RegisterEvidenceType(def) -> boolean, reason is currently restricted to np_admin and np_evidence. Definitions have id, label, family, icon, tint, collectable, and optional decayHours. Keep IDs lowercase and limited to letters, digits, underscores, and hyphens.
Current feature IDs ​
evidence.scene.inspect, evidence.scene.document, evidence.sample.collect, evidence.case.create, evidence.case.read, evidence.case.manage, evidence.sample.transfer, evidence.lab.submit, evidence.lab.analyze, evidence.locker.manage, and evidence.case.close.