hostinger-api-sdk 2.13.1 → 2.14.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/.github/workflows/build-release.yaml +58 -35
- package/README.md +2 -2
- package/api.ts +716 -11
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +2 -2
- package/dist/api.d.ts +481 -11
- package/dist/api.js +469 -21
- 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 +481 -11
- package/dist/esm/api.js +453 -9
- 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/HostingPocketBaseApi.md +311 -0
- package/docs/HostingV1OnboardingsStartOnboardingRequest.md +1 -1
- package/docs/HostingV1PocketBaseBackendCreatedResource.md +36 -0
- package/docs/HostingV1PocketBaseBackendResource.md +32 -0
- package/docs/HostingV1PocketBaseCreateBackendRequest.md +22 -0
- package/docs/HostingV1PocketBaseInstanceResource.md +32 -0
- package/docs/HostingV1PocketBaseSuperuserResource.md +24 -0
- package/docs/HostingV1PocketBaseUpdateSuperuserRequest.md +22 -0
- package/docs/HostingWebsitesApi.md +1 -1
- package/docs/WordPressInstallationsApi.md +1 -1
- package/docs/WordPressV1InstallationsInstallWordPressRequest.md +1 -1
- package/index.ts +1 -1
- package/package.json +1 -1
package/dist/esm/base.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 2.
|
|
4
|
+
* API Version: 2.14.0
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/esm/base.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 2.
|
|
6
|
+
* API Version: 2.14.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/dist/esm/common.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 2.
|
|
4
|
+
* API Version: 2.14.0
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/esm/common.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 2.
|
|
6
|
+
* API Version: 2.14.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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 2.
|
|
4
|
+
* API Version: 2.14.0
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 2.
|
|
6
|
+
* API Version: 2.14.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
|
|
@@ -13,7 +13,7 @@ export class Configuration {
|
|
|
13
13
|
var _a;
|
|
14
14
|
this.accessToken = param.accessToken;
|
|
15
15
|
this.basePath = param.basePath;
|
|
16
|
-
this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-typescript-sdk/2.
|
|
16
|
+
this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-typescript-sdk/2.14.0" }, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) });
|
|
17
17
|
this.formDataCtor = param.formDataCtor;
|
|
18
18
|
}
|
|
19
19
|
/**
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 2.
|
|
4
|
+
* API Version: 2.14.0
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/esm/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 2.
|
|
6
|
+
* API Version: 2.14.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/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 2.
|
|
4
|
+
* API Version: 2.14.0
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Hostinger API
|
|
6
6
|
*
|
|
7
|
-
* API Version: 2.
|
|
7
|
+
* API Version: 2.14.0
|
|
8
8
|
*
|
|
9
9
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
10
10
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
# HostingPocketBaseApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://developers.hostinger.com*
|
|
4
|
+
|
|
5
|
+
|Method | HTTP request | Description|
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
|[**createPocketBaseBackendV1**](#createpocketbasebackendv1) | **POST** /api/hosting/v1/accounts/{username}/websites/{domain}/pocketbase | Create PocketBase backend|
|
|
8
|
+
|[**deletePocketBaseBackendV1**](#deletepocketbasebackendv1) | **DELETE** /api/hosting/v1/accounts/{username}/websites/{domain}/pocketbase | Delete PocketBase backend|
|
|
9
|
+
|[**getPocketBaseBackendV1**](#getpocketbasebackendv1) | **GET** /api/hosting/v1/accounts/{username}/websites/{domain}/pocketbase | Get PocketBase backend|
|
|
10
|
+
|[**listAccountPocketBaseBackendsV1**](#listaccountpocketbasebackendsv1) | **GET** /api/hosting/v1/accounts/{username}/pocketbase | List account PocketBase backends|
|
|
11
|
+
|[**setPocketBaseSuperuserV1**](#setpocketbasesuperuserv1) | **PUT** /api/hosting/v1/accounts/{username}/websites/{domain}/pocketbase/superuser | Set PocketBase superuser|
|
|
12
|
+
|
|
13
|
+
# **createPocketBaseBackendV1**
|
|
14
|
+
> HostingV1PocketBaseBackendCreatedResource createPocketBaseBackendV1()
|
|
15
|
+
|
|
16
|
+
Creates a PocketBase backend for a website: a database, authentication, file storage and a realtime REST API, served from the website\'s own domain. A website has at most one PocketBase backend. Creation usually takes a few seconds. The backend takes over the `/api` and `/_` paths of the website: from then on requests to these paths and everything below them go to PocketBase, while every other path keeps serving the website. Do not create a backend for a website that serves its own `/api` or `/_` paths, because they stop working; confirm with the user before calling it. Deleting the backend gives both paths back to the website. Headless WordPress websites and parked domains are not supported; for a parked domain, use the website it is parked on. A website that already has a backend is rejected with 422, unless that backend is in state `missing`: then it is replaced with a new, empty one. A website set up with `type: headless_empty` becomes `headless_pocketbase`; any other website keeps its type. `superuser_password` is optional: leave it out to get a strong generated password, or send your own (10-128 characters). The response returns it in `superuser_password` once and Hostinger never stores it, so save it in your app secrets right away; you need it to manage the backend through the PocketBase REST API. If it is lost, set a new one with the `Set PocketBase superuser` endpoint. `superuser_email` defaults to the email of the website owner. The instance sleeps when idle and wakes on the first request, so the first call after a quiet period can take a few seconds. `next_steps` in the response lists what to do next. PocketBase is rolling out gradually: an account without access yet gets 422.
|
|
17
|
+
|
|
18
|
+
### Example
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import {
|
|
22
|
+
HostingPocketBaseApi,
|
|
23
|
+
Configuration,
|
|
24
|
+
HostingV1PocketBaseCreateBackendRequest
|
|
25
|
+
} from '@hostinger/sdk';
|
|
26
|
+
|
|
27
|
+
const configuration = new Configuration();
|
|
28
|
+
const apiInstance = new HostingPocketBaseApi(configuration);
|
|
29
|
+
|
|
30
|
+
let username: string; // (default to undefined)
|
|
31
|
+
let domain: string; //Domain name (default to undefined)
|
|
32
|
+
let hostingV1PocketBaseCreateBackendRequest: HostingV1PocketBaseCreateBackendRequest; // (optional)
|
|
33
|
+
|
|
34
|
+
const { status, data } = await apiInstance.createPocketBaseBackendV1(
|
|
35
|
+
username,
|
|
36
|
+
domain,
|
|
37
|
+
hostingV1PocketBaseCreateBackendRequest
|
|
38
|
+
);
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Parameters
|
|
42
|
+
|
|
43
|
+
|Name | Type | Description | Notes|
|
|
44
|
+
|------------- | ------------- | ------------- | -------------|
|
|
45
|
+
| **hostingV1PocketBaseCreateBackendRequest** | **HostingV1PocketBaseCreateBackendRequest**| | |
|
|
46
|
+
| **username** | [**string**] | | defaults to undefined|
|
|
47
|
+
| **domain** | [**string**] | Domain name | defaults to undefined|
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Return type
|
|
51
|
+
|
|
52
|
+
**HostingV1PocketBaseBackendCreatedResource**
|
|
53
|
+
|
|
54
|
+
### Authorization
|
|
55
|
+
|
|
56
|
+
[apiToken](../README.md#apiToken)
|
|
57
|
+
|
|
58
|
+
### HTTP request headers
|
|
59
|
+
|
|
60
|
+
- **Content-Type**: application/json
|
|
61
|
+
- **Accept**: application/json
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### HTTP response details
|
|
65
|
+
| Status code | Description | Response headers |
|
|
66
|
+
|-------------|-------------|------------------|
|
|
67
|
+
|**201** | Created response | - |
|
|
68
|
+
|**422** | Validation error response | - |
|
|
69
|
+
|**401** | Unauthenticated response | - |
|
|
70
|
+
|**404** | Error response | - |
|
|
71
|
+
|**429** | Error response | - |
|
|
72
|
+
|**503** | Error response | - |
|
|
73
|
+
|**500** | Error response | - |
|
|
74
|
+
|
|
75
|
+
[[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)
|
|
76
|
+
|
|
77
|
+
# **deletePocketBaseBackendV1**
|
|
78
|
+
> CommonSuccessEmptyResource deletePocketBaseBackendV1()
|
|
79
|
+
|
|
80
|
+
Permanently deletes the PocketBase backend of a website with all its data (collections, records, users and uploaded files) and gives the `/api` and `/_` paths back to the website; a `headless_pocketbase` website becomes `headless_empty`. This cannot be undone and every app using this backend stops working, so confirm with the user before calling it and export the data you need from the dashboard (`admin_url`) first. Returns success also when the website has no PocketBase backend; then it only clears a `headless_pocketbase` mark. To regain access after losing the superuser password, use the `Set PocketBase superuser` endpoint instead of deleting the backend. PocketBase is rolling out gradually: an account without access yet gets 422; an unknown website gets 404.
|
|
81
|
+
|
|
82
|
+
### Example
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
import {
|
|
86
|
+
HostingPocketBaseApi,
|
|
87
|
+
Configuration
|
|
88
|
+
} from '@hostinger/sdk';
|
|
89
|
+
|
|
90
|
+
const configuration = new Configuration();
|
|
91
|
+
const apiInstance = new HostingPocketBaseApi(configuration);
|
|
92
|
+
|
|
93
|
+
let username: string; // (default to undefined)
|
|
94
|
+
let domain: string; //Domain name (default to undefined)
|
|
95
|
+
|
|
96
|
+
const { status, data } = await apiInstance.deletePocketBaseBackendV1(
|
|
97
|
+
username,
|
|
98
|
+
domain
|
|
99
|
+
);
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Parameters
|
|
103
|
+
|
|
104
|
+
|Name | Type | Description | Notes|
|
|
105
|
+
|------------- | ------------- | ------------- | -------------|
|
|
106
|
+
| **username** | [**string**] | | defaults to undefined|
|
|
107
|
+
| **domain** | [**string**] | Domain name | defaults to undefined|
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
### Return type
|
|
111
|
+
|
|
112
|
+
**CommonSuccessEmptyResource**
|
|
113
|
+
|
|
114
|
+
### Authorization
|
|
115
|
+
|
|
116
|
+
[apiToken](../README.md#apiToken)
|
|
117
|
+
|
|
118
|
+
### HTTP request headers
|
|
119
|
+
|
|
120
|
+
- **Content-Type**: Not defined
|
|
121
|
+
- **Accept**: application/json
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
### HTTP response details
|
|
125
|
+
| Status code | Description | Response headers |
|
|
126
|
+
|-------------|-------------|------------------|
|
|
127
|
+
|**200** | Success empty response | - |
|
|
128
|
+
|**422** | Validation error response | - |
|
|
129
|
+
|**401** | Unauthenticated response | - |
|
|
130
|
+
|**404** | Error response | - |
|
|
131
|
+
|**503** | Error response | - |
|
|
132
|
+
|**500** | Error response | - |
|
|
133
|
+
|
|
134
|
+
[[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)
|
|
135
|
+
|
|
136
|
+
# **getPocketBaseBackendV1**
|
|
137
|
+
> HostingV1PocketBaseBackendResource getPocketBaseBackendV1()
|
|
138
|
+
|
|
139
|
+
Returns the PocketBase backend of a website: its REST API and dashboard URLs, live state and version. A PocketBase backend gives the website a database, authentication, file storage and a realtime REST API, served from the website\'s own domain under `/api` and `/_`. Returns 404 when the website has no PocketBase backend. The superuser password is only shown once, when it is set, and is never returned here. If it is lost, set a new one with the `Set PocketBase superuser` endpoint. The instance sleeps when idle and wakes on the first request, so `asleep` is a normal state and the first call to a sleeping instance can take a few seconds. `starting`, `running` and `stopping` are healthy; `failed` or `unregistered` mean the instance is broken; `missing` means its files are gone from the server, and creating the PocketBase backend again sets up a new, empty one. `state` is null when the server could not be reached; retry later. PocketBase is rolling out gradually: an account without access yet gets 422.
|
|
140
|
+
|
|
141
|
+
### Example
|
|
142
|
+
|
|
143
|
+
```typescript
|
|
144
|
+
import {
|
|
145
|
+
HostingPocketBaseApi,
|
|
146
|
+
Configuration
|
|
147
|
+
} from '@hostinger/sdk';
|
|
148
|
+
|
|
149
|
+
const configuration = new Configuration();
|
|
150
|
+
const apiInstance = new HostingPocketBaseApi(configuration);
|
|
151
|
+
|
|
152
|
+
let username: string; // (default to undefined)
|
|
153
|
+
let domain: string; //Domain name (default to undefined)
|
|
154
|
+
|
|
155
|
+
const { status, data } = await apiInstance.getPocketBaseBackendV1(
|
|
156
|
+
username,
|
|
157
|
+
domain
|
|
158
|
+
);
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Parameters
|
|
162
|
+
|
|
163
|
+
|Name | Type | Description | Notes|
|
|
164
|
+
|------------- | ------------- | ------------- | -------------|
|
|
165
|
+
| **username** | [**string**] | | defaults to undefined|
|
|
166
|
+
| **domain** | [**string**] | Domain name | defaults to undefined|
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
### Return type
|
|
170
|
+
|
|
171
|
+
**HostingV1PocketBaseBackendResource**
|
|
172
|
+
|
|
173
|
+
### Authorization
|
|
174
|
+
|
|
175
|
+
[apiToken](../README.md#apiToken)
|
|
176
|
+
|
|
177
|
+
### HTTP request headers
|
|
178
|
+
|
|
179
|
+
- **Content-Type**: Not defined
|
|
180
|
+
- **Accept**: application/json
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
### HTTP response details
|
|
184
|
+
| Status code | Description | Response headers |
|
|
185
|
+
|-------------|-------------|------------------|
|
|
186
|
+
|**200** | Success response | - |
|
|
187
|
+
|**422** | Validation error response | - |
|
|
188
|
+
|**401** | Unauthenticated response | - |
|
|
189
|
+
|**404** | Error response | - |
|
|
190
|
+
|**500** | Error response | - |
|
|
191
|
+
|
|
192
|
+
[[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)
|
|
193
|
+
|
|
194
|
+
# **listAccountPocketBaseBackendsV1**
|
|
195
|
+
> Array<HostingV1PocketBaseInstanceResource> listAccountPocketBaseBackendsV1()
|
|
196
|
+
|
|
197
|
+
Lists the PocketBase backends of all websites of a hosting account with their URLs, live state, version and disk usage. A PocketBase backend gives a website a database, authentication, file storage and a realtime REST API, served from the website\'s own domain. An empty list means no website of the account has a PocketBase backend. States: `asleep` is normal (the instance sleeps when idle and wakes on the first request); `starting`, `running` and `stopping` are healthy; `failed` or `unregistered` mean the instance is broken; `missing` means its files are gone from the server, and creating the PocketBase backend again sets up a new, empty one. `state` is null when the server could not be reached; retry later. PocketBase is rolling out gradually: an account without access yet gets 422.
|
|
198
|
+
|
|
199
|
+
### Example
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
import {
|
|
203
|
+
HostingPocketBaseApi,
|
|
204
|
+
Configuration
|
|
205
|
+
} from '@hostinger/sdk';
|
|
206
|
+
|
|
207
|
+
const configuration = new Configuration();
|
|
208
|
+
const apiInstance = new HostingPocketBaseApi(configuration);
|
|
209
|
+
|
|
210
|
+
let username: string; // (default to undefined)
|
|
211
|
+
|
|
212
|
+
const { status, data } = await apiInstance.listAccountPocketBaseBackendsV1(
|
|
213
|
+
username
|
|
214
|
+
);
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Parameters
|
|
218
|
+
|
|
219
|
+
|Name | Type | Description | Notes|
|
|
220
|
+
|------------- | ------------- | ------------- | -------------|
|
|
221
|
+
| **username** | [**string**] | | defaults to undefined|
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
### Return type
|
|
225
|
+
|
|
226
|
+
**Array<HostingV1PocketBaseInstanceResource>**
|
|
227
|
+
|
|
228
|
+
### Authorization
|
|
229
|
+
|
|
230
|
+
[apiToken](../README.md#apiToken)
|
|
231
|
+
|
|
232
|
+
### HTTP request headers
|
|
233
|
+
|
|
234
|
+
- **Content-Type**: Not defined
|
|
235
|
+
- **Accept**: application/json
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
### HTTP response details
|
|
239
|
+
| Status code | Description | Response headers |
|
|
240
|
+
|-------------|-------------|------------------|
|
|
241
|
+
|**200** | Success response | - |
|
|
242
|
+
|**422** | Validation error response | - |
|
|
243
|
+
|**401** | Unauthenticated response | - |
|
|
244
|
+
|**404** | Error response | - |
|
|
245
|
+
|**500** | Error response | - |
|
|
246
|
+
|
|
247
|
+
[[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)
|
|
248
|
+
|
|
249
|
+
# **setPocketBaseSuperuserV1**
|
|
250
|
+
> HostingV1PocketBaseSuperuserResource setPocketBaseSuperuserV1()
|
|
251
|
+
|
|
252
|
+
Sets the password of a superuser of the website\'s PocketBase backend, and creates that superuser when there is none with the given email. The old password of that superuser stops working at once, so apps and scripts still using it lose superuser access; confirm with the user before calling it. Use it when the superuser password is lost (Hostinger never stores it), when it leaked and must be rotated, or to add another superuser with a different email. Returns 404 when the website has no PocketBase backend; create one first. App user accounts are managed through the PocketBase REST API, not here. `superuser_password` is optional: leave it out to get a strong generated password, or send your own (10-128 characters). The response returns it in `superuser_password` once and Hostinger never stores it, so save it in your app secrets right away, then authenticate again with `pb.collection(\'_superusers\').authWithPassword`. `superuser_email` defaults to the email of the website owner. PocketBase is rolling out gradually: an account without access yet gets 422.
|
|
253
|
+
|
|
254
|
+
### Example
|
|
255
|
+
|
|
256
|
+
```typescript
|
|
257
|
+
import {
|
|
258
|
+
HostingPocketBaseApi,
|
|
259
|
+
Configuration,
|
|
260
|
+
HostingV1PocketBaseUpdateSuperuserRequest
|
|
261
|
+
} from '@hostinger/sdk';
|
|
262
|
+
|
|
263
|
+
const configuration = new Configuration();
|
|
264
|
+
const apiInstance = new HostingPocketBaseApi(configuration);
|
|
265
|
+
|
|
266
|
+
let username: string; // (default to undefined)
|
|
267
|
+
let domain: string; //Domain name (default to undefined)
|
|
268
|
+
let hostingV1PocketBaseUpdateSuperuserRequest: HostingV1PocketBaseUpdateSuperuserRequest; // (optional)
|
|
269
|
+
|
|
270
|
+
const { status, data } = await apiInstance.setPocketBaseSuperuserV1(
|
|
271
|
+
username,
|
|
272
|
+
domain,
|
|
273
|
+
hostingV1PocketBaseUpdateSuperuserRequest
|
|
274
|
+
);
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Parameters
|
|
278
|
+
|
|
279
|
+
|Name | Type | Description | Notes|
|
|
280
|
+
|------------- | ------------- | ------------- | -------------|
|
|
281
|
+
| **hostingV1PocketBaseUpdateSuperuserRequest** | **HostingV1PocketBaseUpdateSuperuserRequest**| | |
|
|
282
|
+
| **username** | [**string**] | | defaults to undefined|
|
|
283
|
+
| **domain** | [**string**] | Domain name | defaults to undefined|
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
### Return type
|
|
287
|
+
|
|
288
|
+
**HostingV1PocketBaseSuperuserResource**
|
|
289
|
+
|
|
290
|
+
### Authorization
|
|
291
|
+
|
|
292
|
+
[apiToken](../README.md#apiToken)
|
|
293
|
+
|
|
294
|
+
### HTTP request headers
|
|
295
|
+
|
|
296
|
+
- **Content-Type**: application/json
|
|
297
|
+
- **Accept**: application/json
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
### HTTP response details
|
|
301
|
+
| Status code | Description | Response headers |
|
|
302
|
+
|-------------|-------------|------------------|
|
|
303
|
+
|**200** | Success response | - |
|
|
304
|
+
|**422** | Validation error response | - |
|
|
305
|
+
|**401** | Unauthenticated response | - |
|
|
306
|
+
|**404** | Error response | - |
|
|
307
|
+
|**429** | Error response | - |
|
|
308
|
+
|**500** | Error response | - |
|
|
309
|
+
|
|
310
|
+
[[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)
|
|
311
|
+
|
|
@@ -6,7 +6,7 @@ Website type, domain and WordPress settings for a new website setup
|
|
|
6
6
|
|
|
7
7
|
Name | Type | Description | Notes
|
|
8
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_empty`, `headless_wordpress`, `headless_ecommerce`, `headless_pocketbase`) create a headless website; `headless_wordpress` additionally installs WordPress into the `cms` directory with generated credentials. `headless_empty` installs nothing, so WordPress can be added later through `POST /api/hosting/v1/accounts/{username}/wordpress/installations` (`wordpress_installations_install`) with `type: headless`
|
|
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_empty`, `headless_wordpress`, `headless_ecommerce`, `headless_pocketbase`) create a headless website; `headless_wordpress` additionally installs WordPress into the `cms` directory with generated credentials. `headless_pocketbase` only marks the website as a headless PocketBase website: create the backend afterwards with `Create PocketBase backend` (`POST /api/hosting/v1/accounts/{username}/websites/{domain}/pocketbase`). `headless_empty` installs nothing, so WordPress can be added later through `POST /api/hosting/v1/accounts/{username}/wordpress/installations` (`wordpress_installations_install`) with `type: headless`, or a PocketBase backend through the PocketBase endpoint. | [optional] [default to undefined]
|
|
10
10
|
**domain** | **string** | Customer-owned domain. Omit or `null` to set the website up on a generated temporary free subdomain. Cannot start with \"www.\" and can have at most one subdomain level, e.g. `blog.example.com`. A free subdomain generated through `POST /api/hosting/v1/domains/free-subdomains` in the last 24 hours is also accepted. | [optional] [default to undefined]
|
|
11
11
|
**datacenter_code** | **string** | Datacenter for the hosting account when the order does not have one yet. Omit to use the order\'s default datacenter. Ignored when the order already has a hosting account. List available datacenters to find valid codes. | [optional] [default to undefined]
|
|
12
12
|
**wordpress** | [**HostingV1OnboardingsStartOnboardingRequestWordpress**](HostingV1OnboardingsStartOnboardingRequestWordpress.md) | | [optional] [default to undefined]
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# HostingV1PocketBaseBackendCreatedResource
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**instance_id** | **string** | PocketBase instance ID | [default to undefined]
|
|
9
|
+
**domain** | **string** | Website domain that serves the PocketBase API | [default to undefined]
|
|
10
|
+
**api_url** | **string** | Base URL of the PocketBase REST API | [default to undefined]
|
|
11
|
+
**admin_url** | **string** | URL of the PocketBase dashboard | [default to undefined]
|
|
12
|
+
**superuser_email** | **string** | Email of the superuser set up when the backend was created | [default to undefined]
|
|
13
|
+
**superuser_password** | **string** | Password of that superuser, generated when the request had none. Returned only here: Hostinger does not store it, so save it right away. | [default to undefined]
|
|
14
|
+
**state** | **string** | Live process state. The instance sleeps when idle and wakes on the first request. Usually null right after creation. | [default to undefined]
|
|
15
|
+
**version** | **string** | PocketBase version | [default to undefined]
|
|
16
|
+
**next_steps** | **Array<string>** | What to do next with this backend | [default to undefined]
|
|
17
|
+
|
|
18
|
+
## Example
|
|
19
|
+
|
|
20
|
+
```typescript
|
|
21
|
+
import { HostingV1PocketBaseBackendCreatedResource } from '@hostinger/sdk';
|
|
22
|
+
|
|
23
|
+
const instance: HostingV1PocketBaseBackendCreatedResource = {
|
|
24
|
+
instance_id,
|
|
25
|
+
domain,
|
|
26
|
+
api_url,
|
|
27
|
+
admin_url,
|
|
28
|
+
superuser_email,
|
|
29
|
+
superuser_password,
|
|
30
|
+
state,
|
|
31
|
+
version,
|
|
32
|
+
next_steps,
|
|
33
|
+
};
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
[[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,32 @@
|
|
|
1
|
+
# HostingV1PocketBaseBackendResource
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**instance_id** | **string** | PocketBase instance ID | [default to undefined]
|
|
9
|
+
**domain** | **string** | Website domain that serves the PocketBase API | [default to undefined]
|
|
10
|
+
**api_url** | **string** | Base URL of the PocketBase REST API | [default to undefined]
|
|
11
|
+
**admin_url** | **string** | URL of the PocketBase dashboard | [default to undefined]
|
|
12
|
+
**state** | **string** | Live process state. The instance sleeps when idle and wakes on the first request. Null when the server could not be reached. | [default to undefined]
|
|
13
|
+
**version** | **string** | PocketBase version | [default to undefined]
|
|
14
|
+
**next_steps** | **Array<string>** | What to do next with this backend | [default to undefined]
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { HostingV1PocketBaseBackendResource } from '@hostinger/sdk';
|
|
20
|
+
|
|
21
|
+
const instance: HostingV1PocketBaseBackendResource = {
|
|
22
|
+
instance_id,
|
|
23
|
+
domain,
|
|
24
|
+
api_url,
|
|
25
|
+
admin_url,
|
|
26
|
+
state,
|
|
27
|
+
version,
|
|
28
|
+
next_steps,
|
|
29
|
+
};
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[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
|
+
# HostingV1PocketBaseCreateBackendRequest
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**superuser_email** | **string** | Email of the PocketBase superuser. Defaults to the email of the website owner. | [optional] [default to undefined]
|
|
9
|
+
**superuser_password** | **string** | Password for the PocketBase superuser, 10-128 characters. Leave it out to have a strong one generated. Either way it is returned once in the response and never stored. | [optional] [default to undefined]
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { HostingV1PocketBaseCreateBackendRequest } from '@hostinger/sdk';
|
|
15
|
+
|
|
16
|
+
const instance: HostingV1PocketBaseCreateBackendRequest = {
|
|
17
|
+
superuser_email,
|
|
18
|
+
superuser_password,
|
|
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,32 @@
|
|
|
1
|
+
# HostingV1PocketBaseInstanceResource
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**instance_id** | **string** | PocketBase instance ID | [default to undefined]
|
|
9
|
+
**domain** | **string** | Website domain that serves the PocketBase API | [default to undefined]
|
|
10
|
+
**api_url** | **string** | Base URL of the PocketBase REST API | [default to undefined]
|
|
11
|
+
**admin_url** | **string** | URL of the PocketBase dashboard | [default to undefined]
|
|
12
|
+
**state** | **string** | Live process state. The instance sleeps when idle and wakes on the first request. Null when the server could not be reached. | [default to undefined]
|
|
13
|
+
**version** | **string** | PocketBase version | [default to undefined]
|
|
14
|
+
**disk_usage_kb** | **number** | Disk space used by the instance data, in KB | [default to undefined]
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { HostingV1PocketBaseInstanceResource } from '@hostinger/sdk';
|
|
20
|
+
|
|
21
|
+
const instance: HostingV1PocketBaseInstanceResource = {
|
|
22
|
+
instance_id,
|
|
23
|
+
domain,
|
|
24
|
+
api_url,
|
|
25
|
+
admin_url,
|
|
26
|
+
state,
|
|
27
|
+
version,
|
|
28
|
+
disk_usage_kb,
|
|
29
|
+
};
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[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,24 @@
|
|
|
1
|
+
# HostingV1PocketBaseSuperuserResource
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**domain** | **string** | Website domain that serves the PocketBase API | [default to undefined]
|
|
9
|
+
**superuser_email** | **string** | Email of the superuser that was created or got the new password | [default to undefined]
|
|
10
|
+
**superuser_password** | **string** | The new password of that superuser, generated when the request had none. Hostinger does not store it and will not show it again, so save it right away. | [default to undefined]
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import { HostingV1PocketBaseSuperuserResource } from '@hostinger/sdk';
|
|
16
|
+
|
|
17
|
+
const instance: HostingV1PocketBaseSuperuserResource = {
|
|
18
|
+
domain,
|
|
19
|
+
superuser_email,
|
|
20
|
+
superuser_password,
|
|
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)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# HostingV1PocketBaseUpdateSuperuserRequest
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**superuser_email** | **string** | Email of the superuser to create or update. Defaults to the email of the website owner. | [optional] [default to undefined]
|
|
9
|
+
**superuser_password** | **string** | New password of the PocketBase superuser, 10-128 characters. Leave it out to have a strong one generated. Either way it is returned once in the response and never stored. | [optional] [default to undefined]
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { HostingV1PocketBaseUpdateSuperuserRequest } from '@hostinger/sdk';
|
|
15
|
+
|
|
16
|
+
const instance: HostingV1PocketBaseUpdateSuperuserRequest = {
|
|
17
|
+
superuser_email,
|
|
18
|
+
superuser_password,
|
|
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)
|
|
@@ -316,7 +316,7 @@ const { status, data } = await apiInstance.listWebsitesV1(
|
|
|
316
316
|
# **startWebsiteSetupV1**
|
|
317
317
|
> HostingV1OnboardingsOnboardingResource startWebsiteSetupV1(hostingV1OnboardingsStartOnboardingRequest)
|
|
318
318
|
|
|
319
|
-
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 (`hosting_websites_list-setups`) 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_empty`, `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. `headless_empty` installs nothing: WordPress can be added later through `POST /api/hosting/v1/accounts/{username}/wordpress/installations` (`wordpress_installations_install`) with `type: headless
|
|
319
|
+
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 (`hosting_websites_list-setups`) 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_empty`, `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. `headless_pocketbase` marks the website as a headless PocketBase website but installs nothing: create its PocketBase backend with `Create PocketBase backend` (`POST /api/hosting/v1/accounts/{username}/websites/{domain}/pocketbase`) once the setup is `completed`. `headless_empty` installs nothing either: WordPress can be added later through `POST /api/hosting/v1/accounts/{username}/wordpress/installations` (`wordpress_installations_install`) with `type: headless`, or a PocketBase backend through the same PocketBase endpoint. Omit `domain` to set the website up on a generated temporary free subdomain; the created setup returns it as `domain`. REST clients that need to know the free subdomain before the call, so a timed-out call can be looked up and retried on the same domain, can generate one through `POST /api/hosting/v1/domains/free-subdomains` and send it as `domain`. It is accepted for 24 hours, only from the client that generated it. When the order has no hosting account yet, the setup creates one first, in the datacenter given by `datacenter_code` or the order\'s default datacenter when it is omitted. 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.
|
|
320
320
|
|
|
321
321
|
### Example
|
|
322
322
|
|
|
@@ -307,7 +307,7 @@ const { status, data } = await apiInstance.importWordPressWebsiteV1(
|
|
|
307
307
|
# **installWordPressV1**
|
|
308
308
|
> CommonSuccessEmptyResource installWordPressV1(wordPressV1InstallationsInstallWordPressRequest)
|
|
309
309
|
|
|
310
|
-
Install WordPress on an existing website. The website must already exist before calling this endpoint. To create a new website first, use POST /api/hosting/v1/orders/{order_id}/onboardings (`hosting_websites_create`) and poll GET /api/hosting/v1/onboardings (`hosting_websites_list-setups`) with the `domain` filter until its `status` is `completed`. Send `type: headless` to turn a headless website (for example one created by `hosting_websites_create` with `type: headless_empty`) into a headless WordPress website: WordPress is installed into the `cms` directory with the Hostinger headless MU plugin and the website is marked as a headless WordPress website. `directory` is not allowed with it. The target website must
|
|
310
|
+
Install WordPress on an existing website. The website must already exist before calling this endpoint. To create a new website first, use POST /api/hosting/v1/orders/{order_id}/onboardings (`hosting_websites_create`) and poll GET /api/hosting/v1/onboardings (`hosting_websites_list-setups`) with the `domain` filter until its `status` is `completed`. Send `type: headless` to turn a headless website (for example one created by `hosting_websites_create` with `type: headless_empty`) into a headless WordPress website: WordPress is installed into the `cms` directory with the Hostinger headless MU plugin and the website is marked as a headless WordPress website. `directory` is not allowed with it. The target website must be an empty headless website (`headless_empty`): the headless install rewrites the root `.htaccess`, so any other website, including a headless website that already has WordPress or a PocketBase backend, is rejected with 422. To replace a PocketBase backend with WordPress, delete it first with `Delete PocketBase backend`. Call GET /api/hosting/v1/wordpress/installations (`wordpress_installations_list`) filtered by username and domain before proceeding to check whether WordPress is already installed on the target domain/path. If WordPress already exists and `overwrite` is false (the default), the async job will fail. This operation is asynchronous: a successful response only means the install job has been queued, not that WordPress is ready. Installation typically takes 1-2 minutes. Poll GET /api/hosting/v1/wordpress/installations (`wordpress_installations_list`) filtered by username and domain to track progress. When the installation appears in that list, WordPress is ready. Returns 422 when the account already uses all the databases its plan allows, unless `database.name` is an existing database on the account.
|
|
311
311
|
|
|
312
312
|
### Example
|
|
313
313
|
|