Skip to content

Exports & events ​

All exports below are server-side. Server resources should call them directly; never proxy trusted operations to a client.

Server exports ​

Export Signature Notes
can can(src, feature, ctx?) -> allowed, reason, info? Resolve a feature through np_jobs or the transition fallback.
getOutlet getOutlet(id) -> outlet? Reads a configured newsroom outlet.
getOutlets getOutlets() -> map Current outlet map keyed by id.
hasPressAccess hasPressAccess(src, scope?) -> allowed, pass? Verify a credential and optional scene scope.
hasHelicamFeature hasHelicamFeature(src, role) -> boolean np_helicam role-provider callback; grants only air when press.helicam is active and configured model rules pass.
issuePass issuePass(issuer, target, definition) -> ok, result? Requires press.credentials or np_press.passes.
revokePass revokePass(issuer, passId) -> ok, reason? Outlet-scoped for feature issuers; staff node can manage all outlets.
isOnAir isOnAir(src) -> boolean True while np_press tracks the player's live session.
registerOutlet registerOutlet(definition) -> ok, reason? Trusted server integration; validates and upserts an outlet row.
publishArticle publishArticle(definition) -> article, reason? Trusted integration; immediately publishes an article.
pushBreaking pushBreaking(outlet, text, articleId?) -> article Trusted server integration for a breaking announcement.
setLowerThird setLowerThird(channel, definition, seconds?) -> ok, reason? Sets headline/ticker graphics through np_screens; a duration clears them if no later np_press graphics update replaced them.
addTip addTip(outlet, definition) -> tipId, reason? Trusted resource tip ingestion.
addHook addHook(name, fn) -> hookId Registers a resource hook. Hooks returning false, reason block the operation.

Article definitions for publishArticle accept outlet, title, deck, body, category, tags, cover, gallery, author and source. Tip definitions accept body, optional from, anonymous and media.

Phone RPCs ​

When np_phone is running, np_press registers these RPC methods through the phone's owner-tracked registerRpc:

RPC Purpose
news.list Published articles across outlets (or a selected outlet), with a keyset cursor and limit
news.get Read one published article
news.publish Submit a story; requires editor self-publish to appear in the News feed immediately
news.delete Retract an owned draft or, with editorial permission, a published story in the assigned outlet
press.drafts Read the caller's own drafts and submitted stories, plus the assigned outlet's submitted editorial queue
press.tips Read the assigned outlet's tip inbox
press.tip.send Send a reader tip; supports anonymous source mode

The news.* handlers override np_phone's base News RPCs while np_press is running. np_phone restores the prior handlers when the owner resource stops.

news.list accepts { outlet?, cursor?, limit? }. Omit outlet to read the aggregate public feed. The returned cursor is opaque and must be passed unchanged to the next request; it tracks pinned state, publication time and id.

Events ​

Event Direction Description
np_press:article:published server local Published article data
np_press:article:breaking server local Article data after breaking state changes
np_press:article:stateChanged server local (articleId, action, actorSource) for newsroom audit transitions
np_press:live:started / np_press:live:ended server local (channel, source) on live session state changes
np_press:pass:issued server local (passId, targetSource, outlet, scope)
np_press:pass:revoked server local (passId, issuerSource)
np_press:tip:received server local (outletId) when a public tip arrives
np_press:photo:saved server local (source, url, metadata) after camera photo handling

Events are notifications, not permission checks. Use the exports for trusted resource-to-resource calls.