Files
cmbone/frontend/bindings/cmbone/internal/models/models.js
T

987 lines
26 KiB
JavaScript

// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Create as $Create} from "@wailsio/runtime";
export class AppLog {
/**
* Creates a new AppLog instance.
* @param {Partial<AppLog>} [$$source = {}] - The source object to create the AppLog.
*/
constructor($$source = {}) {
if (!("id" in $$source)) {
/**
* @member
* @type {number}
*/
this["id"] = 0;
}
if (!("level" in $$source)) {
/**
* @member
* @type {string}
*/
this["level"] = "";
}
if (!("module" in $$source)) {
/**
* @member
* @type {string}
*/
this["module"] = "";
}
if (!("message" in $$source)) {
/**
* @member
* @type {string}
*/
this["message"] = "";
}
if (!("detail" in $$source)) {
/**
* @member
* @type {string}
*/
this["detail"] = "";
}
if (!("createdAt" in $$source)) {
/**
* @member
* @type {string}
*/
this["createdAt"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new AppLog instance from a string or object.
* @param {any} [$$source = {}]
* @returns {AppLog}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new AppLog(/** @type {Partial<AppLog>} */($$parsedSource));
}
}
export class AppLogFilter {
/**
* Creates a new AppLogFilter instance.
* @param {Partial<AppLogFilter>} [$$source = {}] - The source object to create the AppLogFilter.
*/
constructor($$source = {}) {
if (!("level" in $$source)) {
/**
* @member
* @type {string}
*/
this["level"] = "";
}
if (!("module" in $$source)) {
/**
* @member
* @type {string}
*/
this["module"] = "";
}
if (!("limit" in $$source)) {
/**
* @member
* @type {number}
*/
this["limit"] = 0;
}
if (!("offset" in $$source)) {
/**
* @member
* @type {number}
*/
this["offset"] = 0;
}
Object.assign(this, $$source);
}
/**
* Creates a new AppLogFilter instance from a string or object.
* @param {any} [$$source = {}]
* @returns {AppLogFilter}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new AppLogFilter(/** @type {Partial<AppLogFilter>} */($$parsedSource));
}
}
export class AppSettingDefinition {
/**
* Creates a new AppSettingDefinition instance.
* @param {Partial<AppSettingDefinition>} [$$source = {}] - The source object to create the AppSettingDefinition.
*/
constructor($$source = {}) {
if (!("key" in $$source)) {
/**
* @member
* @type {string}
*/
this["key"] = "";
}
if (!("category" in $$source)) {
/**
* @member
* @type {string}
*/
this["category"] = "";
}
if (!("label" in $$source)) {
/**
* @member
* @type {string}
*/
this["label"] = "";
}
if (!("type" in $$source)) {
/**
* @member
* @type {string}
*/
this["type"] = "";
}
if (!("defaultValue" in $$source)) {
/**
* @member
* @type {string}
*/
this["defaultValue"] = "";
}
if (!("value" in $$source)) {
/**
* @member
* @type {string}
*/
this["value"] = "";
}
if (!("description" in $$source)) {
/**
* @member
* @type {string}
*/
this["description"] = "";
}
if (!("options" in $$source)) {
/**
* @member
* @type {AppSettingOption[]}
*/
this["options"] = [];
}
if (!("readOnly" in $$source)) {
/**
* @member
* @type {boolean}
*/
this["readOnly"] = false;
}
Object.assign(this, $$source);
}
/**
* Creates a new AppSettingDefinition instance from a string or object.
* @param {any} [$$source = {}]
* @returns {AppSettingDefinition}
*/
static createFrom($$source = {}) {
const $$createField7_0 = $$createType1;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("options" in $$parsedSource) {
$$parsedSource["options"] = $$createField7_0($$parsedSource["options"]);
}
return new AppSettingDefinition(/** @type {Partial<AppSettingDefinition>} */($$parsedSource));
}
}
export class AppSettingGroup {
/**
* Creates a new AppSettingGroup instance.
* @param {Partial<AppSettingGroup>} [$$source = {}] - The source object to create the AppSettingGroup.
*/
constructor($$source = {}) {
if (!("category" in $$source)) {
/**
* @member
* @type {string}
*/
this["category"] = "";
}
if (!("label" in $$source)) {
/**
* @member
* @type {string}
*/
this["label"] = "";
}
if (!("description" in $$source)) {
/**
* @member
* @type {string}
*/
this["description"] = "";
}
if (!("items" in $$source)) {
/**
* @member
* @type {AppSettingDefinition[]}
*/
this["items"] = [];
}
Object.assign(this, $$source);
}
/**
* Creates a new AppSettingGroup instance from a string or object.
* @param {any} [$$source = {}]
* @returns {AppSettingGroup}
*/
static createFrom($$source = {}) {
const $$createField3_0 = $$createType3;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("items" in $$parsedSource) {
$$parsedSource["items"] = $$createField3_0($$parsedSource["items"]);
}
return new AppSettingGroup(/** @type {Partial<AppSettingGroup>} */($$parsedSource));
}
}
export class AppSettingOption {
/**
* Creates a new AppSettingOption instance.
* @param {Partial<AppSettingOption>} [$$source = {}] - The source object to create the AppSettingOption.
*/
constructor($$source = {}) {
if (!("value" in $$source)) {
/**
* @member
* @type {string}
*/
this["value"] = "";
}
if (!("label" in $$source)) {
/**
* @member
* @type {string}
*/
this["label"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new AppSettingOption instance from a string or object.
* @param {any} [$$source = {}]
* @returns {AppSettingOption}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new AppSettingOption(/** @type {Partial<AppSettingOption>} */($$parsedSource));
}
}
export class AuditLog {
/**
* Creates a new AuditLog instance.
* @param {Partial<AuditLog>} [$$source = {}] - The source object to create the AuditLog.
*/
constructor($$source = {}) {
if (!("id" in $$source)) {
/**
* @member
* @type {number}
*/
this["id"] = 0;
}
if (!("actor" in $$source)) {
/**
* @member
* @type {string}
*/
this["actor"] = "";
}
if (!("action" in $$source)) {
/**
* @member
* @type {string}
*/
this["action"] = "";
}
if (!("targetType" in $$source)) {
/**
* @member
* @type {string}
*/
this["targetType"] = "";
}
if (!("targetId" in $$source)) {
/**
* @member
* @type {string}
*/
this["targetId"] = "";
}
if (!("detail" in $$source)) {
/**
* @member
* @type {string}
*/
this["detail"] = "";
}
if (!("createdAt" in $$source)) {
/**
* @member
* @type {string}
*/
this["createdAt"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new AuditLog instance from a string or object.
* @param {any} [$$source = {}]
* @returns {AuditLog}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new AuditLog(/** @type {Partial<AuditLog>} */($$parsedSource));
}
}
export class AuditLogFilter {
/**
* Creates a new AuditLogFilter instance.
* @param {Partial<AuditLogFilter>} [$$source = {}] - The source object to create the AuditLogFilter.
*/
constructor($$source = {}) {
if (!("actor" in $$source)) {
/**
* @member
* @type {string}
*/
this["actor"] = "";
}
if (!("action" in $$source)) {
/**
* @member
* @type {string}
*/
this["action"] = "";
}
if (!("targetType" in $$source)) {
/**
* @member
* @type {string}
*/
this["targetType"] = "";
}
if (!("limit" in $$source)) {
/**
* @member
* @type {number}
*/
this["limit"] = 0;
}
if (!("offset" in $$source)) {
/**
* @member
* @type {number}
*/
this["offset"] = 0;
}
Object.assign(this, $$source);
}
/**
* Creates a new AuditLogFilter instance from a string or object.
* @param {any} [$$source = {}]
* @returns {AuditLogFilter}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new AuditLogFilter(/** @type {Partial<AuditLogFilter>} */($$parsedSource));
}
}
export class AuthProviderOption {
/**
* Creates a new AuthProviderOption instance.
* @param {Partial<AuthProviderOption>} [$$source = {}] - The source object to create the AuthProviderOption.
*/
constructor($$source = {}) {
if (!("value" in $$source)) {
/**
* @member
* @type {string}
*/
this["value"] = "";
}
if (!("label" in $$source)) {
/**
* @member
* @type {string}
*/
this["label"] = "";
}
if (!("description" in $$source)) {
/**
* @member
* @type {string}
*/
this["description"] = "";
}
if (!("enabled" in $$source)) {
/**
* @member
* @type {boolean}
*/
this["enabled"] = false;
}
Object.assign(this, $$source);
}
/**
* Creates a new AuthProviderOption instance from a string or object.
* @param {any} [$$source = {}]
* @returns {AuthProviderOption}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new AuthProviderOption(/** @type {Partial<AuthProviderOption>} */($$parsedSource));
}
}
export class AuthSession {
/**
* Creates a new AuthSession instance.
* @param {Partial<AuthSession>} [$$source = {}] - The source object to create the AuthSession.
*/
constructor($$source = {}) {
if (!("id" in $$source)) {
/**
* @member
* @type {number}
*/
this["id"] = 0;
}
if (!("userId" in $$source)) {
/**
* @member
* @type {string}
*/
this["userId"] = "";
}
if (!("username" in $$source)) {
/**
* @member
* @type {string}
*/
this["username"] = "";
}
if (!("provider" in $$source)) {
/**
* @member
* @type {string}
*/
this["provider"] = "";
}
if (!("token" in $$source)) {
/**
* @member
* @type {string}
*/
this["token"] = "";
}
if (!("createdAt" in $$source)) {
/**
* @member
* @type {string}
*/
this["createdAt"] = "";
}
if (!("expiresAt" in $$source)) {
/**
* @member
* @type {string}
*/
this["expiresAt"] = "";
}
if (!("active" in $$source)) {
/**
* @member
* @type {boolean}
*/
this["active"] = false;
}
Object.assign(this, $$source);
}
/**
* Creates a new AuthSession instance from a string or object.
* @param {any} [$$source = {}]
* @returns {AuthSession}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new AuthSession(/** @type {Partial<AuthSession>} */($$parsedSource));
}
}
export class DailyMetric {
/**
* Creates a new DailyMetric instance.
* @param {Partial<DailyMetric>} [$$source = {}] - The source object to create the DailyMetric.
*/
constructor($$source = {}) {
if (!("date" in $$source)) {
/**
* @member
* @type {string}
*/
this["date"] = "";
}
if (!("processedImages" in $$source)) {
/**
* @member
* @type {number}
*/
this["processedImages"] = 0;
}
if (!("succeededTasks" in $$source)) {
/**
* @member
* @type {number}
*/
this["succeededTasks"] = 0;
}
if (!("failedTasks" in $$source)) {
/**
* @member
* @type {number}
*/
this["failedTasks"] = 0;
}
if (!("averageDurationMs" in $$source)) {
/**
* @member
* @type {number}
*/
this["averageDurationMs"] = 0;
}
if (!("auditLogs" in $$source)) {
/**
* @member
* @type {number}
*/
this["auditLogs"] = 0;
}
Object.assign(this, $$source);
}
/**
* Creates a new DailyMetric instance from a string or object.
* @param {any} [$$source = {}]
* @returns {DailyMetric}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new DailyMetric(/** @type {Partial<DailyMetric>} */($$parsedSource));
}
}
export class DashboardMetrics {
/**
* Creates a new DashboardMetrics instance.
* @param {Partial<DashboardMetrics>} [$$source = {}] - The source object to create the DashboardMetrics.
*/
constructor($$source = {}) {
if (!("todayProcessedImages" in $$source)) {
/**
* @member
* @type {number}
*/
this["todayProcessedImages"] = 0;
}
if (!("successRate" in $$source)) {
/**
* @member
* @type {number}
*/
this["successRate"] = 0;
}
if (!("averageDurationMs" in $$source)) {
/**
* @member
* @type {number}
*/
this["averageDurationMs"] = 0;
}
if (!("failedTasks" in $$source)) {
/**
* @member
* @type {number}
*/
this["failedTasks"] = 0;
}
if (!("todayAuditLogs" in $$source)) {
/**
* @member
* @type {number}
*/
this["todayAuditLogs"] = 0;
}
Object.assign(this, $$source);
}
/**
* Creates a new DashboardMetrics instance from a string or object.
* @param {any} [$$source = {}]
* @returns {DashboardMetrics}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new DashboardMetrics(/** @type {Partial<DashboardMetrics>} */($$parsedSource));
}
}
export class Hotkey {
/**
* Creates a new Hotkey instance.
* @param {Partial<Hotkey>} [$$source = {}] - The source object to create the Hotkey.
*/
constructor($$source = {}) {
if (!("id" in $$source)) {
/**
* 热键ID
* @member
* @type {number}
*/
this["id"] = 0;
}
if (!("keycode" in $$source)) {
/**
* 键码
* @member
* @type {number}
*/
this["keycode"] = 0;
}
if (!("modifiers" in $$source)) {
/**
* 修饰键
* @member
* @type {number}
*/
this["modifiers"] = 0;
}
Object.assign(this, $$source);
}
/**
* Creates a new Hotkey instance from a string or object.
* @param {any} [$$source = {}]
* @returns {Hotkey}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new Hotkey(/** @type {Partial<Hotkey>} */($$parsedSource));
}
}
export class ImageTask {
/**
* Creates a new ImageTask instance.
* @param {Partial<ImageTask>} [$$source = {}] - The source object to create the ImageTask.
*/
constructor($$source = {}) {
if (!("id" in $$source)) {
/**
* @member
* @type {number}
*/
this["id"] = 0;
}
if (!("sourcePath" in $$source)) {
/**
* @member
* @type {string}
*/
this["sourcePath"] = "";
}
if (!("status" in $$source)) {
/**
* @member
* @type {string}
*/
this["status"] = "";
}
if (!("operation" in $$source)) {
/**
* @member
* @type {string}
*/
this["operation"] = "";
}
if (!("durationMs" in $$source)) {
/**
* @member
* @type {number}
*/
this["durationMs"] = 0;
}
if (!("errorMessage" in $$source)) {
/**
* @member
* @type {string}
*/
this["errorMessage"] = "";
}
if (!("createdAt" in $$source)) {
/**
* @member
* @type {string}
*/
this["createdAt"] = "";
}
if (!("updatedAt" in $$source)) {
/**
* @member
* @type {string}
*/
this["updatedAt"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new ImageTask instance from a string or object.
* @param {any} [$$source = {}]
* @returns {ImageTask}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new ImageTask(/** @type {Partial<ImageTask>} */($$parsedSource));
}
}
export class ImageTaskDetail {
/**
* Creates a new ImageTaskDetail instance.
* @param {Partial<ImageTaskDetail>} [$$source = {}] - The source object to create the ImageTaskDetail.
*/
constructor($$source = {}) {
if (!("task" in $$source)) {
/**
* @member
* @type {ImageTask}
*/
this["task"] = (new ImageTask());
}
if (!("result" in $$source)) {
/**
* @member
* @type {ImageTaskResult}
*/
this["result"] = (new ImageTaskResult());
}
Object.assign(this, $$source);
}
/**
* Creates a new ImageTaskDetail instance from a string or object.
* @param {any} [$$source = {}]
* @returns {ImageTaskDetail}
*/
static createFrom($$source = {}) {
const $$createField0_0 = $$createType4;
const $$createField1_0 = $$createType5;
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
if ("task" in $$parsedSource) {
$$parsedSource["task"] = $$createField0_0($$parsedSource["task"]);
}
if ("result" in $$parsedSource) {
$$parsedSource["result"] = $$createField1_0($$parsedSource["result"]);
}
return new ImageTaskDetail(/** @type {Partial<ImageTaskDetail>} */($$parsedSource));
}
}
export class ImageTaskFilter {
/**
* Creates a new ImageTaskFilter instance.
* @param {Partial<ImageTaskFilter>} [$$source = {}] - The source object to create the ImageTaskFilter.
*/
constructor($$source = {}) {
if (!("status" in $$source)) {
/**
* @member
* @type {string}
*/
this["status"] = "";
}
if (!("operation" in $$source)) {
/**
* @member
* @type {string}
*/
this["operation"] = "";
}
if (!("limit" in $$source)) {
/**
* @member
* @type {number}
*/
this["limit"] = 0;
}
if (!("offset" in $$source)) {
/**
* @member
* @type {number}
*/
this["offset"] = 0;
}
Object.assign(this, $$source);
}
/**
* Creates a new ImageTaskFilter instance from a string or object.
* @param {any} [$$source = {}]
* @returns {ImageTaskFilter}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new ImageTaskFilter(/** @type {Partial<ImageTaskFilter>} */($$parsedSource));
}
}
export class ImageTaskInput {
/**
* Creates a new ImageTaskInput instance.
* @param {Partial<ImageTaskInput>} [$$source = {}] - The source object to create the ImageTaskInput.
*/
constructor($$source = {}) {
if (!("sourcePath" in $$source)) {
/**
* @member
* @type {string}
*/
this["sourcePath"] = "";
}
if (!("operation" in $$source)) {
/**
* @member
* @type {string}
*/
this["operation"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new ImageTaskInput instance from a string or object.
* @param {any} [$$source = {}]
* @returns {ImageTaskInput}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new ImageTaskInput(/** @type {Partial<ImageTaskInput>} */($$parsedSource));
}
}
export class ImageTaskResult {
/**
* Creates a new ImageTaskResult instance.
* @param {Partial<ImageTaskResult>} [$$source = {}] - The source object to create the ImageTaskResult.
*/
constructor($$source = {}) {
if (!("id" in $$source)) {
/**
* @member
* @type {number}
*/
this["id"] = 0;
}
if (!("taskId" in $$source)) {
/**
* @member
* @type {number}
*/
this["taskId"] = 0;
}
if (!("outputPath" in $$source)) {
/**
* @member
* @type {string}
*/
this["outputPath"] = "";
}
if (!("beforeSize" in $$source)) {
/**
* @member
* @type {number}
*/
this["beforeSize"] = 0;
}
if (!("afterSize" in $$source)) {
/**
* @member
* @type {number}
*/
this["afterSize"] = 0;
}
if (!("createdAt" in $$source)) {
/**
* @member
* @type {string}
*/
this["createdAt"] = "";
}
Object.assign(this, $$source);
}
/**
* Creates a new ImageTaskResult instance from a string or object.
* @param {any} [$$source = {}]
* @returns {ImageTaskResult}
*/
static createFrom($$source = {}) {
let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
return new ImageTaskResult(/** @type {Partial<ImageTaskResult>} */($$parsedSource));
}
}
// Private type creation functions
const $$createType0 = AppSettingOption.createFrom;
const $$createType1 = $Create.Array($$createType0);
const $$createType2 = AppSettingDefinition.createFrom;
const $$createType3 = $Create.Array($$createType2);
const $$createType4 = ImageTask.createFrom;
const $$createType5 = ImageTaskResult.createFrom;