"use strict";
export class Channel {
/** @param {{name?:string,value?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
name;
/** @type {string} */
value;
}
export class Device {
/** @param {{id?:number,type?:string,timeStamp?:number,channels?:Channel[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
id;
/** @type {string} */
type;
/** @type {number} */
timeStamp;
/** @type {Channel[]} */
channels = [];
}
export class Logger {
/** @param {{id?:number,devices?:Device[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {number} */
id;
/** @type {Device[]} */
devices = [];
}
export class StoreLogs {
/** @param {{loggers?:Logger[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {Logger[]} */
loggers = [];
}
export class StoreLogsResponse {
/** @param {{existingLogs?:Logger[],responseStatus?:ResponseStatus}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {Logger[]} */
existingLogs = [];
/** @type {ResponseStatus} */
responseStatus;
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /jsv/reply/StoreLogs HTTP/1.1
Host: test.servicestack.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
loggers:
[
{
id: 0,
devices:
[
{
id: 0,
type: String,
timeStamp: 0,
channels:
[
{
name: String,
value: String
}
]
}
]
}
]
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { existingLogs: [ { id: 0, devices: [ { id: 0, type: String, timeStamp: 0, channels: [ { name: String, value: String } ] } ] } ], responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } } }