@hostinger/sdk 1.53.2 → 1.54.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.
@@ -0,0 +1,238 @@
1
+ # AgencyHostingSSLApi
2
+
3
+ All URIs are relative to *https://developers.hostinger.com*
4
+
5
+ |Method | HTTP request | Description|
6
+ |------------- | ------------- | -------------|
7
+ |[**getWebsiteSSLStatusV1**](#getwebsitesslstatusv1) | **GET** /api/agency-hosting/v1/websites/{website_uid}/domains/{domain}/ssl/status | Get website SSL status|
8
+ |[**installWebsiteSSLV1**](#installwebsitesslv1) | **POST** /api/agency-hosting/v1/websites/{website_uid}/domains/{domain}/ssl/setup | Install website SSL|
9
+ |[**reinstallWebsiteSSLV1**](#reinstallwebsitesslv1) | **POST** /api/agency-hosting/v1/websites/{website_uid}/domains/{domain}/ssl/reinstall | Reinstall website SSL|
10
+ |[**uninstallWebsiteSSLV1**](#uninstallwebsitesslv1) | **DELETE** /api/agency-hosting/v1/websites/{website_uid}/domains/{domain}/ssl | Uninstall website SSL|
11
+
12
+ # **getWebsiteSSLStatusV1**
13
+ > AgencyHostingV1SslSslStatusResource getWebsiteSSLStatusV1()
14
+
15
+ Returns the SSL state of one domain of an Agency Plan website: the certificate `status`, whether the certificate was uploaded by the customer, and when it stops being valid. `installing` means a certificate setup is running or retrying; the `ssl_setup` entry of `List website processes` shows the same progress. `active` means a valid certificate is in place: uploaded by the customer, issued by the platform, or a lifetime certificate bought for the domain. `failed` means the last setup gave up and no valid certificate is in place. `expired` means the certificate has run out. `not_installed` means the domain has no certificate and no setup process. Returns 404 when the website or the domain does not exist.
16
+
17
+ ### Example
18
+
19
+ ```typescript
20
+ import {
21
+ AgencyHostingSSLApi,
22
+ Configuration
23
+ } from '@hostinger/sdk';
24
+
25
+ const configuration = new Configuration();
26
+ const apiInstance = new AgencyHostingSSLApi(configuration);
27
+
28
+ let websiteUid: string; //Agency Plan website UID (default to undefined)
29
+ let domain: string; //Domain name (default to undefined)
30
+
31
+ const { status, data } = await apiInstance.getWebsiteSSLStatusV1(
32
+ websiteUid,
33
+ domain
34
+ );
35
+ ```
36
+
37
+ ### Parameters
38
+
39
+ |Name | Type | Description | Notes|
40
+ |------------- | ------------- | ------------- | -------------|
41
+ | **websiteUid** | [**string**] | Agency Plan website UID | defaults to undefined|
42
+ | **domain** | [**string**] | Domain name | defaults to undefined|
43
+
44
+
45
+ ### Return type
46
+
47
+ **AgencyHostingV1SslSslStatusResource**
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
+ # **installWebsiteSSLV1**
69
+ > CommonSuccessEmptyResource installWebsiteSSLV1()
70
+
71
+ Starts a Let\'s Encrypt certificate setup for the domain and returns at once; the setup runs in the background. `Get website SSL status` reports `installing` while it runs, then `active` or `failed`; the `ssl_setup` entry of `List website processes` shows the same progress. Returns 422 when the domain already has a platform certificate that is not expired, when a certificate process is recorded for the domain (a failed setup counts until it is cleaned up), or when the domain hit its limit of three setups per seven days. Returns 429 when the same domain was requested less than a minute ago, 403 when the website is suspended or locked, and 404 when the website or the domain does not exist.
72
+
73
+ ### Example
74
+
75
+ ```typescript
76
+ import {
77
+ AgencyHostingSSLApi,
78
+ Configuration
79
+ } from '@hostinger/sdk';
80
+
81
+ const configuration = new Configuration();
82
+ const apiInstance = new AgencyHostingSSLApi(configuration);
83
+
84
+ let websiteUid: string; //Agency Plan website UID (default to undefined)
85
+ let domain: string; //Domain name (default to undefined)
86
+
87
+ const { status, data } = await apiInstance.installWebsiteSSLV1(
88
+ websiteUid,
89
+ domain
90
+ );
91
+ ```
92
+
93
+ ### Parameters
94
+
95
+ |Name | Type | Description | Notes|
96
+ |------------- | ------------- | ------------- | -------------|
97
+ | **websiteUid** | [**string**] | Agency Plan website UID | 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
+ # **reinstallWebsiteSSLV1**
126
+ > CommonSuccessEmptyResource reinstallWebsiteSSLV1()
127
+
128
+ Replaces the Let\'s Encrypt certificate of the domain: the current platform certificate, when one is recorded, is revoked and removed, then a new setup starts in the background. Returns at once; `Get website SSL status` reports `installing` while it runs, then `active` or `failed`. Returns 422 for free subdomains, when a certificate process is recorded for the domain (a failed setup counts until it is cleaned up), or when the domain hit its limit of three setups per seven days. Returns 429 when the same domain was requested less than a minute ago, and 403 when the website is suspended or locked, and 404 when the website or the domain does not exist.
129
+
130
+ ### Example
131
+
132
+ ```typescript
133
+ import {
134
+ AgencyHostingSSLApi,
135
+ Configuration
136
+ } from '@hostinger/sdk';
137
+
138
+ const configuration = new Configuration();
139
+ const apiInstance = new AgencyHostingSSLApi(configuration);
140
+
141
+ let websiteUid: string; //Agency Plan website UID (default to undefined)
142
+ let domain: string; //Domain name (default to undefined)
143
+
144
+ const { status, data } = await apiInstance.reinstallWebsiteSSLV1(
145
+ websiteUid,
146
+ domain
147
+ );
148
+ ```
149
+
150
+ ### Parameters
151
+
152
+ |Name | Type | Description | Notes|
153
+ |------------- | ------------- | ------------- | -------------|
154
+ | **websiteUid** | [**string**] | Agency Plan website UID | defaults to undefined|
155
+ | **domain** | [**string**] | Domain name | defaults to undefined|
156
+
157
+
158
+ ### Return type
159
+
160
+ **CommonSuccessEmptyResource**
161
+
162
+ ### Authorization
163
+
164
+ [apiToken](../README.md#apiToken)
165
+
166
+ ### HTTP request headers
167
+
168
+ - **Content-Type**: Not defined
169
+ - **Accept**: application/json
170
+
171
+
172
+ ### HTTP response details
173
+ | Status code | Description | Response headers |
174
+ |-------------|-------------|------------------|
175
+ |**200** | Success empty response | - |
176
+ |**422** | Validation error response | - |
177
+ |**401** | Unauthenticated response | - |
178
+ |**500** | Error response | - |
179
+
180
+ [[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)
181
+
182
+ # **uninstallWebsiteSSLV1**
183
+ > CommonSuccessEmptyResource uninstallWebsiteSSLV1()
184
+
185
+ Removes the platform-issued Let\'s Encrypt certificate of the domain: the certificate is revoked and deleted before the response, so the domain is no longer served with a platform certificate until a new setup completes. Also succeeds when the domain has no platform certificate to remove. Uploaded (custom) certificates are not affected. Returns 422 when a certificate process is recorded for the domain (a failed setup counts until it is cleaned up), 429 when the same domain was requested less than a minute ago, and 403 when the website is suspended or locked, and 404 when the website or the domain does not exist.
186
+
187
+ ### Example
188
+
189
+ ```typescript
190
+ import {
191
+ AgencyHostingSSLApi,
192
+ Configuration
193
+ } from '@hostinger/sdk';
194
+
195
+ const configuration = new Configuration();
196
+ const apiInstance = new AgencyHostingSSLApi(configuration);
197
+
198
+ let websiteUid: string; //Agency Plan website UID (default to undefined)
199
+ let domain: string; //Domain name (default to undefined)
200
+
201
+ const { status, data } = await apiInstance.uninstallWebsiteSSLV1(
202
+ websiteUid,
203
+ domain
204
+ );
205
+ ```
206
+
207
+ ### Parameters
208
+
209
+ |Name | Type | Description | Notes|
210
+ |------------- | ------------- | ------------- | -------------|
211
+ | **websiteUid** | [**string**] | Agency Plan website UID | defaults to undefined|
212
+ | **domain** | [**string**] | Domain name | defaults to undefined|
213
+
214
+
215
+ ### Return type
216
+
217
+ **CommonSuccessEmptyResource**
218
+
219
+ ### Authorization
220
+
221
+ [apiToken](../README.md#apiToken)
222
+
223
+ ### HTTP request headers
224
+
225
+ - **Content-Type**: Not defined
226
+ - **Accept**: application/json
227
+
228
+
229
+ ### HTTP response details
230
+ | Status code | Description | Response headers |
231
+ |-------------|-------------|------------------|
232
+ |**200** | Success empty response | - |
233
+ |**422** | Validation error response | - |
234
+ |**401** | Unauthenticated response | - |
235
+ |**500** | Error response | - |
236
+
237
+ [[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)
238
+
@@ -0,0 +1,24 @@
1
+ # AgencyHostingV1SslSslStatusResource
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **status** | **string** | `installing` while a certificate setup is running or retrying, `active` when a valid certificate is in place (uploaded, platform-issued, or a lifetime certificate bought for the domain), `failed` when the last setup gave up and no valid certificate is in place, `expired` when the certificate has run out, `not_installed` when the domain has no certificate and no setup process. | [default to undefined]
9
+ **is_custom** | **boolean** | Whether the certificate was uploaded by the customer instead of issued or sold by the platform. | [default to undefined]
10
+ **expires_at** | **string** | End of the validity period of the certificate in place; null when there is none or the uploaded certificate carries no expiry. | [default to undefined]
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import { AgencyHostingV1SslSslStatusResource } from '@hostinger/sdk';
16
+
17
+ const instance: AgencyHostingV1SslSslStatusResource = {
18
+ status,
19
+ is_custom,
20
+ expires_at,
21
+ };
22
+ ```
23
+
24
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -13,6 +13,7 @@ All URIs are relative to *https://developers.hostinger.com*
13
13
  |[**listAccountDatabasesV1**](#listaccountdatabasesv1) | **GET** /api/hosting/v1/accounts/{username}/databases | List account databases|
14
14
  |[**listDatabaseRemoteConnectionsV1**](#listdatabaseremoteconnectionsv1) | **GET** /api/hosting/v1/accounts/{username}/databases/remote-connections | List database remote connections|
15
15
  |[**repairDatabaseV1**](#repairdatabasev1) | **PATCH** /api/hosting/v1/accounts/{username}/databases/{name}/repair | Repair database|
16
+ |[**setupWebsiteDatabaseV1**](#setupwebsitedatabasev1) | **POST** /api/hosting/v1/accounts/{username}/websites/{domain}/databases/setup | Setup website database|
16
17
 
17
18
  # **changeDatabasePasswordV1**
18
19
  > CommonSuccessEmptyResource changeDatabasePasswordV1(hostingV1DatabasesChangeDatabasePasswordRequest)
@@ -545,3 +546,64 @@ const { status, data } = await apiInstance.repairDatabaseV1(
545
546
 
546
547
  [[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)
547
548
 
549
+ # **setupWebsiteDatabaseV1**
550
+ > HostingV1DatabasesWebsiteDatabaseResource setupWebsiteDatabaseV1()
551
+
552
+ Creates a new MySQL database for the website and writes its connection details into the website\'s environment variables, then restarts the application. The platform generates the password (and the database name and user, unless supplied). The password is never returned; the application reads it from the environment. Written variables: `DB_HOST`, `DB_PORT`, `DB_NAME`, `DB_USER`, `DB_PASSWORD` and `DATABASE_URL` (`mysql://user:password@host:port/name`, user and password percent-encoded). Existing variables are kept. If the website already has any variable with one of these names the call fails with 422 and nothing is created; the `Replace Node.js environment variables` endpoint removes them. After this call the variables are ordinary environment variables: the `Replace Node.js environment variables` endpoint changes or removes them like any other. A restart is enough for apps that read environment variables at process start, such as Express or NestJS. Frameworks that bake variables into the build output (Next.js, `NEXT_PUBLIC_*`) see the new values only after a fresh build (`Start Node.js build` endpoint). A password in the request is ignored; the platform always generates it. The optional `name` and `user` are identifiers, not secrets.
553
+
554
+ ### Example
555
+
556
+ ```typescript
557
+ import {
558
+ HostingDatabasesApi,
559
+ Configuration,
560
+ HostingV1DatabasesSetupDatabaseRequest
561
+ } from '@hostinger/sdk';
562
+
563
+ const configuration = new Configuration();
564
+ const apiInstance = new HostingDatabasesApi(configuration);
565
+
566
+ let username: string; // (default to undefined)
567
+ let domain: string; //Domain name (default to undefined)
568
+ let hostingV1DatabasesSetupDatabaseRequest: HostingV1DatabasesSetupDatabaseRequest; // (optional)
569
+
570
+ const { status, data } = await apiInstance.setupWebsiteDatabaseV1(
571
+ username,
572
+ domain,
573
+ hostingV1DatabasesSetupDatabaseRequest
574
+ );
575
+ ```
576
+
577
+ ### Parameters
578
+
579
+ |Name | Type | Description | Notes|
580
+ |------------- | ------------- | ------------- | -------------|
581
+ | **hostingV1DatabasesSetupDatabaseRequest** | **HostingV1DatabasesSetupDatabaseRequest**| | |
582
+ | **username** | [**string**] | | defaults to undefined|
583
+ | **domain** | [**string**] | Domain name | defaults to undefined|
584
+
585
+
586
+ ### Return type
587
+
588
+ **HostingV1DatabasesWebsiteDatabaseResource**
589
+
590
+ ### Authorization
591
+
592
+ [apiToken](../README.md#apiToken)
593
+
594
+ ### HTTP request headers
595
+
596
+ - **Content-Type**: application/json
597
+ - **Accept**: application/json
598
+
599
+
600
+ ### HTTP response details
601
+ | Status code | Description | Response headers |
602
+ |-------------|-------------|------------------|
603
+ |**200** | Success response | - |
604
+ |**422** | Validation error response | - |
605
+ |**401** | Unauthenticated response | - |
606
+ |**500** | Error response | - |
607
+
608
+ [[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)
609
+
@@ -0,0 +1,22 @@
1
+ # HostingV1DatabasesSetupDatabaseRequest
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **name** | **string** | Optional database name. Generated when omitted. Letters, digits and underscores; must not start with an underscore. Up to 14 characters without the account username prefix (`u123456789_`), which is added automatically when missing. With the prefix the full name is 12 to 25 characters. | [optional] [default to undefined]
9
+ **user** | **string** | Optional database user. Generated when omitted. Letters, digits and underscores; must not start with an underscore. Up to 14 characters without the account username prefix (`u123456789_`), which is added automatically when missing. With the prefix the full user is 12 to 25 characters. | [optional] [default to undefined]
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import { HostingV1DatabasesSetupDatabaseRequest } from '@hostinger/sdk';
15
+
16
+ const instance: HostingV1DatabasesSetupDatabaseRequest = {
17
+ name,
18
+ user,
19
+ };
20
+ ```
21
+
22
+ [[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,26 @@
1
+ # HostingV1DatabasesWebsiteDatabaseConnectionResource
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **name** | **string** | Database name, as written into DB_NAME | [default to undefined]
9
+ **user** | **string** | Database user, as written into DB_USER | [default to undefined]
10
+ **host** | **string** | MySQL host as written into DB_HOST. The application connects over the loopback. | [default to undefined]
11
+ **port** | **number** | MySQL port as written into DB_PORT | [default to undefined]
12
+
13
+ ## Example
14
+
15
+ ```typescript
16
+ import { HostingV1DatabasesWebsiteDatabaseConnectionResource } from '@hostinger/sdk';
17
+
18
+ const instance: HostingV1DatabasesWebsiteDatabaseConnectionResource = {
19
+ name,
20
+ user,
21
+ host,
22
+ port,
23
+ };
24
+ ```
25
+
26
+ [[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,22 @@
1
+ # HostingV1DatabasesWebsiteDatabaseResource
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **database** | [**HostingV1DatabasesWebsiteDatabaseConnectionResource**](HostingV1DatabasesWebsiteDatabaseConnectionResource.md) | | [default to undefined]
9
+ **env_var_keys** | **Array<string>** | Names of the environment variables written for this database. Values are never returned. | [default to undefined]
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import { HostingV1DatabasesWebsiteDatabaseResource } from '@hostinger/sdk';
15
+
16
+ const instance: HostingV1DatabasesWebsiteDatabaseResource = {
17
+ database,
18
+ env_var_keys,
19
+ };
20
+ ```
21
+
22
+ [[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.53.1
6
+ * API Version: 1.54.1
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.53.2",
3
+ "version": "1.54.1",
4
4
  "description": "Hostinger API TypeScript SDK",
5
5
  "author": "Hostinger",
6
6
  "repository": {