hostinger-api-sdk 1.1.1 → 1.2.0

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,364 @@
1
+ # HostingPHPApi
2
+
3
+ All URIs are relative to *https://developers.hostinger.com*
4
+
5
+ |Method | HTTP request | Description|
6
+ |------------- | ------------- | -------------|
7
+ |[**getPHPDetailsV1**](#getphpdetailsv1) | **GET** /api/hosting/v1/accounts/{username}/websites/{domain}/php/details | Get PHP details|
8
+ |[**getPHPInfoV1**](#getphpinfov1) | **GET** /api/hosting/v1/accounts/{username}/websites/{domain}/php/php-info | Get PHP info|
9
+ |[**resetPHPExtensionsV1**](#resetphpextensionsv1) | **PATCH** /api/hosting/v1/accounts/{username}/websites/{domain}/php/extensions/reset | Reset PHP extensions|
10
+ |[**updatePHPExtensionsV1**](#updatephpextensionsv1) | **PATCH** /api/hosting/v1/accounts/{username}/websites/{domain}/php/extensions | Update PHP extensions|
11
+ |[**updatePHPOptionsV1**](#updatephpoptionsv1) | **PATCH** /api/hosting/v1/accounts/{username}/websites/{domain}/php/options | Update PHP options|
12
+ |[**updatePHPVersionV1**](#updatephpversionv1) | **PATCH** /api/hosting/v1/accounts/{username}/websites/{domain}/php/version | Update PHP version|
13
+
14
+ # **getPHPDetailsV1**
15
+ > HostingV1PhpPhpDetailsResource getPHPDetailsV1()
16
+
17
+ Returns the full PHP configuration for the website: current version, available versions (supported and unsupported), enabled/disabled extensions, options with their current value, default, type and the plan limit (`max`), and conflicting extension groups. Use it to check the current PHP setup before updating the version, extensions or options.
18
+
19
+ ### Example
20
+
21
+ ```typescript
22
+ import {
23
+ HostingPHPApi,
24
+ Configuration
25
+ } from 'hostinger-api-sdk';
26
+
27
+ const configuration = new Configuration();
28
+ const apiInstance = new HostingPHPApi(configuration);
29
+
30
+ let username: string; // (default to undefined)
31
+ let domain: string; //Domain name (default to undefined)
32
+
33
+ const { status, data } = await apiInstance.getPHPDetailsV1(
34
+ username,
35
+ domain
36
+ );
37
+ ```
38
+
39
+ ### Parameters
40
+
41
+ |Name | Type | Description | Notes|
42
+ |------------- | ------------- | ------------- | -------------|
43
+ | **username** | [**string**] | | defaults to undefined|
44
+ | **domain** | [**string**] | Domain name | defaults to undefined|
45
+
46
+
47
+ ### Return type
48
+
49
+ **HostingV1PhpPhpDetailsResource**
50
+
51
+ ### Authorization
52
+
53
+ [apiToken](../README.md#apiToken)
54
+
55
+ ### HTTP request headers
56
+
57
+ - **Content-Type**: Not defined
58
+ - **Accept**: application/json
59
+
60
+
61
+ ### HTTP response details
62
+ | Status code | Description | Response headers |
63
+ |-------------|-------------|------------------|
64
+ |**200** | Success response | - |
65
+ |**401** | Unauthenticated response | - |
66
+ |**500** | Error response | - |
67
+
68
+ [[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)
69
+
70
+ # **getPHPInfoV1**
71
+ > HostingV1PhpPhpInfoResource getPHPInfoV1()
72
+
73
+ Returns the full phpinfo page (HTML) for the website. Use it to debug PHP issues or inspect the complete PHP environment of the website.
74
+
75
+ ### Example
76
+
77
+ ```typescript
78
+ import {
79
+ HostingPHPApi,
80
+ Configuration
81
+ } from 'hostinger-api-sdk';
82
+
83
+ const configuration = new Configuration();
84
+ const apiInstance = new HostingPHPApi(configuration);
85
+
86
+ let username: string; // (default to undefined)
87
+ let domain: string; //Domain name (default to undefined)
88
+
89
+ const { status, data } = await apiInstance.getPHPInfoV1(
90
+ username,
91
+ domain
92
+ );
93
+ ```
94
+
95
+ ### Parameters
96
+
97
+ |Name | Type | Description | Notes|
98
+ |------------- | ------------- | ------------- | -------------|
99
+ | **username** | [**string**] | | defaults to undefined|
100
+ | **domain** | [**string**] | Domain name | defaults to undefined|
101
+
102
+
103
+ ### Return type
104
+
105
+ **HostingV1PhpPhpInfoResource**
106
+
107
+ ### Authorization
108
+
109
+ [apiToken](../README.md#apiToken)
110
+
111
+ ### HTTP request headers
112
+
113
+ - **Content-Type**: Not defined
114
+ - **Accept**: application/json
115
+
116
+
117
+ ### HTTP response details
118
+ | Status code | Description | Response headers |
119
+ |-------------|-------------|------------------|
120
+ |**200** | Success response | - |
121
+ |**401** | Unauthenticated response | - |
122
+ |**500** | Error response | - |
123
+
124
+ [[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)
125
+
126
+ # **resetPHPExtensionsV1**
127
+ > CommonSuccessEmptyResource resetPHPExtensionsV1()
128
+
129
+ Resets all PHP extensions of the website to their default state. Use it to recover from extension conflicts or restore the original configuration.
130
+
131
+ ### Example
132
+
133
+ ```typescript
134
+ import {
135
+ HostingPHPApi,
136
+ Configuration
137
+ } from 'hostinger-api-sdk';
138
+
139
+ const configuration = new Configuration();
140
+ const apiInstance = new HostingPHPApi(configuration);
141
+
142
+ let username: string; // (default to undefined)
143
+ let domain: string; //Domain name (default to undefined)
144
+
145
+ const { status, data } = await apiInstance.resetPHPExtensionsV1(
146
+ username,
147
+ domain
148
+ );
149
+ ```
150
+
151
+ ### Parameters
152
+
153
+ |Name | Type | Description | Notes|
154
+ |------------- | ------------- | ------------- | -------------|
155
+ | **username** | [**string**] | | defaults to undefined|
156
+ | **domain** | [**string**] | Domain name | defaults to undefined|
157
+
158
+
159
+ ### Return type
160
+
161
+ **CommonSuccessEmptyResource**
162
+
163
+ ### Authorization
164
+
165
+ [apiToken](../README.md#apiToken)
166
+
167
+ ### HTTP request headers
168
+
169
+ - **Content-Type**: Not defined
170
+ - **Accept**: application/json
171
+
172
+
173
+ ### HTTP response details
174
+ | Status code | Description | Response headers |
175
+ |-------------|-------------|------------------|
176
+ |**200** | Success empty 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
+ # **updatePHPExtensionsV1**
183
+ > CommonSuccessEmptyResource updatePHPExtensionsV1(hostingV1PhpUpdatePhpExtensionsRequest)
184
+
185
+ Enables or disables PHP extensions (modules) for the website. Use the Get PHP details endpoint to check the current extension states before changing them.
186
+
187
+ ### Example
188
+
189
+ ```typescript
190
+ import {
191
+ HostingPHPApi,
192
+ Configuration,
193
+ HostingV1PhpUpdatePhpExtensionsRequest
194
+ } from 'hostinger-api-sdk';
195
+
196
+ const configuration = new Configuration();
197
+ const apiInstance = new HostingPHPApi(configuration);
198
+
199
+ let username: string; // (default to undefined)
200
+ let domain: string; //Domain name (default to undefined)
201
+ let hostingV1PhpUpdatePhpExtensionsRequest: HostingV1PhpUpdatePhpExtensionsRequest; //
202
+
203
+ const { status, data } = await apiInstance.updatePHPExtensionsV1(
204
+ username,
205
+ domain,
206
+ hostingV1PhpUpdatePhpExtensionsRequest
207
+ );
208
+ ```
209
+
210
+ ### Parameters
211
+
212
+ |Name | Type | Description | Notes|
213
+ |------------- | ------------- | ------------- | -------------|
214
+ | **hostingV1PhpUpdatePhpExtensionsRequest** | **HostingV1PhpUpdatePhpExtensionsRequest**| | |
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**: application/json
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
+
243
+ # **updatePHPOptionsV1**
244
+ > CommonSuccessEmptyResource updatePHPOptionsV1(hostingV1PhpUpdatePhpOptionsRequest)
245
+
246
+ Updates PHP options for the website (e.g. `memory_limit`, `max_execution_time`, `upload_max_filesize`). Only provide the options you want to change, inside the `options` object. Values above the account plan limit are silently capped to that limit, so the request can succeed with a smaller applied value. Call the Get PHP details endpoint afterwards to read the applied value.
247
+
248
+ ### Example
249
+
250
+ ```typescript
251
+ import {
252
+ HostingPHPApi,
253
+ Configuration,
254
+ HostingV1PhpUpdatePhpOptionsRequest
255
+ } from 'hostinger-api-sdk';
256
+
257
+ const configuration = new Configuration();
258
+ const apiInstance = new HostingPHPApi(configuration);
259
+
260
+ let username: string; // (default to undefined)
261
+ let domain: string; //Domain name (default to undefined)
262
+ let hostingV1PhpUpdatePhpOptionsRequest: HostingV1PhpUpdatePhpOptionsRequest; //
263
+
264
+ const { status, data } = await apiInstance.updatePHPOptionsV1(
265
+ username,
266
+ domain,
267
+ hostingV1PhpUpdatePhpOptionsRequest
268
+ );
269
+ ```
270
+
271
+ ### Parameters
272
+
273
+ |Name | Type | Description | Notes|
274
+ |------------- | ------------- | ------------- | -------------|
275
+ | **hostingV1PhpUpdatePhpOptionsRequest** | **HostingV1PhpUpdatePhpOptionsRequest**| | |
276
+ | **username** | [**string**] | | defaults to undefined|
277
+ | **domain** | [**string**] | Domain name | defaults to undefined|
278
+
279
+
280
+ ### Return type
281
+
282
+ **CommonSuccessEmptyResource**
283
+
284
+ ### Authorization
285
+
286
+ [apiToken](../README.md#apiToken)
287
+
288
+ ### HTTP request headers
289
+
290
+ - **Content-Type**: application/json
291
+ - **Accept**: application/json
292
+
293
+
294
+ ### HTTP response details
295
+ | Status code | Description | Response headers |
296
+ |-------------|-------------|------------------|
297
+ |**200** | Success empty response | - |
298
+ |**422** | Validation error response | - |
299
+ |**401** | Unauthenticated response | - |
300
+ |**500** | Error response | - |
301
+
302
+ [[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)
303
+
304
+ # **updatePHPVersionV1**
305
+ > CommonSuccessEmptyResource updatePHPVersionV1(hostingV1PhpUpdatePhpVersionRequest)
306
+
307
+ Changes the PHP version of the website. Use the Get PHP details endpoint to see the versions available for the website.
308
+
309
+ ### Example
310
+
311
+ ```typescript
312
+ import {
313
+ HostingPHPApi,
314
+ Configuration,
315
+ HostingV1PhpUpdatePhpVersionRequest
316
+ } from 'hostinger-api-sdk';
317
+
318
+ const configuration = new Configuration();
319
+ const apiInstance = new HostingPHPApi(configuration);
320
+
321
+ let username: string; // (default to undefined)
322
+ let domain: string; //Domain name (default to undefined)
323
+ let hostingV1PhpUpdatePhpVersionRequest: HostingV1PhpUpdatePhpVersionRequest; //
324
+
325
+ const { status, data } = await apiInstance.updatePHPVersionV1(
326
+ username,
327
+ domain,
328
+ hostingV1PhpUpdatePhpVersionRequest
329
+ );
330
+ ```
331
+
332
+ ### Parameters
333
+
334
+ |Name | Type | Description | Notes|
335
+ |------------- | ------------- | ------------- | -------------|
336
+ | **hostingV1PhpUpdatePhpVersionRequest** | **HostingV1PhpUpdatePhpVersionRequest**| | |
337
+ | **username** | [**string**] | | defaults to undefined|
338
+ | **domain** | [**string**] | Domain name | defaults to undefined|
339
+
340
+
341
+ ### Return type
342
+
343
+ **CommonSuccessEmptyResource**
344
+
345
+ ### Authorization
346
+
347
+ [apiToken](../README.md#apiToken)
348
+
349
+ ### HTTP request headers
350
+
351
+ - **Content-Type**: application/json
352
+ - **Accept**: application/json
353
+
354
+
355
+ ### HTTP response details
356
+ | Status code | Description | Response headers |
357
+ |-------------|-------------|------------------|
358
+ |**200** | Success empty response | - |
359
+ |**422** | Validation error response | - |
360
+ |**401** | Unauthenticated response | - |
361
+ |**500** | Error response | - |
362
+
363
+ [[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)
364
+
@@ -0,0 +1,30 @@
1
+ # HostingV1PhpPhpDetailsResource
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **php_version** | **string** | Current PHP version name | [optional] [default to undefined]
9
+ **php_version_full** | **string** | Full PHP version name | [optional] [default to undefined]
10
+ **php_versions** | [**HostingV1PhpPhpVersionsResource**](HostingV1PhpPhpVersionsResource.md) | | [optional] [default to undefined]
11
+ **_options** | [**{ [key: string]: HostingV1PhpPhpOptionResource; }**](HostingV1PhpPhpOptionResource.md) | PHP options keyed by option name | [optional] [default to undefined]
12
+ **extensions** | **object** | PHP extensions keyed by extension name | [optional] [default to undefined]
13
+ **conflicting_extensions** | **Array<Array<string>>** | Groups of extensions that conflict with each other | [optional] [default to undefined]
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import { HostingV1PhpPhpDetailsResource } from 'hostinger-api-sdk';
19
+
20
+ const instance: HostingV1PhpPhpDetailsResource = {
21
+ php_version,
22
+ php_version_full,
23
+ php_versions,
24
+ _options,
25
+ extensions,
26
+ conflicting_extensions,
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
+ # HostingV1PhpPhpInfoResource
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **info** | **string** | HTML string containing the full phpinfo page | [optional] [default to undefined]
9
+
10
+ ## Example
11
+
12
+ ```typescript
13
+ import { HostingV1PhpPhpInfoResource } from 'hostinger-api-sdk';
14
+
15
+ const instance: HostingV1PhpPhpInfoResource = {
16
+ info,
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)
@@ -0,0 +1,30 @@
1
+ # HostingV1PhpPhpOptionResource
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **type** | **string** | Declared option type (e.g. bool, string) | [optional] [default to undefined]
9
+ **value** | **string** | Current value for this website | [optional] [default to undefined]
10
+ **comment** | **string** | Human-readable description | [optional] [default to undefined]
11
+ **_default** | **string** | Default value | [optional] [default to undefined]
12
+ **range** | **string** | Allowed value range or limits, when applicable | [optional] [default to undefined]
13
+ **max** | **string** | Maximum value allowed by the account hosting plan, when applicable | [optional] [default to undefined]
14
+
15
+ ## Example
16
+
17
+ ```typescript
18
+ import { HostingV1PhpPhpOptionResource } from 'hostinger-api-sdk';
19
+
20
+ const instance: HostingV1PhpPhpOptionResource = {
21
+ type,
22
+ value,
23
+ comment,
24
+ _default,
25
+ range,
26
+ max,
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,22 @@
1
+ # HostingV1PhpPhpVersionsResource
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **supported** | **object** | Key-value pairs of supported versions | [optional] [default to undefined]
9
+ **unsupported** | **object** | Key-value pairs of unsupported versions | [optional] [default to undefined]
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import { HostingV1PhpPhpVersionsResource } from 'hostinger-api-sdk';
15
+
16
+ const instance: HostingV1PhpPhpVersionsResource = {
17
+ supported,
18
+ unsupported,
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,22 @@
1
+ # HostingV1PhpUpdatePhpExtensionsRequest
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **enable** | **Array<string>** | PHP extensions to enable. | [optional] [default to undefined]
9
+ **disable** | **Array<string>** | PHP extensions to disable. | [optional] [default to undefined]
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import { HostingV1PhpUpdatePhpExtensionsRequest } from 'hostinger-api-sdk';
15
+
16
+ const instance: HostingV1PhpUpdatePhpExtensionsRequest = {
17
+ enable,
18
+ disable,
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,20 @@
1
+ # HostingV1PhpUpdatePhpOptionsRequest
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **_options** | [**{ [key: string]: HostingV1PhpUpdatePhpOptionsRequestOptionsValue; }**](HostingV1PhpUpdatePhpOptionsRequestOptionsValue.md) | Map of PHP options to update, keyed by option name. Only include options you want to change. | [default to undefined]
9
+
10
+ ## Example
11
+
12
+ ```typescript
13
+ import { HostingV1PhpUpdatePhpOptionsRequest } from 'hostinger-api-sdk';
14
+
15
+ const instance: HostingV1PhpUpdatePhpOptionsRequest = {
16
+ _options,
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)
@@ -0,0 +1,18 @@
1
+ # HostingV1PhpUpdatePhpOptionsRequestOptionsValue
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+
9
+ ## Example
10
+
11
+ ```typescript
12
+ import { HostingV1PhpUpdatePhpOptionsRequestOptionsValue } from 'hostinger-api-sdk';
13
+
14
+ const instance: HostingV1PhpUpdatePhpOptionsRequestOptionsValue = {
15
+ };
16
+ ```
17
+
18
+ [[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
+ # HostingV1PhpUpdatePhpVersionRequest
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **version** | **string** | PHP version to switch the website to. | [default to undefined]
9
+
10
+ ## Example
11
+
12
+ ```typescript
13
+ import { HostingV1PhpUpdatePhpVersionRequest } from 'hostinger-api-sdk';
14
+
15
+ const instance: HostingV1PhpUpdatePhpVersionRequest = {
16
+ version,
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.1.1
6
+ * API Version: 1.2.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-api-sdk",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Hostinger API TypeScript SDK",
5
5
  "author": "Hostinger",
6
6
  "repository": {