hostinger-api-sdk 1.67.1 → 2.0.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 +231 -23
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +2 -2
- package/dist/api.d.ts +179 -24
- package/dist/api.js +131 -22
- 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 +179 -24
- package/dist/esm/api.js +122 -13
- 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/HostingV1OnboardingsStartOnboardingRequest.md +3 -1
- package/docs/HostingV1WebsitesCreateWebsiteRequest.md +2 -2
- package/docs/HostingWebsitesApi.md +3 -2
- package/docs/WordPressAIContentApi.md +70 -3
- package/docs/WordPressV1ContentGeneratedImageResource.md +27 -0
- package/docs/WordPressV1ContentGeneratedImagesResource.md +3 -3
- package/docs/WordPressV1ContentGenerationResource.md +27 -0
- package/docs/WordPressV1ContentGenerationResourceResult.md +23 -0
- package/index.ts +1 -1
- package/package.json +1 -1
package/dist/esm/api.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version:
|
|
6
|
+
* API Version: 2.0.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
|
|
@@ -1150,6 +1150,15 @@ export const WordPressV1ContentGenerateImagesRequestImageTypeEnum = {
|
|
|
1150
1150
|
Product: 'product',
|
|
1151
1151
|
Logo: 'logo'
|
|
1152
1152
|
};
|
|
1153
|
+
export const WordPressV1ContentGenerationResourceTypeEnum = {
|
|
1154
|
+
WebsiteGeneration: 'website-generation',
|
|
1155
|
+
ImageGeneration: 'image-generation'
|
|
1156
|
+
};
|
|
1157
|
+
export const WordPressV1ContentGenerationResourceStatusEnum = {
|
|
1158
|
+
InProgress: 'in-progress',
|
|
1159
|
+
Completed: 'completed',
|
|
1160
|
+
Failed: 'failed'
|
|
1161
|
+
};
|
|
1153
1162
|
export const WordPressV1HostingerPluginsUpdateAiOptionStatusRequestOptionEnum = {
|
|
1154
1163
|
Llmstxt: 'llmstxt',
|
|
1155
1164
|
Web2agent: 'web2agent'
|
|
@@ -18556,10 +18565,11 @@ export class HostingSSLApi extends BaseAPI {
|
|
|
18556
18565
|
export const HostingWebsitesApiAxiosParamCreator = function (configuration) {
|
|
18557
18566
|
return {
|
|
18558
18567
|
/**
|
|
18559
|
-
* 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`.
|
|
18568
|
+
* Deprecated: use `POST /api/hosting/v1/orders/{order_id}/onboardings` (start website setup) instead. It takes the same `domain` and `datacenter_code`, can also install WordPress, and returns the created setup. 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`. When the order has no hosting account yet, a new hosting account is set up first, in the datacenter given by `datacenter_code` or the order\'s default datacenter when it is omitted. 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.
|
|
18560
18569
|
* @summary Create website
|
|
18561
18570
|
* @param {HostingV1WebsitesCreateWebsiteRequest} hostingV1WebsitesCreateWebsiteRequest
|
|
18562
18571
|
* @param {*} [options] Override http request option.
|
|
18572
|
+
* @deprecated
|
|
18563
18573
|
* @throws {RequiredError}
|
|
18564
18574
|
*/
|
|
18565
18575
|
createWebsiteV1: (hostingV1WebsitesCreateWebsiteRequest_1, ...args_1) => __awaiter(this, [hostingV1WebsitesCreateWebsiteRequest_1, ...args_1], void 0, function* (hostingV1WebsitesCreateWebsiteRequest, options = {}) {
|
|
@@ -18758,7 +18768,7 @@ export const HostingWebsitesApiAxiosParamCreator = function (configuration) {
|
|
|
18758
18768
|
};
|
|
18759
18769
|
}),
|
|
18760
18770
|
/**
|
|
18761
|
-
* 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.
|
|
18771
|
+
* 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. 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.
|
|
18762
18772
|
* @summary Start website setup
|
|
18763
18773
|
* @param {number} orderId Hosting order ID. List orders to find available IDs.
|
|
18764
18774
|
* @param {HostingV1OnboardingsStartOnboardingRequest} hostingV1OnboardingsStartOnboardingRequest
|
|
@@ -18804,10 +18814,11 @@ export const HostingWebsitesApiFp = function (configuration) {
|
|
|
18804
18814
|
const localVarAxiosParamCreator = HostingWebsitesApiAxiosParamCreator(configuration);
|
|
18805
18815
|
return {
|
|
18806
18816
|
/**
|
|
18807
|
-
* 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`.
|
|
18817
|
+
* Deprecated: use `POST /api/hosting/v1/orders/{order_id}/onboardings` (start website setup) instead. It takes the same `domain` and `datacenter_code`, can also install WordPress, and returns the created setup. 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`. When the order has no hosting account yet, a new hosting account is set up first, in the datacenter given by `datacenter_code` or the order\'s default datacenter when it is omitted. 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.
|
|
18808
18818
|
* @summary Create website
|
|
18809
18819
|
* @param {HostingV1WebsitesCreateWebsiteRequest} hostingV1WebsitesCreateWebsiteRequest
|
|
18810
18820
|
* @param {*} [options] Override http request option.
|
|
18821
|
+
* @deprecated
|
|
18811
18822
|
* @throws {RequiredError}
|
|
18812
18823
|
*/
|
|
18813
18824
|
createWebsiteV1(hostingV1WebsitesCreateWebsiteRequest, options) {
|
|
@@ -18889,7 +18900,7 @@ export const HostingWebsitesApiFp = function (configuration) {
|
|
|
18889
18900
|
});
|
|
18890
18901
|
},
|
|
18891
18902
|
/**
|
|
18892
|
-
* 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.
|
|
18903
|
+
* 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. 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.
|
|
18893
18904
|
* @summary Start website setup
|
|
18894
18905
|
* @param {number} orderId Hosting order ID. List orders to find available IDs.
|
|
18895
18906
|
* @param {HostingV1OnboardingsStartOnboardingRequest} hostingV1OnboardingsStartOnboardingRequest
|
|
@@ -18914,10 +18925,11 @@ export const HostingWebsitesApiFactory = function (configuration, basePath, axio
|
|
|
18914
18925
|
const localVarFp = HostingWebsitesApiFp(configuration);
|
|
18915
18926
|
return {
|
|
18916
18927
|
/**
|
|
18917
|
-
* 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`.
|
|
18928
|
+
* Deprecated: use `POST /api/hosting/v1/orders/{order_id}/onboardings` (start website setup) instead. It takes the same `domain` and `datacenter_code`, can also install WordPress, and returns the created setup. 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`. When the order has no hosting account yet, a new hosting account is set up first, in the datacenter given by `datacenter_code` or the order\'s default datacenter when it is omitted. 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.
|
|
18918
18929
|
* @summary Create website
|
|
18919
18930
|
* @param {HostingV1WebsitesCreateWebsiteRequest} hostingV1WebsitesCreateWebsiteRequest
|
|
18920
18931
|
* @param {*} [options] Override http request option.
|
|
18932
|
+
* @deprecated
|
|
18921
18933
|
* @throws {RequiredError}
|
|
18922
18934
|
*/
|
|
18923
18935
|
createWebsiteV1(hostingV1WebsitesCreateWebsiteRequest, options) {
|
|
@@ -18974,7 +18986,7 @@ export const HostingWebsitesApiFactory = function (configuration, basePath, axio
|
|
|
18974
18986
|
return localVarFp.listWebsitesV1(page, perPage, username, orderId, isEnabled, domain, websiteTypes, options).then((request) => request(axios, basePath));
|
|
18975
18987
|
},
|
|
18976
18988
|
/**
|
|
18977
|
-
* 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.
|
|
18989
|
+
* 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. 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.
|
|
18978
18990
|
* @summary Start website setup
|
|
18979
18991
|
* @param {number} orderId Hosting order ID. List orders to find available IDs.
|
|
18980
18992
|
* @param {HostingV1OnboardingsStartOnboardingRequest} hostingV1OnboardingsStartOnboardingRequest
|
|
@@ -18994,10 +19006,11 @@ export const HostingWebsitesApiFactory = function (configuration, basePath, axio
|
|
|
18994
19006
|
*/
|
|
18995
19007
|
export class HostingWebsitesApi extends BaseAPI {
|
|
18996
19008
|
/**
|
|
18997
|
-
* 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`.
|
|
19009
|
+
* Deprecated: use `POST /api/hosting/v1/orders/{order_id}/onboardings` (start website setup) instead. It takes the same `domain` and `datacenter_code`, can also install WordPress, and returns the created setup. 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`. When the order has no hosting account yet, a new hosting account is set up first, in the datacenter given by `datacenter_code` or the order\'s default datacenter when it is omitted. 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.
|
|
18998
19010
|
* @summary Create website
|
|
18999
19011
|
* @param {HostingV1WebsitesCreateWebsiteRequest} hostingV1WebsitesCreateWebsiteRequest
|
|
19000
19012
|
* @param {*} [options] Override http request option.
|
|
19013
|
+
* @deprecated
|
|
19001
19014
|
* @throws {RequiredError}
|
|
19002
19015
|
* @memberof HostingWebsitesApi
|
|
19003
19016
|
*/
|
|
@@ -19059,7 +19072,7 @@ export class HostingWebsitesApi extends BaseAPI {
|
|
|
19059
19072
|
return HostingWebsitesApiFp(this.configuration).listWebsitesV1(page, perPage, username, orderId, isEnabled, domain, websiteTypes, options).then((request) => request(this.axios, this.basePath));
|
|
19060
19073
|
}
|
|
19061
19074
|
/**
|
|
19062
|
-
* 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.
|
|
19075
|
+
* 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. 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.
|
|
19063
19076
|
* @summary Start website setup
|
|
19064
19077
|
* @param {number} orderId Hosting order ID. List orders to find available IDs.
|
|
19065
19078
|
* @param {HostingV1OnboardingsStartOnboardingRequest} hostingV1OnboardingsStartOnboardingRequest
|
|
@@ -32639,7 +32652,7 @@ export class VPSVirtualMachineApi extends BaseAPI {
|
|
|
32639
32652
|
export const WordPressAIContentApiAxiosParamCreator = function (configuration) {
|
|
32640
32653
|
return {
|
|
32641
32654
|
/**
|
|
32642
|
-
*
|
|
32655
|
+
* 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).
|
|
32643
32656
|
* @summary Generate images
|
|
32644
32657
|
* @param {string} username
|
|
32645
32658
|
* @param {string} software WordPress installation (software) identifier
|
|
@@ -32679,6 +32692,50 @@ export const WordPressAIContentApiAxiosParamCreator = function (configuration) {
|
|
|
32679
32692
|
options: localVarRequestOptions,
|
|
32680
32693
|
};
|
|
32681
32694
|
}),
|
|
32695
|
+
/**
|
|
32696
|
+
* 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).
|
|
32697
|
+
* @summary Get generation result
|
|
32698
|
+
* @param {string} username
|
|
32699
|
+
* @param {string} software WordPress installation (software) identifier
|
|
32700
|
+
* @param {string} generationId Generation ID returned when the generation was started
|
|
32701
|
+
* @param {GetGenerationResultV1TypeEnum} [type] Generation type to look up. When omitted, every generation type is checked.
|
|
32702
|
+
* @param {*} [options] Override http request option.
|
|
32703
|
+
* @throws {RequiredError}
|
|
32704
|
+
*/
|
|
32705
|
+
getGenerationResultV1: (username_1, software_1, generationId_1, type_1, ...args_1) => __awaiter(this, [username_1, software_1, generationId_1, type_1, ...args_1], void 0, function* (username, software, generationId, type, options = {}) {
|
|
32706
|
+
// verify required parameter 'username' is not null or undefined
|
|
32707
|
+
assertParamExists('getGenerationResultV1', 'username', username);
|
|
32708
|
+
// verify required parameter 'software' is not null or undefined
|
|
32709
|
+
assertParamExists('getGenerationResultV1', 'software', software);
|
|
32710
|
+
// verify required parameter 'generationId' is not null or undefined
|
|
32711
|
+
assertParamExists('getGenerationResultV1', 'generationId', generationId);
|
|
32712
|
+
const localVarPath = `/api/hosting/v1/accounts/{username}/wordpress/{software}/content/generations/{generation_id}`
|
|
32713
|
+
.replace(`{${"username"}}`, encodeURIComponent(String(username)))
|
|
32714
|
+
.replace(`{${"software"}}`, encodeURIComponent(String(software)))
|
|
32715
|
+
.replace(`{${"generation_id"}}`, encodeURIComponent(String(generationId)));
|
|
32716
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
32717
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
32718
|
+
let baseOptions;
|
|
32719
|
+
if (configuration) {
|
|
32720
|
+
baseOptions = configuration.baseOptions;
|
|
32721
|
+
}
|
|
32722
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
|
|
32723
|
+
const localVarHeaderParameter = {};
|
|
32724
|
+
const localVarQueryParameter = {};
|
|
32725
|
+
// authentication apiToken required
|
|
32726
|
+
// http bearer authentication required
|
|
32727
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
32728
|
+
if (type !== undefined) {
|
|
32729
|
+
localVarQueryParameter['type'] = type;
|
|
32730
|
+
}
|
|
32731
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
32732
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
32733
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
32734
|
+
return {
|
|
32735
|
+
url: toPathString(localVarUrlObj),
|
|
32736
|
+
options: localVarRequestOptions,
|
|
32737
|
+
};
|
|
32738
|
+
}),
|
|
32682
32739
|
};
|
|
32683
32740
|
};
|
|
32684
32741
|
/**
|
|
@@ -32689,7 +32746,7 @@ export const WordPressAIContentApiFp = function (configuration) {
|
|
|
32689
32746
|
const localVarAxiosParamCreator = WordPressAIContentApiAxiosParamCreator(configuration);
|
|
32690
32747
|
return {
|
|
32691
32748
|
/**
|
|
32692
|
-
*
|
|
32749
|
+
* 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).
|
|
32693
32750
|
* @summary Generate images
|
|
32694
32751
|
* @param {string} username
|
|
32695
32752
|
* @param {string} software WordPress installation (software) identifier
|
|
@@ -32705,6 +32762,24 @@ export const WordPressAIContentApiFp = function (configuration) {
|
|
|
32705
32762
|
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
32706
32763
|
});
|
|
32707
32764
|
},
|
|
32765
|
+
/**
|
|
32766
|
+
* 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).
|
|
32767
|
+
* @summary Get generation result
|
|
32768
|
+
* @param {string} username
|
|
32769
|
+
* @param {string} software WordPress installation (software) identifier
|
|
32770
|
+
* @param {string} generationId Generation ID returned when the generation was started
|
|
32771
|
+
* @param {GetGenerationResultV1TypeEnum} [type] Generation type to look up. When omitted, every generation type is checked.
|
|
32772
|
+
* @param {*} [options] Override http request option.
|
|
32773
|
+
* @throws {RequiredError}
|
|
32774
|
+
*/
|
|
32775
|
+
getGenerationResultV1(username, software, generationId, type, options) {
|
|
32776
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32777
|
+
var _a, _b;
|
|
32778
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.getGenerationResultV1(username, software, generationId, type, options);
|
|
32779
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['WordPressAIContentApi.getGenerationResultV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
32780
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
32781
|
+
});
|
|
32782
|
+
},
|
|
32708
32783
|
};
|
|
32709
32784
|
};
|
|
32710
32785
|
/**
|
|
@@ -32715,7 +32790,7 @@ export const WordPressAIContentApiFactory = function (configuration, basePath, a
|
|
|
32715
32790
|
const localVarFp = WordPressAIContentApiFp(configuration);
|
|
32716
32791
|
return {
|
|
32717
32792
|
/**
|
|
32718
|
-
*
|
|
32793
|
+
* 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).
|
|
32719
32794
|
* @summary Generate images
|
|
32720
32795
|
* @param {string} username
|
|
32721
32796
|
* @param {string} software WordPress installation (software) identifier
|
|
@@ -32726,6 +32801,19 @@ export const WordPressAIContentApiFactory = function (configuration, basePath, a
|
|
|
32726
32801
|
generateImagesV1(username, software, wordPressV1ContentGenerateImagesRequest, options) {
|
|
32727
32802
|
return localVarFp.generateImagesV1(username, software, wordPressV1ContentGenerateImagesRequest, options).then((request) => request(axios, basePath));
|
|
32728
32803
|
},
|
|
32804
|
+
/**
|
|
32805
|
+
* 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).
|
|
32806
|
+
* @summary Get generation result
|
|
32807
|
+
* @param {string} username
|
|
32808
|
+
* @param {string} software WordPress installation (software) identifier
|
|
32809
|
+
* @param {string} generationId Generation ID returned when the generation was started
|
|
32810
|
+
* @param {GetGenerationResultV1TypeEnum} [type] Generation type to look up. When omitted, every generation type is checked.
|
|
32811
|
+
* @param {*} [options] Override http request option.
|
|
32812
|
+
* @throws {RequiredError}
|
|
32813
|
+
*/
|
|
32814
|
+
getGenerationResultV1(username, software, generationId, type, options) {
|
|
32815
|
+
return localVarFp.getGenerationResultV1(username, software, generationId, type, options).then((request) => request(axios, basePath));
|
|
32816
|
+
},
|
|
32729
32817
|
};
|
|
32730
32818
|
};
|
|
32731
32819
|
/**
|
|
@@ -32736,7 +32824,7 @@ export const WordPressAIContentApiFactory = function (configuration, basePath, a
|
|
|
32736
32824
|
*/
|
|
32737
32825
|
export class WordPressAIContentApi extends BaseAPI {
|
|
32738
32826
|
/**
|
|
32739
|
-
*
|
|
32827
|
+
* 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).
|
|
32740
32828
|
* @summary Generate images
|
|
32741
32829
|
* @param {string} username
|
|
32742
32830
|
* @param {string} software WordPress installation (software) identifier
|
|
@@ -32748,7 +32836,28 @@ export class WordPressAIContentApi extends BaseAPI {
|
|
|
32748
32836
|
generateImagesV1(username, software, wordPressV1ContentGenerateImagesRequest, options) {
|
|
32749
32837
|
return WordPressAIContentApiFp(this.configuration).generateImagesV1(username, software, wordPressV1ContentGenerateImagesRequest, options).then((request) => request(this.axios, this.basePath));
|
|
32750
32838
|
}
|
|
32839
|
+
/**
|
|
32840
|
+
* 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).
|
|
32841
|
+
* @summary Get generation result
|
|
32842
|
+
* @param {string} username
|
|
32843
|
+
* @param {string} software WordPress installation (software) identifier
|
|
32844
|
+
* @param {string} generationId Generation ID returned when the generation was started
|
|
32845
|
+
* @param {GetGenerationResultV1TypeEnum} [type] Generation type to look up. When omitted, every generation type is checked.
|
|
32846
|
+
* @param {*} [options] Override http request option.
|
|
32847
|
+
* @throws {RequiredError}
|
|
32848
|
+
* @memberof WordPressAIContentApi
|
|
32849
|
+
*/
|
|
32850
|
+
getGenerationResultV1(username, software, generationId, type, options) {
|
|
32851
|
+
return WordPressAIContentApiFp(this.configuration).getGenerationResultV1(username, software, generationId, type, options).then((request) => request(this.axios, this.basePath));
|
|
32852
|
+
}
|
|
32751
32853
|
}
|
|
32854
|
+
/**
|
|
32855
|
+
* @export
|
|
32856
|
+
*/
|
|
32857
|
+
export const GetGenerationResultV1TypeEnum = {
|
|
32858
|
+
WebsiteGeneration: 'website-generation',
|
|
32859
|
+
ImageGeneration: 'image-generation'
|
|
32860
|
+
};
|
|
32752
32861
|
/**
|
|
32753
32862
|
* WordPressAIToolsApi - axios parameter creator
|
|
32754
32863
|
* @export
|
package/dist/esm/base.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version:
|
|
4
|
+
* API Version: 2.0.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:
|
|
6
|
+
* API Version: 2.0.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:
|
|
4
|
+
* API Version: 2.0.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:
|
|
6
|
+
* API Version: 2.0.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:
|
|
4
|
+
* API Version: 2.0.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:
|
|
6
|
+
* API Version: 2.0.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/
|
|
16
|
+
this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-typescript-sdk/2.0.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:
|
|
4
|
+
* API Version: 2.0.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:
|
|
6
|
+
* API Version: 2.0.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:
|
|
4
|
+
* API Version: 2.0.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:
|
|
7
|
+
* API Version: 2.0.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
|
|
@@ -7,7 +7,8 @@ Website type, domain and WordPress settings for a new website setup
|
|
|
7
7
|
Name | Type | Description | Notes
|
|
8
8
|
------------ | ------------- | ------------- | -------------
|
|
9
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]
|
|
10
|
+
**domain** | **string** | Customer-owned domain. Cannot start with \"www.\" and can have at most one subdomain level, e.g. `blog.example.com`. Omit or `null` to set the website up on a generated temporary free subdomain. | [optional] [default to undefined]
|
|
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]
|
|
11
12
|
**wordpress** | [**HostingV1OnboardingsStartOnboardingRequestWordpress**](HostingV1OnboardingsStartOnboardingRequestWordpress.md) | | [optional] [default to undefined]
|
|
12
13
|
|
|
13
14
|
## Example
|
|
@@ -18,6 +19,7 @@ import { HostingV1OnboardingsStartOnboardingRequest } from '@hostinger/sdk';
|
|
|
18
19
|
const instance: HostingV1OnboardingsStartOnboardingRequest = {
|
|
19
20
|
type,
|
|
20
21
|
domain,
|
|
22
|
+
datacenter_code,
|
|
21
23
|
wordpress,
|
|
22
24
|
};
|
|
23
25
|
```
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
Name | Type | Description | Notes
|
|
7
7
|
------------ | ------------- | ------------- | -------------
|
|
8
|
-
**domain** | **string** | Domain name for the website. Cannot start with \"www.\" | [default to undefined]
|
|
8
|
+
**domain** | **string** | Domain name for the website. Cannot start with \"www.\" and can have at most one subdomain level, e.g. `blog.example.com`. | [default to undefined]
|
|
9
9
|
**order_id** | **number** | Hosting order ID to create this website on. Choose the order whose hosting plan should host the new website. List orders to find available IDs. | [default to undefined]
|
|
10
|
-
**datacenter_code** | **string** | Datacenter
|
|
10
|
+
**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. Must be an available datacenter; list available datacenters to find valid codes. | [optional] [default to undefined]
|
|
11
11
|
|
|
12
12
|
## Example
|
|
13
13
|
|
|
@@ -14,7 +14,7 @@ All URIs are relative to *https://developers.hostinger.com*
|
|
|
14
14
|
# **createWebsiteV1**
|
|
15
15
|
> CommonSuccessEmptyResource createWebsiteV1(hostingV1WebsitesCreateWebsiteRequest)
|
|
16
16
|
|
|
17
|
-
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`.
|
|
17
|
+
Deprecated: use `POST /api/hosting/v1/orders/{order_id}/onboardings` (start website setup) instead. It takes the same `domain` and `datacenter_code`, can also install WordPress, and returns the created setup. 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`. When the order has no hosting account yet, a new hosting account is set up first, in the datacenter given by `datacenter_code` or the order\'s default datacenter when it is omitted. 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.
|
|
18
18
|
|
|
19
19
|
### Example
|
|
20
20
|
|
|
@@ -62,6 +62,7 @@ const { status, data } = await apiInstance.createWebsiteV1(
|
|
|
62
62
|
|**200** | Success empty response | - |
|
|
63
63
|
|**422** | Validation error response | - |
|
|
64
64
|
|**401** | Unauthenticated response | - |
|
|
65
|
+
|**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> |
|
|
65
66
|
|**500** | Error response | - |
|
|
66
67
|
|
|
67
68
|
[[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)
|
|
@@ -315,7 +316,7 @@ const { status, data } = await apiInstance.listWebsitesV1(
|
|
|
315
316
|
# **startWebsiteSetupV1**
|
|
316
317
|
> HostingV1OnboardingsOnboardingResource startWebsiteSetupV1(hostingV1OnboardingsStartOnboardingRequest)
|
|
317
318
|
|
|
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.
|
|
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 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. 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.
|
|
319
320
|
|
|
320
321
|
### Example
|
|
321
322
|
|
|
@@ -5,11 +5,12 @@ All URIs are relative to *https://developers.hostinger.com*
|
|
|
5
5
|
|Method | HTTP request | Description|
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
7
|
|[**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|
|
|
8
9
|
|
|
9
10
|
# **generateImagesV1**
|
|
10
|
-
>
|
|
11
|
+
> WordPressV1ContentGenerationResource generateImagesV1(wordPressV1ContentGenerateImagesRequest)
|
|
11
12
|
|
|
12
|
-
|
|
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).
|
|
13
14
|
|
|
14
15
|
### Example
|
|
15
16
|
|
|
@@ -45,7 +46,7 @@ const { status, data } = await apiInstance.generateImagesV1(
|
|
|
45
46
|
|
|
46
47
|
### Return type
|
|
47
48
|
|
|
48
|
-
**
|
|
49
|
+
**WordPressV1ContentGenerationResource**
|
|
49
50
|
|
|
50
51
|
### Authorization
|
|
51
52
|
|
|
@@ -57,12 +58,78 @@ const { status, data } = await apiInstance.generateImagesV1(
|
|
|
57
58
|
- **Accept**: application/json
|
|
58
59
|
|
|
59
60
|
|
|
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. `Retry-After`, 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** | [**'website-generation' | 'image-generation'**]**Array<'website-generation' | 'image-generation'>** | 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
|
+
|
|
60
126
|
### HTTP response details
|
|
61
127
|
| Status code | Description | Response headers |
|
|
62
128
|
|-------------|-------------|------------------|
|
|
63
129
|
|**200** | Success response | - |
|
|
64
130
|
|**422** | Validation error response | - |
|
|
65
131
|
|**401** | Unauthenticated response | - |
|
|
132
|
+
|**404** | Error response | - |
|
|
66
133
|
|**500** | Error response | - |
|
|
67
134
|
|
|
68
135
|
[[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)
|