@hostinger/sdk 1.58.0 → 1.58.2

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.
@@ -5,9 +5,13 @@ All URIs are relative to *https://developers.hostinger.com*
5
5
  |Method | HTTP request | Description|
6
6
  |------------- | ------------- | -------------|
7
7
  |[**deleteGitAutoDeploymentSettingsV1**](#deletegitautodeploymentsettingsv1) | **DELETE** /api/hosting/v1/accounts/{username}/websites/{domain}/git/auto-deployments/settings | Delete Git auto-deployment settings|
8
+ |[**deployWebsiteGitRepositoryV1**](#deploywebsitegitrepositoryv1) | **POST** /api/hosting/v1/accounts/{username}/websites/{domain}/git/repositories/deploy | Deploy website Git repository|
9
+ |[**generateGitSSHKeyV1**](#generategitsshkeyv1) | **POST** /api/hosting/v1/accounts/{username}/git/ssh-key | Generate Git SSH key|
8
10
  |[**getGitAutoDeploymentSettingsV1**](#getgitautodeploymentsettingsv1) | **GET** /api/hosting/v1/accounts/{username}/websites/{domain}/git/auto-deployments/settings | Get Git auto-deployment settings|
11
+ |[**getGitSSHPublicKeyV1**](#getgitsshpublickeyv1) | **GET** /api/hosting/v1/accounts/{username}/git/ssh-key | Get Git SSH public key|
9
12
  |[**listGitInstallationRepositoriesV1**](#listgitinstallationrepositoriesv1) | **GET** /api/hosting/v1/git/installations/{uuid}/repositories | List Git installation repositories|
10
13
  |[**listGitInstallationsV1**](#listgitinstallationsv1) | **GET** /api/hosting/v1/git/installations | List Git installations|
14
+ |[**listWebsiteGitRepositoriesV1**](#listwebsitegitrepositoriesv1) | **GET** /api/hosting/v1/accounts/{username}/websites/{domain}/git/repositories | List website Git repositories|
11
15
  |[**updateGitAutoDeploymentSettingsV1**](#updategitautodeploymentsettingsv1) | **PUT** /api/hosting/v1/accounts/{username}/websites/{domain}/git/auto-deployments/settings | Update Git auto-deployment settings|
12
16
 
13
17
  # **deleteGitAutoDeploymentSettingsV1**
@@ -66,6 +70,121 @@ const { status, data } = await apiInstance.deleteGitAutoDeploymentSettingsV1(
66
70
 
67
71
  [[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)
68
72
 
73
+ # **deployWebsiteGitRepositoryV1**
74
+ > HostingV1GitGitDeployOutputResource deployWebsiteGitRepositoryV1(hostingV1GitDeployWebsiteGitRepositoryRequest)
75
+
76
+ Clones a Git repository into a directory of the website, or pulls it again. An empty or missing directory gets a clone of the branch. A directory that already holds this repository and branch is reset to its last commit and pulled: changes made on the server to files the repository tracks are discarded, files it does not track stay. A directory that holds other files, including another repository or another branch of this one, is rejected. `composer install` runs after the clone or pull when the repository has a `composer.json`. The call waits for the deployment and returns its log. `is_success` false means Git or composer failed and the log says why. A second call for the same directory is rejected while the first is still waiting for the server. If the request times out, the deployment may still finish on the server; calling again later with the same repository and branch pulls. Private repositories need an SSH URL and the account\'s Git SSH key from `Generate Git SSH key`, added to the repository as a deploy key.
77
+
78
+ ### Example
79
+
80
+ ```typescript
81
+ import {
82
+ HostingGitApi,
83
+ Configuration,
84
+ HostingV1GitDeployWebsiteGitRepositoryRequest
85
+ } from '@hostinger/sdk';
86
+
87
+ const configuration = new Configuration();
88
+ const apiInstance = new HostingGitApi(configuration);
89
+
90
+ let username: string; // (default to undefined)
91
+ let domain: string; //Domain name (default to undefined)
92
+ let hostingV1GitDeployWebsiteGitRepositoryRequest: HostingV1GitDeployWebsiteGitRepositoryRequest; //
93
+
94
+ const { status, data } = await apiInstance.deployWebsiteGitRepositoryV1(
95
+ username,
96
+ domain,
97
+ hostingV1GitDeployWebsiteGitRepositoryRequest
98
+ );
99
+ ```
100
+
101
+ ### Parameters
102
+
103
+ |Name | Type | Description | Notes|
104
+ |------------- | ------------- | ------------- | -------------|
105
+ | **hostingV1GitDeployWebsiteGitRepositoryRequest** | **HostingV1GitDeployWebsiteGitRepositoryRequest**| | |
106
+ | **username** | [**string**] | | defaults to undefined|
107
+ | **domain** | [**string**] | Domain name | defaults to undefined|
108
+
109
+
110
+ ### Return type
111
+
112
+ **HostingV1GitGitDeployOutputResource**
113
+
114
+ ### Authorization
115
+
116
+ [apiToken](../README.md#apiToken)
117
+
118
+ ### HTTP request headers
119
+
120
+ - **Content-Type**: application/json
121
+ - **Accept**: application/json
122
+
123
+
124
+ ### HTTP response details
125
+ | Status code | Description | Response headers |
126
+ |-------------|-------------|------------------|
127
+ |**200** | Success response | - |
128
+ |**422** | Validation error response | - |
129
+ |**401** | Unauthenticated response | - |
130
+ |**500** | Error response | - |
131
+
132
+ [[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)
133
+
134
+ # **generateGitSSHKeyV1**
135
+ > HostingV1GitGitSshKeyResource generateGitSSHKeyV1()
136
+
137
+ Creates the SSH key pair of the hosting account and returns the public key. When the account already has a key, returns that key unchanged. One key serves every website of the account; add the public key to a private repository as a deploy key before deploying it.
138
+
139
+ ### Example
140
+
141
+ ```typescript
142
+ import {
143
+ HostingGitApi,
144
+ Configuration
145
+ } from '@hostinger/sdk';
146
+
147
+ const configuration = new Configuration();
148
+ const apiInstance = new HostingGitApi(configuration);
149
+
150
+ let username: string; // (default to undefined)
151
+
152
+ const { status, data } = await apiInstance.generateGitSSHKeyV1(
153
+ username
154
+ );
155
+ ```
156
+
157
+ ### Parameters
158
+
159
+ |Name | Type | Description | Notes|
160
+ |------------- | ------------- | ------------- | -------------|
161
+ | **username** | [**string**] | | defaults to undefined|
162
+
163
+
164
+ ### Return type
165
+
166
+ **HostingV1GitGitSshKeyResource**
167
+
168
+ ### Authorization
169
+
170
+ [apiToken](../README.md#apiToken)
171
+
172
+ ### HTTP request headers
173
+
174
+ - **Content-Type**: Not defined
175
+ - **Accept**: application/json
176
+
177
+
178
+ ### HTTP response details
179
+ | Status code | Description | Response headers |
180
+ |-------------|-------------|------------------|
181
+ |**200** | Success response | - |
182
+ |**422** | Validation error response | - |
183
+ |**401** | Unauthenticated response | - |
184
+ |**500** | Error response | - |
185
+
186
+ [[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)
187
+
69
188
  # **getGitAutoDeploymentSettingsV1**
70
189
  > HostingV1GitGitAutoDeploymentSettingsResource getGitAutoDeploymentSettingsV1()
71
190
 
@@ -113,6 +232,59 @@ const { status, data } = await apiInstance.getGitAutoDeploymentSettingsV1(
113
232
  - **Accept**: application/json
114
233
 
115
234
 
235
+ ### HTTP response details
236
+ | Status code | Description | Response headers |
237
+ |-------------|-------------|------------------|
238
+ |**200** | Success response | - |
239
+ |**401** | Unauthenticated response | - |
240
+ |**500** | Error response | - |
241
+
242
+ [[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)
243
+
244
+ # **getGitSSHPublicKeyV1**
245
+ > HostingV1GitGitSshKeyResource getGitSSHPublicKeyV1()
246
+
247
+ Returns the public SSH key of the hosting account. `Deploy website Git repository` uses this key to clone and pull over SSH, so a private repository works once the key is added to it as a deploy key on the Git host. `public_key` is null when the account has no key yet.
248
+
249
+ ### Example
250
+
251
+ ```typescript
252
+ import {
253
+ HostingGitApi,
254
+ Configuration
255
+ } from '@hostinger/sdk';
256
+
257
+ const configuration = new Configuration();
258
+ const apiInstance = new HostingGitApi(configuration);
259
+
260
+ let username: string; // (default to undefined)
261
+
262
+ const { status, data } = await apiInstance.getGitSSHPublicKeyV1(
263
+ username
264
+ );
265
+ ```
266
+
267
+ ### Parameters
268
+
269
+ |Name | Type | Description | Notes|
270
+ |------------- | ------------- | ------------- | -------------|
271
+ | **username** | [**string**] | | defaults to undefined|
272
+
273
+
274
+ ### Return type
275
+
276
+ **HostingV1GitGitSshKeyResource**
277
+
278
+ ### Authorization
279
+
280
+ [apiToken](../README.md#apiToken)
281
+
282
+ ### HTTP request headers
283
+
284
+ - **Content-Type**: Not defined
285
+ - **Accept**: application/json
286
+
287
+
116
288
  ### HTTP response details
117
289
  | Status code | Description | Response headers |
118
290
  |-------------|-------------|------------------|
@@ -234,6 +406,62 @@ const { status, data } = await apiInstance.listGitInstallationsV1(
234
406
 
235
407
  [[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)
236
408
 
409
+ # **listWebsiteGitRepositoriesV1**
410
+ > Array<HostingV1GitWebsiteGitRepositoryResource> listWebsiteGitRepositoriesV1()
411
+
412
+ Lists the Git repositories linked to directories of the website, with `Deploy website Git repository` or in the Git section of hPanel: clone URL, branch and directory of each one. A repository whose clone failed stays listed; deploying it again retries the clone. GitHub and GitLab auto-deployments are not listed here; see `Get Git auto-deployment settings`.
413
+
414
+ ### Example
415
+
416
+ ```typescript
417
+ import {
418
+ HostingGitApi,
419
+ Configuration
420
+ } from '@hostinger/sdk';
421
+
422
+ const configuration = new Configuration();
423
+ const apiInstance = new HostingGitApi(configuration);
424
+
425
+ let username: string; // (default to undefined)
426
+ let domain: string; //Domain name (default to undefined)
427
+
428
+ const { status, data } = await apiInstance.listWebsiteGitRepositoriesV1(
429
+ username,
430
+ domain
431
+ );
432
+ ```
433
+
434
+ ### Parameters
435
+
436
+ |Name | Type | Description | Notes|
437
+ |------------- | ------------- | ------------- | -------------|
438
+ | **username** | [**string**] | | defaults to undefined|
439
+ | **domain** | [**string**] | Domain name | defaults to undefined|
440
+
441
+
442
+ ### Return type
443
+
444
+ **Array<HostingV1GitWebsiteGitRepositoryResource>**
445
+
446
+ ### Authorization
447
+
448
+ [apiToken](../README.md#apiToken)
449
+
450
+ ### HTTP request headers
451
+
452
+ - **Content-Type**: Not defined
453
+ - **Accept**: application/json
454
+
455
+
456
+ ### HTTP response details
457
+ | Status code | Description | Response headers |
458
+ |-------------|-------------|------------------|
459
+ |**200** | Success response | - |
460
+ |**401** | Unauthenticated response | - |
461
+ |**500** | Error response | - |
462
+
463
+ [[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)
464
+
237
465
  # **updateGitAutoDeploymentSettingsV1**
238
466
  > CommonSuccessEmptyResource updateGitAutoDeploymentSettingsV1(hostingV1GitUpdateGitAutoDeploymentSettingsRequest)
239
467
 
@@ -9,7 +9,7 @@ All URIs are relative to *https://developers.hostinger.com*
9
9
  # **listOrdersV1**
10
10
  > HostingListOrdersV1200Response listOrdersV1()
11
11
 
12
- Retrieve a paginated list of orders accessible to the authenticated client. This endpoint returns orders of your hosting accounts as well as orders of other client hosting accounts that have shared access with you. Use the available query parameters to filter results by order statuses or specific order IDs for more targeted results.
12
+ Retrieve a paginated list of orders accessible to the authenticated client. Only Web and Cloud hosting orders are listed. Agency Plan orders are listed by `GET /api/agency-hosting/v1/orders`. This endpoint returns orders of your hosting accounts as well as orders of other client hosting accounts that have shared access with you. Use the available query parameters to filter results by order statuses or specific order IDs for more targeted results.
13
13
 
14
14
  ### Example
15
15
 
@@ -0,0 +1,24 @@
1
+ # HostingV1GitDeployWebsiteGitRepositoryRequest
2
+
3
+
4
+ ## Properties
5
+
6
+ Name | Type | Description | Notes
7
+ ------------ | ------------- | ------------- | -------------
8
+ **repository_url** | **string** | Clone URL of the repository on any Git host, SSH or HTTPS. Private repositories need an SSH URL and the account\&#39;s Git SSH key added to the repository as a deploy key. An HTTP or HTTPS URL with a username or token, or any URL with a password, is rejected. | [default to undefined]
9
+ **branch** | **string** | Branch to clone and pull | [default to undefined]
10
+ **directory** | **string** | Directory under the website document root, exactly as &#x60;List website Git repositories&#x60; returns it for an existing repository. Empty, null or omitted means the document root. | [optional] [default to '']
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import { HostingV1GitDeployWebsiteGitRepositoryRequest } from '@hostinger/sdk';
16
+
17
+ const instance: HostingV1GitDeployWebsiteGitRepositoryRequest = {
18
+ repository_url,
19
+ branch,
20
+ directory,
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,23 @@
1
+ # HostingV1GitGitDeployOutputResource
2
+
3
+ Result of cloning or pulling a Git repository into the website
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **is_success** | **boolean** | Whether the clone or pull, and composer install when it ran, finished without errors | [default to undefined]
10
+ **output** | **string** | Log of the deployment steps, and the Git or composer error when &#x60;is_success&#x60; is false | [default to undefined]
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import { HostingV1GitGitDeployOutputResource } from '@hostinger/sdk';
16
+
17
+ const instance: HostingV1GitGitDeployOutputResource = {
18
+ is_success,
19
+ output,
20
+ };
21
+ ```
22
+
23
+ [[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,21 @@
1
+ # HostingV1GitGitSshKeyResource
2
+
3
+ Public SSH key the hosting account uses to clone and pull Git repositories
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **public_key** | **string** | Public key to add as a deploy key on the Git host. Null when the account has no key yet. | [default to undefined]
10
+
11
+ ## Example
12
+
13
+ ```typescript
14
+ import { HostingV1GitGitSshKeyResource } from '@hostinger/sdk';
15
+
16
+ const instance: HostingV1GitGitSshKeyResource = {
17
+ public_key,
18
+ };
19
+ ```
20
+
21
+ [[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,27 @@
1
+ # HostingV1GitWebsiteGitRepositoryResource
2
+
3
+ Git repository linked to a directory of the website. A repository whose clone failed stays listed; deploying it again retries the clone.
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **repository_url** | **string** | Clone URL of the repository. A username, password or token in an HTTP(S) URL, or a password in any URL, is shown as &#x60;***&#x60;. | [default to undefined]
10
+ **branch** | **string** | Branch that is cloned and pulled | [default to undefined]
11
+ **directory** | **string** | Directory under the website document root. Empty means the document root. | [default to undefined]
12
+ **webhook** | [**HostingV1GitWebsiteGitRepositoryWebhookResource**](HostingV1GitWebsiteGitRepositoryWebhookResource.md) | | [default to undefined]
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import { HostingV1GitWebsiteGitRepositoryResource } from '@hostinger/sdk';
18
+
19
+ const instance: HostingV1GitWebsiteGitRepositoryResource = {
20
+ repository_url,
21
+ branch,
22
+ directory,
23
+ webhook,
24
+ };
25
+ ```
26
+
27
+ [[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,27 @@
1
+ # HostingV1GitWebsiteGitRepositoryWebhookResource
2
+
3
+ Auto-deployment webhook of the repository, the same one the Git section of hPanel shows
4
+
5
+ ## Properties
6
+
7
+ Name | Type | Description | Notes
8
+ ------------ | ------------- | ------------- | -------------
9
+ **url** | **string** | Webhook URL to add on the Git host for automatic deployment | [default to undefined]
10
+ **provider** | **string** | Git host detected from the repository URL. Null when it is not GitHub, GitLab or Bitbucket. | [default to undefined]
11
+ **setup_url** | **string** | Page on the Git host where the webhook is added. Null when the host is not detected. | [default to undefined]
12
+ **tutorial_url** | **string** | Git host guide for adding a webhook. Null when the host is not detected. | [default to undefined]
13
+
14
+ ## Example
15
+
16
+ ```typescript
17
+ import { HostingV1GitWebsiteGitRepositoryWebhookResource } from '@hostinger/sdk';
18
+
19
+ const instance: HostingV1GitWebsiteGitRepositoryWebhookResource = {
20
+ url,
21
+ provider,
22
+ setup_url,
23
+ tutorial_url,
24
+ };
25
+ ```
26
+
27
+ [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
@@ -13,7 +13,7 @@ All URIs are relative to *https://developers.hostinger.com*
13
13
  # **createWebsiteV1**
14
14
  > CommonSuccessEmptyResource createWebsiteV1(hostingV1WebsitesCreateWebsiteRequest)
15
15
 
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
+ 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. Only Web and Cloud hosting orders are accepted. To create a website on an Agency Plan order, use `POST /api/agency-hosting/v1/orders/{order_id}/websites/setups`. 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.
17
17
 
18
18
  ### Example
19
19
 
package/index.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Hostinger API
5
5
  *
6
- * API Version: 1.58.0
6
+ * API Version: 1.58.2
7
7
  *
8
8
  * NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
9
9
  * If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostinger/sdk",
3
- "version": "1.58.0",
3
+ "version": "1.58.2",
4
4
  "description": "Hostinger API TypeScript SDK",
5
5
  "author": "Hostinger",
6
6
  "repository": {