@hostinger/sdk 1.52.2 → 1.53.1
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 +442 -1
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +2 -2
- package/dist/api.d.ts +252 -1
- package/dist/api.js +372 -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 +252 -1
- package/dist/esm/api.js +358 -1
- 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/HostingSSLApi.md +242 -0
- package/docs/HostingV1SslSslStatusResource.md +30 -0
- package/docs/HostingV1SslToggleHttpsRedirectRequest.md +20 -0
- package/index.ts +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# HostingSSLApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://developers.hostinger.com*
|
|
4
|
+
|
|
5
|
+
|Method | HTTP request | Description|
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
|[**getSSLStatusV1**](#getsslstatusv1) | **GET** /api/hosting/v1/accounts/{username}/websites/{domain}/ssl/status | Get SSL status|
|
|
8
|
+
|[**installSSLV1**](#installsslv1) | **POST** /api/hosting/v1/accounts/{username}/websites/{domain}/ssl/setup | Install SSL|
|
|
9
|
+
|[**toggleHTTPSRedirectV1**](#togglehttpsredirectv1) | **PATCH** /api/hosting/v1/accounts/{username}/websites/{domain}/ssl/https-redirect/toggle | Toggle HTTPS redirect|
|
|
10
|
+
|[**uninstallSSLV1**](#uninstallsslv1) | **DELETE** /api/hosting/v1/accounts/{username}/websites/{domain}/ssl | Uninstall SSL|
|
|
11
|
+
|
|
12
|
+
# **getSSLStatusV1**
|
|
13
|
+
> HostingV1SslSslStatusResource getSSLStatusV1()
|
|
14
|
+
|
|
15
|
+
Returns the SSL state of the website: the certificate `status` and `provider`, whether the certificate is a lifetime one managed by the platform, whether HTTP requests are redirected to HTTPS, when the certificate stops being valid and the last installation error. `installing` and `waiting_for_retry` mean an installation is in progress. `failed` means the last installation gave up, or the website was not updated for 60 minutes while `installing`; `last_error` holds the reason when it is a known message, otherwise it is null. `expired` means the assigned certificate\'s validity has ended. `not_installed` means no certificate is assigned. Free subdomains use a platform-managed certificate: with no installation recorded they report `active` with `provider` and `expires_at` null.
|
|
16
|
+
|
|
17
|
+
### Example
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import {
|
|
21
|
+
HostingSSLApi,
|
|
22
|
+
Configuration
|
|
23
|
+
} from '@hostinger/sdk';
|
|
24
|
+
|
|
25
|
+
const configuration = new Configuration();
|
|
26
|
+
const apiInstance = new HostingSSLApi(configuration);
|
|
27
|
+
|
|
28
|
+
let username: string; // (default to undefined)
|
|
29
|
+
let domain: string; //Domain name (default to undefined)
|
|
30
|
+
|
|
31
|
+
const { status, data } = await apiInstance.getSSLStatusV1(
|
|
32
|
+
username,
|
|
33
|
+
domain
|
|
34
|
+
);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Parameters
|
|
38
|
+
|
|
39
|
+
|Name | Type | Description | Notes|
|
|
40
|
+
|------------- | ------------- | ------------- | -------------|
|
|
41
|
+
| **username** | [**string**] | | defaults to undefined|
|
|
42
|
+
| **domain** | [**string**] | Domain name | defaults to undefined|
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Return type
|
|
46
|
+
|
|
47
|
+
**HostingV1SslSslStatusResource**
|
|
48
|
+
|
|
49
|
+
### Authorization
|
|
50
|
+
|
|
51
|
+
[apiToken](../README.md#apiToken)
|
|
52
|
+
|
|
53
|
+
### HTTP request headers
|
|
54
|
+
|
|
55
|
+
- **Content-Type**: Not defined
|
|
56
|
+
- **Accept**: application/json
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### HTTP response details
|
|
60
|
+
| Status code | Description | Response headers |
|
|
61
|
+
|-------------|-------------|------------------|
|
|
62
|
+
|**200** | Success response | - |
|
|
63
|
+
|**401** | Unauthenticated response | - |
|
|
64
|
+
|**500** | Error response | - |
|
|
65
|
+
|
|
66
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
67
|
+
|
|
68
|
+
# **installSSLV1**
|
|
69
|
+
> CommonSuccessEmptyResource installSSLV1()
|
|
70
|
+
|
|
71
|
+
Requests a lifetime SSL certificate for the website. The installation runs in the background; `Get SSL status` reports `active` or `failed` when it ends. An `active` lifetime certificate does not block the request: a new installation is requested, which is how a certificate is reinstalled. Returns 422 for free subdomains (their certificate is managed by the platform), while an installation is `installing` or `waiting_for_retry`, when the website\'s certificate was revoked (it cannot be reissued), and when an uploaded custom certificate is installed; that one has to be uninstalled first.
|
|
72
|
+
|
|
73
|
+
### Example
|
|
74
|
+
|
|
75
|
+
```typescript
|
|
76
|
+
import {
|
|
77
|
+
HostingSSLApi,
|
|
78
|
+
Configuration
|
|
79
|
+
} from '@hostinger/sdk';
|
|
80
|
+
|
|
81
|
+
const configuration = new Configuration();
|
|
82
|
+
const apiInstance = new HostingSSLApi(configuration);
|
|
83
|
+
|
|
84
|
+
let username: string; // (default to undefined)
|
|
85
|
+
let domain: string; //Domain name (default to undefined)
|
|
86
|
+
|
|
87
|
+
const { status, data } = await apiInstance.installSSLV1(
|
|
88
|
+
username,
|
|
89
|
+
domain
|
|
90
|
+
);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Parameters
|
|
94
|
+
|
|
95
|
+
|Name | Type | Description | Notes|
|
|
96
|
+
|------------- | ------------- | ------------- | -------------|
|
|
97
|
+
| **username** | [**string**] | | defaults to undefined|
|
|
98
|
+
| **domain** | [**string**] | Domain name | defaults to undefined|
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Return type
|
|
102
|
+
|
|
103
|
+
**CommonSuccessEmptyResource**
|
|
104
|
+
|
|
105
|
+
### Authorization
|
|
106
|
+
|
|
107
|
+
[apiToken](../README.md#apiToken)
|
|
108
|
+
|
|
109
|
+
### HTTP request headers
|
|
110
|
+
|
|
111
|
+
- **Content-Type**: Not defined
|
|
112
|
+
- **Accept**: application/json
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
### HTTP response details
|
|
116
|
+
| Status code | Description | Response headers |
|
|
117
|
+
|-------------|-------------|------------------|
|
|
118
|
+
|**200** | Success empty response | - |
|
|
119
|
+
|**422** | Validation error response | - |
|
|
120
|
+
|**401** | Unauthenticated response | - |
|
|
121
|
+
|**500** | Error response | - |
|
|
122
|
+
|
|
123
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
124
|
+
|
|
125
|
+
# **toggleHTTPSRedirectV1**
|
|
126
|
+
> CommonSuccessEmptyResource toggleHTTPSRedirectV1(hostingV1SslToggleHttpsRedirectRequest)
|
|
127
|
+
|
|
128
|
+
Turns the HTTP to HTTPS redirect of the website on or off, based on `is_enabled`. Does nothing when the redirect is already in the requested state. Turning it on requires an installed certificate (`status` `active` or `expired` on `Get SSL status`) and returns 422 when there is none; turning it off is always accepted.
|
|
129
|
+
|
|
130
|
+
### Example
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
import {
|
|
134
|
+
HostingSSLApi,
|
|
135
|
+
Configuration,
|
|
136
|
+
HostingV1SslToggleHttpsRedirectRequest
|
|
137
|
+
} from '@hostinger/sdk';
|
|
138
|
+
|
|
139
|
+
const configuration = new Configuration();
|
|
140
|
+
const apiInstance = new HostingSSLApi(configuration);
|
|
141
|
+
|
|
142
|
+
let username: string; // (default to undefined)
|
|
143
|
+
let domain: string; //Domain name (default to undefined)
|
|
144
|
+
let hostingV1SslToggleHttpsRedirectRequest: HostingV1SslToggleHttpsRedirectRequest; //
|
|
145
|
+
|
|
146
|
+
const { status, data } = await apiInstance.toggleHTTPSRedirectV1(
|
|
147
|
+
username,
|
|
148
|
+
domain,
|
|
149
|
+
hostingV1SslToggleHttpsRedirectRequest
|
|
150
|
+
);
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
### Parameters
|
|
154
|
+
|
|
155
|
+
|Name | Type | Description | Notes|
|
|
156
|
+
|------------- | ------------- | ------------- | -------------|
|
|
157
|
+
| **hostingV1SslToggleHttpsRedirectRequest** | **HostingV1SslToggleHttpsRedirectRequest**| | |
|
|
158
|
+
| **username** | [**string**] | | defaults to undefined|
|
|
159
|
+
| **domain** | [**string**] | Domain name | defaults to undefined|
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
### Return type
|
|
163
|
+
|
|
164
|
+
**CommonSuccessEmptyResource**
|
|
165
|
+
|
|
166
|
+
### Authorization
|
|
167
|
+
|
|
168
|
+
[apiToken](../README.md#apiToken)
|
|
169
|
+
|
|
170
|
+
### HTTP request headers
|
|
171
|
+
|
|
172
|
+
- **Content-Type**: application/json
|
|
173
|
+
- **Accept**: application/json
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
### HTTP response details
|
|
177
|
+
| Status code | Description | Response headers |
|
|
178
|
+
|-------------|-------------|------------------|
|
|
179
|
+
|**200** | Success empty response | - |
|
|
180
|
+
|**422** | Validation error response | - |
|
|
181
|
+
|**401** | Unauthenticated response | - |
|
|
182
|
+
|**500** | Error response | - |
|
|
183
|
+
|
|
184
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
185
|
+
|
|
186
|
+
# **uninstallSSLV1**
|
|
187
|
+
> CommonSuccessEmptyResource uninstallSSLV1()
|
|
188
|
+
|
|
189
|
+
Removes the SSL certificate assigned to the website, turns the HTTPS redirect off and cancels a pending installation retry. The website serves plain HTTP until a new installation completes. `Get SSL status` reports `not_installed` as soon as the call returns; the call also succeeds when no certificate is assigned, so repeating it is safe. Returns 422 for free subdomains (their certificate is managed by the platform) and while an installation is `installing`.
|
|
190
|
+
|
|
191
|
+
### Example
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
import {
|
|
195
|
+
HostingSSLApi,
|
|
196
|
+
Configuration
|
|
197
|
+
} from '@hostinger/sdk';
|
|
198
|
+
|
|
199
|
+
const configuration = new Configuration();
|
|
200
|
+
const apiInstance = new HostingSSLApi(configuration);
|
|
201
|
+
|
|
202
|
+
let username: string; // (default to undefined)
|
|
203
|
+
let domain: string; //Domain name (default to undefined)
|
|
204
|
+
|
|
205
|
+
const { status, data } = await apiInstance.uninstallSSLV1(
|
|
206
|
+
username,
|
|
207
|
+
domain
|
|
208
|
+
);
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Parameters
|
|
212
|
+
|
|
213
|
+
|Name | Type | Description | Notes|
|
|
214
|
+
|------------- | ------------- | ------------- | -------------|
|
|
215
|
+
| **username** | [**string**] | | defaults to undefined|
|
|
216
|
+
| **domain** | [**string**] | Domain name | defaults to undefined|
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
### Return type
|
|
220
|
+
|
|
221
|
+
**CommonSuccessEmptyResource**
|
|
222
|
+
|
|
223
|
+
### Authorization
|
|
224
|
+
|
|
225
|
+
[apiToken](../README.md#apiToken)
|
|
226
|
+
|
|
227
|
+
### HTTP request headers
|
|
228
|
+
|
|
229
|
+
- **Content-Type**: Not defined
|
|
230
|
+
- **Accept**: application/json
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
### HTTP response details
|
|
234
|
+
| Status code | Description | Response headers |
|
|
235
|
+
|-------------|-------------|------------------|
|
|
236
|
+
|**200** | Success empty response | - |
|
|
237
|
+
|**422** | Validation error response | - |
|
|
238
|
+
|**401** | Unauthenticated response | - |
|
|
239
|
+
|**500** | Error response | - |
|
|
240
|
+
|
|
241
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
242
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# HostingV1SslSslStatusResource
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**status** | **string** | Current certificate status | [default to undefined]
|
|
9
|
+
**provider** | **string** | Provider of the assigned certificate, or of the last recorded installation when none is assigned. `custom` means an uploaded certificate. Null when no certificate is assigned and no installation is recorded, which is also the case for free subdomains on the platform-managed certificate. | [default to undefined]
|
|
10
|
+
**is_lifetime** | **boolean** | Whether the certificate comes from a lifetime provider managed by the platform, not an uploaded one. Follows `provider`: it reflects the last recorded installation when no certificate is assigned, and is false when `provider` is null. | [default to undefined]
|
|
11
|
+
**is_https_redirect_enabled** | **boolean** | Whether HTTP requests to the website are redirected to HTTPS | [default to undefined]
|
|
12
|
+
**expires_at** | **string** | End of the assigned certificate validity period; null when no certificate details are available. | [default to undefined]
|
|
13
|
+
**last_error** | **string** | Last installation error, when it is one of the known displayable messages | [default to undefined]
|
|
14
|
+
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { HostingV1SslSslStatusResource } from '@hostinger/sdk';
|
|
19
|
+
|
|
20
|
+
const instance: HostingV1SslSslStatusResource = {
|
|
21
|
+
status,
|
|
22
|
+
provider,
|
|
23
|
+
is_lifetime,
|
|
24
|
+
is_https_redirect_enabled,
|
|
25
|
+
expires_at,
|
|
26
|
+
last_error,
|
|
27
|
+
};
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# HostingV1SslToggleHttpsRedirectRequest
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**is_enabled** | **boolean** | Turn the HTTP to HTTPS redirect on (true) or off (false) for the website. | [default to undefined]
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```typescript
|
|
13
|
+
import { HostingV1SslToggleHttpsRedirectRequest } from '@hostinger/sdk';
|
|
14
|
+
|
|
15
|
+
const instance: HostingV1SslToggleHttpsRedirectRequest = {
|
|
16
|
+
is_enabled,
|
|
17
|
+
};
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
package/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.
|
|
6
|
+
* API Version: 1.53.0
|
|
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hostinger/sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.53.1",
|
|
4
4
|
"description": "Hostinger API TypeScript SDK",
|
|
5
5
|
"author": "Hostinger",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"axios": "^1.8.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@types/node": "12.11.5 - 26.
|
|
31
|
+
"@types/node": "12.11.5 - 26.5.2",
|
|
32
32
|
"typescript": "^4.0 || ^5.0"
|
|
33
33
|
}
|
|
34
34
|
}
|