@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
95 lines • 4.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SessionTable = void 0;
const index_1 = require("./index");
class SessionTable {
constructor(data) {
let activeSessionsDefault = 0;
this.activeSessions = typeof (data === null || data === void 0 ? void 0 : data.activeSessions) !== "undefined" ? data === null || data === void 0 ? void 0 : data.activeSessions : activeSessionsDefault;
let expiredSessionsDefault = 0;
this.expiredSessions = typeof (data === null || data === void 0 ? void 0 : data.expiredSessions) !== "undefined" ? data === null || data === void 0 ? void 0 : data.expiredSessions : expiredSessionsDefault;
let sessionCountDefault = 0;
this.sessionCount = typeof (data === null || data === void 0 ? void 0 : data.sessionCount) !== "undefined" ? data === null || data === void 0 ? void 0 : data.sessionCount : sessionCountDefault;
let sessionDiskUsageDefault = 0;
this.sessionDiskUsage = typeof (data === null || data === void 0 ? void 0 : data.sessionDiskUsage) !== "undefined" ? data === null || data === void 0 ? void 0 : data.sessionDiskUsage : sessionDiskUsageDefault;
let sessionIdDefault = "";
this.sessionId = typeof (data === null || data === void 0 ? void 0 : data.sessionId) !== "undefined" ? data === null || data === void 0 ? void 0 : data.sessionId : sessionIdDefault;
this.sessionList = (data.sessionList || []).map(index_1.SessionTableEntry.fromJson);
let timestampDefault = 0;
this.timestamp = typeof (data === null || data === void 0 ? void 0 : data.timestamp) !== "undefined" ? data === null || data === void 0 ? void 0 : data.timestamp : timestampDefault;
let unstableSessionsDefault = 0;
this.unstableSessions = typeof (data === null || data === void 0 ? void 0 : data.unstableSessions) !== "undefined" ? data === null || data === void 0 ? void 0 : data.unstableSessions : unstableSessionsDefault;
}
static getActiveSessionsDefault() {
return 0;
}
static getActiveSessionsDescription() {
return "Total number of active sessions.";
}
static getExpiredSessionsDefault() {
return 0;
}
static getExpiredSessionsDescription() {
return "Total number of expired sessions.";
}
static getSessionCountDefault() {
return 0;
}
static getSessionCountDescription() {
return "Total number of sessions.";
}
static getSessionDiskUsageDefault() {
return 0;
}
static getSessionDiskUsageDescription() {
return "Total size in bytes required by all sessions together on the hard disk in the base folder.";
}
static getSessionIdDefault() {
return "";
}
static getSessionIdDescription() {
return "Session ID of the session that requested the session table.";
}
static getSessionListDefault() {
return [];
}
static getSessionListDescription() {
return "List of all sessions and detailed information about each session.";
}
static getTimestampDefault() {
return 0;
}
static getTimestampDescription() {
return "UTC time when the query was executed.";
}
static getUnstableSessionsDefault() {
return 0;
}
static getUnstableSessionsDescription() {
return "Total number of sessions that have not yet been initialized or are currently expiring.";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new SessionTable(data);
}
toJson() {
var _a;
return {
'activeSessions': this.activeSessions,
'expiredSessions': this.expiredSessions,
'sessionCount': this.sessionCount,
'sessionDiskUsage': this.sessionDiskUsage,
'sessionId': this.sessionId,
'sessionList': (_a = this.sessionList) === null || _a === void 0 ? void 0 : _a.map((data) => data.toJson()),
'timestamp': this.timestamp,
'unstableSessions': this.unstableSessions,
};
}
clone() {
return SessionTable.fromJson(this.toJson());
}
}
exports.SessionTable = SessionTable;
//# sourceMappingURL=SessionTable.js.map