Skip to content

Commit 7ac1a09

Browse files
chore: sdk update
1 parent 6c63177 commit 7ac1a09

12 files changed

Lines changed: 368 additions & 26 deletions

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
## @hostinger/sdk@1.68.0
1+
## @hostinger/sdk@2.0.0
22

33
For more information, please visit [https://developers.hostinger.com](https://developers.hostinger.com).
44

55
### Usage
66

77
```
8-
npm install @hostinger/sdk@1.68.0 --save
8+
npm install @hostinger/sdk@2.0.0 --save
99
```

‎api.ts‎

Lines changed: 210 additions & 12 deletions
Large diffs are not rendered by default.

‎base.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Hostinger API
55
*
6-
* API Version: 1.68.0
6+
* API Version: 2.0.0
77
*
88
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
99
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api

‎common.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Hostinger API
55
*
6-
* API Version: 1.68.0
6+
* API Version: 2.0.0
77
*
88
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
99
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api

‎configuration.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/**
44
* Hostinger API
55
*
6-
* API Version: 1.68.0
6+
* API Version: 2.0.0
77
*
88
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
99
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
@@ -48,7 +48,7 @@ export class Configuration {
4848
this.baseOptions = {
4949
...param.baseOptions,
5050
headers: {
51-
'User-Agent': "hostinger-typescript-sdk/1.68.0",
51+
'User-Agent': "hostinger-typescript-sdk/2.0.0",
5252
...param.baseOptions?.headers,
5353
},
5454
};

‎docs/WordPressAIContentApi.md‎

Lines changed: 70 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ All URIs are relative to *https://developers.hostinger.com*
55
|Method | HTTP request | Description|
66
|------------- | ------------- | -------------|
77
|[**generateImagesV1**](#generateimagesv1) | **POST** /api/hosting/v1/accounts/{username}/wordpress/{software}/content/images/generate | Generate images|
8+
|[**getGenerationResultV1**](#getgenerationresultv1) | **GET** /api/hosting/v1/accounts/{username}/wordpress/{software}/content/generations/{generation_id} | Get generation result|
89

910
# **generateImagesV1**
10-
> WordPressV1ContentGeneratedImagesResource generateImagesV1(wordPressV1ContentGenerateImagesRequest)
11+
> WordPressV1ContentGenerationResource generateImagesV1(wordPressV1ContentGenerateImagesRequest)
1112
12-
Generate one or more images from a prompt and an image type for the specified WordPress installation. Images are returned inline as base64-encoded PNGs. They match the requested aspect ratio and are never smaller than the requested size; logos are transparent PNGs cropped to the mark. Generation is synchronous and can take up to a minute. The endpoint is limited to 10 requests per minute. Provide the WordPress installation (software) identifier in the path. It can be obtained from GET /api/hosting/v1/wordpress/installations (the `id` field).
13+
Start generating one or more images from a prompt and an image type for the specified WordPress installation. The generation runs asynchronously: the response is returned right away with `status: in-progress` and a `generation_id`. Poll GET /api/hosting/v1/accounts/{username}/wordpress/{software}/content/generations/{generation_id} every few seconds until `status` is `completed` or `failed`. A completed generation returns temporary image URLs together with the time they expire; download the images before then. Images match the requested aspect ratio and are never smaller than the requested size; logos are transparent images cropped to the mark. Only one image generation can run per installation at a time: while one is still in progress the endpoint returns 409 without the ID of the running generation, so a caller that did not receive the `202` has to wait for it to finish (up to a few minutes) before starting a new one. The endpoint is limited to 10 requests per minute. Provide the WordPress installation (software) identifier in the path. It can be obtained from GET /api/hosting/v1/wordpress/installations (the `id` field).
1314

1415
### Example
1516

@@ -45,7 +46,7 @@ const { status, data } = await apiInstance.generateImagesV1(
4546

4647
### Return type
4748

48-
**WordPressV1ContentGeneratedImagesResource**
49+
**WordPressV1ContentGenerationResource**
4950

5051
### Authorization
5152

@@ -57,12 +58,78 @@ const { status, data } = await apiInstance.generateImagesV1(
5758
- **Accept**: application/json
5859

5960

61+
### HTTP response details
62+
| Status code | Description | Response headers |
63+
|-------------|-------------|------------------|
64+
|**202** | Accepted response | - |
65+
|**422** | Validation error response | - |
66+
|**401** | Unauthenticated response | - |
67+
|**404** | Error response | - |
68+
|**409** | Conflict response. &#x60;Retry-After&#x60;, when present, is the number of seconds to wait before retrying. | * Retry-After - Seconds to wait before retrying the request <br> |
69+
|**500** | Error response | - |
70+
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)
72+
73+
# **getGenerationResultV1**
74+
> WordPressV1ContentGenerationResource getGenerationResultV1()
75+
76+
Get the result of an AI content generation started for the specified WordPress installation, such as an image generation started with POST /api/hosting/v1/accounts/{username}/wordpress/{software}/content/images/generate. While the generation is still running only `status: in-progress` is returned; poll every few seconds. Once `completed`, `result` holds the generated content shaped according to `type`: temporary image URLs together with the time they expire for `image-generation`, or the generated website document for `website-generation` (started from the Hostinger WordPress plugin). A `failed` generation has no `result`. Unknown or expired generation IDs return 404. Provide the WordPress installation (software) identifier in the path. It can be obtained from GET /api/hosting/v1/wordpress/installations (the `id` field).
77+
78+
### Example
79+
80+
```typescript
81+
import {
82+
WordPressAIContentApi,
83+
Configuration
84+
} from '@hostinger/sdk';
85+
86+
const configuration = new Configuration();
87+
const apiInstance = new WordPressAIContentApi(configuration);
88+
89+
let username: string; // (default to undefined)
90+
let software: string; //WordPress installation (software) identifier (default to undefined)
91+
let generationId: string; //Generation ID returned when the generation was started (default to undefined)
92+
let type: 'website-generation' | 'image-generation'; //Generation type to look up. When omitted, every generation type is checked. (optional) (default to undefined)
93+
94+
const { status, data } = await apiInstance.getGenerationResultV1(
95+
username,
96+
software,
97+
generationId,
98+
type
99+
);
100+
```
101+
102+
### Parameters
103+
104+
|Name | Type | Description | Notes|
105+
|------------- | ------------- | ------------- | -------------|
106+
| **username** | [**string**] | | defaults to undefined|
107+
| **software** | [**string**] | WordPress installation (software) identifier | defaults to undefined|
108+
| **generationId** | [**string**] | Generation ID returned when the generation was started | defaults to undefined|
109+
| **type** | [**&#39;website-generation&#39; | &#39;image-generation&#39;**]**Array<&#39;website-generation&#39; &#124; &#39;image-generation&#39;>** | Generation type to look up. When omitted, every generation type is checked. | (optional) defaults to undefined|
110+
111+
112+
### Return type
113+
114+
**WordPressV1ContentGenerationResource**
115+
116+
### Authorization
117+
118+
[apiToken](../README.md#apiToken)
119+
120+
### HTTP request headers
121+
122+
- **Content-Type**: Not defined
123+
- **Accept**: application/json
124+
125+
60126
### HTTP response details
61127
| Status code | Description | Response headers |
62128
|-------------|-------------|------------------|
63129
|**200** | Success response | - |
64130
|**422** | Validation error response | - |
65131
|**401** | Unauthenticated response | - |
132+
|**404** | Error response | - |
66133
|**500** | Error response | - |
67134

68135
[[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)
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# WordPressV1ContentGeneratedImageResource
2+
3+
Single image generated by the AI image generator.
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**url** | **string** | Temporary URL of the generated image, valid until the &#x60;expires_at&#x60; time of the result | [default to undefined]
10+
**width** | **number** | Image width in pixels | [default to undefined]
11+
**height** | **number** | Image height in pixels | [default to undefined]
12+
**content_type** | **string** | MIME type of the image | [default to undefined]
13+
14+
## Example
15+
16+
```typescript
17+
import { WordPressV1ContentGeneratedImageResource } from '@hostinger/sdk';
18+
19+
const instance: WordPressV1ContentGeneratedImageResource = {
20+
url,
21+
width,
22+
height,
23+
content_type,
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)

‎docs/WordPressV1ContentGeneratedImagesResource.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Images generated by the AI image generator.
66

77
Name | Type | Description | Notes
88
------------ | ------------- | ------------- | -------------
9-
**images** | **Array&lt;string&gt;** | Generated images, each encoded as a base64 string | [default to undefined]
10-
**content_type** | **string** | MIME type shared by all returned images | [default to undefined]
9+
**images** | [**Array&lt;WordPressV1ContentGeneratedImageResource&gt;**](WordPressV1ContentGeneratedImageResource.md) | Generated images, each available at a temporary URL | [default to undefined]
10+
**expires_at** | **string** | Time after which the image URLs stop working. Download the images before then. | [default to undefined]
1111

1212
## Example
1313

@@ -16,7 +16,7 @@ import { WordPressV1ContentGeneratedImagesResource } from '@hostinger/sdk';
1616

1717
const instance: WordPressV1ContentGeneratedImagesResource = {
1818
images,
19-
content_type,
19+
expires_at,
2020
};
2121
```
2222

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# WordPressV1ContentGenerationResource
2+
3+
State of an AI content generation and, once completed, its result.
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**generation_id** | **string** | Generation ID (UUID) used to poll for the result | [default to undefined]
10+
**type** | **string** | Kind of generation, determines the shape of &#x60;result&#x60; | [default to undefined]
11+
**status** | **string** | &#x60;in-progress&#x60; while the generation is still running, &#x60;completed&#x60; once &#x60;result&#x60; is available, &#x60;failed&#x60; when the generation stopped without a result. | [default to undefined]
12+
**result** | [**WordPressV1ContentGenerationResourceResult**](WordPressV1ContentGenerationResourceResult.md) | | [default to undefined]
13+
14+
## Example
15+
16+
```typescript
17+
import { WordPressV1ContentGenerationResource } from '@hostinger/sdk';
18+
19+
const instance: WordPressV1ContentGenerationResource = {
20+
generation_id,
21+
type,
22+
status,
23+
result,
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)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# WordPressV1ContentGenerationResourceResult
2+
3+
Generated content, `null` until the status is `completed`. For `image-generation` it is the generated images object; for `website-generation` it is the generated website document.
4+
5+
## Properties
6+
7+
Name | Type | Description | Notes
8+
------------ | ------------- | ------------- | -------------
9+
**images** | [**Array&lt;WordPressV1ContentGeneratedImageResource&gt;**](WordPressV1ContentGeneratedImageResource.md) | Generated images, each available at a temporary URL | [default to undefined]
10+
**expires_at** | **string** | Time after which the image URLs stop working. Download the images before then. | [default to undefined]
11+
12+
## Example
13+
14+
```typescript
15+
import { WordPressV1ContentGenerationResourceResult } from '@hostinger/sdk';
16+
17+
const instance: WordPressV1ContentGenerationResourceResult = {
18+
images,
19+
expires_at,
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 commit comments

Comments
 (0)