summaryrefslogtreecommitdiff
path: root/cmd/client/frontend/wailsjs/go/models.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/client/frontend/wailsjs/go/models.ts')
-rwxr-xr-xcmd/client/frontend/wailsjs/go/models.ts319
1 files changed, 319 insertions, 0 deletions
diff --git a/cmd/client/frontend/wailsjs/go/models.ts b/cmd/client/frontend/wailsjs/go/models.ts
new file mode 100755
index 0000000..0f8dc72
--- /dev/null
+++ b/cmd/client/frontend/wailsjs/go/models.ts
@@ -0,0 +1,319 @@
+export namespace models {
+
+ export class CatalogAuth {
+ uuid?: string;
+ method?: string;
+ password?: string;
+
+ static createFrom(source: any = {}) {
+ return new CatalogAuth(source);
+ }
+
+ constructor(source: any = {}) {
+ if ('string' === typeof source) source = JSON.parse(source);
+ this.uuid = source["uuid"];
+ this.method = source["method"];
+ this.password = source["password"];
+ }
+ }
+ export class Reality {
+ enabled?: boolean;
+ public_key?: string;
+ private_key?: string;
+ short_id?: string;
+ fingerprint?: string;
+
+ static createFrom(source: any = {}) {
+ return new Reality(source);
+ }
+
+ constructor(source: any = {}) {
+ if ('string' === typeof source) source = JSON.parse(source);
+ this.enabled = source["enabled"];
+ this.public_key = source["public_key"];
+ this.private_key = source["private_key"];
+ this.short_id = source["short_id"];
+ this.fingerprint = source["fingerprint"];
+ }
+ }
+ export class TLS {
+ enabled: boolean;
+ server_name?: string;
+ insecure?: boolean;
+ alpn?: string[];
+ min_version?: string;
+ max_version?: string;
+ reality?: Reality;
+
+ static createFrom(source: any = {}) {
+ return new TLS(source);
+ }
+
+ constructor(source: any = {}) {
+ if ('string' === typeof source) source = JSON.parse(source);
+ this.enabled = source["enabled"];
+ this.server_name = source["server_name"];
+ this.insecure = source["insecure"];
+ this.alpn = source["alpn"];
+ this.min_version = source["min_version"];
+ this.max_version = source["max_version"];
+ this.reality = this.convertValues(source["reality"], Reality);
+ }
+
+ convertValues(a: any, classs: any, asMap: boolean = false): any {
+ if (!a) {
+ return a;
+ }
+ if (a.slice && a.map) {
+ return (a as any[]).map(elem => this.convertValues(elem, classs));
+ } else if ("object" === typeof a) {
+ if (asMap) {
+ for (const key of Object.keys(a)) {
+ a[key] = new classs(a[key]);
+ }
+ return a;
+ }
+ return new classs(a);
+ }
+ return a;
+ }
+ }
+ export class CatalogProtocol {
+ type: string;
+ enabled: boolean;
+ port: number;
+ tls?: TLS;
+ auth?: CatalogAuth;
+ extra?: Record<string, any>;
+
+ static createFrom(source: any = {}) {
+ return new CatalogProtocol(source);
+ }
+
+ constructor(source: any = {}) {
+ if ('string' === typeof source) source = JSON.parse(source);
+ this.type = source["type"];
+ this.enabled = source["enabled"];
+ this.port = source["port"];
+ this.tls = this.convertValues(source["tls"], TLS);
+ this.auth = this.convertValues(source["auth"], CatalogAuth);
+ this.extra = source["extra"];
+ }
+
+ convertValues(a: any, classs: any, asMap: boolean = false): any {
+ if (!a) {
+ return a;
+ }
+ if (a.slice && a.map) {
+ return (a as any[]).map(elem => this.convertValues(elem, classs));
+ } else if ("object" === typeof a) {
+ if (asMap) {
+ for (const key of Object.keys(a)) {
+ a[key] = new classs(a[key]);
+ }
+ return a;
+ }
+ return new classs(a);
+ }
+ return a;
+ }
+ }
+ export class CatalogNode {
+ id: string;
+ name: string;
+ provider?: string;
+ region: string;
+ host: string;
+ domain?: string;
+ public_host: string;
+ protocols: CatalogProtocol[];
+ status?: string;
+ tags?: string[];
+ metadata?: Record<string, any>;
+
+ static createFrom(source: any = {}) {
+ return new CatalogNode(source);
+ }
+
+ constructor(source: any = {}) {
+ if ('string' === typeof source) source = JSON.parse(source);
+ this.id = source["id"];
+ this.name = source["name"];
+ this.provider = source["provider"];
+ this.region = source["region"];
+ this.host = source["host"];
+ this.domain = source["domain"];
+ this.public_host = source["public_host"];
+ this.protocols = this.convertValues(source["protocols"], CatalogProtocol);
+ this.status = source["status"];
+ this.tags = source["tags"];
+ this.metadata = source["metadata"];
+ }
+
+ convertValues(a: any, classs: any, asMap: boolean = false): any {
+ if (!a) {
+ return a;
+ }
+ if (a.slice && a.map) {
+ return (a as any[]).map(elem => this.convertValues(elem, classs));
+ } else if ("object" === typeof a) {
+ if (asMap) {
+ for (const key of Object.keys(a)) {
+ a[key] = new classs(a[key]);
+ }
+ return a;
+ }
+ return new classs(a);
+ }
+ return a;
+ }
+ }
+
+ export class CatalogV2 {
+ version: string;
+ nodes: CatalogNode[];
+
+ static createFrom(source: any = {}) {
+ return new CatalogV2(source);
+ }
+
+ constructor(source: any = {}) {
+ if ('string' === typeof source) source = JSON.parse(source);
+ this.version = source["version"];
+ this.nodes = this.convertValues(source["nodes"], CatalogNode);
+ }
+
+ convertValues(a: any, classs: any, asMap: boolean = false): any {
+ if (!a) {
+ return a;
+ }
+ if (a.slice && a.map) {
+ return (a as any[]).map(elem => this.convertValues(elem, classs));
+ } else if ("object" === typeof a) {
+ if (asMap) {
+ for (const key of Object.keys(a)) {
+ a[key] = new classs(a[key]);
+ }
+ return a;
+ }
+ return new classs(a);
+ }
+ return a;
+ }
+ }
+
+ export class Transport {
+ type?: string;
+ path?: string;
+
+ static createFrom(source: any = {}) {
+ return new Transport(source);
+ }
+
+ constructor(source: any = {}) {
+ if ('string' === typeof source) source = JSON.parse(source);
+ this.type = source["type"];
+ this.path = source["path"];
+ }
+ }
+ export class Server {
+ tag: string;
+ region: string;
+ type: string;
+ server: string;
+ server_port: number;
+ udp_over_tcp?: boolean;
+ uuid?: string;
+ method?: string;
+ password?: string;
+ obfs_password?: string;
+ up_mbps?: number;
+ down_mbps?: number;
+ tls?: TLS;
+ transport?: Transport;
+ companions?: Server[];
+
+ static createFrom(source: any = {}) {
+ return new Server(source);
+ }
+
+ constructor(source: any = {}) {
+ if ('string' === typeof source) source = JSON.parse(source);
+ this.tag = source["tag"];
+ this.region = source["region"];
+ this.type = source["type"];
+ this.server = source["server"];
+ this.server_port = source["server_port"];
+ this.udp_over_tcp = source["udp_over_tcp"];
+ this.uuid = source["uuid"];
+ this.method = source["method"];
+ this.password = source["password"];
+ this.obfs_password = source["obfs_password"];
+ this.up_mbps = source["up_mbps"];
+ this.down_mbps = source["down_mbps"];
+ this.tls = this.convertValues(source["tls"], TLS);
+ this.transport = this.convertValues(source["transport"], Transport);
+ this.companions = this.convertValues(source["companions"], Server);
+ }
+
+ convertValues(a: any, classs: any, asMap: boolean = false): any {
+ if (!a) {
+ return a;
+ }
+ if (a.slice && a.map) {
+ return (a as any[]).map(elem => this.convertValues(elem, classs));
+ } else if ("object" === typeof a) {
+ if (asMap) {
+ for (const key of Object.keys(a)) {
+ a[key] = new classs(a[key]);
+ }
+ return a;
+ }
+ return new classs(a);
+ }
+ return a;
+ }
+ }
+
+
+}
+
+export namespace sync {
+
+ export class LatencyResult {
+ tag: string;
+ region: string;
+ latency_ms: number;
+
+ static createFrom(source: any = {}) {
+ return new LatencyResult(source);
+ }
+
+ constructor(source: any = {}) {
+ if ('string' === typeof source) source = JSON.parse(source);
+ this.tag = source["tag"];
+ this.region = source["region"];
+ this.latency_ms = source["latency_ms"];
+ }
+ }
+ export class UpdateInfo {
+ available: boolean;
+ version: string;
+ changelog: string;
+ current_version: string;
+
+ static createFrom(source: any = {}) {
+ return new UpdateInfo(source);
+ }
+
+ constructor(source: any = {}) {
+ if ('string' === typeof source) source = JSON.parse(source);
+ this.available = source["available"];
+ this.version = source["version"];
+ this.changelog = source["changelog"];
+ this.current_version = source["current_version"];
+ }
+ }
+
+}
+