hostinger-api-sdk 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/api.ts +373 -5
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +2 -2
- package/dist/api.d.ts +192 -5
- package/dist/api.js +349 -11
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +2 -2
- package/dist/esm/api.d.ts +192 -5
- package/dist/esm/api.js +339 -5
- package/dist/esm/base.d.ts +1 -1
- package/dist/esm/base.js +1 -1
- package/dist/esm/common.d.ts +1 -1
- package/dist/esm/common.js +1 -1
- package/dist/esm/configuration.d.ts +1 -1
- package/dist/esm/configuration.js +2 -2
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/HostingCDNApi.md +238 -0
- package/docs/HostingCacheApi.md +1 -1
- package/docs/HostingV1CdnCdnStatusResource.md +20 -0
- package/index.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
## @hostinger/sdk@2.1.
|
|
1
|
+
## @hostinger/sdk@2.1.2
|
|
2
2
|
|
|
3
3
|
For more information, please visit [https://developers.hostinger.com](https://developers.hostinger.com).
|
|
4
4
|
|
|
5
5
|
### Usage
|
|
6
6
|
|
|
7
7
|
```
|
|
8
|
-
npm install @hostinger/sdk@2.1.
|
|
8
|
+
npm install @hostinger/sdk@2.1.2 --save
|
|
9
9
|
```
|
package/api.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 2.1.
|
|
6
|
+
* API Version: 2.1.2
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -7228,6 +7228,19 @@ export interface HostingV1CacheToggleCachelessModeRequest {
|
|
|
7228
7228
|
*/
|
|
7229
7229
|
'enabled': boolean;
|
|
7230
7230
|
}
|
|
7231
|
+
/**
|
|
7232
|
+
*
|
|
7233
|
+
* @export
|
|
7234
|
+
* @interface HostingV1CdnCdnStatusResource
|
|
7235
|
+
*/
|
|
7236
|
+
export interface HostingV1CdnCdnStatusResource {
|
|
7237
|
+
/**
|
|
7238
|
+
* Whether the Hostinger CDN is enabled for the website domain
|
|
7239
|
+
* @type {boolean}
|
|
7240
|
+
* @memberof HostingV1CdnCdnStatusResource
|
|
7241
|
+
*/
|
|
7242
|
+
'is_enabled': boolean;
|
|
7243
|
+
}
|
|
7231
7244
|
/**
|
|
7232
7245
|
*
|
|
7233
7246
|
* @export
|
|
@@ -30828,6 +30841,361 @@ export class HorizonsWebsitesApi extends BaseAPI {
|
|
|
30828
30841
|
|
|
30829
30842
|
|
|
30830
30843
|
|
|
30844
|
+
/**
|
|
30845
|
+
* HostingCDNApi - axios parameter creator
|
|
30846
|
+
* @export
|
|
30847
|
+
*/
|
|
30848
|
+
export const HostingCDNApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
30849
|
+
return {
|
|
30850
|
+
/**
|
|
30851
|
+
* Turns off the Hostinger CDN for the website domain. Once DNS propagation completes, the website content is served directly from the origin server. Repeating the call is safe; when CDN is already disabled, it applies the DNS change again. Returns 422 for platform-managed domains (for example `*.hostingersite.com` and `*.app-preview.com`), where CDN cannot be disabled, even when CDN is already off. Also returns 422 while the account is being moved to another server (retry after the move finishes), or when the CDN provider rejects the change. Returns 404 when the domain is not a website on the account.
|
|
30852
|
+
* @summary Disable CDN
|
|
30853
|
+
* @param {string} username
|
|
30854
|
+
* @param {string} domain Domain name
|
|
30855
|
+
* @param {*} [options] Override http request option.
|
|
30856
|
+
* @throws {RequiredError}
|
|
30857
|
+
*/
|
|
30858
|
+
disableCDNV1: async (username: string, domain: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
30859
|
+
// verify required parameter 'username' is not null or undefined
|
|
30860
|
+
assertParamExists('disableCDNV1', 'username', username)
|
|
30861
|
+
// verify required parameter 'domain' is not null or undefined
|
|
30862
|
+
assertParamExists('disableCDNV1', 'domain', domain)
|
|
30863
|
+
const localVarPath = `/api/hosting/v1/accounts/{username}/websites/{domain}/cdn/disable`
|
|
30864
|
+
.replace(`{${"username"}}`, encodeURIComponent(String(username)))
|
|
30865
|
+
.replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
|
|
30866
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
30867
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
30868
|
+
let baseOptions;
|
|
30869
|
+
if (configuration) {
|
|
30870
|
+
baseOptions = configuration.baseOptions;
|
|
30871
|
+
}
|
|
30872
|
+
|
|
30873
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
30874
|
+
const localVarHeaderParameter = {} as any;
|
|
30875
|
+
const localVarQueryParameter = {} as any;
|
|
30876
|
+
|
|
30877
|
+
// authentication apiToken required
|
|
30878
|
+
// http bearer authentication required
|
|
30879
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
30880
|
+
|
|
30881
|
+
|
|
30882
|
+
|
|
30883
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
30884
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
30885
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
30886
|
+
|
|
30887
|
+
return {
|
|
30888
|
+
url: toPathString(localVarUrlObj),
|
|
30889
|
+
options: localVarRequestOptions,
|
|
30890
|
+
};
|
|
30891
|
+
},
|
|
30892
|
+
/**
|
|
30893
|
+
* Turns on the Hostinger CDN for the website domain, which speeds up page loads and reduces the load on the server. Works for the main domain, parked domains and subdomains of the account. Enabling changes the domain\'s DNS records and usually takes a few seconds. After that, DNS propagation can take a few more minutes before visitors are served through the CDN. Repeating the call is safe, for example after a timeout. When CDN is already enabled, it applies the DNS change again and refreshes the CDN SSL certificate. Returns 422 when the account is disabled, while the account is being moved to another server (retry after the move finishes), or when the CDN provider rejects the change. Returns 404 when the domain is not a website on the account.
|
|
30894
|
+
* @summary Enable CDN
|
|
30895
|
+
* @param {string} username
|
|
30896
|
+
* @param {string} domain Domain name
|
|
30897
|
+
* @param {*} [options] Override http request option.
|
|
30898
|
+
* @throws {RequiredError}
|
|
30899
|
+
*/
|
|
30900
|
+
enableCDNV1: async (username: string, domain: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
30901
|
+
// verify required parameter 'username' is not null or undefined
|
|
30902
|
+
assertParamExists('enableCDNV1', 'username', username)
|
|
30903
|
+
// verify required parameter 'domain' is not null or undefined
|
|
30904
|
+
assertParamExists('enableCDNV1', 'domain', domain)
|
|
30905
|
+
const localVarPath = `/api/hosting/v1/accounts/{username}/websites/{domain}/cdn/enable`
|
|
30906
|
+
.replace(`{${"username"}}`, encodeURIComponent(String(username)))
|
|
30907
|
+
.replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
|
|
30908
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
30909
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
30910
|
+
let baseOptions;
|
|
30911
|
+
if (configuration) {
|
|
30912
|
+
baseOptions = configuration.baseOptions;
|
|
30913
|
+
}
|
|
30914
|
+
|
|
30915
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
30916
|
+
const localVarHeaderParameter = {} as any;
|
|
30917
|
+
const localVarQueryParameter = {} as any;
|
|
30918
|
+
|
|
30919
|
+
// authentication apiToken required
|
|
30920
|
+
// http bearer authentication required
|
|
30921
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
30922
|
+
|
|
30923
|
+
|
|
30924
|
+
|
|
30925
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
30926
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
30927
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
30928
|
+
|
|
30929
|
+
return {
|
|
30930
|
+
url: toPathString(localVarUrlObj),
|
|
30931
|
+
options: localVarRequestOptions,
|
|
30932
|
+
};
|
|
30933
|
+
},
|
|
30934
|
+
/**
|
|
30935
|
+
* Returns whether the Hostinger CDN is enabled for the website domain. Works for the main domain, parked domains and subdomains of the account. The domain must be the exact website name as listed on the account, without a `www.` prefix. Returns 404 when the domain is not a website on the account.
|
|
30936
|
+
* @summary Get CDN status
|
|
30937
|
+
* @param {string} username
|
|
30938
|
+
* @param {string} domain Domain name
|
|
30939
|
+
* @param {*} [options] Override http request option.
|
|
30940
|
+
* @throws {RequiredError}
|
|
30941
|
+
*/
|
|
30942
|
+
getCDNStatusV1: async (username: string, domain: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
30943
|
+
// verify required parameter 'username' is not null or undefined
|
|
30944
|
+
assertParamExists('getCDNStatusV1', 'username', username)
|
|
30945
|
+
// verify required parameter 'domain' is not null or undefined
|
|
30946
|
+
assertParamExists('getCDNStatusV1', 'domain', domain)
|
|
30947
|
+
const localVarPath = `/api/hosting/v1/accounts/{username}/websites/{domain}/cdn/status`
|
|
30948
|
+
.replace(`{${"username"}}`, encodeURIComponent(String(username)))
|
|
30949
|
+
.replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
|
|
30950
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
30951
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
30952
|
+
let baseOptions;
|
|
30953
|
+
if (configuration) {
|
|
30954
|
+
baseOptions = configuration.baseOptions;
|
|
30955
|
+
}
|
|
30956
|
+
|
|
30957
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
30958
|
+
const localVarHeaderParameter = {} as any;
|
|
30959
|
+
const localVarQueryParameter = {} as any;
|
|
30960
|
+
|
|
30961
|
+
// authentication apiToken required
|
|
30962
|
+
// http bearer authentication required
|
|
30963
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
30964
|
+
|
|
30965
|
+
|
|
30966
|
+
|
|
30967
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
30968
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
30969
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
30970
|
+
|
|
30971
|
+
return {
|
|
30972
|
+
url: toPathString(localVarUrlObj),
|
|
30973
|
+
options: localVarRequestOptions,
|
|
30974
|
+
};
|
|
30975
|
+
},
|
|
30976
|
+
/**
|
|
30977
|
+
* Purges the website\'s content from the Hostinger CDN edge cache only. The origin server cache is not touched; to clear both, use `Clear website cache`. Returns 422 when CDN is not enabled on the website. Returns 404 when the domain is not a website on the account.
|
|
30978
|
+
* @summary Purge CDN cache
|
|
30979
|
+
* @param {string} username
|
|
30980
|
+
* @param {string} domain Domain name
|
|
30981
|
+
* @param {*} [options] Override http request option.
|
|
30982
|
+
* @throws {RequiredError}
|
|
30983
|
+
*/
|
|
30984
|
+
purgeCDNCacheV1: async (username: string, domain: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
30985
|
+
// verify required parameter 'username' is not null or undefined
|
|
30986
|
+
assertParamExists('purgeCDNCacheV1', 'username', username)
|
|
30987
|
+
// verify required parameter 'domain' is not null or undefined
|
|
30988
|
+
assertParamExists('purgeCDNCacheV1', 'domain', domain)
|
|
30989
|
+
const localVarPath = `/api/hosting/v1/accounts/{username}/websites/{domain}/cdn/purge`
|
|
30990
|
+
.replace(`{${"username"}}`, encodeURIComponent(String(username)))
|
|
30991
|
+
.replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
|
|
30992
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
30993
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
30994
|
+
let baseOptions;
|
|
30995
|
+
if (configuration) {
|
|
30996
|
+
baseOptions = configuration.baseOptions;
|
|
30997
|
+
}
|
|
30998
|
+
|
|
30999
|
+
const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
|
|
31000
|
+
const localVarHeaderParameter = {} as any;
|
|
31001
|
+
const localVarQueryParameter = {} as any;
|
|
31002
|
+
|
|
31003
|
+
// authentication apiToken required
|
|
31004
|
+
// http bearer authentication required
|
|
31005
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
31006
|
+
|
|
31007
|
+
|
|
31008
|
+
|
|
31009
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
31010
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
31011
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
31012
|
+
|
|
31013
|
+
return {
|
|
31014
|
+
url: toPathString(localVarUrlObj),
|
|
31015
|
+
options: localVarRequestOptions,
|
|
31016
|
+
};
|
|
31017
|
+
},
|
|
31018
|
+
}
|
|
31019
|
+
};
|
|
31020
|
+
|
|
31021
|
+
/**
|
|
31022
|
+
* HostingCDNApi - functional programming interface
|
|
31023
|
+
* @export
|
|
31024
|
+
*/
|
|
31025
|
+
export const HostingCDNApiFp = function(configuration?: Configuration) {
|
|
31026
|
+
const localVarAxiosParamCreator = HostingCDNApiAxiosParamCreator(configuration)
|
|
31027
|
+
return {
|
|
31028
|
+
/**
|
|
31029
|
+
* Turns off the Hostinger CDN for the website domain. Once DNS propagation completes, the website content is served directly from the origin server. Repeating the call is safe; when CDN is already disabled, it applies the DNS change again. Returns 422 for platform-managed domains (for example `*.hostingersite.com` and `*.app-preview.com`), where CDN cannot be disabled, even when CDN is already off. Also returns 422 while the account is being moved to another server (retry after the move finishes), or when the CDN provider rejects the change. Returns 404 when the domain is not a website on the account.
|
|
31030
|
+
* @summary Disable CDN
|
|
31031
|
+
* @param {string} username
|
|
31032
|
+
* @param {string} domain Domain name
|
|
31033
|
+
* @param {*} [options] Override http request option.
|
|
31034
|
+
* @throws {RequiredError}
|
|
31035
|
+
*/
|
|
31036
|
+
async disableCDNV1(username: string, domain: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CommonSuccessEmptyResource>> {
|
|
31037
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.disableCDNV1(username, domain, options);
|
|
31038
|
+
const localVarOperationServerBasePath = operationServerMap['HostingCDNApi.disableCDNV1']?.[0]?.url;
|
|
31039
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
31040
|
+
},
|
|
31041
|
+
/**
|
|
31042
|
+
* Turns on the Hostinger CDN for the website domain, which speeds up page loads and reduces the load on the server. Works for the main domain, parked domains and subdomains of the account. Enabling changes the domain\'s DNS records and usually takes a few seconds. After that, DNS propagation can take a few more minutes before visitors are served through the CDN. Repeating the call is safe, for example after a timeout. When CDN is already enabled, it applies the DNS change again and refreshes the CDN SSL certificate. Returns 422 when the account is disabled, while the account is being moved to another server (retry after the move finishes), or when the CDN provider rejects the change. Returns 404 when the domain is not a website on the account.
|
|
31043
|
+
* @summary Enable CDN
|
|
31044
|
+
* @param {string} username
|
|
31045
|
+
* @param {string} domain Domain name
|
|
31046
|
+
* @param {*} [options] Override http request option.
|
|
31047
|
+
* @throws {RequiredError}
|
|
31048
|
+
*/
|
|
31049
|
+
async enableCDNV1(username: string, domain: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CommonSuccessEmptyResource>> {
|
|
31050
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.enableCDNV1(username, domain, options);
|
|
31051
|
+
const localVarOperationServerBasePath = operationServerMap['HostingCDNApi.enableCDNV1']?.[0]?.url;
|
|
31052
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
31053
|
+
},
|
|
31054
|
+
/**
|
|
31055
|
+
* Returns whether the Hostinger CDN is enabled for the website domain. Works for the main domain, parked domains and subdomains of the account. The domain must be the exact website name as listed on the account, without a `www.` prefix. Returns 404 when the domain is not a website on the account.
|
|
31056
|
+
* @summary Get CDN status
|
|
31057
|
+
* @param {string} username
|
|
31058
|
+
* @param {string} domain Domain name
|
|
31059
|
+
* @param {*} [options] Override http request option.
|
|
31060
|
+
* @throws {RequiredError}
|
|
31061
|
+
*/
|
|
31062
|
+
async getCDNStatusV1(username: string, domain: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<HostingV1CdnCdnStatusResource>> {
|
|
31063
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getCDNStatusV1(username, domain, options);
|
|
31064
|
+
const localVarOperationServerBasePath = operationServerMap['HostingCDNApi.getCDNStatusV1']?.[0]?.url;
|
|
31065
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
31066
|
+
},
|
|
31067
|
+
/**
|
|
31068
|
+
* Purges the website\'s content from the Hostinger CDN edge cache only. The origin server cache is not touched; to clear both, use `Clear website cache`. Returns 422 when CDN is not enabled on the website. Returns 404 when the domain is not a website on the account.
|
|
31069
|
+
* @summary Purge CDN cache
|
|
31070
|
+
* @param {string} username
|
|
31071
|
+
* @param {string} domain Domain name
|
|
31072
|
+
* @param {*} [options] Override http request option.
|
|
31073
|
+
* @throws {RequiredError}
|
|
31074
|
+
*/
|
|
31075
|
+
async purgeCDNCacheV1(username: string, domain: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CommonSuccessEmptyResource>> {
|
|
31076
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.purgeCDNCacheV1(username, domain, options);
|
|
31077
|
+
const localVarOperationServerBasePath = operationServerMap['HostingCDNApi.purgeCDNCacheV1']?.[0]?.url;
|
|
31078
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
31079
|
+
},
|
|
31080
|
+
}
|
|
31081
|
+
};
|
|
31082
|
+
|
|
31083
|
+
/**
|
|
31084
|
+
* HostingCDNApi - factory interface
|
|
31085
|
+
* @export
|
|
31086
|
+
*/
|
|
31087
|
+
export const HostingCDNApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
31088
|
+
const localVarFp = HostingCDNApiFp(configuration)
|
|
31089
|
+
return {
|
|
31090
|
+
/**
|
|
31091
|
+
* Turns off the Hostinger CDN for the website domain. Once DNS propagation completes, the website content is served directly from the origin server. Repeating the call is safe; when CDN is already disabled, it applies the DNS change again. Returns 422 for platform-managed domains (for example `*.hostingersite.com` and `*.app-preview.com`), where CDN cannot be disabled, even when CDN is already off. Also returns 422 while the account is being moved to another server (retry after the move finishes), or when the CDN provider rejects the change. Returns 404 when the domain is not a website on the account.
|
|
31092
|
+
* @summary Disable CDN
|
|
31093
|
+
* @param {string} username
|
|
31094
|
+
* @param {string} domain Domain name
|
|
31095
|
+
* @param {*} [options] Override http request option.
|
|
31096
|
+
* @throws {RequiredError}
|
|
31097
|
+
*/
|
|
31098
|
+
disableCDNV1(username: string, domain: string, options?: RawAxiosRequestConfig): AxiosPromise<CommonSuccessEmptyResource> {
|
|
31099
|
+
return localVarFp.disableCDNV1(username, domain, options).then((request) => request(axios, basePath));
|
|
31100
|
+
},
|
|
31101
|
+
/**
|
|
31102
|
+
* Turns on the Hostinger CDN for the website domain, which speeds up page loads and reduces the load on the server. Works for the main domain, parked domains and subdomains of the account. Enabling changes the domain\'s DNS records and usually takes a few seconds. After that, DNS propagation can take a few more minutes before visitors are served through the CDN. Repeating the call is safe, for example after a timeout. When CDN is already enabled, it applies the DNS change again and refreshes the CDN SSL certificate. Returns 422 when the account is disabled, while the account is being moved to another server (retry after the move finishes), or when the CDN provider rejects the change. Returns 404 when the domain is not a website on the account.
|
|
31103
|
+
* @summary Enable CDN
|
|
31104
|
+
* @param {string} username
|
|
31105
|
+
* @param {string} domain Domain name
|
|
31106
|
+
* @param {*} [options] Override http request option.
|
|
31107
|
+
* @throws {RequiredError}
|
|
31108
|
+
*/
|
|
31109
|
+
enableCDNV1(username: string, domain: string, options?: RawAxiosRequestConfig): AxiosPromise<CommonSuccessEmptyResource> {
|
|
31110
|
+
return localVarFp.enableCDNV1(username, domain, options).then((request) => request(axios, basePath));
|
|
31111
|
+
},
|
|
31112
|
+
/**
|
|
31113
|
+
* Returns whether the Hostinger CDN is enabled for the website domain. Works for the main domain, parked domains and subdomains of the account. The domain must be the exact website name as listed on the account, without a `www.` prefix. Returns 404 when the domain is not a website on the account.
|
|
31114
|
+
* @summary Get CDN status
|
|
31115
|
+
* @param {string} username
|
|
31116
|
+
* @param {string} domain Domain name
|
|
31117
|
+
* @param {*} [options] Override http request option.
|
|
31118
|
+
* @throws {RequiredError}
|
|
31119
|
+
*/
|
|
31120
|
+
getCDNStatusV1(username: string, domain: string, options?: RawAxiosRequestConfig): AxiosPromise<HostingV1CdnCdnStatusResource> {
|
|
31121
|
+
return localVarFp.getCDNStatusV1(username, domain, options).then((request) => request(axios, basePath));
|
|
31122
|
+
},
|
|
31123
|
+
/**
|
|
31124
|
+
* Purges the website\'s content from the Hostinger CDN edge cache only. The origin server cache is not touched; to clear both, use `Clear website cache`. Returns 422 when CDN is not enabled on the website. Returns 404 when the domain is not a website on the account.
|
|
31125
|
+
* @summary Purge CDN cache
|
|
31126
|
+
* @param {string} username
|
|
31127
|
+
* @param {string} domain Domain name
|
|
31128
|
+
* @param {*} [options] Override http request option.
|
|
31129
|
+
* @throws {RequiredError}
|
|
31130
|
+
*/
|
|
31131
|
+
purgeCDNCacheV1(username: string, domain: string, options?: RawAxiosRequestConfig): AxiosPromise<CommonSuccessEmptyResource> {
|
|
31132
|
+
return localVarFp.purgeCDNCacheV1(username, domain, options).then((request) => request(axios, basePath));
|
|
31133
|
+
},
|
|
31134
|
+
};
|
|
31135
|
+
};
|
|
31136
|
+
|
|
31137
|
+
/**
|
|
31138
|
+
* HostingCDNApi - object-oriented interface
|
|
31139
|
+
* @export
|
|
31140
|
+
* @class HostingCDNApi
|
|
31141
|
+
* @extends {BaseAPI}
|
|
31142
|
+
*/
|
|
31143
|
+
export class HostingCDNApi extends BaseAPI {
|
|
31144
|
+
/**
|
|
31145
|
+
* Turns off the Hostinger CDN for the website domain. Once DNS propagation completes, the website content is served directly from the origin server. Repeating the call is safe; when CDN is already disabled, it applies the DNS change again. Returns 422 for platform-managed domains (for example `*.hostingersite.com` and `*.app-preview.com`), where CDN cannot be disabled, even when CDN is already off. Also returns 422 while the account is being moved to another server (retry after the move finishes), or when the CDN provider rejects the change. Returns 404 when the domain is not a website on the account.
|
|
31146
|
+
* @summary Disable CDN
|
|
31147
|
+
* @param {string} username
|
|
31148
|
+
* @param {string} domain Domain name
|
|
31149
|
+
* @param {*} [options] Override http request option.
|
|
31150
|
+
* @throws {RequiredError}
|
|
31151
|
+
* @memberof HostingCDNApi
|
|
31152
|
+
*/
|
|
31153
|
+
public disableCDNV1(username: string, domain: string, options?: RawAxiosRequestConfig) {
|
|
31154
|
+
return HostingCDNApiFp(this.configuration).disableCDNV1(username, domain, options).then((request) => request(this.axios, this.basePath));
|
|
31155
|
+
}
|
|
31156
|
+
|
|
31157
|
+
/**
|
|
31158
|
+
* Turns on the Hostinger CDN for the website domain, which speeds up page loads and reduces the load on the server. Works for the main domain, parked domains and subdomains of the account. Enabling changes the domain\'s DNS records and usually takes a few seconds. After that, DNS propagation can take a few more minutes before visitors are served through the CDN. Repeating the call is safe, for example after a timeout. When CDN is already enabled, it applies the DNS change again and refreshes the CDN SSL certificate. Returns 422 when the account is disabled, while the account is being moved to another server (retry after the move finishes), or when the CDN provider rejects the change. Returns 404 when the domain is not a website on the account.
|
|
31159
|
+
* @summary Enable CDN
|
|
31160
|
+
* @param {string} username
|
|
31161
|
+
* @param {string} domain Domain name
|
|
31162
|
+
* @param {*} [options] Override http request option.
|
|
31163
|
+
* @throws {RequiredError}
|
|
31164
|
+
* @memberof HostingCDNApi
|
|
31165
|
+
*/
|
|
31166
|
+
public enableCDNV1(username: string, domain: string, options?: RawAxiosRequestConfig) {
|
|
31167
|
+
return HostingCDNApiFp(this.configuration).enableCDNV1(username, domain, options).then((request) => request(this.axios, this.basePath));
|
|
31168
|
+
}
|
|
31169
|
+
|
|
31170
|
+
/**
|
|
31171
|
+
* Returns whether the Hostinger CDN is enabled for the website domain. Works for the main domain, parked domains and subdomains of the account. The domain must be the exact website name as listed on the account, without a `www.` prefix. Returns 404 when the domain is not a website on the account.
|
|
31172
|
+
* @summary Get CDN status
|
|
31173
|
+
* @param {string} username
|
|
31174
|
+
* @param {string} domain Domain name
|
|
31175
|
+
* @param {*} [options] Override http request option.
|
|
31176
|
+
* @throws {RequiredError}
|
|
31177
|
+
* @memberof HostingCDNApi
|
|
31178
|
+
*/
|
|
31179
|
+
public getCDNStatusV1(username: string, domain: string, options?: RawAxiosRequestConfig) {
|
|
31180
|
+
return HostingCDNApiFp(this.configuration).getCDNStatusV1(username, domain, options).then((request) => request(this.axios, this.basePath));
|
|
31181
|
+
}
|
|
31182
|
+
|
|
31183
|
+
/**
|
|
31184
|
+
* Purges the website\'s content from the Hostinger CDN edge cache only. The origin server cache is not touched; to clear both, use `Clear website cache`. Returns 422 when CDN is not enabled on the website. Returns 404 when the domain is not a website on the account.
|
|
31185
|
+
* @summary Purge CDN cache
|
|
31186
|
+
* @param {string} username
|
|
31187
|
+
* @param {string} domain Domain name
|
|
31188
|
+
* @param {*} [options] Override http request option.
|
|
31189
|
+
* @throws {RequiredError}
|
|
31190
|
+
* @memberof HostingCDNApi
|
|
31191
|
+
*/
|
|
31192
|
+
public purgeCDNCacheV1(username: string, domain: string, options?: RawAxiosRequestConfig) {
|
|
31193
|
+
return HostingCDNApiFp(this.configuration).purgeCDNCacheV1(username, domain, options).then((request) => request(this.axios, this.basePath));
|
|
31194
|
+
}
|
|
31195
|
+
}
|
|
31196
|
+
|
|
31197
|
+
|
|
31198
|
+
|
|
30831
31199
|
/**
|
|
30832
31200
|
* HostingCacheApi - axios parameter creator
|
|
30833
31201
|
* @export
|
|
@@ -30835,7 +31203,7 @@ export class HorizonsWebsitesApi extends BaseAPI {
|
|
|
30835
31203
|
export const HostingCacheApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
30836
31204
|
return {
|
|
30837
31205
|
/**
|
|
30838
|
-
* Permanently clears all server-side cache for the website at once. Use it when content was updated and needs to be visible immediately, or after making major changes. Also purges the Hostinger CDN cache when CDN is enabled on the website. For a WordPress installation living in a subdirectory, pass the directory query parameter to clear its cache.
|
|
31206
|
+
* Permanently clears all server-side cache for the website at once. Use it when content was updated and needs to be visible immediately, or after making major changes. Also purges the Hostinger CDN cache when CDN is enabled on the website. To purge only the CDN cache and leave the server cache untouched, use `Purge CDN cache`. For a WordPress installation living in a subdirectory, pass the directory query parameter to clear its cache.
|
|
30839
31207
|
* @summary Clear website cache
|
|
30840
31208
|
* @param {string} username
|
|
30841
31209
|
* @param {string} domain Domain name
|
|
@@ -30988,7 +31356,7 @@ export const HostingCacheApiFp = function(configuration?: Configuration) {
|
|
|
30988
31356
|
const localVarAxiosParamCreator = HostingCacheApiAxiosParamCreator(configuration)
|
|
30989
31357
|
return {
|
|
30990
31358
|
/**
|
|
30991
|
-
* Permanently clears all server-side cache for the website at once. Use it when content was updated and needs to be visible immediately, or after making major changes. Also purges the Hostinger CDN cache when CDN is enabled on the website. For a WordPress installation living in a subdirectory, pass the directory query parameter to clear its cache.
|
|
31359
|
+
* Permanently clears all server-side cache for the website at once. Use it when content was updated and needs to be visible immediately, or after making major changes. Also purges the Hostinger CDN cache when CDN is enabled on the website. To purge only the CDN cache and leave the server cache untouched, use `Purge CDN cache`. For a WordPress installation living in a subdirectory, pass the directory query parameter to clear its cache.
|
|
30992
31360
|
* @summary Clear website cache
|
|
30993
31361
|
* @param {string} username
|
|
30994
31362
|
* @param {string} domain Domain name
|
|
@@ -31040,7 +31408,7 @@ export const HostingCacheApiFactory = function (configuration?: Configuration, b
|
|
|
31040
31408
|
const localVarFp = HostingCacheApiFp(configuration)
|
|
31041
31409
|
return {
|
|
31042
31410
|
/**
|
|
31043
|
-
* Permanently clears all server-side cache for the website at once. Use it when content was updated and needs to be visible immediately, or after making major changes. Also purges the Hostinger CDN cache when CDN is enabled on the website. For a WordPress installation living in a subdirectory, pass the directory query parameter to clear its cache.
|
|
31411
|
+
* Permanently clears all server-side cache for the website at once. Use it when content was updated and needs to be visible immediately, or after making major changes. Also purges the Hostinger CDN cache when CDN is enabled on the website. To purge only the CDN cache and leave the server cache untouched, use `Purge CDN cache`. For a WordPress installation living in a subdirectory, pass the directory query parameter to clear its cache.
|
|
31044
31412
|
* @summary Clear website cache
|
|
31045
31413
|
* @param {string} username
|
|
31046
31414
|
* @param {string} domain Domain name
|
|
@@ -31086,7 +31454,7 @@ export const HostingCacheApiFactory = function (configuration?: Configuration, b
|
|
|
31086
31454
|
*/
|
|
31087
31455
|
export class HostingCacheApi extends BaseAPI {
|
|
31088
31456
|
/**
|
|
31089
|
-
* Permanently clears all server-side cache for the website at once. Use it when content was updated and needs to be visible immediately, or after making major changes. Also purges the Hostinger CDN cache when CDN is enabled on the website. For a WordPress installation living in a subdirectory, pass the directory query parameter to clear its cache.
|
|
31457
|
+
* Permanently clears all server-side cache for the website at once. Use it when content was updated and needs to be visible immediately, or after making major changes. Also purges the Hostinger CDN cache when CDN is enabled on the website. To purge only the CDN cache and leave the server cache untouched, use `Purge CDN cache`. For a WordPress installation living in a subdirectory, pass the directory query parameter to clear its cache.
|
|
31090
31458
|
* @summary Clear website cache
|
|
31091
31459
|
* @param {string} username
|
|
31092
31460
|
* @param {string} domain Domain name
|
package/base.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 2.1.
|
|
6
|
+
* API Version: 2.1.2
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/common.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 2.1.
|
|
6
|
+
* API Version: 2.1.2
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/configuration.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 2.1.
|
|
6
|
+
* API Version: 2.1.2
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -48,7 +48,7 @@ export class Configuration {
|
|
|
48
48
|
this.baseOptions = {
|
|
49
49
|
...param.baseOptions,
|
|
50
50
|
headers: {
|
|
51
|
-
'User-Agent': "hostinger-typescript-sdk/2.1.
|
|
51
|
+
'User-Agent': "hostinger-typescript-sdk/2.1.2",
|
|
52
52
|
...param.baseOptions?.headers,
|
|
53
53
|
},
|
|
54
54
|
};
|