typed-wamp
This is a package that provides accurate TypeScript type definitions and basic message wrappers for the WAMP protocol.
This package doesn't do much by itself. It lets other code, like client and router implementations, use a uniform set of typed and wrappers for working with the WAMP protocol.
Wrappers and Enums
These work in both JS and TS.
Message Type Codes
Via the WampType
enum:
; ;;
WAMP Message Wrapper Objects
These are object versions of WAMP messages, that support properties and methods. They are easier to work with than naked arrays.
Craft using a constructor:
; ;;
Parse from an array object:
;;
Turn back to raw form:
;console.lograw2; // [1, "realm", helloDetails]
Common URIs
URIs mentioned in the WAMP specification.
; ; // wamp.error.not_authorized; // wamp.registration.on_register
Type Definitions
These only make sense from TypeScript.
WAMP Message Structure Definitions
These are in the namespace WampRaw
.
;; ;
WAMP Options Type Definitions
Type definitions for things like the HELLO message details
field.
; ;
Limitations
This package intentionally doesn't address any specific authentication method, so it doesn't include specific wrappers for wampcra
authentication (except for wrappers and types describing general Challenge
and Authenticate
messages).