1.0.0 • Published 4 years ago

@555platform/555-sdk-parser v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Build

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;
};