@hostinger/sdk 1.54.3 → 1.56.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.
- package/README.md +2 -2
- package/api.ts +242 -18
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +2 -2
- package/dist/api.d.ts +158 -18
- package/dist/api.js +170 -28
- 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 +158 -18
- package/dist/esm/api.js +159 -17
- 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/DomainsTransferApi.md +56 -0
- package/docs/DomainsV1TransferTransferRequest.md +26 -0
- package/docs/HostingDatabasesApi.md +1 -1
- package/docs/HostingFilesApi.md +2 -1
- package/docs/HostingV1OnboardingsOnboardingResource.md +28 -0
- package/docs/HostingV1WebsitesWebsiteResource.md +1 -1
- package/docs/HostingWebsitesApi.md +57 -2
- package/index.ts +1 -1
- package/package.json +1 -1
package/docs/HostingFilesApi.md
CHANGED
|
@@ -11,7 +11,7 @@ All URIs are relative to *https://developers.hostinger.com*
|
|
|
11
11
|
# **generateUploadURLV1**
|
|
12
12
|
> HostingV1FilesUploadUrlResource generateUploadURLV1(hostingV1FilesGenerateUploadUrlRequest)
|
|
13
13
|
|
|
14
|
-
Generate a file browser upload URL with authentication credentials for uploading files directly to a website\'s file storage. Returns `url`, `auth_key` and `rest_auth_key`. Use these to upload a file to the website\'s `public_html` directory via the TUS resumable upload protocol (TUS 1.0.0). Send `X-Auth: {auth_key}` and `X-Auth-Rest: {rest_auth_key}` headers on every request below. 1. Create the upload: `POST` to `{url}/{relative_file_path}?override=true` with headers `upload-length: {file size in bytes}` and `upload-offset: 0`. Expect `201 Created`. 2. Upload the file: send the file bytes to the same location (any TUS 1.0.0 client, or `PATCH` requests with an `upload-offset` header tracking progress) until complete. `relative_file_path` is the destination path inside `public_html`, e.g. `app.zip`. Instead of a TUS client, plain `curl` also works: ``` FILE=app.zip SIZE=$(stat -f%z \"$FILE\") # stat -c%s on Linux curl -i -X POST \"{url}/${FILE}?override=true\" \\ -H \"X-Auth: {auth_key}\" \\ -H \"X-Auth-Rest: {rest_auth_key}\" \\ -H \"Tus-Resumable: 1.0.0\" \\ -H \"Upload-Length: ${SIZE}\" \\ -H \"Upload-Offset: 0\" # -> 201 Created curl -i -X PATCH \"{url}/${FILE}?override=true\" \\ -H \"X-Auth: {auth_key}\" \\ -H \"X-Auth-Rest: {rest_auth_key}\" \\ -H \"Tus-Resumable: 1.0.0\" \\ -H \"Content-Type: application/offset+octet-stream\" \\ -H \"Upload-Offset: 0\" \\ --data-binary \"@${FILE}\" # -> 204 No Content, Upload-Offset response header equals SIZE when done ```
|
|
14
|
+
Generate a file browser upload URL with authentication credentials for uploading files directly to a website\'s file storage. While the website is still being set up (`status: running` on the list website setups endpoint) this endpoint returns 409 with a `Retry-After` header: wait that many seconds and retry, or poll the website setups until the status is `completed`. Returns `url`, `auth_key` and `rest_auth_key`. Use these to upload a file to the website\'s `public_html` directory via the TUS resumable upload protocol (TUS 1.0.0). Send `X-Auth: {auth_key}` and `X-Auth-Rest: {rest_auth_key}` headers on every request below. 1. Create the upload: `POST` to `{url}/{relative_file_path}?override=true` with headers `upload-length: {file size in bytes}` and `upload-offset: 0`. Expect `201 Created`. 2. Upload the file: send the file bytes to the same location (any TUS 1.0.0 client, or `PATCH` requests with an `upload-offset` header tracking progress) until complete. `relative_file_path` is the destination path inside `public_html`, e.g. `app.zip`. Instead of a TUS client, plain `curl` also works: ``` FILE=app.zip SIZE=$(stat -f%z \"$FILE\") # stat -c%s on Linux curl -i -X POST \"{url}/${FILE}?override=true\" \\ -H \"X-Auth: {auth_key}\" \\ -H \"X-Auth-Rest: {rest_auth_key}\" \\ -H \"Tus-Resumable: 1.0.0\" \\ -H \"Upload-Length: ${SIZE}\" \\ -H \"Upload-Offset: 0\" # -> 201 Created curl -i -X PATCH \"{url}/${FILE}?override=true\" \\ -H \"X-Auth: {auth_key}\" \\ -H \"X-Auth-Rest: {rest_auth_key}\" \\ -H \"Tus-Resumable: 1.0.0\" \\ -H \"Content-Type: application/offset+octet-stream\" \\ -H \"Upload-Offset: 0\" \\ --data-binary \"@${FILE}\" # -> 204 No Content, Upload-Offset response header equals SIZE when done ```
|
|
15
15
|
|
|
16
16
|
### Example
|
|
17
17
|
|
|
@@ -59,6 +59,7 @@ const { status, data } = await apiInstance.generateUploadURLV1(
|
|
|
59
59
|
|**200** | Success response | - |
|
|
60
60
|
|**422** | Validation error response | - |
|
|
61
61
|
|**401** | Unauthenticated response | - |
|
|
62
|
+
|**409** | Conflict response. `Retry-After`, when present, is the number of seconds to wait before retrying. | * Retry-After - Seconds to wait before retrying the request <br> |
|
|
62
63
|
|**500** | Error response | - |
|
|
63
64
|
|
|
64
65
|
[[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)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# HostingV1OnboardingsOnboardingResource
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**domain** | **string** | Domain of the website being set up. | [default to undefined]
|
|
9
|
+
**username** | **string** | Hosting account username. | [default to undefined]
|
|
10
|
+
**status** | **string** | `running` while the website is still being set up, `completed` once the setup has finished, `failed` when it stopped before finishing or has not reported progress for over an hour. | [default to undefined]
|
|
11
|
+
**created_at** | **string** | When the setup was requested. | [default to undefined]
|
|
12
|
+
**updated_at** | **string** | When the setup last reported progress. | [default to undefined]
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { HostingV1OnboardingsOnboardingResource } from '@hostinger/sdk';
|
|
18
|
+
|
|
19
|
+
const instance: HostingV1OnboardingsOnboardingResource = {
|
|
20
|
+
domain,
|
|
21
|
+
username,
|
|
22
|
+
status,
|
|
23
|
+
created_at,
|
|
24
|
+
updated_at,
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
@@ -7,7 +7,7 @@ Name | Type | Description | Notes
|
|
|
7
7
|
------------ | ------------- | ------------- | -------------
|
|
8
8
|
**domain** | **string** | Website domain. Null for U4S websites with no domain attached. | [optional] [default to undefined]
|
|
9
9
|
**vhost_type** | **string** | Virtual host type. Only present for CloudLinux websites. | [optional] [default to undefined]
|
|
10
|
-
**is_enabled** | **boolean** |
|
|
10
|
+
**is_enabled** | **boolean** | True unless the website is suspended. Not a readiness signal: a website that is still being set up is enabled too, see the list website setups endpoint. | [optional] [default to undefined]
|
|
11
11
|
**username** | **string** | Username. Not applicable for U4S websites. | [optional] [default to undefined]
|
|
12
12
|
**client_id** | **number** | Client ID | [optional] [default to undefined]
|
|
13
13
|
**order_id** | **number** | Order ID | [optional] [default to undefined]
|
|
@@ -7,12 +7,13 @@ All URIs are relative to *https://developers.hostinger.com*
|
|
|
7
7
|
|[**createWebsiteV1**](#createwebsitev1) | **POST** /api/hosting/v1/websites | Create website|
|
|
8
8
|
|[**deleteWebsiteV1**](#deletewebsitev1) | **DELETE** /api/hosting/v1/websites/{domain} | Delete website|
|
|
9
9
|
|[**deployStaticSiteArchiveV1**](#deploystaticsitearchivev1) | **POST** /api/hosting/v1/accounts/{username}/websites/{domain}/deploy | Deploy static site archive|
|
|
10
|
+
|[**listWebsiteSetupsV1**](#listwebsitesetupsv1) | **GET** /api/hosting/v1/onboardings | List website setups|
|
|
10
11
|
|[**listWebsitesV1**](#listwebsitesv1) | **GET** /api/hosting/v1/websites | List websites|
|
|
11
12
|
|
|
12
13
|
# **createWebsiteV1**
|
|
13
14
|
> CommonSuccessEmptyResource createWebsiteV1(hostingV1WebsitesCreateWebsiteRequest)
|
|
14
15
|
|
|
15
|
-
Create a new website for the authenticated client. You must choose which hosting order to create this website on. Pass that order as `order_id` together with the domain name. List orders to see available IDs; the website is provisioned on that order\'s hosting plan. The datacenter_code parameter is required when creating the first website on a new hosting plan - this will set up and configure new hosting account in the selected datacenter. Subsequent websites will be hosted on the same datacenter automatically. Website creation takes up to a few minutes to
|
|
16
|
+
Create a new website for the authenticated client. You must choose which hosting order to create this website on. Pass that order as `order_id` together with the domain name. List orders to see available IDs; the website is provisioned on that order\'s hosting plan. The datacenter_code parameter is required when creating the first website on a new hosting plan - this will set up and configure new hosting account in the selected datacenter. Subsequent websites will be hosted on the same datacenter automatically. Website creation is asynchronous and takes up to a few minutes. Poll the list website setups endpoint with the `domain` filter every 10 to 15 seconds and wait for `status: completed` before uploading files, deploying or creating databases. While the setup is `running`, endpoints that operate on the website may respond with `404` or `409`. `is_enabled` on the websites list reflects suspension, not readiness.
|
|
16
17
|
|
|
17
18
|
### Example
|
|
18
19
|
|
|
@@ -169,6 +170,60 @@ const { status, data } = await apiInstance.deployStaticSiteArchiveV1(
|
|
|
169
170
|
- **Accept**: application/json
|
|
170
171
|
|
|
171
172
|
|
|
173
|
+
### HTTP response details
|
|
174
|
+
| Status code | Description | Response headers |
|
|
175
|
+
|-------------|-------------|------------------|
|
|
176
|
+
|**200** | Success response | - |
|
|
177
|
+
|**422** | Validation error response | - |
|
|
178
|
+
|**401** | Unauthenticated response | - |
|
|
179
|
+
|**500** | Error response | - |
|
|
180
|
+
|
|
181
|
+
[[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)
|
|
182
|
+
|
|
183
|
+
# **listWebsiteSetupsV1**
|
|
184
|
+
> Array<HostingV1OnboardingsOnboardingResource> listWebsiteSetupsV1()
|
|
185
|
+
|
|
186
|
+
Returns the website setups started in the last 24 hours for the hosting accounts accessible to the authenticated client, newest first. Meant for polling right after creating a website: the website shows up in the websites list before its server-side setup has finished, and while the setup is `running` endpoints that operate on that website may respond with `404` or `409`. Poll this endpoint with the `domain` filter every 10 to 15 seconds and wait for `status: completed` before uploading files, deploying or creating databases. `failed` means the setup stopped before finishing or has not reported progress for over an hour. Setups older than 24 hours are not listed.
|
|
187
|
+
|
|
188
|
+
### Example
|
|
189
|
+
|
|
190
|
+
```typescript
|
|
191
|
+
import {
|
|
192
|
+
HostingWebsitesApi,
|
|
193
|
+
Configuration
|
|
194
|
+
} from '@hostinger/sdk';
|
|
195
|
+
|
|
196
|
+
const configuration = new Configuration();
|
|
197
|
+
const apiInstance = new HostingWebsitesApi(configuration);
|
|
198
|
+
|
|
199
|
+
let domain: string; //Filter by domain name (exact match) (optional) (default to undefined)
|
|
200
|
+
|
|
201
|
+
const { status, data } = await apiInstance.listWebsiteSetupsV1(
|
|
202
|
+
domain
|
|
203
|
+
);
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Parameters
|
|
207
|
+
|
|
208
|
+
|Name | Type | Description | Notes|
|
|
209
|
+
|------------- | ------------- | ------------- | -------------|
|
|
210
|
+
| **domain** | [**string**] | Filter by domain name (exact match) | (optional) defaults to undefined|
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
### Return type
|
|
214
|
+
|
|
215
|
+
**Array<HostingV1OnboardingsOnboardingResource>**
|
|
216
|
+
|
|
217
|
+
### Authorization
|
|
218
|
+
|
|
219
|
+
[apiToken](../README.md#apiToken)
|
|
220
|
+
|
|
221
|
+
### HTTP request headers
|
|
222
|
+
|
|
223
|
+
- **Content-Type**: Not defined
|
|
224
|
+
- **Accept**: application/json
|
|
225
|
+
|
|
226
|
+
|
|
172
227
|
### HTTP response details
|
|
173
228
|
| Status code | Description | Response headers |
|
|
174
229
|
|-------------|-------------|------------------|
|
|
@@ -182,7 +237,7 @@ const { status, data } = await apiInstance.deployStaticSiteArchiveV1(
|
|
|
182
237
|
# **listWebsitesV1**
|
|
183
238
|
> HostingListWebsitesV1200Response listWebsitesV1()
|
|
184
239
|
|
|
185
|
-
Retrieve a paginated list of websites (CloudLinux, Builder, and Horizons) accessible to the authenticated client. This endpoint returns websites from your hosting accounts as well as websites from other client hosting accounts that have shared access with you. Each website includes a `website_type` field describing the type of website detected on the underlying platform (`wordpress`, `builder`, `horizons`, `nodejs`, or `other`). Some fields, such as `vhost_type`, `username`, and `root_directory`, only apply to CloudLinux websites and are null for other platforms. Use `website_types` to list only websites of a given detected type, e.g. only WordPress websites (`website_types=wordpress`) or only Node.js websites (`website_types=nodejs`). Combine with the other available query parameters to filter by username, order ID, enabled status, or domain name for more targeted results.
|
|
240
|
+
Retrieve a paginated list of websites (CloudLinux, Builder, and Horizons) accessible to the authenticated client. This endpoint returns websites from your hosting accounts as well as websites from other client hosting accounts that have shared access with you. Each website includes a `website_type` field describing the type of website detected on the underlying platform (`wordpress`, `builder`, `horizons`, `nodejs`, or `other`). Some fields, such as `vhost_type`, `username`, and `root_directory`, only apply to CloudLinux websites and are null for other platforms. Use `website_types` to list only websites of a given detected type, e.g. only WordPress websites (`website_types=wordpress`) or only Node.js websites (`website_types=nodejs`). Combine with the other available query parameters to filter by username, order ID, enabled status, or domain name for more targeted results. A website appears in this list before its server-side setup has finished, and `is_enabled` reflects suspension, not readiness. To know when a newly created website is ready for file, deploy or database operations, poll the list website setups endpoint instead.
|
|
186
241
|
|
|
187
242
|
### Example
|
|
188
243
|
|
package/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.
|
|
6
|
+
* API Version: 1.56.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
|