Pull request: beta client squashed

Merge in DNS/adguard-home from beta-client-2 to master

Squashed commit of the following:

commit b2640cc49a6c5484d730b534dcf5a8013d7fa478
Merge: 659def862 aef4659e9
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Tue Dec 29 19:23:09 2020 +0300

    Merge branch 'master' into beta-client-2

commit 659def8626467949c35b7a6a0c99ffafb07b4385
Author: Eugene Burkov <e.burkov@adguard.com>
Date:   Tue Dec 29 17:25:14 2020 +0300

    all: upgrade github actions node version

commit b4b8cf8dd75672e9155da5d111ac66e8f5ba1535
Author: Vladislav Abdulmyanov <v.abdulmyanov@adguard.com>
Date:   Tue Dec 29 16:57:14 2020 +0300

    all: beta client squashed
This commit is contained in:
Eugene Burkov
2020-12-29 19:53:56 +03:00
parent aef4659e93
commit 5e20ac7ed5
200 changed files with 20843 additions and 55 deletions

View File

@@ -0,0 +1,15 @@
.ant-radio {
margin-right: 18px;
}
.ant-radio-inner {
width: 20px;
height: 20px;
background-color: transparent;
border-color: var(--gray400);
&::after {
width: 12px;
height: 12px;
}
}

View File

@@ -0,0 +1,65 @@
.ant-steps {
display: flex;
margin-left: -67px;
.ant-steps-item-process {
.ant-steps-item-icon {
top: -4px;
box-sizing: content-box;
width: 16px;
height: 16px;
.ant-steps-icon {
background: var(--green400);
.ant-steps-icon-dot {
background: var(--green400);
border: 0;
}
}
}
}
.ant-steps-item-content {
width: 99px;
}
.ant-steps-item-finish > .ant-steps-item-container > .ant-steps-item-tail,
.ant-steps-item-wait > .ant-steps-item-container > .ant-steps-item-tail,
.ant-steps-item-process > .ant-steps-item-container > .ant-steps-item-tail {
top: 2px;
width: 100%;
margin: 0px 0px 0px 70px;
padding: 0;
&::after {
width: calc(100% - 8px);
height: 2px;
margin-left: 5px;
}
}
.ant-steps-item-wait > .ant-steps-item-container > .ant-steps-item-tail::after,
.ant-steps-item-process > .ant-steps-item-container > .ant-steps-item-tail::after {
background-color: var(--gray400);
}
.ant-steps-item-finish > .ant-steps-item-container > .ant-steps-item-tail::after {
background-color: var(--green400);
}
.ant-steps-item-finish {
.ant-steps-item-icon {
.ant-steps-icon {
background: var(--green400);
.ant-steps-icon-dot {
background: var(--green400);
border: 0;
}
}
}
}
.ant-steps-item-icon {
width: 8px;
height: 8px;
.ant-steps-icon {
background: transparent;
.ant-steps-icon-dot {
background: transparent;
border: 2px solid var(--gray400);
}
}
}
}

View File

@@ -0,0 +1,8 @@
@primary-color: #67b279;
@success-color: #53d4b1;
@text-color: #000;
@link-hover-color: #1332BB;
@link-active-color: #246FFF;
@font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
@font-size-base: 14px;

View File

@@ -0,0 +1,2 @@
@import '~antd/dist/antd.less';
@import './ant-overrides.less';

View File

@@ -0,0 +1,5 @@
import './Step.pcss';
import './Radio.pcss';
const insertStyles = true;
export default insertStyles;

View File

@@ -0,0 +1,31 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class BlockedServicesApi {
static async blockedServicesList(): Promise<string[] | Error> {
return await fetch(`/control/blocked_services/list`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async blockedServicesSet(data: string[]): Promise<number | Error> {
return await fetch(`/control/blocked_services/set`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1,103 @@
import qs from 'qs';
import Client, { IClient } from 'Entities/Client';
import ClientDelete, { IClientDelete } from 'Entities/ClientDelete';
import ClientUpdate, { IClientUpdate } from 'Entities/ClientUpdate';
import Clients, { IClients } from 'Entities/Clients';
import ClientsFindEntry, { IClientsFindEntry } from 'Entities/ClientsFindEntry';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class ClientsApi {
static async clientsAdd(client: IClient): Promise<number | string[] | Error> {
const haveError: string[] = [];
const clientValid = new Client(client);
haveError.push(...clientValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/clients/add`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(clientValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async clientsDelete(clientdelete: IClientDelete): Promise<number | string[] | Error> {
const haveError: string[] = [];
const clientdeleteValid = new ClientDelete(clientdelete);
haveError.push(...clientdeleteValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/clients/delete`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(clientdeleteValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async clientsFind(ip0?: string): Promise<IClientsFindEntry[] | Error> {
const queryParams = {
ip0: ip0,
}
return await fetch(`/control/clients/find?${qs.stringify(queryParams, { arrayFormat: 'comma' })}`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async clientsStatus(): Promise<IClients | Error> {
return await fetch(`/control/clients`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async clientsUpdate(clientupdate: IClientUpdate): Promise<number | string[] | Error> {
const haveError: string[] = [];
const clientupdateValid = new ClientUpdate(clientupdate);
haveError.push(...clientupdateValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/clients/update`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(clientupdateValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1,110 @@
import DhcpConfig, { IDhcpConfig } from 'Entities/DhcpConfig';
import DhcpSearchResult, { IDhcpSearchResult } from 'Entities/DhcpSearchResult';
import DhcpStaticLease, { IDhcpStaticLease } from 'Entities/DhcpStaticLease';
import DhcpStatus, { IDhcpStatus } from 'Entities/DhcpStatus';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class DhcpApi {
static async checkActiveDhcp(): Promise<IDhcpSearchResult | Error> {
return await fetch(`/control/dhcp/find_active_dhcp`, {
method: 'POST',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async dhcpAddStaticLease(dhcpstaticlease: IDhcpStaticLease): Promise<number | string[] | Error> {
const haveError: string[] = [];
const dhcpstaticleaseValid = new DhcpStaticLease(dhcpstaticlease);
haveError.push(...dhcpstaticleaseValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/dhcp/add_static_lease`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(dhcpstaticleaseValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async dhcpRemoveStaticLease(dhcpstaticlease: IDhcpStaticLease): Promise<number | string[] | Error> {
const haveError: string[] = [];
const dhcpstaticleaseValid = new DhcpStaticLease(dhcpstaticlease);
haveError.push(...dhcpstaticleaseValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/dhcp/remove_static_lease`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(dhcpstaticleaseValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async dhcpReset(): Promise<number | Error> {
return await fetch(`/control/dhcp/reset`, {
method: 'POST',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async dhcpSetConfig(dhcpconfig: IDhcpConfig): Promise<number | string[] | Error> {
const haveError: string[] = [];
const dhcpconfigValid = new DhcpConfig(dhcpconfig);
haveError.push(...dhcpconfigValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/dhcp/set_config`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(dhcpconfigValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async dhcpStatus(): Promise<IDhcpStatus | Error> {
return await fetch(`/control/dhcp/status`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1,167 @@
import qs from 'qs';
import AddUrlRequest, { IAddUrlRequest } from 'Entities/AddUrlRequest';
import FilterCheckHostResponse, { IFilterCheckHostResponse } from 'Entities/FilterCheckHostResponse';
import FilterConfig, { IFilterConfig } from 'Entities/FilterConfig';
import FilterRefreshRequest, { IFilterRefreshRequest } from 'Entities/FilterRefreshRequest';
import FilterRefreshResponse, { IFilterRefreshResponse } from 'Entities/FilterRefreshResponse';
import FilterSetUrl, { IFilterSetUrl } from 'Entities/FilterSetUrl';
import FilterStatus, { IFilterStatus } from 'Entities/FilterStatus';
import RemoveUrlRequest, { IRemoveUrlRequest } from 'Entities/RemoveUrlRequest';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class FilteringApi {
static async filteringAddURL(addurlrequest: IAddUrlRequest): Promise<number | string[] | Error> {
const haveError: string[] = [];
const addurlrequestValid = new AddUrlRequest(addurlrequest);
haveError.push(...addurlrequestValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/filtering/add_url`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(addurlrequestValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async filteringCheckHost(name?: string): Promise<IFilterCheckHostResponse | Error> {
const queryParams = {
name: name,
}
return await fetch(`/control/filtering/check_host?${qs.stringify(queryParams, { arrayFormat: 'comma' })}`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async filteringConfig(filterconfig: IFilterConfig): Promise<number | string[] | Error> {
const haveError: string[] = [];
const filterconfigValid = new FilterConfig(filterconfig);
haveError.push(...filterconfigValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/filtering/config`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(filterconfigValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async filteringRefresh(filterrefreshrequest: IFilterRefreshRequest): Promise<IFilterRefreshResponse | string[] | Error> {
const haveError: string[] = [];
const filterrefreshrequestValid = new FilterRefreshRequest(filterrefreshrequest);
haveError.push(...filterrefreshrequestValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/filtering/refresh`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(filterrefreshrequestValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async filteringRemoveURL(removeurlrequest: IRemoveUrlRequest): Promise<number | string[] | Error> {
const haveError: string[] = [];
const removeurlrequestValid = new RemoveUrlRequest(removeurlrequest);
haveError.push(...removeurlrequestValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/filtering/remove_url`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(removeurlrequestValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async filteringSetRules(data: string): Promise<number | Error> {
const params = String(data);
return await fetch(`/control/filtering/set_rules`, {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
body: params,
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async filteringSetURL(filterseturl: IFilterSetUrl): Promise<number | string[] | Error> {
const haveError: string[] = [];
const filterseturlValid = new FilterSetUrl(filterseturl);
haveError.push(...filterseturlValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/filtering/set_url`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(filterseturlValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async filteringStatus(): Promise<IFilterStatus | Error> {
return await fetch(`/control/filtering/status`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1,160 @@
import DNSConfig, { IDNSConfig } from 'Entities/DNSConfig';
import GetVersionRequest, { IGetVersionRequest } from 'Entities/GetVersionRequest';
import Login, { ILogin } from 'Entities/Login';
import ProfileInfo, { IProfileInfo } from 'Entities/ProfileInfo';
import ServerStatus, { IServerStatus } from 'Entities/ServerStatus';
import UpstreamsConfig, { IUpstreamsConfig } from 'Entities/UpstreamsConfig';
import UpstreamsConfigResponse, { IUpstreamsConfigResponse } from 'Entities/UpstreamsConfigResponse';
import VersionInfo, { IVersionInfo } from 'Entities/VersionInfo';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class GlobalApi {
static async beginUpdate(): Promise<number | Error> {
return await fetch(`/control/update`, {
method: 'POST',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async dnsConfig(dnsconfig: IDNSConfig): Promise<number | string[] | Error> {
const haveError: string[] = [];
const dnsconfigValid = new DNSConfig(dnsconfig);
haveError.push(...dnsconfigValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/dns_config`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(dnsconfigValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async dnsInfo(): Promise<IDNSConfig | Error> {
return await fetch(`/control/dns_info`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async getProfile(): Promise<IProfileInfo | Error> {
return await fetch(`/control/profile`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async getVersionJson(getversionrequest: IGetVersionRequest): Promise<IVersionInfo | string[] | Error> {
const haveError: string[] = [];
const getversionrequestValid = new GetVersionRequest(getversionrequest);
haveError.push(...getversionrequestValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/version.json`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(getversionrequestValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async login(login: ILogin): Promise<number | string[] | Error> {
const haveError: string[] = [];
const loginValid = new Login(login);
haveError.push(...loginValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/login`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(loginValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async logout(): Promise<number | Error> {
return await fetch(`/control/logout`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async status(): Promise<IServerStatus | Error> {
return await fetch(`/control/status`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async testUpstreamDNS(upstreamsconfig: IUpstreamsConfig): Promise<IUpstreamsConfigResponse | string[] | Error> {
const haveError: string[] = [];
const upstreamsconfigValid = new UpstreamsConfig(upstreamsconfig);
haveError.push(...upstreamsconfigValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/test_upstream_dns`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(upstreamsconfigValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1,32 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class I18nApi {
static async changeLanguage(data: string): Promise<number | Error> {
const params = String(data);
return await fetch(`/control/i18n/change_language`, {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
body: params,
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async currentLanguage(): Promise<number | Error> {
return await fetch(`/control/i18n/current_language`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1,123 @@
import AddressesInfo, { IAddressesInfo } from 'Entities/AddressesInfo';
import AddressesInfoBeta, { IAddressesInfoBeta } from 'Entities/AddressesInfoBeta';
import CheckConfigRequest, { ICheckConfigRequest } from 'Entities/CheckConfigRequest';
import CheckConfigRequestBeta, { ICheckConfigRequestBeta } from 'Entities/CheckConfigRequestBeta';
import CheckConfigResponse, { ICheckConfigResponse } from 'Entities/CheckConfigResponse';
import InitialConfiguration, { IInitialConfiguration } from 'Entities/InitialConfiguration';
import InitialConfigurationBeta, { IInitialConfigurationBeta } from 'Entities/InitialConfigurationBeta';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class InstallApi {
static async installCheckConfig(checkconfigrequest: ICheckConfigRequest): Promise<ICheckConfigResponse | string[] | Error> {
const haveError: string[] = [];
const checkconfigrequestValid = new CheckConfigRequest(checkconfigrequest);
haveError.push(...checkconfigrequestValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/install/check_config`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(checkconfigrequestValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async installCheckConfigBeta(checkconfigrequestbeta: ICheckConfigRequestBeta): Promise<ICheckConfigResponse | string[] | Error> {
const haveError: string[] = [];
const checkconfigrequestbetaValid = new CheckConfigRequestBeta(checkconfigrequestbeta);
haveError.push(...checkconfigrequestbetaValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/install/check_config_beta`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(checkconfigrequestbetaValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async installConfigure(initialconfiguration: IInitialConfiguration): Promise<number | string[] | Error> {
const haveError: string[] = [];
const initialconfigurationValid = new InitialConfiguration(initialconfiguration);
haveError.push(...initialconfigurationValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/install/configure`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(initialconfigurationValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async installConfigureBeta(initialconfigurationbeta: IInitialConfigurationBeta): Promise<number | string[] | Error> {
const haveError: string[] = [];
const initialconfigurationbetaValid = new InitialConfigurationBeta(initialconfigurationbeta);
haveError.push(...initialconfigurationbetaValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/install/configure_beta`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(initialconfigurationbetaValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async installGetAddresses(): Promise<IAddressesInfo | Error> {
return await fetch(`/control/install/get_addresses`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async installGetAddressesBeta(): Promise<IAddressesInfoBeta | Error> {
return await fetch(`/control/install/get_addresses_beta`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1,72 @@
import qs from 'qs';
import QueryLog, { IQueryLog } from 'Entities/QueryLog';
import QueryLogConfig, { IQueryLogConfig } from 'Entities/QueryLogConfig';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class LogApi {
static async queryLog(older_than?: string, offset?: number, limit?: number, search?: string, response_status?: string): Promise<IQueryLog | Error> {
const queryParams = {
older_than: older_than,
offset: offset,
limit: limit,
search: search,
response_status: response_status,
}
return await fetch(`/control/querylog?${qs.stringify(queryParams, { arrayFormat: 'comma' })}`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async queryLogConfig(querylogconfig: IQueryLogConfig): Promise<number | string[] | Error> {
const haveError: string[] = [];
const querylogconfigValid = new QueryLogConfig(querylogconfig);
haveError.push(...querylogconfigValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/querylog_config`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(querylogconfigValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async queryLogInfo(): Promise<IQueryLogConfig | Error> {
return await fetch(`/control/querylog_info`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async querylogClear(): Promise<number | Error> {
return await fetch(`/control/querylog_clear`, {
method: 'POST',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1,35 @@
import qs from 'qs';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class MobileconfigApi {
static async mobileConfigDoH(host?: string): Promise<number | Error> {
const queryParams = {
host: host,
}
return await fetch(`/control/apple/doh.mobileconfig?${qs.stringify(queryParams, { arrayFormat: 'comma' })}`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async mobileConfigDoT(host?: string): Promise<number | Error> {
const queryParams = {
host: host,
}
return await fetch(`/control/apple/dot.mobileconfig?${qs.stringify(queryParams, { arrayFormat: 'comma' })}`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1,44 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class ParentalApi {
static async parentalDisable(): Promise<number | Error> {
return await fetch(`/control/parental/disable`, {
method: 'POST',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async parentalEnable(data: string): Promise<number | Error> {
const params = String(data);
return await fetch(`/control/parental/enable`, {
method: 'POST',
headers: {
'Content-Type': 'text/plain',
},
body: params,
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async parentalStatus(): Promise<any | Error> {
return await fetch(`/control/parental/status`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1,61 @@
import RewriteEntry, { IRewriteEntry } from 'Entities/RewriteEntry';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class RewriteApi {
static async rewriteAdd(rewriteentry: IRewriteEntry): Promise<number | string[] | Error> {
const haveError: string[] = [];
const rewriteentryValid = new RewriteEntry(rewriteentry);
haveError.push(...rewriteentryValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/rewrite/add`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(rewriteentryValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async rewriteDelete(rewriteentry: IRewriteEntry): Promise<number | string[] | Error> {
const haveError: string[] = [];
const rewriteentryValid = new RewriteEntry(rewriteentry);
haveError.push(...rewriteentryValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/rewrite/delete`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(rewriteentryValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async rewriteList(): Promise<IRewriteEntry[] | Error> {
return await fetch(`/control/rewrite/list`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1,39 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class SafebrowsingApi {
static async safebrowsingDisable(): Promise<number | Error> {
return await fetch(`/control/safebrowsing/disable`, {
method: 'POST',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async safebrowsingEnable(): Promise<number | Error> {
return await fetch(`/control/safebrowsing/enable`, {
method: 'POST',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async safebrowsingStatus(): Promise<any | Error> {
return await fetch(`/control/safebrowsing/status`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1,39 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class SafesearchApi {
static async safesearchDisable(): Promise<number | Error> {
return await fetch(`/control/safesearch/disable`, {
method: 'POST',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async safesearchEnable(): Promise<number | Error> {
return await fetch(`/control/safesearch/enable`, {
method: 'POST',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async safesearchStatus(): Promise<any | Error> {
return await fetch(`/control/safesearch/status`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1,64 @@
import Stats, { IStats } from 'Entities/Stats';
import StatsConfig, { IStatsConfig } from 'Entities/StatsConfig';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class StatsApi {
static async stats(): Promise<IStats | Error> {
return await fetch(`/control/stats`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async statsConfig(statsconfig: IStatsConfig): Promise<number | string[] | Error> {
const haveError: string[] = [];
const statsconfigValid = new StatsConfig(statsconfig);
haveError.push(...statsconfigValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/stats_config`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(statsconfigValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
static async statsInfo(): Promise<IStatsConfig | Error> {
return await fetch(`/control/stats_info`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async statsReset(): Promise<number | Error> {
return await fetch(`/control/stats_reset`, {
method: 'POST',
}).then(async (res) => {
if (res.status === 200) {
return res.status;
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1,61 @@
import TlsConfig, { ITlsConfig } from 'Entities/TlsConfig';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export default class TlsApi {
static async tlsConfigure(tlsconfig: ITlsConfig): Promise<ITlsConfig | string[] | Error> {
const haveError: string[] = [];
const tlsconfigValid = new TlsConfig(tlsconfig);
haveError.push(...tlsconfigValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/tls/configure`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(tlsconfigValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async tlsStatus(): Promise<ITlsConfig | Error> {
return await fetch(`/control/tls/status`, {
method: 'GET',
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
static async tlsValidate(tlsconfig: ITlsConfig): Promise<ITlsConfig | string[] | Error> {
const haveError: string[] = [];
const tlsconfigValid = new TlsConfig(tlsconfig);
haveError.push(...tlsconfigValid.validate());
if (haveError.length > 0) {
return Promise.resolve(haveError);
}
return await fetch(`/control/tls/validate`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(tlsconfigValid.serialize()),
}).then(async (res) => {
if (res.status === 200) {
return res.json();
} else {
return new Error(String(res.status));
}
})
}
}

View File

@@ -0,0 +1 @@
export const DEFAULT_NOTIFICATION_DURATION = 5;

View File

@@ -0,0 +1 @@
export const EMPTY_FIELD_ERROR = 'empty_field';

View File

@@ -0,0 +1,7 @@
export const DEFAULT_IP_ADDRESS = '0.0.0.0';
export const DEFAULT_IP_PORT = 80;
export const DEFAULT_DNS_ADDRESS = '0.0.0.0';
export const DEFAULT_DNS_PORT = 53;

View File

@@ -0,0 +1,78 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IAddUrlRequest {
name?: string;
url?: string;
whitelist?: boolean;
}
export default class AddUrlRequest {
readonly _name: string | undefined;
get name(): string | undefined {
return this._name;
}
readonly _url: string | undefined;
/**
* Description: URL or an absolute path to the file containing filtering rules.
*
* Example: https://filters.adtidy.org/windows/filters/15.txt
*/
get url(): string | undefined {
return this._url;
}
readonly _whitelist: boolean | undefined;
get whitelist(): boolean | undefined {
return this._whitelist;
}
constructor(props: IAddUrlRequest) {
if (typeof props.name === 'string') {
this._name = props.name.trim();
}
if (typeof props.url === 'string') {
this._url = props.url.trim();
}
if (typeof props.whitelist === 'boolean') {
this._whitelist = props.whitelist;
}
}
serialize(): IAddUrlRequest {
const data: IAddUrlRequest = {
};
if (typeof this._name !== 'undefined') {
data.name = this._name;
}
if (typeof this._url !== 'undefined') {
data.url = this._url;
}
if (typeof this._whitelist !== 'undefined') {
data.whitelist = this._whitelist;
}
return data;
}
validate(): string[] {
const validate = {
name: !this._name ? true : typeof this._name === 'string' && !this._name ? true : this._name,
url: !this._url ? true : typeof this._url === 'string' && !this._url ? true : this._url,
whitelist: !this._whitelist ? true : typeof this._whitelist === 'boolean',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IAddUrlRequest>): AddUrlRequest {
return new AddUrlRequest({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,67 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IAddressInfo {
ip: string;
port: number;
}
export default class AddressInfo {
readonly _ip: string;
/**
* Description: undefined
* Example: 127.0.0.1
*/
get ip(): string {
return this._ip;
}
static ipValidate(ip: string): boolean {
return typeof ip === 'string' && !!ip.trim();
}
readonly _port: number;
/**
* Description: undefined
* Example: 53
*/
get port(): number {
return this._port;
}
static portValidate(port: number): boolean {
return typeof port === 'number';
}
constructor(props: IAddressInfo) {
this._ip = props.ip.trim();
this._port = props.port;
}
serialize(): IAddressInfo {
const data: IAddressInfo = {
ip: this._ip,
port: this._port,
};
return data;
}
validate(): string[] {
const validate = {
ip: typeof this._ip === 'string' && !this._ip ? true : this._ip,
port: typeof this._port === 'number',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IAddressInfo>): AddressInfo {
return new AddressInfo({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,71 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IAddressInfoBeta {
ip: string[];
port: number;
}
export default class AddressInfoBeta {
readonly _ip: string[];
/**
* Description: undefined
* Example: 127.0.0.1
*/
get ip(): string[] {
return this._ip;
}
static get ipMinItems() {
return 1;
}
static ipValidate(ip: string[]): boolean {
return ip.reduce<boolean>((result, p) => result && (typeof p === 'string' && !!p.trim()), true);
}
readonly _port: number;
/**
* Description: undefined
* Example: 53
*/
get port(): number {
return this._port;
}
static portValidate(port: number): boolean {
return typeof port === 'number';
}
constructor(props: IAddressInfoBeta) {
this._ip = props.ip;
this._port = props.port;
}
serialize(): IAddressInfoBeta {
const data: IAddressInfoBeta = {
ip: this._ip,
port: this._port,
};
return data;
}
validate(): string[] {
const validate = {
ip: this._ip.reduce((result, p) => result && typeof p === 'string', true),
port: typeof this._port === 'number',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IAddressInfoBeta>): AddressInfoBeta {
return new AddressInfoBeta({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,81 @@
import NetInterface, { INetInterface } from './NetInterface';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IAddressesInfo {
dns_port: number;
interfaces: { [key: string]: INetInterface };
web_port: number;
}
export default class AddressesInfo {
readonly _dns_port: number;
/**
* Description: undefined
* Example: 53
*/
get dnsPort(): number {
return this._dns_port;
}
static dnsPortValidate(dnsPort: number): boolean {
return typeof dnsPort === 'number';
}
readonly _interfaces: { [key: string]: NetInterface };
/** */
get interfaces(): { [key: string]: NetInterface } {
return this._interfaces;
}
readonly _web_port: number;
/**
* Description: undefined
* Example: 80
*/
get webPort(): number {
return this._web_port;
}
static webPortValidate(webPort: number): boolean {
return typeof webPort === 'number';
}
constructor(props: IAddressesInfo) {
this._dns_port = props.dns_port;
this._interfaces = Object.keys(props.interfaces).reduce((prev, key) => {
return { ...prev, [key]: new NetInterface(props.interfaces[key])};
},{})
this._web_port = props.web_port;
}
serialize(): IAddressesInfo {
const data: IAddressesInfo = {
dns_port: this._dns_port,
interfaces: Object.keys(this._interfaces).reduce<Record<string, any>>((prev, key) => ({ ...prev, [key]: this._interfaces[key].serialize() }), {}),
web_port: this._web_port,
};
return data;
}
validate(): string[] {
const validate = {
dns_port: typeof this._dns_port === 'number',
web_port: typeof this._web_port === 'number',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IAddressesInfo>): AddressesInfo {
return new AddressesInfo({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,80 @@
import NetInterface, { INetInterface } from './NetInterface';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IAddressesInfoBeta {
dns_port: number;
interfaces: INetInterface[];
web_port: number;
}
export default class AddressesInfoBeta {
readonly _dns_port: number;
/**
* Description: undefined
* Example: 53
*/
get dnsPort(): number {
return this._dns_port;
}
static dnsPortValidate(dnsPort: number): boolean {
return typeof dnsPort === 'number';
}
readonly _interfaces: NetInterface[];
/** */
get interfaces(): NetInterface[] {
return this._interfaces;
}
readonly _web_port: number;
/**
* Description: undefined
* Example: 80
*/
get webPort(): number {
return this._web_port;
}
static webPortValidate(webPort: number): boolean {
return typeof webPort === 'number';
}
constructor(props: IAddressesInfoBeta) {
this._dns_port = props.dns_port;
this._interfaces = props.interfaces.map((p) => new NetInterface(p));
this._web_port = props.web_port;
}
serialize(): IAddressesInfoBeta {
const data: IAddressesInfoBeta = {
dns_port: this._dns_port,
interfaces: this._interfaces.map((p) => p.serialize()),
web_port: this._web_port,
};
return data;
}
validate(): string[] {
const validate = {
dns_port: typeof this._dns_port === 'number',
web_port: typeof this._web_port === 'number',
interfaces: this._interfaces.reduce((result, p) => result && p.validate().length === 0, true),
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IAddressesInfoBeta>): AddressesInfoBeta {
return new AddressesInfoBeta({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,31 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IBlockedServicesArray {
}
export default class BlockedServicesArray {
constructor(props: IBlockedServicesArray) {
}
serialize(): IBlockedServicesArray {
const data: IBlockedServicesArray = {
};
return data;
}
validate(): string[] {
const validate = {
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IBlockedServicesArray>): BlockedServicesArray {
return new BlockedServicesArray({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,75 @@
import CheckConfigRequestInfo, { ICheckConfigRequestInfo } from './CheckConfigRequestInfo';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface ICheckConfigRequest {
dns?: ICheckConfigRequestInfo;
set_static_ip?: boolean;
web?: ICheckConfigRequestInfo;
}
export default class CheckConfigRequest {
readonly _dns: CheckConfigRequestInfo | undefined;
get dns(): CheckConfigRequestInfo | undefined {
return this._dns;
}
readonly _set_static_ip: boolean | undefined;
get setStaticIp(): boolean | undefined {
return this._set_static_ip;
}
readonly _web: CheckConfigRequestInfo | undefined;
get web(): CheckConfigRequestInfo | undefined {
return this._web;
}
constructor(props: ICheckConfigRequest) {
if (props.dns) {
this._dns = new CheckConfigRequestInfo(props.dns);
}
if (typeof props.set_static_ip === 'boolean') {
this._set_static_ip = props.set_static_ip;
}
if (props.web) {
this._web = new CheckConfigRequestInfo(props.web);
}
}
serialize(): ICheckConfigRequest {
const data: ICheckConfigRequest = {
};
if (typeof this._dns !== 'undefined') {
data.dns = this._dns.serialize();
}
if (typeof this._set_static_ip !== 'undefined') {
data.set_static_ip = this._set_static_ip;
}
if (typeof this._web !== 'undefined') {
data.web = this._web.serialize();
}
return data;
}
validate(): string[] {
const validate = {
dns: !this._dns ? true : this._dns.validate().length === 0,
web: !this._web ? true : this._web.validate().length === 0,
set_static_ip: !this._set_static_ip ? true : typeof this._set_static_ip === 'boolean',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<ICheckConfigRequest>): CheckConfigRequest {
return new CheckConfigRequest({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,75 @@
import CheckConfigRequestInfoBeta, { ICheckConfigRequestInfoBeta } from './CheckConfigRequestInfoBeta';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface ICheckConfigRequestBeta {
dns?: ICheckConfigRequestInfoBeta;
set_static_ip?: boolean;
web?: ICheckConfigRequestInfoBeta;
}
export default class CheckConfigRequestBeta {
readonly _dns: CheckConfigRequestInfoBeta | undefined;
get dns(): CheckConfigRequestInfoBeta | undefined {
return this._dns;
}
readonly _set_static_ip: boolean | undefined;
get setStaticIp(): boolean | undefined {
return this._set_static_ip;
}
readonly _web: CheckConfigRequestInfoBeta | undefined;
get web(): CheckConfigRequestInfoBeta | undefined {
return this._web;
}
constructor(props: ICheckConfigRequestBeta) {
if (props.dns) {
this._dns = new CheckConfigRequestInfoBeta(props.dns);
}
if (typeof props.set_static_ip === 'boolean') {
this._set_static_ip = props.set_static_ip;
}
if (props.web) {
this._web = new CheckConfigRequestInfoBeta(props.web);
}
}
serialize(): ICheckConfigRequestBeta {
const data: ICheckConfigRequestBeta = {
};
if (typeof this._dns !== 'undefined') {
data.dns = this._dns.serialize();
}
if (typeof this._set_static_ip !== 'undefined') {
data.set_static_ip = this._set_static_ip;
}
if (typeof this._web !== 'undefined') {
data.web = this._web.serialize();
}
return data;
}
validate(): string[] {
const validate = {
dns: !this._dns ? true : this._dns.validate().length === 0,
web: !this._web ? true : this._web.validate().length === 0,
set_static_ip: !this._set_static_ip ? true : typeof this._set_static_ip === 'boolean',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<ICheckConfigRequestBeta>): CheckConfigRequestBeta {
return new CheckConfigRequestBeta({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,81 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface ICheckConfigRequestInfo {
autofix?: boolean;
ip?: string;
port?: number;
}
export default class CheckConfigRequestInfo {
readonly _autofix: boolean | undefined;
get autofix(): boolean | undefined {
return this._autofix;
}
readonly _ip: string | undefined;
/**
* Description: undefined
* Example: 127.0.0.1
*/
get ip(): string | undefined {
return this._ip;
}
readonly _port: number | undefined;
/**
* Description: undefined
* Example: 53
*/
get port(): number | undefined {
return this._port;
}
constructor(props: ICheckConfigRequestInfo) {
if (typeof props.autofix === 'boolean') {
this._autofix = props.autofix;
}
if (typeof props.ip === 'string') {
this._ip = props.ip.trim();
}
if (typeof props.port === 'number') {
this._port = props.port;
}
}
serialize(): ICheckConfigRequestInfo {
const data: ICheckConfigRequestInfo = {
};
if (typeof this._autofix !== 'undefined') {
data.autofix = this._autofix;
}
if (typeof this._ip !== 'undefined') {
data.ip = this._ip;
}
if (typeof this._port !== 'undefined') {
data.port = this._port;
}
return data;
}
validate(): string[] {
const validate = {
ip: !this._ip ? true : typeof this._ip === 'string' && !this._ip ? true : this._ip,
port: !this._port ? true : typeof this._port === 'number',
autofix: !this._autofix ? true : typeof this._autofix === 'boolean',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<ICheckConfigRequestInfo>): CheckConfigRequestInfo {
return new CheckConfigRequestInfo({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,85 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface ICheckConfigRequestInfoBeta {
autofix?: boolean;
ip?: string[];
port?: number;
}
export default class CheckConfigRequestInfoBeta {
readonly _autofix: boolean | undefined;
get autofix(): boolean | undefined {
return this._autofix;
}
readonly _ip: string[] | undefined;
/**
* Description: undefined
* Example: 127.0.0.1
*/
get ip(): string[] | undefined {
return this._ip;
}
static get ipMinItems() {
return 1;
}
readonly _port: number | undefined;
/**
* Description: undefined
* Example: 53
*/
get port(): number | undefined {
return this._port;
}
constructor(props: ICheckConfigRequestInfoBeta) {
if (typeof props.autofix === 'boolean') {
this._autofix = props.autofix;
}
if (props.ip) {
this._ip = props.ip;
}
if (typeof props.port === 'number') {
this._port = props.port;
}
}
serialize(): ICheckConfigRequestInfoBeta {
const data: ICheckConfigRequestInfoBeta = {
};
if (typeof this._autofix !== 'undefined') {
data.autofix = this._autofix;
}
if (typeof this._ip !== 'undefined') {
data.ip = this._ip;
}
if (typeof this._port !== 'undefined') {
data.port = this._port;
}
return data;
}
validate(): string[] {
const validate = {
ip: !this._ip ? true : this._ip.reduce((result, p) => result && typeof p === 'string', true),
port: !this._port ? true : typeof this._port === 'number',
autofix: !this._autofix ? true : typeof this._autofix === 'boolean',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<ICheckConfigRequestInfoBeta>): CheckConfigRequestInfoBeta {
return new CheckConfigRequestInfoBeta({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,64 @@
import CheckConfigResponseInfo, { ICheckConfigResponseInfo } from './CheckConfigResponseInfo';
import CheckConfigStaticIpInfo, { ICheckConfigStaticIpInfo } from './CheckConfigStaticIpInfo';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface ICheckConfigResponse {
dns: ICheckConfigResponseInfo;
static_ip: ICheckConfigStaticIpInfo;
web: ICheckConfigResponseInfo;
}
export default class CheckConfigResponse {
readonly _dns: CheckConfigResponseInfo;
get dns(): CheckConfigResponseInfo {
return this._dns;
}
readonly _static_ip: CheckConfigStaticIpInfo;
get staticIp(): CheckConfigStaticIpInfo {
return this._static_ip;
}
readonly _web: CheckConfigResponseInfo;
get web(): CheckConfigResponseInfo {
return this._web;
}
constructor(props: ICheckConfigResponse) {
this._dns = new CheckConfigResponseInfo(props.dns);
this._static_ip = new CheckConfigStaticIpInfo(props.static_ip);
this._web = new CheckConfigResponseInfo(props.web);
}
serialize(): ICheckConfigResponse {
const data: ICheckConfigResponse = {
dns: this._dns.serialize(),
static_ip: this._static_ip.serialize(),
web: this._web.serialize(),
};
return data;
}
validate(): string[] {
const validate = {
dns: this._dns.validate().length === 0,
web: this._web.validate().length === 0,
static_ip: this._static_ip.validate().length === 0,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<ICheckConfigResponse>): CheckConfigResponse {
return new CheckConfigResponse({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,59 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface ICheckConfigResponseInfo {
can_autofix: boolean;
status: string;
}
export default class CheckConfigResponseInfo {
readonly _can_autofix: boolean;
get canAutofix(): boolean {
return this._can_autofix;
}
static canAutofixValidate(canAutofix: boolean): boolean {
return typeof canAutofix === 'boolean';
}
readonly _status: string;
get status(): string {
return this._status;
}
static statusValidate(status: string): boolean {
return typeof status === 'string' && !!status.trim();
}
constructor(props: ICheckConfigResponseInfo) {
this._can_autofix = props.can_autofix;
this._status = props.status.trim();
}
serialize(): ICheckConfigResponseInfo {
const data: ICheckConfigResponseInfo = {
can_autofix: this._can_autofix,
status: this._status,
};
return data;
}
validate(): string[] {
const validate = {
status: typeof this._status === 'string' && !this._status ? true : this._status,
can_autofix: typeof this._can_autofix === 'boolean',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<ICheckConfigResponseInfo>): CheckConfigResponseInfo {
return new CheckConfigResponseInfo({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,79 @@
import { CheckConfigStaticIpInfoStatic } from './CheckConfigStaticIpInfoStatic';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface ICheckConfigStaticIpInfo {
error?: string;
ip?: string;
static?: CheckConfigStaticIpInfoStatic;
}
export default class CheckConfigStaticIpInfo {
readonly _error: string | undefined;
/** */
get error(): string | undefined {
return this._error;
}
readonly _ip: string | undefined;
/**
* Description: Current dynamic IP address. Set if static=no
* Example: 192.168.1.1
*/
get ip(): string | undefined {
return this._ip;
}
readonly _static: CheckConfigStaticIpInfoStatic | undefined;
get static(): CheckConfigStaticIpInfoStatic | undefined {
return this._static;
}
constructor(props: ICheckConfigStaticIpInfo) {
if (typeof props.error === 'string') {
this._error = props.error.trim();
}
if (typeof props.ip === 'string') {
this._ip = props.ip.trim();
}
if (props.static) {
this._static = props.static;
}
}
serialize(): ICheckConfigStaticIpInfo {
const data: ICheckConfigStaticIpInfo = {
};
if (typeof this._error !== 'undefined') {
data.error = this._error;
}
if (typeof this._ip !== 'undefined') {
data.ip = this._ip;
}
if (typeof this._static !== 'undefined') {
data.static = this._static;
}
return data;
}
validate(): string[] {
const validate = {
ip: !this._ip ? true : typeof this._ip === 'string' && !this._ip ? true : this._ip,
error: !this._error ? true : typeof this._error === 'string' && !this._error ? true : this._error,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<ICheckConfigStaticIpInfo>): CheckConfigStaticIpInfo {
return new CheckConfigStaticIpInfo({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,7 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export enum CheckConfigStaticIpInfoStatic {
YES = 'yes',
NO = 'no',
ERROR = 'error'
}

View File

@@ -0,0 +1,176 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IClient {
blocked_services?: string[];
filtering_enabled?: boolean;
ids?: string[];
name?: string;
parental_enabled?: boolean;
safebrowsing_enabled?: boolean;
safesearch_enabled?: boolean;
upstreams?: string[];
use_global_blocked_services?: boolean;
use_global_settings?: boolean;
}
export default class Client {
readonly _blocked_services: string[] | undefined;
get blockedServices(): string[] | undefined {
return this._blocked_services;
}
readonly _filtering_enabled: boolean | undefined;
get filteringEnabled(): boolean | undefined {
return this._filtering_enabled;
}
readonly _ids: string[] | undefined;
/** */
get ids(): string[] | undefined {
return this._ids;
}
readonly _name: string | undefined;
/**
* Description: Name
* Example: localhost
*/
get name(): string | undefined {
return this._name;
}
readonly _parental_enabled: boolean | undefined;
get parentalEnabled(): boolean | undefined {
return this._parental_enabled;
}
readonly _safebrowsing_enabled: boolean | undefined;
get safebrowsingEnabled(): boolean | undefined {
return this._safebrowsing_enabled;
}
readonly _safesearch_enabled: boolean | undefined;
get safesearchEnabled(): boolean | undefined {
return this._safesearch_enabled;
}
readonly _upstreams: string[] | undefined;
get upstreams(): string[] | undefined {
return this._upstreams;
}
readonly _use_global_blocked_services: boolean | undefined;
get useGlobalBlockedServices(): boolean | undefined {
return this._use_global_blocked_services;
}
readonly _use_global_settings: boolean | undefined;
get useGlobalSettings(): boolean | undefined {
return this._use_global_settings;
}
constructor(props: IClient) {
if (props.blocked_services) {
this._blocked_services = props.blocked_services;
}
if (typeof props.filtering_enabled === 'boolean') {
this._filtering_enabled = props.filtering_enabled;
}
if (props.ids) {
this._ids = props.ids;
}
if (typeof props.name === 'string') {
this._name = props.name.trim();
}
if (typeof props.parental_enabled === 'boolean') {
this._parental_enabled = props.parental_enabled;
}
if (typeof props.safebrowsing_enabled === 'boolean') {
this._safebrowsing_enabled = props.safebrowsing_enabled;
}
if (typeof props.safesearch_enabled === 'boolean') {
this._safesearch_enabled = props.safesearch_enabled;
}
if (props.upstreams) {
this._upstreams = props.upstreams;
}
if (typeof props.use_global_blocked_services === 'boolean') {
this._use_global_blocked_services = props.use_global_blocked_services;
}
if (typeof props.use_global_settings === 'boolean') {
this._use_global_settings = props.use_global_settings;
}
}
serialize(): IClient {
const data: IClient = {
};
if (typeof this._blocked_services !== 'undefined') {
data.blocked_services = this._blocked_services;
}
if (typeof this._filtering_enabled !== 'undefined') {
data.filtering_enabled = this._filtering_enabled;
}
if (typeof this._ids !== 'undefined') {
data.ids = this._ids;
}
if (typeof this._name !== 'undefined') {
data.name = this._name;
}
if (typeof this._parental_enabled !== 'undefined') {
data.parental_enabled = this._parental_enabled;
}
if (typeof this._safebrowsing_enabled !== 'undefined') {
data.safebrowsing_enabled = this._safebrowsing_enabled;
}
if (typeof this._safesearch_enabled !== 'undefined') {
data.safesearch_enabled = this._safesearch_enabled;
}
if (typeof this._upstreams !== 'undefined') {
data.upstreams = this._upstreams;
}
if (typeof this._use_global_blocked_services !== 'undefined') {
data.use_global_blocked_services = this._use_global_blocked_services;
}
if (typeof this._use_global_settings !== 'undefined') {
data.use_global_settings = this._use_global_settings;
}
return data;
}
validate(): string[] {
const validate = {
name: !this._name ? true : typeof this._name === 'string' && !this._name ? true : this._name,
ids: !this._ids ? true : this._ids.reduce((result, p) => result && typeof p === 'string', true),
use_global_settings: !this._use_global_settings ? true : typeof this._use_global_settings === 'boolean',
filtering_enabled: !this._filtering_enabled ? true : typeof this._filtering_enabled === 'boolean',
parental_enabled: !this._parental_enabled ? true : typeof this._parental_enabled === 'boolean',
safebrowsing_enabled: !this._safebrowsing_enabled ? true : typeof this._safebrowsing_enabled === 'boolean',
safesearch_enabled: !this._safesearch_enabled ? true : typeof this._safesearch_enabled === 'boolean',
use_global_blocked_services: !this._use_global_blocked_services ? true : typeof this._use_global_blocked_services === 'boolean',
blocked_services: !this._blocked_services ? true : this._blocked_services.reduce((result, p) => result && typeof p === 'string', true),
upstreams: !this._upstreams ? true : this._upstreams.reduce((result, p) => result && typeof p === 'string', true),
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IClient>): Client {
return new Client({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,85 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IClientAuto {
ip?: string;
name?: string;
source?: string;
}
export default class ClientAuto {
readonly _ip: string | undefined;
/**
* Description: IP address
* Example: 127.0.0.1
*/
get ip(): string | undefined {
return this._ip;
}
readonly _name: string | undefined;
/**
* Description: Name
* Example: localhost
*/
get name(): string | undefined {
return this._name;
}
readonly _source: string | undefined;
/**
* Description: The source of this information
* Example: etc/hosts
*/
get source(): string | undefined {
return this._source;
}
constructor(props: IClientAuto) {
if (typeof props.ip === 'string') {
this._ip = props.ip.trim();
}
if (typeof props.name === 'string') {
this._name = props.name.trim();
}
if (typeof props.source === 'string') {
this._source = props.source.trim();
}
}
serialize(): IClientAuto {
const data: IClientAuto = {
};
if (typeof this._ip !== 'undefined') {
data.ip = this._ip;
}
if (typeof this._name !== 'undefined') {
data.name = this._name;
}
if (typeof this._source !== 'undefined') {
data.source = this._source;
}
return data;
}
validate(): string[] {
const validate = {
ip: !this._ip ? true : typeof this._ip === 'string' && !this._ip ? true : this._ip,
name: !this._name ? true : typeof this._name === 'string' && !this._name ? true : this._name,
source: !this._source ? true : typeof this._source === 'string' && !this._source ? true : this._source,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IClientAuto>): ClientAuto {
return new ClientAuto({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,45 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IClientDelete {
name?: string;
}
export default class ClientDelete {
readonly _name: string | undefined;
get name(): string | undefined {
return this._name;
}
constructor(props: IClientDelete) {
if (typeof props.name === 'string') {
this._name = props.name.trim();
}
}
serialize(): IClientDelete {
const data: IClientDelete = {
};
if (typeof this._name !== 'undefined') {
data.name = this._name;
}
return data;
}
validate(): string[] {
const validate = {
name: !this._name ? true : typeof this._name === 'string' && !this._name ? true : this._name,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IClientDelete>): ClientDelete {
return new ClientDelete({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,222 @@
import WhoisInfo, { IWhoisInfo } from './WhoisInfo';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IClientFindSubEntry {
blocked_services?: string[];
disallowed?: boolean;
disallowed_rule?: string;
filtering_enabled?: boolean;
ids?: string[];
name?: string;
parental_enabled?: boolean;
safebrowsing_enabled?: boolean;
safesearch_enabled?: boolean;
upstreams?: string[];
use_global_blocked_services?: boolean;
use_global_settings?: boolean;
whois_info?: IWhoisInfo[];
}
export default class ClientFindSubEntry {
readonly _blocked_services: string[] | undefined;
get blockedServices(): string[] | undefined {
return this._blocked_services;
}
readonly _disallowed: boolean | undefined;
/** */
get disallowed(): boolean | undefined {
return this._disallowed;
}
readonly _disallowed_rule: string | undefined;
/** */
get disallowedRule(): string | undefined {
return this._disallowed_rule;
}
readonly _filtering_enabled: boolean | undefined;
get filteringEnabled(): boolean | undefined {
return this._filtering_enabled;
}
readonly _ids: string[] | undefined;
/** */
get ids(): string[] | undefined {
return this._ids;
}
readonly _name: string | undefined;
/**
* Description: Name
* Example: localhost
*/
get name(): string | undefined {
return this._name;
}
readonly _parental_enabled: boolean | undefined;
get parentalEnabled(): boolean | undefined {
return this._parental_enabled;
}
readonly _safebrowsing_enabled: boolean | undefined;
get safebrowsingEnabled(): boolean | undefined {
return this._safebrowsing_enabled;
}
readonly _safesearch_enabled: boolean | undefined;
get safesearchEnabled(): boolean | undefined {
return this._safesearch_enabled;
}
readonly _upstreams: string[] | undefined;
get upstreams(): string[] | undefined {
return this._upstreams;
}
readonly _use_global_blocked_services: boolean | undefined;
get useGlobalBlockedServices(): boolean | undefined {
return this._use_global_blocked_services;
}
readonly _use_global_settings: boolean | undefined;
get useGlobalSettings(): boolean | undefined {
return this._use_global_settings;
}
readonly _whois_info: WhoisInfo[] | undefined;
get whoisInfo(): WhoisInfo[] | undefined {
return this._whois_info;
}
constructor(props: IClientFindSubEntry) {
if (props.blocked_services) {
this._blocked_services = props.blocked_services;
}
if (typeof props.disallowed === 'boolean') {
this._disallowed = props.disallowed;
}
if (typeof props.disallowed_rule === 'string') {
this._disallowed_rule = props.disallowed_rule.trim();
}
if (typeof props.filtering_enabled === 'boolean') {
this._filtering_enabled = props.filtering_enabled;
}
if (props.ids) {
this._ids = props.ids;
}
if (typeof props.name === 'string') {
this._name = props.name.trim();
}
if (typeof props.parental_enabled === 'boolean') {
this._parental_enabled = props.parental_enabled;
}
if (typeof props.safebrowsing_enabled === 'boolean') {
this._safebrowsing_enabled = props.safebrowsing_enabled;
}
if (typeof props.safesearch_enabled === 'boolean') {
this._safesearch_enabled = props.safesearch_enabled;
}
if (props.upstreams) {
this._upstreams = props.upstreams;
}
if (typeof props.use_global_blocked_services === 'boolean') {
this._use_global_blocked_services = props.use_global_blocked_services;
}
if (typeof props.use_global_settings === 'boolean') {
this._use_global_settings = props.use_global_settings;
}
if (props.whois_info) {
this._whois_info = props.whois_info.map((p) => new WhoisInfo(p));
}
}
serialize(): IClientFindSubEntry {
const data: IClientFindSubEntry = {
};
if (typeof this._blocked_services !== 'undefined') {
data.blocked_services = this._blocked_services;
}
if (typeof this._disallowed !== 'undefined') {
data.disallowed = this._disallowed;
}
if (typeof this._disallowed_rule !== 'undefined') {
data.disallowed_rule = this._disallowed_rule;
}
if (typeof this._filtering_enabled !== 'undefined') {
data.filtering_enabled = this._filtering_enabled;
}
if (typeof this._ids !== 'undefined') {
data.ids = this._ids;
}
if (typeof this._name !== 'undefined') {
data.name = this._name;
}
if (typeof this._parental_enabled !== 'undefined') {
data.parental_enabled = this._parental_enabled;
}
if (typeof this._safebrowsing_enabled !== 'undefined') {
data.safebrowsing_enabled = this._safebrowsing_enabled;
}
if (typeof this._safesearch_enabled !== 'undefined') {
data.safesearch_enabled = this._safesearch_enabled;
}
if (typeof this._upstreams !== 'undefined') {
data.upstreams = this._upstreams;
}
if (typeof this._use_global_blocked_services !== 'undefined') {
data.use_global_blocked_services = this._use_global_blocked_services;
}
if (typeof this._use_global_settings !== 'undefined') {
data.use_global_settings = this._use_global_settings;
}
if (typeof this._whois_info !== 'undefined') {
data.whois_info = this._whois_info.map((p) => p.serialize());
}
return data;
}
validate(): string[] {
const validate = {
name: !this._name ? true : typeof this._name === 'string' && !this._name ? true : this._name,
ids: !this._ids ? true : this._ids.reduce((result, p) => result && typeof p === 'string', true),
use_global_settings: !this._use_global_settings ? true : typeof this._use_global_settings === 'boolean',
filtering_enabled: !this._filtering_enabled ? true : typeof this._filtering_enabled === 'boolean',
parental_enabled: !this._parental_enabled ? true : typeof this._parental_enabled === 'boolean',
safebrowsing_enabled: !this._safebrowsing_enabled ? true : typeof this._safebrowsing_enabled === 'boolean',
safesearch_enabled: !this._safesearch_enabled ? true : typeof this._safesearch_enabled === 'boolean',
use_global_blocked_services: !this._use_global_blocked_services ? true : typeof this._use_global_blocked_services === 'boolean',
blocked_services: !this._blocked_services ? true : this._blocked_services.reduce((result, p) => result && typeof p === 'string', true),
upstreams: !this._upstreams ? true : this._upstreams.reduce((result, p) => result && typeof p === 'string', true),
whois_info: !this._whois_info ? true : this._whois_info.reduce((result, p) => result && p.validate().length === 0, true),
disallowed: !this._disallowed ? true : typeof this._disallowed === 'boolean',
disallowed_rule: !this._disallowed_rule ? true : typeof this._disallowed_rule === 'string' && !this._disallowed_rule ? true : this._disallowed_rule,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IClientFindSubEntry>): ClientFindSubEntry {
return new ClientFindSubEntry({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,61 @@
import Client, { IClient } from './Client';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IClientUpdate {
data?: IClient;
name?: string;
}
export default class ClientUpdate {
readonly _data: Client | undefined;
get data(): Client | undefined {
return this._data;
}
readonly _name: string | undefined;
get name(): string | undefined {
return this._name;
}
constructor(props: IClientUpdate) {
if (props.data) {
this._data = new Client(props.data);
}
if (typeof props.name === 'string') {
this._name = props.name.trim();
}
}
serialize(): IClientUpdate {
const data: IClientUpdate = {
};
if (typeof this._data !== 'undefined') {
data.data = this._data.serialize();
}
if (typeof this._name !== 'undefined') {
data.name = this._name;
}
return data;
}
validate(): string[] {
const validate = {
name: !this._name ? true : typeof this._name === 'string' && !this._name ? true : this._name,
data: !this._data ? true : this._data.validate().length === 0,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IClientUpdate>): ClientUpdate {
return new ClientUpdate({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,62 @@
import Client, { IClient } from './Client';
import ClientAuto, { IClientAuto } from './ClientAuto';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IClients {
auto_clients?: IClientAuto[];
clients?: IClient[];
}
export default class Clients {
readonly _auto_clients: ClientAuto[] | undefined;
get autoClients(): ClientAuto[] | undefined {
return this._auto_clients;
}
readonly _clients: Client[] | undefined;
get clients(): Client[] | undefined {
return this._clients;
}
constructor(props: IClients) {
if (props.auto_clients) {
this._auto_clients = props.auto_clients.map((p) => new ClientAuto(p));
}
if (props.clients) {
this._clients = props.clients.map((p) => new Client(p));
}
}
serialize(): IClients {
const data: IClients = {
};
if (typeof this._auto_clients !== 'undefined') {
data.auto_clients = this._auto_clients.map((p) => p.serialize());
}
if (typeof this._clients !== 'undefined') {
data.clients = this._clients.map((p) => p.serialize());
}
return data;
}
validate(): string[] {
const validate = {
clients: !this._clients ? true : this._clients.reduce((result, p) => result && p.validate().length === 0, true),
auto_clients: !this._auto_clients ? true : this._auto_clients.reduce((result, p) => result && p.validate().length === 0, true),
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IClients>): Clients {
return new Clients({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,31 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IClientsArray {
}
export default class ClientsArray {
constructor(props: IClientsArray) {
}
serialize(): IClientsArray {
const data: IClientsArray = {
};
return data;
}
validate(): string[] {
const validate = {
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IClientsArray>): ClientsArray {
return new ClientsArray({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,31 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IClientsAutoArray {
}
export default class ClientsAutoArray {
constructor(props: IClientsAutoArray) {
}
serialize(): IClientsAutoArray {
const data: IClientsAutoArray = {
};
return data;
}
validate(): string[] {
const validate = {
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IClientsAutoArray>): ClientsAutoArray {
return new ClientsAutoArray({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,31 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IClientsFindEntry {
}
export default class ClientsFindEntry {
constructor(props: IClientsFindEntry) {
}
serialize(): IClientsFindEntry {
const data: IClientsFindEntry = {
};
return data;
}
validate(): string[] {
const validate = {
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IClientsFindEntry>): ClientsFindEntry {
return new ClientsFindEntry({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,31 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IClientsFindResponse {
}
export default class ClientsFindResponse {
constructor(props: IClientsFindResponse) {
}
serialize(): IClientsFindResponse {
const data: IClientsFindResponse = {
};
return data;
}
validate(): string[] {
const validate = {
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IClientsFindResponse>): ClientsFindResponse {
return new ClientsFindResponse({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,250 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDNSConfig {
blocking_ipv4?: string;
blocking_ipv6?: string;
blocking_mode?: string;
bootstrap_dns?: string[];
cache_size?: number;
cache_ttl_max?: number;
cache_ttl_min?: number;
dhcp_available?: boolean;
dnssec_enabled?: boolean;
edns_cs_enabled?: boolean;
protection_enabled?: boolean;
ratelimit?: number;
upstream_dns?: string[];
upstream_dns_file?: string;
upstream_mode?: any;
}
export default class DNSConfig {
readonly _blocking_ipv4: string | undefined;
get blockingIpv4(): string | undefined {
return this._blocking_ipv4;
}
readonly _blocking_ipv6: string | undefined;
get blockingIpv6(): string | undefined {
return this._blocking_ipv6;
}
readonly _blocking_mode: string | undefined;
get blockingMode(): string | undefined {
return this._blocking_mode;
}
readonly _bootstrap_dns: string[] | undefined;
/**
* Description: Bootstrap servers, port is optional after colon. Empty value will reset it to default values.
*
* Example: 8.8.8.8:53,1.1.1.1:53
*/
get bootstrapDns(): string[] | undefined {
return this._bootstrap_dns;
}
readonly _cache_size: number | undefined;
get cacheSize(): number | undefined {
return this._cache_size;
}
readonly _cache_ttl_max: number | undefined;
get cacheTtlMax(): number | undefined {
return this._cache_ttl_max;
}
readonly _cache_ttl_min: number | undefined;
get cacheTtlMin(): number | undefined {
return this._cache_ttl_min;
}
readonly _dhcp_available: boolean | undefined;
get dhcpAvailable(): boolean | undefined {
return this._dhcp_available;
}
readonly _dnssec_enabled: boolean | undefined;
get dnssecEnabled(): boolean | undefined {
return this._dnssec_enabled;
}
readonly _edns_cs_enabled: boolean | undefined;
get ednsCsEnabled(): boolean | undefined {
return this._edns_cs_enabled;
}
readonly _protection_enabled: boolean | undefined;
get protectionEnabled(): boolean | undefined {
return this._protection_enabled;
}
readonly _ratelimit: number | undefined;
get ratelimit(): number | undefined {
return this._ratelimit;
}
readonly _upstream_dns: string[] | undefined;
/**
* Description: Upstream servers, port is optional after colon. Empty value will reset it to default values.
*
* Example: tls://1.1.1.1,tls://1.0.0.1
*/
get upstreamDns(): string[] | undefined {
return this._upstream_dns;
}
readonly _upstream_dns_file: string | undefined;
get upstreamDnsFile(): string | undefined {
return this._upstream_dns_file;
}
readonly _upstream_mode: any | undefined;
get upstreamMode(): any | undefined {
return this._upstream_mode;
}
constructor(props: IDNSConfig) {
if (typeof props.blocking_ipv4 === 'string') {
this._blocking_ipv4 = props.blocking_ipv4.trim();
}
if (typeof props.blocking_ipv6 === 'string') {
this._blocking_ipv6 = props.blocking_ipv6.trim();
}
if (typeof props.blocking_mode === 'string') {
this._blocking_mode = props.blocking_mode.trim();
}
if (props.bootstrap_dns) {
this._bootstrap_dns = props.bootstrap_dns;
}
if (typeof props.cache_size === 'number') {
this._cache_size = props.cache_size;
}
if (typeof props.cache_ttl_max === 'number') {
this._cache_ttl_max = props.cache_ttl_max;
}
if (typeof props.cache_ttl_min === 'number') {
this._cache_ttl_min = props.cache_ttl_min;
}
if (typeof props.dhcp_available === 'boolean') {
this._dhcp_available = props.dhcp_available;
}
if (typeof props.dnssec_enabled === 'boolean') {
this._dnssec_enabled = props.dnssec_enabled;
}
if (typeof props.edns_cs_enabled === 'boolean') {
this._edns_cs_enabled = props.edns_cs_enabled;
}
if (typeof props.protection_enabled === 'boolean') {
this._protection_enabled = props.protection_enabled;
}
if (typeof props.ratelimit === 'number') {
this._ratelimit = props.ratelimit;
}
if (props.upstream_dns) {
this._upstream_dns = props.upstream_dns;
}
if (typeof props.upstream_dns_file === 'string') {
this._upstream_dns_file = props.upstream_dns_file.trim();
}
if (props.upstream_mode) {
this._upstream_mode = props.upstream_mode;
}
}
serialize(): IDNSConfig {
const data: IDNSConfig = {
};
if (typeof this._blocking_ipv4 !== 'undefined') {
data.blocking_ipv4 = this._blocking_ipv4;
}
if (typeof this._blocking_ipv6 !== 'undefined') {
data.blocking_ipv6 = this._blocking_ipv6;
}
if (typeof this._blocking_mode !== 'undefined') {
data.blocking_mode = this._blocking_mode;
}
if (typeof this._bootstrap_dns !== 'undefined') {
data.bootstrap_dns = this._bootstrap_dns;
}
if (typeof this._cache_size !== 'undefined') {
data.cache_size = this._cache_size;
}
if (typeof this._cache_ttl_max !== 'undefined') {
data.cache_ttl_max = this._cache_ttl_max;
}
if (typeof this._cache_ttl_min !== 'undefined') {
data.cache_ttl_min = this._cache_ttl_min;
}
if (typeof this._dhcp_available !== 'undefined') {
data.dhcp_available = this._dhcp_available;
}
if (typeof this._dnssec_enabled !== 'undefined') {
data.dnssec_enabled = this._dnssec_enabled;
}
if (typeof this._edns_cs_enabled !== 'undefined') {
data.edns_cs_enabled = this._edns_cs_enabled;
}
if (typeof this._protection_enabled !== 'undefined') {
data.protection_enabled = this._protection_enabled;
}
if (typeof this._ratelimit !== 'undefined') {
data.ratelimit = this._ratelimit;
}
if (typeof this._upstream_dns !== 'undefined') {
data.upstream_dns = this._upstream_dns;
}
if (typeof this._upstream_dns_file !== 'undefined') {
data.upstream_dns_file = this._upstream_dns_file;
}
if (typeof this._upstream_mode !== 'undefined') {
data.upstream_mode = this._upstream_mode;
}
return data;
}
validate(): string[] {
const validate = {
bootstrap_dns: !this._bootstrap_dns ? true : this._bootstrap_dns.reduce((result, p) => result && typeof p === 'string', true),
upstream_dns: !this._upstream_dns ? true : this._upstream_dns.reduce((result, p) => result && typeof p === 'string', true),
upstream_dns_file: !this._upstream_dns_file ? true : typeof this._upstream_dns_file === 'string' && !this._upstream_dns_file ? true : this._upstream_dns_file,
protection_enabled: !this._protection_enabled ? true : typeof this._protection_enabled === 'boolean',
dhcp_available: !this._dhcp_available ? true : typeof this._dhcp_available === 'boolean',
ratelimit: !this._ratelimit ? true : typeof this._ratelimit === 'number',
blocking_mode: !this._blocking_mode ? true : typeof this._blocking_mode === 'string' && !this._blocking_mode ? true : this._blocking_mode,
blocking_ipv4: !this._blocking_ipv4 ? true : typeof this._blocking_ipv4 === 'string' && !this._blocking_ipv4 ? true : this._blocking_ipv4,
blocking_ipv6: !this._blocking_ipv6 ? true : typeof this._blocking_ipv6 === 'string' && !this._blocking_ipv6 ? true : this._blocking_ipv6,
edns_cs_enabled: !this._edns_cs_enabled ? true : typeof this._edns_cs_enabled === 'boolean',
dnssec_enabled: !this._dnssec_enabled ? true : typeof this._dnssec_enabled === 'boolean',
cache_size: !this._cache_size ? true : typeof this._cache_size === 'number',
cache_ttl_min: !this._cache_ttl_min ? true : typeof this._cache_ttl_min === 'number',
cache_ttl_max: !this._cache_ttl_max ? true : typeof this._cache_ttl_max === 'number',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IDNSConfig>): DNSConfig {
return new DNSConfig({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,90 @@
import DhcpConfigV4, { IDhcpConfigV4 } from './DhcpConfigV4';
import DhcpConfigV6, { IDhcpConfigV6 } from './DhcpConfigV6';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDhcpConfig {
enabled?: boolean;
interface_name?: string;
v4?: IDhcpConfigV4;
v6?: IDhcpConfigV6;
}
export default class DhcpConfig {
readonly _enabled: boolean | undefined;
get enabled(): boolean | undefined {
return this._enabled;
}
readonly _interface_name: string | undefined;
get interfaceName(): string | undefined {
return this._interface_name;
}
readonly _v4: DhcpConfigV4 | undefined;
get v4(): DhcpConfigV4 | undefined {
return this._v4;
}
readonly _v6: DhcpConfigV6 | undefined;
get v6(): DhcpConfigV6 | undefined {
return this._v6;
}
constructor(props: IDhcpConfig) {
if (typeof props.enabled === 'boolean') {
this._enabled = props.enabled;
}
if (typeof props.interface_name === 'string') {
this._interface_name = props.interface_name.trim();
}
if (props.v4) {
this._v4 = new DhcpConfigV4(props.v4);
}
if (props.v6) {
this._v6 = new DhcpConfigV6(props.v6);
}
}
serialize(): IDhcpConfig {
const data: IDhcpConfig = {
};
if (typeof this._enabled !== 'undefined') {
data.enabled = this._enabled;
}
if (typeof this._interface_name !== 'undefined') {
data.interface_name = this._interface_name;
}
if (typeof this._v4 !== 'undefined') {
data.v4 = this._v4.serialize();
}
if (typeof this._v6 !== 'undefined') {
data.v6 = this._v6.serialize();
}
return data;
}
validate(): string[] {
const validate = {
enabled: !this._enabled ? true : typeof this._enabled === 'boolean',
interface_name: !this._interface_name ? true : typeof this._interface_name === 'string' && !this._interface_name ? true : this._interface_name,
v4: !this._v4 ? true : this._v4.validate().length === 0,
v6: !this._v6 ? true : this._v6.validate().length === 0,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IDhcpConfig>): DhcpConfig {
return new DhcpConfig({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,117 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDhcpConfigV4 {
gateway_ip?: string;
lease_duration?: number;
range_end?: string;
range_start?: string;
subnet_mask?: string;
}
export default class DhcpConfigV4 {
readonly _gateway_ip: string | undefined;
/**
* Description: undefined
* Example: 192.168.1.1
*/
get gatewayIp(): string | undefined {
return this._gateway_ip;
}
readonly _lease_duration: number | undefined;
get leaseDuration(): number | undefined {
return this._lease_duration;
}
readonly _range_end: string | undefined;
/**
* Description: undefined
* Example: 192.168.10.50
*/
get rangeEnd(): string | undefined {
return this._range_end;
}
readonly _range_start: string | undefined;
/**
* Description: undefined
* Example: 192.168.1.2
*/
get rangeStart(): string | undefined {
return this._range_start;
}
readonly _subnet_mask: string | undefined;
/**
* Description: undefined
* Example: 255.255.255.0
*/
get subnetMask(): string | undefined {
return this._subnet_mask;
}
constructor(props: IDhcpConfigV4) {
if (typeof props.gateway_ip === 'string') {
this._gateway_ip = props.gateway_ip.trim();
}
if (typeof props.lease_duration === 'number') {
this._lease_duration = props.lease_duration;
}
if (typeof props.range_end === 'string') {
this._range_end = props.range_end.trim();
}
if (typeof props.range_start === 'string') {
this._range_start = props.range_start.trim();
}
if (typeof props.subnet_mask === 'string') {
this._subnet_mask = props.subnet_mask.trim();
}
}
serialize(): IDhcpConfigV4 {
const data: IDhcpConfigV4 = {
};
if (typeof this._gateway_ip !== 'undefined') {
data.gateway_ip = this._gateway_ip;
}
if (typeof this._lease_duration !== 'undefined') {
data.lease_duration = this._lease_duration;
}
if (typeof this._range_end !== 'undefined') {
data.range_end = this._range_end;
}
if (typeof this._range_start !== 'undefined') {
data.range_start = this._range_start;
}
if (typeof this._subnet_mask !== 'undefined') {
data.subnet_mask = this._subnet_mask;
}
return data;
}
validate(): string[] {
const validate = {
gateway_ip: !this._gateway_ip ? true : typeof this._gateway_ip === 'string' && !this._gateway_ip ? true : this._gateway_ip,
subnet_mask: !this._subnet_mask ? true : typeof this._subnet_mask === 'string' && !this._subnet_mask ? true : this._subnet_mask,
range_start: !this._range_start ? true : typeof this._range_start === 'string' && !this._range_start ? true : this._range_start,
range_end: !this._range_end ? true : typeof this._range_end === 'string' && !this._range_end ? true : this._range_end,
lease_duration: !this._lease_duration ? true : typeof this._lease_duration === 'number',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IDhcpConfigV4>): DhcpConfigV4 {
return new DhcpConfigV4({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,59 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDhcpConfigV6 {
lease_duration?: number;
range_start?: string;
}
export default class DhcpConfigV6 {
readonly _lease_duration: number | undefined;
get leaseDuration(): number | undefined {
return this._lease_duration;
}
readonly _range_start: string | undefined;
get rangeStart(): string | undefined {
return this._range_start;
}
constructor(props: IDhcpConfigV6) {
if (typeof props.lease_duration === 'number') {
this._lease_duration = props.lease_duration;
}
if (typeof props.range_start === 'string') {
this._range_start = props.range_start.trim();
}
}
serialize(): IDhcpConfigV6 {
const data: IDhcpConfigV6 = {
};
if (typeof this._lease_duration !== 'undefined') {
data.lease_duration = this._lease_duration;
}
if (typeof this._range_start !== 'undefined') {
data.range_start = this._range_start;
}
return data;
}
validate(): string[] {
const validate = {
range_start: !this._range_start ? true : typeof this._range_start === 'string' && !this._range_start ? true : this._range_start,
lease_duration: !this._lease_duration ? true : typeof this._lease_duration === 'number',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IDhcpConfigV6>): DhcpConfigV6 {
return new DhcpConfigV6({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,103 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDhcpLease {
expires: string;
hostname: string;
ip: string;
mac: string;
}
export default class DhcpLease {
readonly _expires: string;
/**
* Description: undefined
* Example: 2017-07-21T17:32:28Z
*/
get expires(): string {
return this._expires;
}
static expiresValidate(expires: string): boolean {
return typeof expires === 'string' && !!expires.trim();
}
readonly _hostname: string;
/**
* Description: undefined
* Example: dell
*/
get hostname(): string {
return this._hostname;
}
static hostnameValidate(hostname: string): boolean {
return typeof hostname === 'string' && !!hostname.trim();
}
readonly _ip: string;
/**
* Description: undefined
* Example: 192.168.1.22
*/
get ip(): string {
return this._ip;
}
static ipValidate(ip: string): boolean {
return typeof ip === 'string' && !!ip.trim();
}
readonly _mac: string;
/**
* Description: undefined
* Example: 00:11:09:b3:b3:b8
*/
get mac(): string {
return this._mac;
}
static macValidate(mac: string): boolean {
return typeof mac === 'string' && !!mac.trim();
}
constructor(props: IDhcpLease) {
this._expires = props.expires.trim();
this._hostname = props.hostname.trim();
this._ip = props.ip.trim();
this._mac = props.mac.trim();
}
serialize(): IDhcpLease {
const data: IDhcpLease = {
expires: this._expires,
hostname: this._hostname,
ip: this._ip,
mac: this._mac,
};
return data;
}
validate(): string[] {
const validate = {
mac: typeof this._mac === 'string' && !this._mac ? true : this._mac,
ip: typeof this._ip === 'string' && !this._ip ? true : this._ip,
hostname: typeof this._hostname === 'string' && !this._hostname ? true : this._hostname,
expires: typeof this._expires === 'string' && !this._expires ? true : this._expires,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IDhcpLease>): DhcpLease {
return new DhcpLease({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,62 @@
import DhcpSearchV4, { IDhcpSearchV4 } from './DhcpSearchV4';
import DhcpSearchV6, { IDhcpSearchV6 } from './DhcpSearchV6';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDhcpSearchResult {
v4?: IDhcpSearchV4;
v6?: IDhcpSearchV6;
}
export default class DhcpSearchResult {
readonly _v4: DhcpSearchV4 | undefined;
get v4(): DhcpSearchV4 | undefined {
return this._v4;
}
readonly _v6: DhcpSearchV6 | undefined;
get v6(): DhcpSearchV6 | undefined {
return this._v6;
}
constructor(props: IDhcpSearchResult) {
if (props.v4) {
this._v4 = new DhcpSearchV4(props.v4);
}
if (props.v6) {
this._v6 = new DhcpSearchV6(props.v6);
}
}
serialize(): IDhcpSearchResult {
const data: IDhcpSearchResult = {
};
if (typeof this._v4 !== 'undefined') {
data.v4 = this._v4.serialize();
}
if (typeof this._v6 !== 'undefined') {
data.v6 = this._v6.serialize();
}
return data;
}
validate(): string[] {
const validate = {
v4: !this._v4 ? true : this._v4.validate().length === 0,
v6: !this._v6 ? true : this._v6.validate().length === 0,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IDhcpSearchResult>): DhcpSearchResult {
return new DhcpSearchResult({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,64 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDhcpSearchResultOtherServer {
error?: string;
found?: string;
}
export default class DhcpSearchResultOtherServer {
readonly _error: string | undefined;
/** */
get error(): string | undefined {
return this._error;
}
readonly _found: string | undefined;
/**
* Description: yes|no|error
* Example: no
*/
get found(): string | undefined {
return this._found;
}
constructor(props: IDhcpSearchResultOtherServer) {
if (typeof props.error === 'string') {
this._error = props.error.trim();
}
if (typeof props.found === 'string') {
this._found = props.found.trim();
}
}
serialize(): IDhcpSearchResultOtherServer {
const data: IDhcpSearchResultOtherServer = {
};
if (typeof this._error !== 'undefined') {
data.error = this._error;
}
if (typeof this._found !== 'undefined') {
data.found = this._found;
}
return data;
}
validate(): string[] {
const validate = {
found: !this._found ? true : typeof this._found === 'string' && !this._found ? true : this._found,
error: !this._error ? true : typeof this._error === 'string' && !this._error ? true : this._error,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IDhcpSearchResultOtherServer>): DhcpSearchResultOtherServer {
return new DhcpSearchResultOtherServer({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,64 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDhcpSearchResultStaticIP {
ip?: string;
static?: string;
}
export default class DhcpSearchResultStaticIP {
readonly _ip: string | undefined;
/** */
get ip(): string | undefined {
return this._ip;
}
readonly _static: string | undefined;
/**
* Description: yes|no|error
* Example: yes
*/
get static(): string | undefined {
return this._static;
}
constructor(props: IDhcpSearchResultStaticIP) {
if (typeof props.ip === 'string') {
this._ip = props.ip.trim();
}
if (typeof props.static === 'string') {
this._static = props.static.trim();
}
}
serialize(): IDhcpSearchResultStaticIP {
const data: IDhcpSearchResultStaticIP = {
};
if (typeof this._ip !== 'undefined') {
data.ip = this._ip;
}
if (typeof this._static !== 'undefined') {
data.static = this._static;
}
return data;
}
validate(): string[] {
const validate = {
static: !this._static ? true : typeof this._static === 'string' && !this._static ? true : this._static,
ip: !this._ip ? true : typeof this._ip === 'string' && !this._ip ? true : this._ip,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IDhcpSearchResultStaticIP>): DhcpSearchResultStaticIP {
return new DhcpSearchResultStaticIP({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,62 @@
import DhcpSearchResultOtherServer, { IDhcpSearchResultOtherServer } from './DhcpSearchResultOtherServer';
import DhcpSearchResultStaticIP, { IDhcpSearchResultStaticIP } from './DhcpSearchResultStaticIP';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDhcpSearchV4 {
other_server?: IDhcpSearchResultOtherServer;
static_ip?: IDhcpSearchResultStaticIP;
}
export default class DhcpSearchV4 {
readonly _other_server: DhcpSearchResultOtherServer | undefined;
get otherServer(): DhcpSearchResultOtherServer | undefined {
return this._other_server;
}
readonly _static_ip: DhcpSearchResultStaticIP | undefined;
get staticIp(): DhcpSearchResultStaticIP | undefined {
return this._static_ip;
}
constructor(props: IDhcpSearchV4) {
if (props.other_server) {
this._other_server = new DhcpSearchResultOtherServer(props.other_server);
}
if (props.static_ip) {
this._static_ip = new DhcpSearchResultStaticIP(props.static_ip);
}
}
serialize(): IDhcpSearchV4 {
const data: IDhcpSearchV4 = {
};
if (typeof this._other_server !== 'undefined') {
data.other_server = this._other_server.serialize();
}
if (typeof this._static_ip !== 'undefined') {
data.static_ip = this._static_ip.serialize();
}
return data;
}
validate(): string[] {
const validate = {
other_server: !this._other_server ? true : this._other_server.validate().length === 0,
static_ip: !this._static_ip ? true : this._static_ip.validate().length === 0,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IDhcpSearchV4>): DhcpSearchV4 {
return new DhcpSearchV4({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,47 @@
import DhcpSearchResultOtherServer, { IDhcpSearchResultOtherServer } from './DhcpSearchResultOtherServer';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDhcpSearchV6 {
other_server?: IDhcpSearchResultOtherServer;
}
export default class DhcpSearchV6 {
readonly _other_server: DhcpSearchResultOtherServer | undefined;
get otherServer(): DhcpSearchResultOtherServer | undefined {
return this._other_server;
}
constructor(props: IDhcpSearchV6) {
if (props.other_server) {
this._other_server = new DhcpSearchResultOtherServer(props.other_server);
}
}
serialize(): IDhcpSearchV6 {
const data: IDhcpSearchV6 = {
};
if (typeof this._other_server !== 'undefined') {
data.other_server = this._other_server.serialize();
}
return data;
}
validate(): string[] {
const validate = {
other_server: !this._other_server ? true : this._other_server.validate().length === 0,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IDhcpSearchV6>): DhcpSearchV6 {
return new DhcpSearchV6({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,85 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDhcpStaticLease {
hostname: string;
ip: string;
mac: string;
}
export default class DhcpStaticLease {
readonly _hostname: string;
/**
* Description: undefined
* Example: dell
*/
get hostname(): string {
return this._hostname;
}
static hostnameValidate(hostname: string): boolean {
return typeof hostname === 'string' && !!hostname.trim();
}
readonly _ip: string;
/**
* Description: undefined
* Example: 192.168.1.22
*/
get ip(): string {
return this._ip;
}
static ipValidate(ip: string): boolean {
return typeof ip === 'string' && !!ip.trim();
}
readonly _mac: string;
/**
* Description: undefined
* Example: 00:11:09:b3:b3:b8
*/
get mac(): string {
return this._mac;
}
static macValidate(mac: string): boolean {
return typeof mac === 'string' && !!mac.trim();
}
constructor(props: IDhcpStaticLease) {
this._hostname = props.hostname.trim();
this._ip = props.ip.trim();
this._mac = props.mac.trim();
}
serialize(): IDhcpStaticLease {
const data: IDhcpStaticLease = {
hostname: this._hostname,
ip: this._ip,
mac: this._mac,
};
return data;
}
validate(): string[] {
const validate = {
mac: typeof this._mac === 'string' && !this._mac ? true : this._mac,
ip: typeof this._ip === 'string' && !this._ip ? true : this._ip,
hostname: typeof this._hostname === 'string' && !this._hostname ? true : this._hostname,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IDhcpStaticLease>): DhcpStaticLease {
return new DhcpStaticLease({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,116 @@
import DhcpConfigV4, { IDhcpConfigV4 } from './DhcpConfigV4';
import DhcpConfigV6, { IDhcpConfigV6 } from './DhcpConfigV6';
import DhcpLease, { IDhcpLease } from './DhcpLease';
import DhcpStaticLease, { IDhcpStaticLease } from './DhcpStaticLease';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDhcpStatus {
enabled?: boolean;
interface_name?: string;
leases: IDhcpLease[];
static_leases?: IDhcpStaticLease[];
v4?: IDhcpConfigV4;
v6?: IDhcpConfigV6;
}
export default class DhcpStatus {
readonly _enabled: boolean | undefined;
get enabled(): boolean | undefined {
return this._enabled;
}
readonly _interface_name: string | undefined;
get interfaceName(): string | undefined {
return this._interface_name;
}
readonly _leases: DhcpLease[];
get leases(): DhcpLease[] {
return this._leases;
}
readonly _static_leases: DhcpStaticLease[] | undefined;
get staticLeases(): DhcpStaticLease[] | undefined {
return this._static_leases;
}
readonly _v4: DhcpConfigV4 | undefined;
get v4(): DhcpConfigV4 | undefined {
return this._v4;
}
readonly _v6: DhcpConfigV6 | undefined;
get v6(): DhcpConfigV6 | undefined {
return this._v6;
}
constructor(props: IDhcpStatus) {
if (typeof props.enabled === 'boolean') {
this._enabled = props.enabled;
}
if (typeof props.interface_name === 'string') {
this._interface_name = props.interface_name.trim();
}
this._leases = props.leases.map((p) => new DhcpLease(p));
if (props.static_leases) {
this._static_leases = props.static_leases.map((p) => new DhcpStaticLease(p));
}
if (props.v4) {
this._v4 = new DhcpConfigV4(props.v4);
}
if (props.v6) {
this._v6 = new DhcpConfigV6(props.v6);
}
}
serialize(): IDhcpStatus {
const data: IDhcpStatus = {
leases: this._leases.map((p) => p.serialize()),
};
if (typeof this._enabled !== 'undefined') {
data.enabled = this._enabled;
}
if (typeof this._interface_name !== 'undefined') {
data.interface_name = this._interface_name;
}
if (typeof this._static_leases !== 'undefined') {
data.static_leases = this._static_leases.map((p) => p.serialize());
}
if (typeof this._v4 !== 'undefined') {
data.v4 = this._v4.serialize();
}
if (typeof this._v6 !== 'undefined') {
data.v6 = this._v6.serialize();
}
return data;
}
validate(): string[] {
const validate = {
enabled: !this._enabled ? true : typeof this._enabled === 'boolean',
interface_name: !this._interface_name ? true : typeof this._interface_name === 'string' && !this._interface_name ? true : this._interface_name,
v4: !this._v4 ? true : this._v4.validate().length === 0,
v6: !this._v6 ? true : this._v6.validate().length === 0,
leases: this._leases.reduce((result, p) => result && p.validate().length === 0, true),
static_leases: !this._static_leases ? true : this._static_leases.reduce((result, p) => result && p.validate().length === 0, true),
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IDhcpStatus>): DhcpStatus {
return new DhcpStatus({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,85 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDnsAnswer {
ttl?: number;
type?: string;
value?: string;
}
export default class DnsAnswer {
readonly _ttl: number | undefined;
/**
* Description: undefined
* Example: 55
*/
get ttl(): number | undefined {
return this._ttl;
}
readonly _type: string | undefined;
/**
* Description: undefined
* Example: A
*/
get type(): string | undefined {
return this._type;
}
readonly _value: string | undefined;
/**
* Description: undefined
* Example: 217.69.139.201
*/
get value(): string | undefined {
return this._value;
}
constructor(props: IDnsAnswer) {
if (typeof props.ttl === 'number') {
this._ttl = props.ttl;
}
if (typeof props.type === 'string') {
this._type = props.type.trim();
}
if (typeof props.value === 'string') {
this._value = props.value.trim();
}
}
serialize(): IDnsAnswer {
const data: IDnsAnswer = {
};
if (typeof this._ttl !== 'undefined') {
data.ttl = this._ttl;
}
if (typeof this._type !== 'undefined') {
data.type = this._type;
}
if (typeof this._value !== 'undefined') {
data.value = this._value;
}
return data;
}
validate(): string[] {
const validate = {
ttl: !this._ttl ? true : typeof this._ttl === 'number',
type: !this._type ? true : typeof this._type === 'string' && !this._type ? true : this._type,
value: !this._value ? true : typeof this._value === 'string' && !this._value ? true : this._value,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IDnsAnswer>): DnsAnswer {
return new DnsAnswer({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,85 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IDnsQuestion {
class?: string;
host?: string;
type?: string;
}
export default class DnsQuestion {
readonly _class: string | undefined;
/**
* Description: undefined
* Example: IN
*/
get class(): string | undefined {
return this._class;
}
readonly _host: string | undefined;
/**
* Description: undefined
* Example: example.org
*/
get host(): string | undefined {
return this._host;
}
readonly _type: string | undefined;
/**
* Description: undefined
* Example: A
*/
get type(): string | undefined {
return this._type;
}
constructor(props: IDnsQuestion) {
if (typeof props.class === 'string') {
this._class = props.class.trim();
}
if (typeof props.host === 'string') {
this._host = props.host.trim();
}
if (typeof props.type === 'string') {
this._type = props.type.trim();
}
}
serialize(): IDnsQuestion {
const data: IDnsQuestion = {
};
if (typeof this._class !== 'undefined') {
data.class = this._class;
}
if (typeof this._host !== 'undefined') {
data.host = this._host;
}
if (typeof this._type !== 'undefined') {
data.type = this._type;
}
return data;
}
validate(): string[] {
const validate = {
class: !this._class ? true : typeof this._class === 'string' && !this._class ? true : this._class,
host: !this._host ? true : typeof this._host === 'string' && !this._host ? true : this._host,
type: !this._type ? true : typeof this._type === 'string' && !this._type ? true : this._type,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IDnsQuestion>): DnsQuestion {
return new DnsQuestion({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,46 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IError {
message?: string;
}
export default class Error {
readonly _message: string | undefined;
/** */
get message(): string | undefined {
return this._message;
}
constructor(props: IError) {
if (typeof props.message === 'string') {
this._message = props.message.trim();
}
}
serialize(): IError {
const data: IError = {
};
if (typeof this._message !== 'undefined') {
data.message = this._message;
}
return data;
}
validate(): string[] {
const validate = {
message: !this._message ? true : typeof this._message === 'string' && !this._message ? true : this._message,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IError>): Error {
return new Error({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,136 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IFilter {
enabled: boolean;
id: number;
lastUpdated: string;
name: string;
rulesCount: number;
url: string;
}
export default class Filter {
readonly _enabled: boolean;
get enabled(): boolean {
return this._enabled;
}
static enabledValidate(enabled: boolean): boolean {
return typeof enabled === 'boolean';
}
readonly _id: number;
/**
* Description: undefined
* Example: 1234
*/
get id(): number {
return this._id;
}
static idValidate(id: number): boolean {
return typeof id === 'number';
}
readonly _lastUpdated: string;
/**
* Description: undefined
* Example: 2018-10-30T12:18:57+03:00
*/
get lastUpdated(): string {
return this._lastUpdated;
}
static lastUpdatedValidate(lastUpdated: string): boolean {
return typeof lastUpdated === 'string' && !!lastUpdated.trim();
}
readonly _name: string;
/**
* Description: undefined
* Example: AdGuard Simplified Domain Names filter
*/
get name(): string {
return this._name;
}
static nameValidate(name: string): boolean {
return typeof name === 'string' && !!name.trim();
}
readonly _rulesCount: number;
/**
* Description: undefined
* Example: 5912
*/
get rulesCount(): number {
return this._rulesCount;
}
static rulesCountValidate(rulesCount: number): boolean {
return typeof rulesCount === 'number';
}
readonly _url: string;
/**
* Description: undefined
* Example: https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt
*
*/
get url(): string {
return this._url;
}
static urlValidate(url: string): boolean {
return typeof url === 'string' && !!url.trim();
}
constructor(props: IFilter) {
this._enabled = props.enabled;
this._id = props.id;
this._lastUpdated = props.lastUpdated.trim();
this._name = props.name.trim();
this._rulesCount = props.rulesCount;
this._url = props.url.trim();
}
serialize(): IFilter {
const data: IFilter = {
enabled: this._enabled,
id: this._id,
lastUpdated: this._lastUpdated,
name: this._name,
rulesCount: this._rulesCount,
url: this._url,
};
return data;
}
validate(): string[] {
const validate = {
enabled: typeof this._enabled === 'boolean',
id: typeof this._id === 'number',
lastUpdated: typeof this._lastUpdated === 'string' && !this._lastUpdated ? true : this._lastUpdated,
name: typeof this._name === 'string' && !this._name ? true : this._name,
rulesCount: typeof this._rulesCount === 'number',
url: typeof this._url === 'string' && !this._url ? true : this._url,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IFilter>): Filter {
return new Filter({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,143 @@
import ResultRule, { IResultRule } from './ResultRule';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IFilterCheckHostResponse {
cname?: string;
filter_id?: number;
ip_addrs?: string[];
reason?: string;
rule?: string;
rules?: IResultRule[];
service_name?: string;
}
export default class FilterCheckHostResponse {
readonly _cname: string | undefined;
/** */
get cname(): string | undefined {
return this._cname;
}
readonly _filter_id: number | undefined;
/** */
get filterId(): number | undefined {
return this._filter_id;
}
readonly _ip_addrs: string[] | undefined;
/** */
get ipAddrs(): string[] | undefined {
return this._ip_addrs;
}
readonly _reason: string | undefined;
/** */
get reason(): string | undefined {
return this._reason;
}
readonly _rule: string | undefined;
/**
* Description: Filtering rule applied to the request (if any).
* Deprecated: use `rules[*].text` instead.
*
* Example: ||example.org^
*/
get rule(): string | undefined {
return this._rule;
}
readonly _rules: ResultRule[] | undefined;
/** */
get rules(): ResultRule[] | undefined {
return this._rules;
}
readonly _service_name: string | undefined;
/** */
get serviceName(): string | undefined {
return this._service_name;
}
constructor(props: IFilterCheckHostResponse) {
if (typeof props.cname === 'string') {
this._cname = props.cname.trim();
}
if (typeof props.filter_id === 'number') {
this._filter_id = props.filter_id;
}
if (props.ip_addrs) {
this._ip_addrs = props.ip_addrs;
}
if (typeof props.reason === 'string') {
this._reason = props.reason.trim();
}
if (typeof props.rule === 'string') {
this._rule = props.rule.trim();
}
if (props.rules) {
this._rules = props.rules.map((p) => new ResultRule(p));
}
if (typeof props.service_name === 'string') {
this._service_name = props.service_name.trim();
}
}
serialize(): IFilterCheckHostResponse {
const data: IFilterCheckHostResponse = {
};
if (typeof this._cname !== 'undefined') {
data.cname = this._cname;
}
if (typeof this._filter_id !== 'undefined') {
data.filter_id = this._filter_id;
}
if (typeof this._ip_addrs !== 'undefined') {
data.ip_addrs = this._ip_addrs;
}
if (typeof this._reason !== 'undefined') {
data.reason = this._reason;
}
if (typeof this._rule !== 'undefined') {
data.rule = this._rule;
}
if (typeof this._rules !== 'undefined') {
data.rules = this._rules.map((p) => p.serialize());
}
if (typeof this._service_name !== 'undefined') {
data.service_name = this._service_name;
}
return data;
}
validate(): string[] {
const validate = {
reason: !this._reason ? true : typeof this._reason === 'string' && !this._reason ? true : this._reason,
filter_id: !this._filter_id ? true : typeof this._filter_id === 'number',
rule: !this._rule ? true : typeof this._rule === 'string' && !this._rule ? true : this._rule,
rules: !this._rules ? true : this._rules.reduce((result, p) => result && p.validate().length === 0, true),
service_name: !this._service_name ? true : typeof this._service_name === 'string' && !this._service_name ? true : this._service_name,
cname: !this._cname ? true : typeof this._cname === 'string' && !this._cname ? true : this._cname,
ip_addrs: !this._ip_addrs ? true : this._ip_addrs.reduce((result, p) => result && typeof p === 'string', true),
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IFilterCheckHostResponse>): FilterCheckHostResponse {
return new FilterCheckHostResponse({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,59 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IFilterConfig {
enabled?: boolean;
interval?: number;
}
export default class FilterConfig {
readonly _enabled: boolean | undefined;
get enabled(): boolean | undefined {
return this._enabled;
}
readonly _interval: number | undefined;
get interval(): number | undefined {
return this._interval;
}
constructor(props: IFilterConfig) {
if (typeof props.enabled === 'boolean') {
this._enabled = props.enabled;
}
if (typeof props.interval === 'number') {
this._interval = props.interval;
}
}
serialize(): IFilterConfig {
const data: IFilterConfig = {
};
if (typeof this._enabled !== 'undefined') {
data.enabled = this._enabled;
}
if (typeof this._interval !== 'undefined') {
data.interval = this._interval;
}
return data;
}
validate(): string[] {
const validate = {
enabled: !this._enabled ? true : typeof this._enabled === 'boolean',
interval: !this._interval ? true : typeof this._interval === 'number',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IFilterConfig>): FilterConfig {
return new FilterConfig({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,45 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IFilterRefreshRequest {
whitelist?: boolean;
}
export default class FilterRefreshRequest {
readonly _whitelist: boolean | undefined;
get whitelist(): boolean | undefined {
return this._whitelist;
}
constructor(props: IFilterRefreshRequest) {
if (typeof props.whitelist === 'boolean') {
this._whitelist = props.whitelist;
}
}
serialize(): IFilterRefreshRequest {
const data: IFilterRefreshRequest = {
};
if (typeof this._whitelist !== 'undefined') {
data.whitelist = this._whitelist;
}
return data;
}
validate(): string[] {
const validate = {
whitelist: !this._whitelist ? true : typeof this._whitelist === 'boolean',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IFilterRefreshRequest>): FilterRefreshRequest {
return new FilterRefreshRequest({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,45 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IFilterRefreshResponse {
updated?: number;
}
export default class FilterRefreshResponse {
readonly _updated: number | undefined;
get updated(): number | undefined {
return this._updated;
}
constructor(props: IFilterRefreshResponse) {
if (typeof props.updated === 'number') {
this._updated = props.updated;
}
}
serialize(): IFilterRefreshResponse {
const data: IFilterRefreshResponse = {
};
if (typeof this._updated !== 'undefined') {
data.updated = this._updated;
}
return data;
}
validate(): string[] {
const validate = {
updated: !this._updated ? true : typeof this._updated === 'number',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IFilterRefreshResponse>): FilterRefreshResponse {
return new FilterRefreshResponse({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,72 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IFilterSetUrl {
data?: any;
url?: string;
whitelist?: boolean;
}
export default class FilterSetUrl {
readonly _data: any | undefined;
get data(): any | undefined {
return this._data;
}
readonly _url: string | undefined;
get url(): string | undefined {
return this._url;
}
readonly _whitelist: boolean | undefined;
get whitelist(): boolean | undefined {
return this._whitelist;
}
constructor(props: IFilterSetUrl) {
if (props.data) {
this._data = props.data;
}
if (typeof props.url === 'string') {
this._url = props.url.trim();
}
if (typeof props.whitelist === 'boolean') {
this._whitelist = props.whitelist;
}
}
serialize(): IFilterSetUrl {
const data: IFilterSetUrl = {
};
if (typeof this._data !== 'undefined') {
data.data = this._data;
}
if (typeof this._url !== 'undefined') {
data.url = this._url;
}
if (typeof this._whitelist !== 'undefined') {
data.whitelist = this._whitelist;
}
return data;
}
validate(): string[] {
const validate = {
url: !this._url ? true : typeof this._url === 'string' && !this._url ? true : this._url,
whitelist: !this._whitelist ? true : typeof this._whitelist === 'boolean',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IFilterSetUrl>): FilterSetUrl {
return new FilterSetUrl({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,89 @@
import Filter, { IFilter } from './Filter';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IFilterStatus {
enabled?: boolean;
filters?: IFilter[];
interval?: number;
user_rules?: string[];
}
export default class FilterStatus {
readonly _enabled: boolean | undefined;
get enabled(): boolean | undefined {
return this._enabled;
}
readonly _filters: Filter[] | undefined;
get filters(): Filter[] | undefined {
return this._filters;
}
readonly _interval: number | undefined;
get interval(): number | undefined {
return this._interval;
}
readonly _user_rules: string[] | undefined;
get userRules(): string[] | undefined {
return this._user_rules;
}
constructor(props: IFilterStatus) {
if (typeof props.enabled === 'boolean') {
this._enabled = props.enabled;
}
if (props.filters) {
this._filters = props.filters.map((p) => new Filter(p));
}
if (typeof props.interval === 'number') {
this._interval = props.interval;
}
if (props.user_rules) {
this._user_rules = props.user_rules;
}
}
serialize(): IFilterStatus {
const data: IFilterStatus = {
};
if (typeof this._enabled !== 'undefined') {
data.enabled = this._enabled;
}
if (typeof this._filters !== 'undefined') {
data.filters = this._filters.map((p) => p.serialize());
}
if (typeof this._interval !== 'undefined') {
data.interval = this._interval;
}
if (typeof this._user_rules !== 'undefined') {
data.user_rules = this._user_rules;
}
return data;
}
validate(): string[] {
const validate = {
enabled: !this._enabled ? true : typeof this._enabled === 'boolean',
interval: !this._interval ? true : typeof this._interval === 'number',
filters: !this._filters ? true : this._filters.reduce((result, p) => result && p.validate().length === 0, true),
user_rules: !this._user_rules ? true : this._user_rules.reduce((result, p) => result && typeof p === 'string', true),
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IFilterStatus>): FilterStatus {
return new FilterStatus({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,46 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IGetVersionRequest {
recheck_now?: boolean;
}
export default class GetVersionRequest {
readonly _recheck_now: boolean | undefined;
/** */
get recheckNow(): boolean | undefined {
return this._recheck_now;
}
constructor(props: IGetVersionRequest) {
if (typeof props.recheck_now === 'boolean') {
this._recheck_now = props.recheck_now;
}
}
serialize(): IGetVersionRequest {
const data: IGetVersionRequest = {
};
if (typeof this._recheck_now !== 'undefined') {
data.recheck_now = this._recheck_now;
}
return data;
}
validate(): string[] {
const validate = {
recheck_now: !this._recheck_now ? true : typeof this._recheck_now === 'boolean',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IGetVersionRequest>): GetVersionRequest {
return new GetVersionRequest({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,89 @@
import AddressInfo, { IAddressInfo } from './AddressInfo';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IInitialConfiguration {
dns: IAddressInfo;
password: string;
username: string;
web: IAddressInfo;
}
export default class InitialConfiguration {
readonly _dns: AddressInfo;
get dns(): AddressInfo {
return this._dns;
}
readonly _password: string;
/**
* Description: Basic auth password
* Example: password
*/
get password(): string {
return this._password;
}
static passwordValidate(password: string): boolean {
return typeof password === 'string' && !!password.trim();
}
readonly _username: string;
/**
* Description: Basic auth username
* Example: admin
*/
get username(): string {
return this._username;
}
static usernameValidate(username: string): boolean {
return typeof username === 'string' && !!username.trim();
}
readonly _web: AddressInfo;
get web(): AddressInfo {
return this._web;
}
constructor(props: IInitialConfiguration) {
this._dns = new AddressInfo(props.dns);
this._password = props.password.trim();
this._username = props.username.trim();
this._web = new AddressInfo(props.web);
}
serialize(): IInitialConfiguration {
const data: IInitialConfiguration = {
dns: this._dns.serialize(),
password: this._password,
username: this._username,
web: this._web.serialize(),
};
return data;
}
validate(): string[] {
const validate = {
dns: this._dns.validate().length === 0,
web: this._web.validate().length === 0,
username: typeof this._username === 'string' && !this._username ? true : this._username,
password: typeof this._password === 'string' && !this._password ? true : this._password,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IInitialConfiguration>): InitialConfiguration {
return new InitialConfiguration({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,89 @@
import AddressInfoBeta, { IAddressInfoBeta } from './AddressInfoBeta';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IInitialConfigurationBeta {
dns: IAddressInfoBeta;
password: string;
username: string;
web: IAddressInfoBeta;
}
export default class InitialConfigurationBeta {
readonly _dns: AddressInfoBeta;
get dns(): AddressInfoBeta {
return this._dns;
}
readonly _password: string;
/**
* Description: Basic auth password
* Example: password
*/
get password(): string {
return this._password;
}
static passwordValidate(password: string): boolean {
return typeof password === 'string' && !!password.trim();
}
readonly _username: string;
/**
* Description: Basic auth username
* Example: admin
*/
get username(): string {
return this._username;
}
static usernameValidate(username: string): boolean {
return typeof username === 'string' && !!username.trim();
}
readonly _web: AddressInfoBeta;
get web(): AddressInfoBeta {
return this._web;
}
constructor(props: IInitialConfigurationBeta) {
this._dns = new AddressInfoBeta(props.dns);
this._password = props.password.trim();
this._username = props.username.trim();
this._web = new AddressInfoBeta(props.web);
}
serialize(): IInitialConfigurationBeta {
const data: IInitialConfigurationBeta = {
dns: this._dns.serialize(),
password: this._password,
username: this._username,
web: this._web.serialize(),
};
return data;
}
validate(): string[] {
const validate = {
dns: this._dns.validate().length === 0,
web: this._web.validate().length === 0,
username: typeof this._username === 'string' && !this._username ? true : this._username,
password: typeof this._password === 'string' && !this._password ? true : this._password,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IInitialConfigurationBeta>): InitialConfigurationBeta {
return new InitialConfigurationBeta({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,61 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface ILogin {
password?: string;
username?: string;
}
export default class Login {
readonly _password: string | undefined;
/** */
get password(): string | undefined {
return this._password;
}
readonly _username: string | undefined;
/** */
get username(): string | undefined {
return this._username;
}
constructor(props: ILogin) {
if (typeof props.password === 'string') {
this._password = props.password.trim();
}
if (typeof props.username === 'string') {
this._username = props.username.trim();
}
}
serialize(): ILogin {
const data: ILogin = {
};
if (typeof this._password !== 'undefined') {
data.password = this._password;
}
if (typeof this._username !== 'undefined') {
data.username = this._username;
}
return data;
}
validate(): string[] {
const validate = {
username: !this._username ? true : typeof this._username === 'string' && !this._username ? true : this._username,
password: !this._password ? true : typeof this._password === 'string' && !this._password ? true : this._password,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<ILogin>): Login {
return new Login({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,113 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface INetInterface {
flags: string;
hardware_address: string;
ip_addresses?: string[];
mtu: number;
name: string;
}
export default class NetInterface {
readonly _flags: string;
/**
* Description: undefined
* Example: up|broadcast|multicast
*/
get flags(): string {
return this._flags;
}
static flagsValidate(flags: string): boolean {
return typeof flags === 'string' && !!flags.trim();
}
readonly _hardware_address: string;
/**
* Description: undefined
* Example: 52:54:00:11:09:ba
*/
get hardwareAddress(): string {
return this._hardware_address;
}
static hardwareAddressValidate(hardwareAddress: string): boolean {
return typeof hardwareAddress === 'string' && !!hardwareAddress.trim();
}
readonly _ip_addresses: string[] | undefined;
get ipAddresses(): string[] | undefined {
return this._ip_addresses;
}
readonly _mtu: number;
get mtu(): number {
return this._mtu;
}
static mtuValidate(mtu: number): boolean {
return typeof mtu === 'number';
}
readonly _name: string;
/**
* Description: undefined
* Example: eth0
*/
get name(): string {
return this._name;
}
static nameValidate(name: string): boolean {
return typeof name === 'string' && !!name.trim();
}
constructor(props: INetInterface) {
this._flags = props.flags.trim();
this._hardware_address = props.hardware_address.trim();
if (props.ip_addresses) {
this._ip_addresses = props.ip_addresses;
}
this._mtu = props.mtu;
this._name = props.name.trim();
}
serialize(): INetInterface {
const data: INetInterface = {
flags: this._flags,
hardware_address: this._hardware_address,
mtu: this._mtu,
name: this._name,
};
if (typeof this._ip_addresses !== 'undefined') {
data.ip_addresses = this._ip_addresses;
}
return data;
}
validate(): string[] {
const validate = {
flags: typeof this._flags === 'string' && !this._flags ? true : this._flags,
hardware_address: typeof this._hardware_address === 'string' && !this._hardware_address ? true : this._hardware_address,
name: typeof this._name === 'string' && !this._name ? true : this._name,
ip_addresses: !this._ip_addresses ? true : this._ip_addresses.reduce((result, p) => result && typeof p === 'string', true),
mtu: typeof this._mtu === 'number',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<INetInterface>): NetInterface {
return new NetInterface({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,45 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IProfileInfo {
name?: string;
}
export default class ProfileInfo {
readonly _name: string | undefined;
get name(): string | undefined {
return this._name;
}
constructor(props: IProfileInfo) {
if (typeof props.name === 'string') {
this._name = props.name.trim();
}
}
serialize(): IProfileInfo {
const data: IProfileInfo = {
};
if (typeof this._name !== 'undefined') {
data.name = this._name;
}
return data;
}
validate(): string[] {
const validate = {
name: !this._name ? true : typeof this._name === 'string' && !this._name ? true : this._name,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IProfileInfo>): ProfileInfo {
return new ProfileInfo({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,65 @@
import QueryLogItem, { IQueryLogItem } from './QueryLogItem';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IQueryLog {
data?: IQueryLogItem[];
oldest?: string;
}
export default class QueryLog {
readonly _data: QueryLogItem[] | undefined;
get data(): QueryLogItem[] | undefined {
return this._data;
}
readonly _oldest: string | undefined;
/**
* Description: undefined
* Example: 2018-11-26T00:02:41+03:00
*/
get oldest(): string | undefined {
return this._oldest;
}
constructor(props: IQueryLog) {
if (props.data) {
this._data = props.data.map((p) => new QueryLogItem(p));
}
if (typeof props.oldest === 'string') {
this._oldest = props.oldest.trim();
}
}
serialize(): IQueryLog {
const data: IQueryLog = {
};
if (typeof this._data !== 'undefined') {
data.data = this._data.map((p) => p.serialize());
}
if (typeof this._oldest !== 'undefined') {
data.oldest = this._oldest;
}
return data;
}
validate(): string[] {
const validate = {
oldest: !this._oldest ? true : typeof this._oldest === 'string' && !this._oldest ? true : this._oldest,
data: !this._data ? true : this._data.reduce((result, p) => result && p.validate().length === 0, true),
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IQueryLog>): QueryLog {
return new QueryLog({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,76 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IQueryLogConfig {
anonymize_client_ip?: boolean;
enabled?: boolean;
interval?: number;
}
export default class QueryLogConfig {
readonly _anonymize_client_ip: boolean | undefined;
/** */
get anonymizeClientIp(): boolean | undefined {
return this._anonymize_client_ip;
}
readonly _enabled: boolean | undefined;
/** */
get enabled(): boolean | undefined {
return this._enabled;
}
readonly _interval: number | undefined;
/** */
get interval(): number | undefined {
return this._interval;
}
constructor(props: IQueryLogConfig) {
if (typeof props.anonymize_client_ip === 'boolean') {
this._anonymize_client_ip = props.anonymize_client_ip;
}
if (typeof props.enabled === 'boolean') {
this._enabled = props.enabled;
}
if (typeof props.interval === 'number') {
this._interval = props.interval;
}
}
serialize(): IQueryLogConfig {
const data: IQueryLogConfig = {
};
if (typeof this._anonymize_client_ip !== 'undefined') {
data.anonymize_client_ip = this._anonymize_client_ip;
}
if (typeof this._enabled !== 'undefined') {
data.enabled = this._enabled;
}
if (typeof this._interval !== 'undefined') {
data.interval = this._interval;
}
return data;
}
validate(): string[] {
const validate = {
enabled: !this._enabled ? true : typeof this._enabled === 'boolean',
interval: !this._interval ? true : typeof this._interval === 'number',
anonymize_client_ip: !this._anonymize_client_ip ? true : typeof this._anonymize_client_ip === 'boolean',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IQueryLogConfig>): QueryLogConfig {
return new QueryLogConfig({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,277 @@
import DnsAnswer, { IDnsAnswer } from './DnsAnswer';
import DnsQuestion, { IDnsQuestion } from './DnsQuestion';
import ResultRule, { IResultRule } from './ResultRule';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IQueryLogItem {
answer?: IDnsAnswer[];
answer_dnssec?: boolean;
client?: string;
client_proto?: any;
elapsedMs?: string;
filterId?: number;
original_answer?: IDnsAnswer[];
question?: IDnsQuestion;
reason?: string;
rule?: string;
rules?: IResultRule[];
service_name?: string;
status?: string;
time?: string;
upstream?: string;
}
export default class QueryLogItem {
readonly _answer: DnsAnswer[] | undefined;
get answer(): DnsAnswer[] | undefined {
return this._answer;
}
readonly _answer_dnssec: boolean | undefined;
get answerDnssec(): boolean | undefined {
return this._answer_dnssec;
}
readonly _client: string | undefined;
/**
* Description: undefined
* Example: 192.168.0.1
*/
get client(): string | undefined {
return this._client;
}
readonly _client_proto: any | undefined;
get clientProto(): any | undefined {
return this._client_proto;
}
readonly _elapsedMs: string | undefined;
/**
* Description: undefined
* Example: 54.023928
*/
get elapsedMs(): string | undefined {
return this._elapsedMs;
}
readonly _filterId: number | undefined;
/**
* Description: In case if there's a rule applied to this DNS request, this is ID of the filter list that the rule belongs to.
* Deprecated: use `rules[*].filter_list_id` instead.
*
* Example: 123123
*/
get filterId(): number | undefined {
return this._filterId;
}
readonly _original_answer: DnsAnswer[] | undefined;
/** */
get originalAnswer(): DnsAnswer[] | undefined {
return this._original_answer;
}
readonly _question: DnsQuestion | undefined;
get question(): DnsQuestion | undefined {
return this._question;
}
readonly _reason: string | undefined;
/** */
get reason(): string | undefined {
return this._reason;
}
readonly _rule: string | undefined;
/**
* Description: Filtering rule applied to the request (if any).
* Deprecated: use `rules[*].text` instead.
*
* Example: ||example.org^
*/
get rule(): string | undefined {
return this._rule;
}
readonly _rules: ResultRule[] | undefined;
/** */
get rules(): ResultRule[] | undefined {
return this._rules;
}
readonly _service_name: string | undefined;
/** */
get serviceName(): string | undefined {
return this._service_name;
}
readonly _status: string | undefined;
/**
* Description: DNS response status
* Example: NOERROR
*/
get status(): string | undefined {
return this._status;
}
readonly _time: string | undefined;
/**
* Description: DNS request processing start time
* Example: 2018-11-26T00:02:41+03:00
*/
get time(): string | undefined {
return this._time;
}
readonly _upstream: string | undefined;
/** */
get upstream(): string | undefined {
return this._upstream;
}
constructor(props: IQueryLogItem) {
if (props.answer) {
this._answer = props.answer.map((p) => new DnsAnswer(p));
}
if (typeof props.answer_dnssec === 'boolean') {
this._answer_dnssec = props.answer_dnssec;
}
if (typeof props.client === 'string') {
this._client = props.client.trim();
}
if (props.client_proto) {
this._client_proto = props.client_proto;
}
if (typeof props.elapsedMs === 'string') {
this._elapsedMs = props.elapsedMs.trim();
}
if (typeof props.filterId === 'number') {
this._filterId = props.filterId;
}
if (props.original_answer) {
this._original_answer = props.original_answer.map((p) => new DnsAnswer(p));
}
if (props.question) {
this._question = new DnsQuestion(props.question);
}
if (typeof props.reason === 'string') {
this._reason = props.reason.trim();
}
if (typeof props.rule === 'string') {
this._rule = props.rule.trim();
}
if (props.rules) {
this._rules = props.rules.map((p) => new ResultRule(p));
}
if (typeof props.service_name === 'string') {
this._service_name = props.service_name.trim();
}
if (typeof props.status === 'string') {
this._status = props.status.trim();
}
if (typeof props.time === 'string') {
this._time = props.time.trim();
}
if (typeof props.upstream === 'string') {
this._upstream = props.upstream.trim();
}
}
serialize(): IQueryLogItem {
const data: IQueryLogItem = {
};
if (typeof this._answer !== 'undefined') {
data.answer = this._answer.map((p) => p.serialize());
}
if (typeof this._answer_dnssec !== 'undefined') {
data.answer_dnssec = this._answer_dnssec;
}
if (typeof this._client !== 'undefined') {
data.client = this._client;
}
if (typeof this._client_proto !== 'undefined') {
data.client_proto = this._client_proto;
}
if (typeof this._elapsedMs !== 'undefined') {
data.elapsedMs = this._elapsedMs;
}
if (typeof this._filterId !== 'undefined') {
data.filterId = this._filterId;
}
if (typeof this._original_answer !== 'undefined') {
data.original_answer = this._original_answer.map((p) => p.serialize());
}
if (typeof this._question !== 'undefined') {
data.question = this._question.serialize();
}
if (typeof this._reason !== 'undefined') {
data.reason = this._reason;
}
if (typeof this._rule !== 'undefined') {
data.rule = this._rule;
}
if (typeof this._rules !== 'undefined') {
data.rules = this._rules.map((p) => p.serialize());
}
if (typeof this._service_name !== 'undefined') {
data.service_name = this._service_name;
}
if (typeof this._status !== 'undefined') {
data.status = this._status;
}
if (typeof this._time !== 'undefined') {
data.time = this._time;
}
if (typeof this._upstream !== 'undefined') {
data.upstream = this._upstream;
}
return data;
}
validate(): string[] {
const validate = {
answer: !this._answer ? true : this._answer.reduce((result, p) => result && p.validate().length === 0, true),
original_answer: !this._original_answer ? true : this._original_answer.reduce((result, p) => result && p.validate().length === 0, true),
upstream: !this._upstream ? true : typeof this._upstream === 'string' && !this._upstream ? true : this._upstream,
answer_dnssec: !this._answer_dnssec ? true : typeof this._answer_dnssec === 'boolean',
client: !this._client ? true : typeof this._client === 'string' && !this._client ? true : this._client,
elapsedMs: !this._elapsedMs ? true : typeof this._elapsedMs === 'string' && !this._elapsedMs ? true : this._elapsedMs,
question: !this._question ? true : this._question.validate().length === 0,
filterId: !this._filterId ? true : typeof this._filterId === 'number',
rule: !this._rule ? true : typeof this._rule === 'string' && !this._rule ? true : this._rule,
rules: !this._rules ? true : this._rules.reduce((result, p) => result && p.validate().length === 0, true),
reason: !this._reason ? true : typeof this._reason === 'string' && !this._reason ? true : this._reason,
service_name: !this._service_name ? true : typeof this._service_name === 'string' && !this._service_name ? true : this._service_name,
status: !this._status ? true : typeof this._status === 'string' && !this._status ? true : this._status,
time: !this._time ? true : typeof this._time === 'string' && !this._time ? true : this._time,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IQueryLogItem>): QueryLogItem {
return new QueryLogItem({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,49 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IRemoveUrlRequest {
url?: string;
}
export default class RemoveUrlRequest {
readonly _url: string | undefined;
/**
* Description: Previously added URL containing filtering rules
* Example: https://filters.adtidy.org/windows/filters/15.txt
*/
get url(): string | undefined {
return this._url;
}
constructor(props: IRemoveUrlRequest) {
if (typeof props.url === 'string') {
this._url = props.url.trim();
}
}
serialize(): IRemoveUrlRequest {
const data: IRemoveUrlRequest = {
};
if (typeof this._url !== 'undefined') {
data.url = this._url;
}
return data;
}
validate(): string[] {
const validate = {
url: !this._url ? true : typeof this._url === 'string' && !this._url ? true : this._url,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IRemoveUrlRequest>): RemoveUrlRequest {
return new RemoveUrlRequest({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,69 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IResultRule {
filter_list_id?: number;
text?: string;
}
export default class ResultRule {
readonly _filter_list_id: number | undefined;
/**
* Description: In case if there's a rule applied to this DNS request, this is ID of the filter list that the rule belongs to.
*
* Example: 123123
*/
get filterListId(): number | undefined {
return this._filter_list_id;
}
readonly _text: string | undefined;
/**
* Description: The text of the filtering rule applied to the request (if any).
*
* Example: ||example.org^
*/
get text(): string | undefined {
return this._text;
}
constructor(props: IResultRule) {
if (typeof props.filter_list_id === 'number') {
this._filter_list_id = props.filter_list_id;
}
if (typeof props.text === 'string') {
this._text = props.text.trim();
}
}
serialize(): IResultRule {
const data: IResultRule = {
};
if (typeof this._filter_list_id !== 'undefined') {
data.filter_list_id = this._filter_list_id;
}
if (typeof this._text !== 'undefined') {
data.text = this._text;
}
return data;
}
validate(): string[] {
const validate = {
filter_list_id: !this._filter_list_id ? true : typeof this._filter_list_id === 'number',
text: !this._text ? true : typeof this._text === 'string' && !this._text ? true : this._text,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IResultRule>): ResultRule {
return new ResultRule({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,67 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IRewriteEntry {
answer?: string;
domain?: string;
}
export default class RewriteEntry {
readonly _answer: string | undefined;
/**
* Description: value of A, AAAA or CNAME DNS record
* Example: 127.0.0.1
*/
get answer(): string | undefined {
return this._answer;
}
readonly _domain: string | undefined;
/**
* Description: Domain name
* Example: example.org
*/
get domain(): string | undefined {
return this._domain;
}
constructor(props: IRewriteEntry) {
if (typeof props.answer === 'string') {
this._answer = props.answer.trim();
}
if (typeof props.domain === 'string') {
this._domain = props.domain.trim();
}
}
serialize(): IRewriteEntry {
const data: IRewriteEntry = {
};
if (typeof this._answer !== 'undefined') {
data.answer = this._answer;
}
if (typeof this._domain !== 'undefined') {
data.domain = this._domain;
}
return data;
}
validate(): string[] {
const validate = {
domain: !this._domain ? true : typeof this._domain === 'string' && !this._domain ? true : this._domain,
answer: !this._answer ? true : typeof this._answer === 'string' && !this._answer ? true : this._answer,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IRewriteEntry>): RewriteEntry {
return new RewriteEntry({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,31 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IRewriteList {
}
export default class RewriteList {
constructor(props: IRewriteList) {
}
serialize(): IRewriteList {
const data: IRewriteList = {
};
return data;
}
validate(): string[] {
const validate = {
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IRewriteList>): RewriteList {
return new RewriteList({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,167 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IServerStatus {
dhcp_available?: boolean;
dns_address: string;
dns_port: number;
language: string;
protection_enabled: boolean;
querylog_enabled: boolean;
running: boolean;
version: string;
}
export default class ServerStatus {
readonly _dhcp_available: boolean | undefined;
get dhcpAvailable(): boolean | undefined {
return this._dhcp_available;
}
readonly _dns_address: string;
/**
* Description: undefined
* Example: 127.0.0.1
*/
get dnsAddress(): string {
return this._dns_address;
}
static dnsAddressValidate(dnsAddress: string): boolean {
return typeof dnsAddress === 'string' && !!dnsAddress.trim();
}
readonly _dns_port: number;
/**
* Description: undefined
* Example: 53
*/
get dnsPort(): number {
return this._dns_port;
}
static get dnsPortMinValue() {
return 1;
}
static get dnsPortMaxValue() {
return 65535;
}
static dnsPortValidate(dnsPort: number): boolean {
return dnsPort >= 1 && dnsPort <= 65535;
}
readonly _language: string;
/**
* Description: undefined
* Example: en
*/
get language(): string {
return this._language;
}
static languageValidate(language: string): boolean {
return typeof language === 'string' && !!language.trim();
}
readonly _protection_enabled: boolean;
get protectionEnabled(): boolean {
return this._protection_enabled;
}
static protectionEnabledValidate(protectionEnabled: boolean): boolean {
return typeof protectionEnabled === 'boolean';
}
readonly _querylog_enabled: boolean;
get querylogEnabled(): boolean {
return this._querylog_enabled;
}
static querylogEnabledValidate(querylogEnabled: boolean): boolean {
return typeof querylogEnabled === 'boolean';
}
readonly _running: boolean;
get running(): boolean {
return this._running;
}
static runningValidate(running: boolean): boolean {
return typeof running === 'boolean';
}
readonly _version: string;
/**
* Description: undefined
* Example: 0.1
*/
get version(): string {
return this._version;
}
static versionValidate(version: string): boolean {
return typeof version === 'string' && !!version.trim();
}
constructor(props: IServerStatus) {
if (typeof props.dhcp_available === 'boolean') {
this._dhcp_available = props.dhcp_available;
}
this._dns_address = props.dns_address.trim();
this._dns_port = props.dns_port;
this._language = props.language.trim();
this._protection_enabled = props.protection_enabled;
this._querylog_enabled = props.querylog_enabled;
this._running = props.running;
this._version = props.version.trim();
}
serialize(): IServerStatus {
const data: IServerStatus = {
dns_address: this._dns_address,
dns_port: this._dns_port,
language: this._language,
protection_enabled: this._protection_enabled,
querylog_enabled: this._querylog_enabled,
running: this._running,
version: this._version,
};
if (typeof this._dhcp_available !== 'undefined') {
data.dhcp_available = this._dhcp_available;
}
return data;
}
validate(): string[] {
const validate = {
dns_address: typeof this._dns_address === 'string' && !this._dns_address ? true : this._dns_address,
dns_port: this._dns_port >= 1 && this._dns_port <= 65535,
protection_enabled: typeof this._protection_enabled === 'boolean',
dhcp_available: !this._dhcp_available ? true : typeof this._dhcp_available === 'boolean',
querylog_enabled: typeof this._querylog_enabled === 'boolean',
running: typeof this._running === 'boolean',
version: typeof this._version === 'string' && !this._version ? true : this._version,
language: typeof this._language === 'string' && !this._language ? true : this._language,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IServerStatus>): ServerStatus {
return new ServerStatus({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,257 @@
import TopArrayEntry, { ITopArrayEntry } from './TopArrayEntry';
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IStats {
avg_processing_time?: number;
blocked_filtering?: number[];
dns_queries?: number[];
num_blocked_filtering?: number;
num_dns_queries?: number;
num_replaced_parental?: number;
num_replaced_safebrowsing?: number;
num_replaced_safesearch?: number;
replaced_parental?: number[];
replaced_safebrowsing?: number[];
time_units?: string;
top_blocked_domains?: ITopArrayEntry[];
top_clients?: ITopArrayEntry[];
top_queried_domains?: ITopArrayEntry[];
}
export default class Stats {
readonly _avg_processing_time: number | undefined;
/**
* Description: Average time in milliseconds on processing a DNS
* Example: 0.34
*/
get avgProcessingTime(): number | undefined {
return this._avg_processing_time;
}
readonly _blocked_filtering: number[] | undefined;
get blockedFiltering(): number[] | undefined {
return this._blocked_filtering;
}
readonly _dns_queries: number[] | undefined;
get dnsQueries(): number[] | undefined {
return this._dns_queries;
}
readonly _num_blocked_filtering: number | undefined;
/**
* Description: Number of requests blocked by filtering rules
* Example: 50
*/
get numBlockedFiltering(): number | undefined {
return this._num_blocked_filtering;
}
readonly _num_dns_queries: number | undefined;
/**
* Description: Total number of DNS queries
* Example: 123
*/
get numDnsQueries(): number | undefined {
return this._num_dns_queries;
}
readonly _num_replaced_parental: number | undefined;
/**
* Description: Number of blocked adult websites
* Example: 15
*/
get numReplacedParental(): number | undefined {
return this._num_replaced_parental;
}
readonly _num_replaced_safebrowsing: number | undefined;
/**
* Description: Number of requests blocked by safebrowsing module
* Example: 5
*/
get numReplacedSafebrowsing(): number | undefined {
return this._num_replaced_safebrowsing;
}
readonly _num_replaced_safesearch: number | undefined;
/**
* Description: Number of requests blocked by safesearch module
* Example: 5
*/
get numReplacedSafesearch(): number | undefined {
return this._num_replaced_safesearch;
}
readonly _replaced_parental: number[] | undefined;
get replacedParental(): number[] | undefined {
return this._replaced_parental;
}
readonly _replaced_safebrowsing: number[] | undefined;
get replacedSafebrowsing(): number[] | undefined {
return this._replaced_safebrowsing;
}
readonly _time_units: string | undefined;
/**
* Description: Time units (hours | days)
* Example: hours
*/
get timeUnits(): string | undefined {
return this._time_units;
}
readonly _top_blocked_domains: TopArrayEntry[] | undefined;
get topBlockedDomains(): TopArrayEntry[] | undefined {
return this._top_blocked_domains;
}
readonly _top_clients: TopArrayEntry[] | undefined;
get topClients(): TopArrayEntry[] | undefined {
return this._top_clients;
}
readonly _top_queried_domains: TopArrayEntry[] | undefined;
get topQueriedDomains(): TopArrayEntry[] | undefined {
return this._top_queried_domains;
}
constructor(props: IStats) {
if (typeof props.avg_processing_time === 'number') {
this._avg_processing_time = props.avg_processing_time;
}
if (props.blocked_filtering) {
this._blocked_filtering = props.blocked_filtering;
}
if (props.dns_queries) {
this._dns_queries = props.dns_queries;
}
if (typeof props.num_blocked_filtering === 'number') {
this._num_blocked_filtering = props.num_blocked_filtering;
}
if (typeof props.num_dns_queries === 'number') {
this._num_dns_queries = props.num_dns_queries;
}
if (typeof props.num_replaced_parental === 'number') {
this._num_replaced_parental = props.num_replaced_parental;
}
if (typeof props.num_replaced_safebrowsing === 'number') {
this._num_replaced_safebrowsing = props.num_replaced_safebrowsing;
}
if (typeof props.num_replaced_safesearch === 'number') {
this._num_replaced_safesearch = props.num_replaced_safesearch;
}
if (props.replaced_parental) {
this._replaced_parental = props.replaced_parental;
}
if (props.replaced_safebrowsing) {
this._replaced_safebrowsing = props.replaced_safebrowsing;
}
if (typeof props.time_units === 'string') {
this._time_units = props.time_units.trim();
}
if (props.top_blocked_domains) {
this._top_blocked_domains = props.top_blocked_domains.map((p) => new TopArrayEntry(p));
}
if (props.top_clients) {
this._top_clients = props.top_clients.map((p) => new TopArrayEntry(p));
}
if (props.top_queried_domains) {
this._top_queried_domains = props.top_queried_domains.map((p) => new TopArrayEntry(p));
}
}
serialize(): IStats {
const data: IStats = {
};
if (typeof this._avg_processing_time !== 'undefined') {
data.avg_processing_time = this._avg_processing_time;
}
if (typeof this._blocked_filtering !== 'undefined') {
data.blocked_filtering = this._blocked_filtering;
}
if (typeof this._dns_queries !== 'undefined') {
data.dns_queries = this._dns_queries;
}
if (typeof this._num_blocked_filtering !== 'undefined') {
data.num_blocked_filtering = this._num_blocked_filtering;
}
if (typeof this._num_dns_queries !== 'undefined') {
data.num_dns_queries = this._num_dns_queries;
}
if (typeof this._num_replaced_parental !== 'undefined') {
data.num_replaced_parental = this._num_replaced_parental;
}
if (typeof this._num_replaced_safebrowsing !== 'undefined') {
data.num_replaced_safebrowsing = this._num_replaced_safebrowsing;
}
if (typeof this._num_replaced_safesearch !== 'undefined') {
data.num_replaced_safesearch = this._num_replaced_safesearch;
}
if (typeof this._replaced_parental !== 'undefined') {
data.replaced_parental = this._replaced_parental;
}
if (typeof this._replaced_safebrowsing !== 'undefined') {
data.replaced_safebrowsing = this._replaced_safebrowsing;
}
if (typeof this._time_units !== 'undefined') {
data.time_units = this._time_units;
}
if (typeof this._top_blocked_domains !== 'undefined') {
data.top_blocked_domains = this._top_blocked_domains.map((p) => p.serialize());
}
if (typeof this._top_clients !== 'undefined') {
data.top_clients = this._top_clients.map((p) => p.serialize());
}
if (typeof this._top_queried_domains !== 'undefined') {
data.top_queried_domains = this._top_queried_domains.map((p) => p.serialize());
}
return data;
}
validate(): string[] {
const validate = {
time_units: !this._time_units ? true : typeof this._time_units === 'string' && !this._time_units ? true : this._time_units,
num_dns_queries: !this._num_dns_queries ? true : typeof this._num_dns_queries === 'number',
num_blocked_filtering: !this._num_blocked_filtering ? true : typeof this._num_blocked_filtering === 'number',
num_replaced_safebrowsing: !this._num_replaced_safebrowsing ? true : typeof this._num_replaced_safebrowsing === 'number',
num_replaced_safesearch: !this._num_replaced_safesearch ? true : typeof this._num_replaced_safesearch === 'number',
num_replaced_parental: !this._num_replaced_parental ? true : typeof this._num_replaced_parental === 'number',
avg_processing_time: !this._avg_processing_time ? true : typeof this._avg_processing_time === 'number',
top_queried_domains: !this._top_queried_domains ? true : this._top_queried_domains.reduce((result, p) => result && p.validate().length === 0, true),
top_clients: !this._top_clients ? true : this._top_clients.reduce((result, p) => result && p.validate().length === 0, true),
top_blocked_domains: !this._top_blocked_domains ? true : this._top_blocked_domains.reduce((result, p) => result && p.validate().length === 0, true),
dns_queries: !this._dns_queries ? true : this._dns_queries.reduce((result, p) => result && typeof p === 'number', true),
blocked_filtering: !this._blocked_filtering ? true : this._blocked_filtering.reduce((result, p) => result && typeof p === 'number', true),
replaced_safebrowsing: !this._replaced_safebrowsing ? true : this._replaced_safebrowsing.reduce((result, p) => result && typeof p === 'number', true),
replaced_parental: !this._replaced_parental ? true : this._replaced_parental.reduce((result, p) => result && typeof p === 'number', true),
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IStats>): Stats {
return new Stats({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,46 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IStatsConfig {
interval?: number;
}
export default class StatsConfig {
readonly _interval: number | undefined;
/** */
get interval(): number | undefined {
return this._interval;
}
constructor(props: IStatsConfig) {
if (typeof props.interval === 'number') {
this._interval = props.interval;
}
}
serialize(): IStatsConfig {
const data: IStatsConfig = {
};
if (typeof this._interval !== 'undefined') {
data.interval = this._interval;
}
return data;
}
validate(): string[] {
const validate = {
interval: !this._interval ? true : typeof this._interval === 'number',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IStatsConfig>): StatsConfig {
return new StatsConfig({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,404 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface ITlsConfig {
certificate_chain?: string;
certificate_path?: string;
dns_names?: string[];
enabled?: boolean;
force_https?: boolean;
issuer?: string;
key_type?: string;
not_after?: string;
not_before?: string;
port_dns_over_quic?: number;
port_dns_over_tls?: number;
port_https?: number;
private_key?: string;
private_key_path?: string;
server_name?: string;
subject?: string;
valid_cert?: boolean;
valid_chain?: boolean;
valid_key?: boolean;
valid_pair?: boolean;
warning_validation?: string;
}
export default class TlsConfig {
readonly _certificate_chain: string | undefined;
/** */
get certificateChain(): string | undefined {
return this._certificate_chain;
}
readonly _certificate_path: string | undefined;
/** */
get certificatePath(): string | undefined {
return this._certificate_path;
}
readonly _dns_names: string[] | undefined;
/**
* Description: The value of SubjectAltNames field of the first certificate in the chain.
*
* Example: *.example.org
*/
get dnsNames(): string[] | undefined {
return this._dns_names;
}
readonly _enabled: boolean | undefined;
/**
* Description: enabled is the encryption (DOT/DOH/HTTPS) status
* Example: true
*/
get enabled(): boolean | undefined {
return this._enabled;
}
readonly _force_https: boolean | undefined;
/**
* Description: if true, forces HTTP->HTTPS redirect
* Example: true
*/
get forceHttps(): boolean | undefined {
return this._force_https;
}
readonly _issuer: string | undefined;
/**
* Description: The issuer of the first certificate in the chain.
* Example: CN=Let's Encrypt Authority X3,O=Let's Encrypt,C=US
*/
get issuer(): string | undefined {
return this._issuer;
}
readonly _key_type: string | undefined;
/**
* Description: Key type.
* Example: RSA
*/
get keyType(): string | undefined {
return this._key_type;
}
readonly _not_after: string | undefined;
/**
* Description: The NotAfter field of the first certificate in the chain.
*
* Example: 2019-05-01T10:47:32Z
*/
get notAfter(): string | undefined {
return this._not_after;
}
readonly _not_before: string | undefined;
/**
* Description: The NotBefore field of the first certificate in the chain.
*
* Example: 2019-01-31T10:47:32Z
*/
get notBefore(): string | undefined {
return this._not_before;
}
readonly _port_dns_over_quic: number | undefined;
/**
* Description: DNS-over-QUIC port. If 0, DOQ will be disabled.
* Example: 784
*/
get portDnsOverQuic(): number | undefined {
return this._port_dns_over_quic;
}
readonly _port_dns_over_tls: number | undefined;
/**
* Description: DNS-over-TLS port. If 0, DOT will be disabled.
* Example: 853
*/
get portDnsOverTls(): number | undefined {
return this._port_dns_over_tls;
}
readonly _port_https: number | undefined;
/**
* Description: HTTPS port. If 0, HTTPS will be disabled.
* Example: 443
*/
get portHttps(): number | undefined {
return this._port_https;
}
readonly _private_key: string | undefined;
/** */
get privateKey(): string | undefined {
return this._private_key;
}
readonly _private_key_path: string | undefined;
/** */
get privateKeyPath(): string | undefined {
return this._private_key_path;
}
readonly _server_name: string | undefined;
/**
* Description: server_name is the hostname of your HTTPS/TLS server
* Example: example.org
*/
get serverName(): string | undefined {
return this._server_name;
}
readonly _subject: string | undefined;
/**
* Description: The subject of the first certificate in the chain.
* Example: CN=example.org
*/
get subject(): string | undefined {
return this._subject;
}
readonly _valid_cert: boolean | undefined;
/**
* Description: Set to true if the specified certificates chain is a valid chain of X509 certificates.
*
* Example: true
*/
get validCert(): boolean | undefined {
return this._valid_cert;
}
readonly _valid_chain: boolean | undefined;
/**
* Description: Set to true if the specified certificates chain is verified and issued by a known CA.
*
* Example: true
*/
get validChain(): boolean | undefined {
return this._valid_chain;
}
readonly _valid_key: boolean | undefined;
/**
* Description: Set to true if the key is a valid private key.
* Example: true
*/
get validKey(): boolean | undefined {
return this._valid_key;
}
readonly _valid_pair: boolean | undefined;
/**
* Description: Set to true if both certificate and private key are correct.
*
* Example: true
*/
get validPair(): boolean | undefined {
return this._valid_pair;
}
readonly _warning_validation: string | undefined;
/**
* Description: A validation warning message with the issue description.
*
* Example: You have specified an empty certificate
*/
get warningValidation(): string | undefined {
return this._warning_validation;
}
constructor(props: ITlsConfig) {
if (typeof props.certificate_chain === 'string') {
this._certificate_chain = props.certificate_chain.trim();
}
if (typeof props.certificate_path === 'string') {
this._certificate_path = props.certificate_path.trim();
}
if (props.dns_names) {
this._dns_names = props.dns_names;
}
if (typeof props.enabled === 'boolean') {
this._enabled = props.enabled;
}
if (typeof props.force_https === 'boolean') {
this._force_https = props.force_https;
}
if (typeof props.issuer === 'string') {
this._issuer = props.issuer.trim();
}
if (typeof props.key_type === 'string') {
this._key_type = props.key_type.trim();
}
if (typeof props.not_after === 'string') {
this._not_after = props.not_after.trim();
}
if (typeof props.not_before === 'string') {
this._not_before = props.not_before.trim();
}
if (typeof props.port_dns_over_quic === 'number') {
this._port_dns_over_quic = props.port_dns_over_quic;
}
if (typeof props.port_dns_over_tls === 'number') {
this._port_dns_over_tls = props.port_dns_over_tls;
}
if (typeof props.port_https === 'number') {
this._port_https = props.port_https;
}
if (typeof props.private_key === 'string') {
this._private_key = props.private_key.trim();
}
if (typeof props.private_key_path === 'string') {
this._private_key_path = props.private_key_path.trim();
}
if (typeof props.server_name === 'string') {
this._server_name = props.server_name.trim();
}
if (typeof props.subject === 'string') {
this._subject = props.subject.trim();
}
if (typeof props.valid_cert === 'boolean') {
this._valid_cert = props.valid_cert;
}
if (typeof props.valid_chain === 'boolean') {
this._valid_chain = props.valid_chain;
}
if (typeof props.valid_key === 'boolean') {
this._valid_key = props.valid_key;
}
if (typeof props.valid_pair === 'boolean') {
this._valid_pair = props.valid_pair;
}
if (typeof props.warning_validation === 'string') {
this._warning_validation = props.warning_validation.trim();
}
}
serialize(): ITlsConfig {
const data: ITlsConfig = {
};
if (typeof this._certificate_chain !== 'undefined') {
data.certificate_chain = this._certificate_chain;
}
if (typeof this._certificate_path !== 'undefined') {
data.certificate_path = this._certificate_path;
}
if (typeof this._dns_names !== 'undefined') {
data.dns_names = this._dns_names;
}
if (typeof this._enabled !== 'undefined') {
data.enabled = this._enabled;
}
if (typeof this._force_https !== 'undefined') {
data.force_https = this._force_https;
}
if (typeof this._issuer !== 'undefined') {
data.issuer = this._issuer;
}
if (typeof this._key_type !== 'undefined') {
data.key_type = this._key_type;
}
if (typeof this._not_after !== 'undefined') {
data.not_after = this._not_after;
}
if (typeof this._not_before !== 'undefined') {
data.not_before = this._not_before;
}
if (typeof this._port_dns_over_quic !== 'undefined') {
data.port_dns_over_quic = this._port_dns_over_quic;
}
if (typeof this._port_dns_over_tls !== 'undefined') {
data.port_dns_over_tls = this._port_dns_over_tls;
}
if (typeof this._port_https !== 'undefined') {
data.port_https = this._port_https;
}
if (typeof this._private_key !== 'undefined') {
data.private_key = this._private_key;
}
if (typeof this._private_key_path !== 'undefined') {
data.private_key_path = this._private_key_path;
}
if (typeof this._server_name !== 'undefined') {
data.server_name = this._server_name;
}
if (typeof this._subject !== 'undefined') {
data.subject = this._subject;
}
if (typeof this._valid_cert !== 'undefined') {
data.valid_cert = this._valid_cert;
}
if (typeof this._valid_chain !== 'undefined') {
data.valid_chain = this._valid_chain;
}
if (typeof this._valid_key !== 'undefined') {
data.valid_key = this._valid_key;
}
if (typeof this._valid_pair !== 'undefined') {
data.valid_pair = this._valid_pair;
}
if (typeof this._warning_validation !== 'undefined') {
data.warning_validation = this._warning_validation;
}
return data;
}
validate(): string[] {
const validate = {
enabled: !this._enabled ? true : typeof this._enabled === 'boolean',
server_name: !this._server_name ? true : typeof this._server_name === 'string' && !this._server_name ? true : this._server_name,
force_https: !this._force_https ? true : typeof this._force_https === 'boolean',
port_https: !this._port_https ? true : typeof this._port_https === 'number',
port_dns_over_tls: !this._port_dns_over_tls ? true : typeof this._port_dns_over_tls === 'number',
port_dns_over_quic: !this._port_dns_over_quic ? true : typeof this._port_dns_over_quic === 'number',
certificate_chain: !this._certificate_chain ? true : typeof this._certificate_chain === 'string' && !this._certificate_chain ? true : this._certificate_chain,
private_key: !this._private_key ? true : typeof this._private_key === 'string' && !this._private_key ? true : this._private_key,
certificate_path: !this._certificate_path ? true : typeof this._certificate_path === 'string' && !this._certificate_path ? true : this._certificate_path,
private_key_path: !this._private_key_path ? true : typeof this._private_key_path === 'string' && !this._private_key_path ? true : this._private_key_path,
valid_cert: !this._valid_cert ? true : typeof this._valid_cert === 'boolean',
valid_chain: !this._valid_chain ? true : typeof this._valid_chain === 'boolean',
subject: !this._subject ? true : typeof this._subject === 'string' && !this._subject ? true : this._subject,
issuer: !this._issuer ? true : typeof this._issuer === 'string' && !this._issuer ? true : this._issuer,
not_before: !this._not_before ? true : typeof this._not_before === 'string' && !this._not_before ? true : this._not_before,
not_after: !this._not_after ? true : typeof this._not_after === 'string' && !this._not_after ? true : this._not_after,
dns_names: !this._dns_names ? true : this._dns_names.reduce((result, p) => result && typeof p === 'string', true),
valid_key: !this._valid_key ? true : typeof this._valid_key === 'boolean',
key_type: !this._key_type ? true : typeof this._key_type === 'string' && !this._key_type ? true : this._key_type,
warning_validation: !this._warning_validation ? true : typeof this._warning_validation === 'string' && !this._warning_validation ? true : this._warning_validation,
valid_pair: !this._valid_pair ? true : typeof this._valid_pair === 'boolean',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<ITlsConfig>): TlsConfig {
return new TlsConfig({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,45 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface ITopArrayEntry {
domain_or_ip?: number;
}
export default class TopArrayEntry {
readonly _domain_or_ip: number | undefined;
get domainOrIp(): number | undefined {
return this._domain_or_ip;
}
constructor(props: ITopArrayEntry) {
if (typeof props.domain_or_ip === 'number') {
this._domain_or_ip = props.domain_or_ip;
}
}
serialize(): ITopArrayEntry {
const data: ITopArrayEntry = {
};
if (typeof this._domain_or_ip !== 'undefined') {
data.domain_or_ip = this._domain_or_ip;
}
return data;
}
validate(): string[] {
const validate = {
domain_or_ip: !this._domain_or_ip ? true : typeof this._domain_or_ip === 'number',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<ITopArrayEntry>): TopArrayEntry {
return new TopArrayEntry({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,69 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IUpstreamsConfig {
bootstrap_dns: string[];
upstream_dns: string[];
}
export default class UpstreamsConfig {
readonly _bootstrap_dns: string[];
/**
* Description: Bootstrap servers, port is optional after colon. Empty value will reset it to default values.
*
* Example: 8.8.8.8:53,1.1.1.1:53
*/
get bootstrapDns(): string[] {
return this._bootstrap_dns;
}
static bootstrapDnsValidate(bootstrapDns: string[]): boolean {
return bootstrapDns.reduce<boolean>((result, p) => result && (typeof p === 'string' && !!p.trim()), true);
}
readonly _upstream_dns: string[];
/**
* Description: Upstream servers, port is optional after colon. Empty value will reset it to default values.
*
* Example: tls://1.1.1.1,tls://1.0.0.1
*/
get upstreamDns(): string[] {
return this._upstream_dns;
}
static upstreamDnsValidate(upstreamDns: string[]): boolean {
return upstreamDns.reduce<boolean>((result, p) => result && (typeof p === 'string' && !!p.trim()), true);
}
constructor(props: IUpstreamsConfig) {
this._bootstrap_dns = props.bootstrap_dns;
this._upstream_dns = props.upstream_dns;
}
serialize(): IUpstreamsConfig {
const data: IUpstreamsConfig = {
bootstrap_dns: this._bootstrap_dns,
upstream_dns: this._upstream_dns,
};
return data;
}
validate(): string[] {
const validate = {
bootstrap_dns: this._bootstrap_dns.reduce((result, p) => result && typeof p === 'string', true),
upstream_dns: this._upstream_dns.reduce((result, p) => result && typeof p === 'string', true),
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IUpstreamsConfig>): UpstreamsConfig {
return new UpstreamsConfig({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,31 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IUpstreamsConfigResponse {
}
export default class UpstreamsConfigResponse {
constructor(props: IUpstreamsConfigResponse) {
}
serialize(): IUpstreamsConfigResponse {
const data: IUpstreamsConfigResponse = {
};
return data;
}
validate(): string[] {
const validate = {
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IUpstreamsConfigResponse>): UpstreamsConfigResponse {
return new UpstreamsConfigResponse({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,100 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IVersionInfo {
announcement?: string;
announcement_url?: string;
can_autoupdate?: boolean;
new_version?: string;
}
export default class VersionInfo {
readonly _announcement: string | undefined;
/**
* Description: undefined
* Example: AdGuard Home v0.9 is now available!
*/
get announcement(): string | undefined {
return this._announcement;
}
readonly _announcement_url: string | undefined;
/**
* Description: undefined
* Example: https://github.com/AdguardTeam/AdGuardHome/releases/tag/v0.9
*
*/
get announcementUrl(): string | undefined {
return this._announcement_url;
}
readonly _can_autoupdate: boolean | undefined;
get canAutoupdate(): boolean | undefined {
return this._can_autoupdate;
}
readonly _new_version: string | undefined;
/**
* Description: undefined
* Example: v0.9
*/
get newVersion(): string | undefined {
return this._new_version;
}
constructor(props: IVersionInfo) {
if (typeof props.announcement === 'string') {
this._announcement = props.announcement.trim();
}
if (typeof props.announcement_url === 'string') {
this._announcement_url = props.announcement_url.trim();
}
if (typeof props.can_autoupdate === 'boolean') {
this._can_autoupdate = props.can_autoupdate;
}
if (typeof props.new_version === 'string') {
this._new_version = props.new_version.trim();
}
}
serialize(): IVersionInfo {
const data: IVersionInfo = {
};
if (typeof this._announcement !== 'undefined') {
data.announcement = this._announcement;
}
if (typeof this._announcement_url !== 'undefined') {
data.announcement_url = this._announcement_url;
}
if (typeof this._can_autoupdate !== 'undefined') {
data.can_autoupdate = this._can_autoupdate;
}
if (typeof this._new_version !== 'undefined') {
data.new_version = this._new_version;
}
return data;
}
validate(): string[] {
const validate = {
new_version: !this._new_version ? true : typeof this._new_version === 'string' && !this._new_version ? true : this._new_version,
announcement: !this._announcement ? true : typeof this._announcement === 'string' && !this._announcement ? true : this._announcement,
announcement_url: !this._announcement_url ? true : typeof this._announcement_url === 'string' && !this._announcement_url ? true : this._announcement_url,
can_autoupdate: !this._can_autoupdate ? true : typeof this._can_autoupdate === 'boolean',
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IVersionInfo>): VersionInfo {
return new VersionInfo({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,45 @@
// This file was autogenerated. Please do not change.
// All changes will be overwrited on commit.
export interface IWhoisInfo {
key?: string;
}
export default class WhoisInfo {
readonly _key: string | undefined;
get key(): string | undefined {
return this._key;
}
constructor(props: IWhoisInfo) {
if (typeof props.key === 'string') {
this._key = props.key.trim();
}
}
serialize(): IWhoisInfo {
const data: IWhoisInfo = {
};
if (typeof this._key !== 'undefined') {
data.key = this._key;
}
return data;
}
validate(): string[] {
const validate = {
key: !this._key ? true : typeof this._key === 'string' && !this._key ? true : this._key,
};
const isError: string[] = [];
Object.keys(validate).forEach((key) => {
if (!(validate as any)[key]) {
isError.push(key);
}
});
return isError;
}
update(props: Partial<IWhoisInfo>): WhoisInfo {
return new WhoisInfo({ ...this.serialize(), ...props });
}
}

View File

@@ -0,0 +1,14 @@
interface ErrorCheck<T = any> {
error?: Error;
result?: T;
}
export function errorChecker<T = any>(response: Error | any): ErrorCheck<T> {
if (typeof response !== 'object') {
return { result: response };
}
if (response instanceof Error) {
return { error: response };
}
return { result: response };
}

View File

@@ -0,0 +1,17 @@
export enum NETWORK_TYPE {
LOCAL = 'LOCAL',
ETHERNET = 'ETHERNET',
OTHER = 'OTHER',
}
export const chechNetworkType = (network: string | undefined) => {
if (!network) {
return NETWORK_TYPE.OTHER;
}
if (network.includes('en')) {
return NETWORK_TYPE.ETHERNET;
}
if (network.includes('lo')) {
return NETWORK_TYPE.LOCAL;
}
};

View File

@@ -0,0 +1,78 @@
.group {
display: block;
margin-bottom: 24px;
&_last,
&:last-child {
margin-bottom: 0;
}
}
.label {
margin-bottom: 4px;
font-size: 14px;
color: var(--gray700);
}
.reveal {
color: var(--black);
transition: color var(--transition);
cursor: pointer;
&:hover,
&:focus {
color: var(--gray);
}
}
.reveal + .suffix {
margin-left: 16px;
}
.addon {
display: flex;
height: 48px;
padding: 14px 3px 14px 14px;
font-size: 14px;
font-weight: 500;
line-height: 1.4;
cursor: pointer;
overflow: hidden;
@media (--m-viewport) {
padding-right: 6px;
font-size: 16px;
line-height: 1.3;
}
}
.addonCountry {
min-width: 28px;
margin-right: 3px;
@media (--m-viewport) {
margin-right: 12px;
}
}
.addonIcon {
position: relative;
top: -2px;
margin-right: 9px;
color: var(--concrete);
}
.addonCode {
position: relative;
padding-left: 12px;
&::before {
content: "";
position: absolute;
top: -14px;
left: 0;
width: 1px;
height: 48px;
background-color: var(--borders-white);
}
}

View File

@@ -0,0 +1,3 @@
.icons {
display: none;
}

View File

@@ -0,0 +1,54 @@
import React, { FC } from 'react';
import './Icon.pcss';
export type IconType =
'mainLogo' |
'visibility_disable' |
'visibility_enable';
const Icons: FC = () => (
<svg xmlns="http://www.w3.org/2000/svg" className="icons">
<symbol id="mainLogo" width="185px" height="57px" viewBox="0 0 185 57">
<g stroke="none" strokeWidth="1" fill="none" fillRule="evenodd">
<g transform="translate(-521.000000, -104.000000)">
<g transform="translate(521.000000, 104.000000)">
<g>
<g transform="translate(67.500000, 14.000000)" fill="#242424" fillRule="nonzero">
<path d="M0.5,15.7348066 L7.2386844,0.154696133 L10.4283283,0.154696133 L17.1670127,15.7348066 L13.5505855,15.7348066 L12.1129994,12.2651934 L5.46416417,12.2651934 L4.02657817,15.7348066 L0.5,15.7348066 Z M6.69958965,9.25966851 L10.877574,9.25966851 L8.78858181,4.24309392 L6.69958965,9.25966851 Z M18.9722792,15.7348066 L18.9722792,0.26519337 L25.104482,0.26519337 C27.5603704,0.26519337 29.5669808,0.99815105 31.1243734,2.4640884 C32.681766,3.93002575 33.4604507,5.77531116 33.4604507,8 C33.4604507,10.2099558 32.6780224,12.0515654 31.1131423,13.5248619 C29.5482622,14.9981584 27.5453955,15.7348066 25.104482,15.7348066 L18.9722792,15.7348066 Z M22.4314705,12.6629834 L25.104482,12.6629834 C26.5271003,12.6629834 27.6726695,12.2320485 28.5412111,11.3701657 C29.4097569,10.508283 29.8440234,9.38490564 29.8440234,8 C29.8440234,6.6298274 29.4060133,5.51013326 28.5299799,4.64088398 C27.6539466,3.7716347 26.5121254,3.33701657 25.104482,3.33701657 L22.4314705,3.33701657 L22.4314705,12.6629834 Z M43.4869121,16 C41.0459987,16 39.0581066,15.2486263 37.5231764,13.7458564 C35.9882462,12.2430864 35.2207926,10.3278201 35.2207926,8 C35.2207926,5.77531116 36.0069646,3.88582729 37.5793321,2.33149171 C39.1516997,0.777156133 41.113386,0 43.4644498,0 C44.8271684,0 45.9802206,0.173110608 46.9236412,0.519337017 C47.8670617,0.865563425 48.7730313,1.39962807 49.6415772,2.12154696 L47.4627359,4.70718232 C46.803839,4.16205989 46.1674141,3.76427381 45.553442,3.51381215 C44.9394699,3.2633505 44.2057051,3.13812155 43.3521384,3.13812155 C42.0942444,3.13812155 41.0272967,3.61325492 40.1512633,4.56353591 C39.27523,5.51381691 38.8372199,6.65929348 38.8372199,8 C38.8372199,9.41437171 39.2827173,10.5856307 40.1737256,11.5138122 C41.0647339,12.4419936 42.2065551,12.9060773 43.5992235,12.9060773 C44.8870674,12.9060773 45.9727335,12.5966882 46.8562543,11.9779006 L46.8562543,9.7679558 L43.3746007,9.7679558 L43.3746007,6.82872928 L50.2031342,6.82872928 L50.2031342,13.5469613 C48.2414185,15.1823286 46.0027002,16 43.4869121,16 Z M60.086538,15.9779006 C57.9451232,15.9779006 56.2754376,15.392271 55.0774493,14.2209945 C53.8794549,13.0497179 53.2804668,11.3443943 53.2804668,9.10497238 L53.2804668,0.26519337 L56.7396581,0.26519337 L56.7396581,9.01657459 C56.7396581,10.2541498 57.0354085,11.2007334 57.6269182,11.8563536 C58.2184279,12.5119738 59.0532677,12.839779 60.1314626,12.839779 C61.2096575,12.839779 62.0444972,12.5230234 62.6360069,11.8895028 C63.2275166,11.2559821 63.5232671,10.335181 63.5232671,9.12707182 L63.5232671,0.26519337 L66.9824584,0.26519337 L66.9824584,8.99447514 C66.9824584,11.2928292 66.3722392,13.0313017 65.1517825,14.2099448 C63.9313257,15.3885878 62.2429278,15.9779006 60.086538,15.9779006 Z M67.9199798,15.7348066 L74.6586642,0.154696133 L77.8483082,0.154696133 L84.5869926,15.7348066 L80.9705653,15.7348066 L79.5329793,12.2651934 L72.884144,12.2651934 L71.446558,15.7348066 L67.9199798,15.7348066 Z M74.1195695,9.25966851 L78.2975538,9.25966851 L76.2085617,4.24309392 L74.1195695,9.25966851 Z M86.3922591,15.7348066 L86.3922591,0.26519337 L93.5801891,0.26519337 C95.5718547,0.26519337 97.0992745,0.788208398 98.1624945,1.83425414 C99.0609902,2.71823646 99.5102314,3.9115947 99.5102314,5.41436464 C99.5102314,7.78638387 98.3871285,9.38489459 96.1408892,10.2099448 L99.9819393,15.7348066 L95.9387286,15.7348066 L92.5244619,10.7845304 L89.8514504,10.7845304 L89.8514504,15.7348066 L86.3922591,15.7348066 Z M89.8514504,7.77900552 L93.3555663,7.77900552 C94.1941623,7.77900552 94.8455619,7.57642928 95.3097847,7.17127072 C95.7740075,6.76611215 96.0061155,6.2246811 96.0061155,5.54696133 C96.0061155,4.82504243 95.7665202,4.27624497 95.2873225,3.90055249 C94.8081247,3.52486 94.1417504,3.33701657 93.2881794,3.33701657 L89.8514504,3.33701657 L89.8514504,7.77900552 Z M102.011829,15.7348066 L102.011829,0.26519337 L108.144031,0.26519337 C110.59992,0.26519337 112.60653,0.99815105 114.163923,2.4640884 C115.721315,3.93002575 116.5,5.77531116 116.5,8 C116.5,10.2099558 115.717572,12.0515654 114.152692,13.5248619 C112.587812,14.9981584 110.584945,15.7348066 108.144031,15.7348066 L102.011829,15.7348066 Z M105.47102,12.6629834 L108.144031,12.6629834 C109.56665,12.6629834 110.712219,12.2320485 111.58076,11.3701657 C112.449306,10.508283 112.883573,9.38490564 112.883573,8 C112.883573,6.6298274 112.445563,5.51013326 111.569529,4.64088398 C110.693496,3.7716347 109.551675,3.33701657 108.144031,3.33701657 L105.47102,3.33701657 L105.47102,12.6629834 Z"></path>
</g>
<g>
<g id="small/Logo-3">
<g id="small/Logo-2">
<g id="small/Logo">
<g id="Group-4">
<g id="Group">
<path d="M28.4993695,0 C19.5913422,0 8.84603419,2.043769 8.73987156e-06,6.54224924 C8.73987156e-06,16.2577508 -0.122097033,40.4620061 28.4993695,57 C57.1214688,40.4620061 56.9999957,16.2577508 56.9999957,6.54224924 C48.1533375,2.043769 37.4080296,0 28.4993695,0 L28.4993695,0 Z" id="Path" fill="#68BC71"></path>
<path d="M28.4993695,0 L28.4993695,57 C0.736546964,40.9581459 0.0185516086,17.7031064 0.000458427595,7.45516583 L8.73987165e-06,6.54224924 C8.84603419,2.043769 19.5913422,0 28.4993695,0 L28.4993695,0 Z" id="Combined-Shape" fill="#67B279"></path>
</g>
<path d="M28.2485704,36.6428571 L44.7857143,14.7312121 C43.573906,13.7763263 42.510977,14.450265 41.9258467,14.9720239 L41.9044958,14.9736962 L28.1158485,29.075123 L22.9206532,22.9288475 C20.4422167,20.113802 17.0728126,22.2610406 16.2857143,22.8285092 L28.2485704,36.6428571" id="Fill-11" fill="#FFFFFF"></path>
</g>
</g>
</g>
</g>
</g>
</g>
<text fontFamily="HelveticaNeue, Helvetica Neue" fontSize="16" fontWeight="normal" letterSpacing="1" fill="#4D4D4D">
<tspan x="67.288" y="49">HOME</tspan>
</text>
</g>
</g>
</g>
</symbol>
<symbol id="visibility_disable" viewBox="0 0 24 24" fill="currentColor" fillRule="evenodd" clipRule="evenodd">
<path d="M6.07675 11.0186L5.30088 11.4665C4.88614 11.706 4.35582 11.5639 4.11638 11.1491C3.87693 10.7344 4.01903 10.2041 4.43376 9.96464L5.77791 9.1886C5.82632 9.16065 5.87632 9.1379 5.92724 9.12017C5.94 9.11267 5.95302 9.10545 5.96629 9.09852C6.39087 8.877 6.91464 9.04161 7.13616 9.4662C7.63369 10.4198 9.41088 12.43 12.3523 12.4681C15.2937 12.43 17.0709 10.4198 17.5684 9.4662C17.7899 9.04161 18.3137 8.877 18.7383 9.09852C18.7844 9.1226 18.8275 9.15025 18.8674 9.18096C18.8719 9.18347 18.8764 9.18601 18.8809 9.1886L20.225 9.96464C20.6398 10.2041 20.7818 10.7344 20.5424 11.1491C20.303 11.5639 19.7726 11.706 19.3579 11.4665L18.614 11.037C18.188 11.6053 17.575 12.2431 16.7787 12.7966L17.2222 13.5647C17.4616 13.9794 17.3195 14.5097 16.9048 14.7492C16.4901 14.9886 15.9597 14.8465 15.7203 14.4318L15.2549 13.6258C14.6462 13.8742 13.9706 14.0595 13.2289 14.1469V15.1327C13.2289 15.6116 12.8407 15.9998 12.3618 15.9998C11.8829 15.9998 11.4947 15.6116 11.4947 15.1327V14.1492C10.607 14.0466 9.81358 13.804 9.11589 13.4803L8.56656 14.4318C8.32711 14.8465 7.79679 14.9886 7.38206 14.7492C6.96732 14.5097 6.82523 13.9794 7.06467 13.5647L7.63183 12.5823C6.969 12.0763 6.44978 11.5196 6.07675 11.0186Z" />
</symbol>
<symbol id="visibility_enable" viewBox="0 0 24 24" fill="currentColor">
<path fillRule="evenodd" clipRule="evenodd" d="M4 11.9999C4.02485 11.6762 4.15136 11.3586 4.37852 11.0961L4.37907 11.0955C4.47595 10.9837 5.34608 9.99479 6.66752 9.0233C7.95858 8.07415 9.87032 7 12.0213 7C14.1723 7 16.084 8.07415 17.3751 9.0233C18.6965 9.99479 19.5666 10.9837 19.6635 11.0955L19.6676 11.1003C19.8904 11.3598 20.0171 11.6759 20.0422 11.9999C20.0171 12.324 19.8904 12.6402 19.6676 12.8997L19.6635 12.9045C19.5666 13.0163 18.6965 14.0052 17.3751 14.9767C16.084 15.9259 14.1723 17 12.0213 17C9.87032 17 7.95858 15.9259 6.66752 14.9767C5.34608 14.0052 4.47595 13.0163 4.37907 12.9045L4.37852 12.9039C4.15136 12.6414 4.02485 12.3237 4 11.9999ZM18.6435 11.9425C18.6588 11.9603 18.6715 11.9796 18.6815 11.9999C18.6715 12.0203 18.6588 12.0397 18.6435 12.0575C18.5147 12.2061 15.455 15.6908 12.0213 15.6908C8.58758 15.6908 5.52785 12.2061 5.39911 12.0575C5.38362 12.0397 5.37086 12.0202 5.36082 11.9999C5.37086 11.9797 5.38362 11.9603 5.39911 11.9425C5.52785 11.7939 8.58758 8.30924 12.0213 8.30924C15.455 8.30924 18.5147 11.7939 18.6435 11.9425Z" />
<circle cx="12" cy="11" r="3" />
</symbol>
</svg>
);
export default Icons;

View File

@@ -0,0 +1,36 @@
.title, .subTitle, .text {
color: var(--gray900);
letter-spacing: 0px;
}
.title {
font-size: 30px;
line-height: 36px;
margin-bottom: 16px;
}
.subTitle {
font-size: 20px;
line-height: 24px;
margin-bottom: 16px;
}
.text {
font-size: 16px;
line-height: 22px;
&_block {
margin-bottom: 48px;
}
&_base {
margin-bottom: 32px;
}
}
.subtext {
color: var(--gray400);
}
.danger {
text-transform: capitalize;
color: var(--red400);
font-weight: bold;
}

View File

@@ -0,0 +1,9 @@
import typography from './Typography.module.pcss';
import form from './Form.module.pcss';
const theme = {
typography,
form,
};
export default theme;