@555platform/555parser.ts
v1.2.7
Published
555 Platform Message Parser
Downloads
88
Readme
555 Platform Message Format and Chat Message Format Typescript Parser
All of the Platform Message Format functions reside in PMF namespace and Chat Message Format functions are in CMF namespace.
Install and Use
npm i @555platform/555parser.ts -S
import { PMF, CMF } from '@555platform/555parser.ts';
PMF Namespace Functions
- pmfBuilder(options: EnvelopeOptions, payload: object) - builds PMF message with specified payload
- pmfParser(message: Envelope) - returns payload object
- pmfNamespace(message: Envelope) - returns namespace in PMF Envelope
PMF Types
EnvelopeOptions = {
auth: string;
namespace: string;
tid?: string;
logLevel?: PmfLogLevels;
ttl?: number;
};
Envelope = {
auth: string;
mid: string;
namespace: string;
tid: string;
logLevel: PmfLogLevels;
ttl: number;
version: string;
timestamp: Date;
body: Object;
};