@nextera.one/axis-server-sdk
v0.8.0
Published
Axis Protocol server-side SDK — decorators, interfaces, and routing primitives for building Axis handlers
Downloads
951
Maintainers
Readme
@nextera.one/axis-server-sdk
Server-side SDK for the AXIS protocol.
This package contains the Nest-friendly server runtime pieces plus the shared AXIS binary protocol utilities used by both client and server implementations.
Installation
npm install @nextera.one/axis-server-sdkPeer dependencies:
@nestjs/commonreflect-metadata
What It Exposes
Root exports are split into two groups:
- Server runtime helpers:
@Handler,@Intent,IntentRouter, handler interfaces, sensor interfaces. - Shared protocol primitives: binary frame codecs, TLV/varint/constants, binary signature helpers, codec utilities, packet types.
Shared Core API
The canonical cross-SDK protocol layer is the ./core subpath:
import {
AXIS_MAGIC,
TLV_AUD,
TLV_REALM,
AxisBinaryFrame,
encodeFrame,
decodeFrame,
getSignTarget,
signFrame,
verifyFrameSignature,
} from '@nextera.one/axis-server-sdk/core';Notes:
TLV_AUDis the canonical name for tag8.TLV_REALMremains available as a compatibility alias.AxisBinaryFrameis the explicit low-level binary frame type.- The server
./coresurface is additive, but shared protocol constants and wire-format helpers are kept aligned with the client SDK. AxisFrameZis available from the server package as a server-side validation helper, not as part of the shared minimum core contract.
Decorator Example
import {
Handler,
Intent,
IntentRouter,
AxisEffect,
} from '@nextera.one/axis-server-sdk';
import type { AxisBinaryFrame } from '@nextera.one/axis-server-sdk/core';
@Handler('system')
export class SystemHandler {
constructor(private readonly router: IntentRouter) {}
onModuleInit() {
this.router.registerHandler(this);
}
@Intent('ping', { frame: true })
async ping(frame: AxisBinaryFrame): Promise<AxisEffect> {
return {
ok: true,
effect: 'PONG',
body: frame.body,
};
}
}Versioning
The server SDK may include additional server-only exports beyond the shared ./core surface. For code intended to work across both client and server SDKs, prefer importing protocol primitives from ./core.
