@softvision/webpdf-wsclient-typescript
Version:
A simplified and optimized API client library for the webPDF server
121 lines • 5.51 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SessionTableEntry = void 0;
class SessionTableEntry {
constructor(data) {
let adminDefault = false;
this.admin = typeof (data === null || data === void 0 ? void 0 : data.admin) !== "undefined" ? data === null || data === void 0 ? void 0 : data.admin : adminDefault;
let fileCountDefault = 0;
this.fileCount = typeof (data === null || data === void 0 ? void 0 : data.fileCount) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fileCount : fileCountDefault;
let fileSizeDefault = 0;
this.fileSize = typeof (data === null || data === void 0 ? void 0 : data.fileSize) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fileSize : fileSizeDefault;
let fileSizeHistoryDefault = 0;
this.fileSizeHistory = typeof (data === null || data === void 0 ? void 0 : data.fileSizeHistory) !== "undefined" ? data === null || data === void 0 ? void 0 : data.fileSizeHistory : fileSizeHistoryDefault;
let isAdminDefault = false;
this.isAdmin = typeof (data === null || data === void 0 ? void 0 : data.isAdmin) !== "undefined" ? data === null || data === void 0 ? void 0 : data.isAdmin : isAdminDefault;
let lastAccessDefault = 0;
this.lastAccess = typeof (data === null || data === void 0 ? void 0 : data.lastAccess) !== "undefined" ? data === null || data === void 0 ? void 0 : data.lastAccess : lastAccessDefault;
let providerIdDefault = "";
this.providerId = typeof (data === null || data === void 0 ? void 0 : data.providerId) !== "undefined" ? data === null || data === void 0 ? void 0 : data.providerId : providerIdDefault;
let sessionExpirationDefault = 0;
this.sessionExpiration = typeof (data === null || data === void 0 ? void 0 : data.sessionExpiration) !== "undefined" ? data === null || data === void 0 ? void 0 : data.sessionExpiration : sessionExpirationDefault;
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;
let sessionStateDefault = "unknown";
this.sessionState = typeof (data === null || data === void 0 ? void 0 : data.sessionState) !== "undefined" ? data === null || data === void 0 ? void 0 : data.sessionState : sessionStateDefault;
let userNameDefault = "";
this.userName = typeof (data === null || data === void 0 ? void 0 : data.userName) !== "undefined" ? data === null || data === void 0 ? void 0 : data.userName : userNameDefault;
}
static getAdminDefault() {
return false;
}
static getAdminDescription() {
return "";
}
static getFileCountDefault() {
return 0;
}
static getFileCountDescription() {
return "Number of files saved in the session.";
}
static getFileSizeDefault() {
return 0;
}
static getFileSizeDescription() {
return "Total size in bytes of all files saved in the session, excluding history entries.";
}
static getFileSizeHistoryDefault() {
return 0;
}
static getFileSizeHistoryDescription() {
return "Total size in bytes of all history files stored in the session, except the active file entry.";
}
static getIsAdminDefault() {
return false;
}
static getIsAdminDescription() {
return "Set if the user has administrator rights.";
}
static getLastAccessDefault() {
return 0;
}
static getLastAccessDescription() {
return "UTC time of the last access to the session.";
}
static getProviderIdDefault() {
return "";
}
static getProviderIdDescription() {
return "The ID of the external credential provider used to create the session. Empty if local provider was used.";
}
static getSessionExpirationDefault() {
return 0;
}
static getSessionExpirationDescription() {
return "Time in seconds when the session will expire.";
}
static getSessionIdDefault() {
return "";
}
static getSessionIdDescription() {
return "Unique id of the session.";
}
static getSessionStateDefault() {
return "unknown";
}
static getSessionStateDescription() {
return "";
}
static getUserNameDefault() {
return "";
}
static getUserNameDescription() {
return "Username of the authenticated user or empty if unknown or it is an anonymous session.";
}
static fromJson(data) {
if (data === undefined || data === null) {
return data;
}
return new SessionTableEntry(data);
}
toJson() {
return {
'admin': this.admin,
'fileCount': this.fileCount,
'fileSize': this.fileSize,
'fileSizeHistory': this.fileSizeHistory,
'isAdmin': this.isAdmin,
'lastAccess': this.lastAccess,
'providerId': this.providerId,
'sessionExpiration': this.sessionExpiration,
'sessionId': this.sessionId,
'sessionState': this.sessionState,
'userName': this.userName,
};
}
clone() {
return SessionTableEntry.fromJson(this.toJson());
}
}
exports.SessionTableEntry = SessionTableEntry;
//# sourceMappingURL=SessionTableEntry.js.map