@hostinger/sdk 1.58.3 → 1.59.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 +200 -12
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +2 -2
- package/dist/api.d.ts +142 -9
- package/dist/api.js +119 -23
- 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 +142 -9
- package/dist/esm/api.js +108 -12
- 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/HostingV1OnboardingsOnboardingResource.md +2 -0
- package/docs/HostingV1OnboardingsStartOnboardingRequest.md +25 -0
- package/docs/HostingV1OnboardingsStartOnboardingRequestWordpress.md +25 -0
- package/docs/HostingV1OnboardingsStartOnboardingRequestWordpressAdmin.md +25 -0
- package/docs/HostingWebsitesApi.md +68 -1
- package/index.ts +1 -1
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ Name | Type | Description | Notes
|
|
|
7
7
|
------------ | ------------- | ------------- | -------------
|
|
8
8
|
**domain** | **string** | Domain of the website being set up. | [default to undefined]
|
|
9
9
|
**username** | **string** | Hosting account username. | [default to undefined]
|
|
10
|
+
**type** | **string** | Website type requested for the setup: `wordpress`, `headless_wordpress`, `headless_ecommerce` or `headless_pocketbase`. `null` for an empty website. Setups started outside this API may report other legacy types. | [optional] [default to undefined]
|
|
10
11
|
**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
12
|
**created_at** | **string** | When the setup was requested. | [default to undefined]
|
|
12
13
|
**updated_at** | **string** | When the setup last reported progress. | [default to undefined]
|
|
@@ -19,6 +20,7 @@ import { HostingV1OnboardingsOnboardingResource } from '@hostinger/sdk';
|
|
|
19
20
|
const instance: HostingV1OnboardingsOnboardingResource = {
|
|
20
21
|
domain,
|
|
21
22
|
username,
|
|
23
|
+
type,
|
|
22
24
|
status,
|
|
23
25
|
created_at,
|
|
24
26
|
updated_at,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# HostingV1OnboardingsStartOnboardingRequest
|
|
2
|
+
|
|
3
|
+
Website type, domain and WordPress settings for a new website setup
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type | Description | Notes
|
|
8
|
+
------------ | ------------- | ------------- | -------------
|
|
9
|
+
**type** | **string** | Website type. Omit or `null` for an empty website. `wordpress` installs WordPress in the website root and requires `wordpress`. The headless types (`headless_wordpress`, `headless_ecommerce`, `headless_pocketbase`) create a headless website; `headless_wordpress` additionally installs WordPress into the `cms` directory with generated credentials. | [optional] [default to undefined]
|
|
10
|
+
**domain** | **string** | Customer-owned domain. Cannot start with \"www.\". Omit or `null` to set the website up on a generated temporary free subdomain. | [optional] [default to undefined]
|
|
11
|
+
**wordpress** | [**HostingV1OnboardingsStartOnboardingRequestWordpress**](HostingV1OnboardingsStartOnboardingRequestWordpress.md) | | [optional] [default to undefined]
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { HostingV1OnboardingsStartOnboardingRequest } from '@hostinger/sdk';
|
|
17
|
+
|
|
18
|
+
const instance: HostingV1OnboardingsStartOnboardingRequest = {
|
|
19
|
+
type,
|
|
20
|
+
domain,
|
|
21
|
+
wordpress,
|
|
22
|
+
};
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
[[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,25 @@
|
|
|
1
|
+
# HostingV1OnboardingsStartOnboardingRequestWordpress
|
|
2
|
+
|
|
3
|
+
WordPress install settings. Required when `type` is `wordpress`, not allowed otherwise. The site title is the domain.
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type | Description | Notes
|
|
8
|
+
------------ | ------------- | ------------- | -------------
|
|
9
|
+
**language** | **string** | WordPress locale, for example `en_US` or `lt_LT`. Defaults to `en_US` when omitted. | [optional] [default to undefined]
|
|
10
|
+
**is_ai_builder** | **boolean** | When `true`, installs the Hostinger AI theme (`hostinger-ai-theme`). Defaults to `false` when omitted. | [optional] [default to undefined]
|
|
11
|
+
**admin** | [**HostingV1OnboardingsStartOnboardingRequestWordpressAdmin**](HostingV1OnboardingsStartOnboardingRequestWordpressAdmin.md) | | [default to undefined]
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { HostingV1OnboardingsStartOnboardingRequestWordpress } from '@hostinger/sdk';
|
|
17
|
+
|
|
18
|
+
const instance: HostingV1OnboardingsStartOnboardingRequestWordpress = {
|
|
19
|
+
language,
|
|
20
|
+
is_ai_builder,
|
|
21
|
+
admin,
|
|
22
|
+
};
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
[[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,25 @@
|
|
|
1
|
+
# HostingV1OnboardingsStartOnboardingRequestWordpressAdmin
|
|
2
|
+
|
|
3
|
+
WordPress administrator account
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type | Description | Notes
|
|
8
|
+
------------ | ------------- | ------------- | -------------
|
|
9
|
+
**user** | **string** | WordPress admin username (letters, numbers, and underscore) | [default to undefined]
|
|
10
|
+
**password** | **string** | WordPress admin password (8-50 characters, mixed case, a digit, and not compromised) | [default to undefined]
|
|
11
|
+
**email** | **string** | WordPress admin email address | [default to undefined]
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { HostingV1OnboardingsStartOnboardingRequestWordpressAdmin } from '@hostinger/sdk';
|
|
17
|
+
|
|
18
|
+
const instance: HostingV1OnboardingsStartOnboardingRequestWordpressAdmin = {
|
|
19
|
+
user,
|
|
20
|
+
password,
|
|
21
|
+
email,
|
|
22
|
+
};
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
@@ -9,6 +9,7 @@ All URIs are relative to *https://developers.hostinger.com*
|
|
|
9
9
|
|[**deployStaticSiteArchiveV1**](#deploystaticsitearchivev1) | **POST** /api/hosting/v1/accounts/{username}/websites/{domain}/deploy | Deploy static site archive|
|
|
10
10
|
|[**listWebsiteSetupsV1**](#listwebsitesetupsv1) | **GET** /api/hosting/v1/onboardings | List website setups|
|
|
11
11
|
|[**listWebsitesV1**](#listwebsitesv1) | **GET** /api/hosting/v1/websites | List websites|
|
|
12
|
+
|[**startWebsiteSetupV1**](#startwebsitesetupv1) | **POST** /api/hosting/v1/orders/{order_id}/onboardings | Start website setup|
|
|
12
13
|
|
|
13
14
|
# **createWebsiteV1**
|
|
14
15
|
> CommonSuccessEmptyResource createWebsiteV1(hostingV1WebsitesCreateWebsiteRequest)
|
|
@@ -183,7 +184,7 @@ const { status, data } = await apiInstance.deployStaticSiteArchiveV1(
|
|
|
183
184
|
# **listWebsiteSetupsV1**
|
|
184
185
|
> Array<HostingV1OnboardingsOnboardingResource> listWebsiteSetupsV1()
|
|
185
186
|
|
|
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
|
+
Returns the website setups started in the last 24 hours for the hosting accounts accessible to the authenticated client, newest first. Narrow the list with the `order_id`, `subscription_id` or `domain` filters. Meant for polling right after creating a website or starting a website setup: 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. `type` is the website type the setup was started with (`wordpress`, `headless_wordpress`, `headless_ecommerce`, `headless_pocketbase`), or `null` for an empty website.
|
|
187
188
|
|
|
188
189
|
### Example
|
|
189
190
|
|
|
@@ -196,9 +197,13 @@ import {
|
|
|
196
197
|
const configuration = new Configuration();
|
|
197
198
|
const apiInstance = new HostingWebsitesApi(configuration);
|
|
198
199
|
|
|
200
|
+
let orderId: number; //Order ID (optional) (default to undefined)
|
|
201
|
+
let subscriptionId: string; //Filter by hosting order subscription ID (optional) (default to undefined)
|
|
199
202
|
let domain: string; //Filter by domain name (exact match) (optional) (default to undefined)
|
|
200
203
|
|
|
201
204
|
const { status, data } = await apiInstance.listWebsiteSetupsV1(
|
|
205
|
+
orderId,
|
|
206
|
+
subscriptionId,
|
|
202
207
|
domain
|
|
203
208
|
);
|
|
204
209
|
```
|
|
@@ -207,6 +212,8 @@ const { status, data } = await apiInstance.listWebsiteSetupsV1(
|
|
|
207
212
|
|
|
208
213
|
|Name | Type | Description | Notes|
|
|
209
214
|
|------------- | ------------- | ------------- | -------------|
|
|
215
|
+
| **orderId** | [**number**] | Order ID | (optional) defaults to undefined|
|
|
216
|
+
| **subscriptionId** | [**string**] | Filter by hosting order subscription ID | (optional) defaults to undefined|
|
|
210
217
|
| **domain** | [**string**] | Filter by domain name (exact match) | (optional) defaults to undefined|
|
|
211
218
|
|
|
212
219
|
|
|
@@ -305,3 +312,63 @@ const { status, data } = await apiInstance.listWebsitesV1(
|
|
|
305
312
|
|
|
306
313
|
[[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)
|
|
307
314
|
|
|
315
|
+
# **startWebsiteSetupV1**
|
|
316
|
+
> HostingV1OnboardingsOnboardingResource startWebsiteSetupV1(hostingV1OnboardingsStartOnboardingRequest)
|
|
317
|
+
|
|
318
|
+
Starts a website setup on a Web or Cloud hosting order and returns the created setup right away; the website itself is provisioned asynchronously. 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. Omit `type` for an empty website. `type: wordpress` installs WordPress in the website root with the admin user, email and password from `wordpress`, the domain as the site title, and `en_US` when `wordpress.language` is omitted. The headless types (`headless_wordpress`, `headless_ecommerce`, `headless_pocketbase`) create a headless website; `headless_wordpress` additionally installs WordPress into the `cms` directory of the website root with generated credentials. Omit `domain` to set the website up on a generated temporary free subdomain. The order must already have a hosting account: to create the first website on a new hosting plan use the create website endpoint, which takes the `datacenter_code`. Returns 404 when the order does not exist or is not accessible to the authenticated client, and 409 with a `Retry-After` header while a setup for the same domain is still running.
|
|
319
|
+
|
|
320
|
+
### Example
|
|
321
|
+
|
|
322
|
+
```typescript
|
|
323
|
+
import {
|
|
324
|
+
HostingWebsitesApi,
|
|
325
|
+
Configuration,
|
|
326
|
+
HostingV1OnboardingsStartOnboardingRequest
|
|
327
|
+
} from '@hostinger/sdk';
|
|
328
|
+
|
|
329
|
+
const configuration = new Configuration();
|
|
330
|
+
const apiInstance = new HostingWebsitesApi(configuration);
|
|
331
|
+
|
|
332
|
+
let orderId: number; //Hosting order ID. List orders to find available IDs. (default to undefined)
|
|
333
|
+
let hostingV1OnboardingsStartOnboardingRequest: HostingV1OnboardingsStartOnboardingRequest; //
|
|
334
|
+
|
|
335
|
+
const { status, data } = await apiInstance.startWebsiteSetupV1(
|
|
336
|
+
orderId,
|
|
337
|
+
hostingV1OnboardingsStartOnboardingRequest
|
|
338
|
+
);
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
### Parameters
|
|
342
|
+
|
|
343
|
+
|Name | Type | Description | Notes|
|
|
344
|
+
|------------- | ------------- | ------------- | -------------|
|
|
345
|
+
| **hostingV1OnboardingsStartOnboardingRequest** | **HostingV1OnboardingsStartOnboardingRequest**| | |
|
|
346
|
+
| **orderId** | [**number**] | Hosting order ID. List orders to find available IDs. | defaults to undefined|
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
### Return type
|
|
350
|
+
|
|
351
|
+
**HostingV1OnboardingsOnboardingResource**
|
|
352
|
+
|
|
353
|
+
### Authorization
|
|
354
|
+
|
|
355
|
+
[apiToken](../README.md#apiToken)
|
|
356
|
+
|
|
357
|
+
### HTTP request headers
|
|
358
|
+
|
|
359
|
+
- **Content-Type**: application/json
|
|
360
|
+
- **Accept**: application/json
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
### HTTP response details
|
|
364
|
+
| Status code | Description | Response headers |
|
|
365
|
+
|-------------|-------------|------------------|
|
|
366
|
+
|**201** | Created response | - |
|
|
367
|
+
|**422** | Validation error response | - |
|
|
368
|
+
|**401** | Unauthenticated response | - |
|
|
369
|
+
|**404** | Error response | - |
|
|
370
|
+
|**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> |
|
|
371
|
+
|**500** | Error response | - |
|
|
372
|
+
|
|
373
|
+
[[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)
|
|
374
|
+
|
package/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.
|
|
6
|
+
* API Version: 1.59.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
|